Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3ds Crash on loading large game. #1097

Open
fawkinguy opened this issue Feb 5, 2017 · 9 comments
Open

3ds Crash on loading large game. #1097

fawkinguy opened this issue Feb 5, 2017 · 9 comments
Labels
3DS Crash Performance Related to improvements on memory, less CPU or disk usage, battery savings, etc.
Milestone

Comments

@fawkinguy
Copy link

fawkinguy commented Feb 5, 2017

Name of the game:

  • Violated Heroine 170122_translated_V1
  • 7th Jojo

Player platform:

3ds - v113 (stable)
3ds - v114 (nightly)
3ds - 0.5.1

Attach files (as a .zip archive or link them)

No log available due to crash on load

Describe the issue in detail and how to reproduce it:

(reproduce) Load game
Hangs on loading (around 12~15 minutes) then crashes to the home screen.
Cannot reproduce on windows (but windows wasn't loading the rtp for it)

Analysis

I can get the Zelda-Links awakening to load (crashes when talking to Marin)
This might just be due to the sheer size of the game, it is around 270MB with the rtp and the new 3ds only has 256MB sysram iirc
I have tried with the rtp installed to data/rtp/2000 and with FullPackageFlag=1.

If it is a size issue then it is still a problem that needs to be looked at as there should be some sort of dynamic file loading going on right?

@Ghabry
Copy link
Member

Ghabry commented Feb 5, 2017

The files are not loaded in the memory, only the game database file (LDB). But very few games have a database file with many entries which results in huge RAM usage.
How many MB of used RAM does Windows show for Player.exe after starting VH1?

@carstene1ns
Copy link
Member

I started the game under Linux, went through the character creation and quitted after starting the Intro.
Maximum memory usage was 190mb.
Because all download links I found are currently unavailable, I uploaded the game here: VH_170122_en.tar.xz

@Ghabry
Copy link
Member

Ghabry commented Feb 5, 2017

Okay thats probably currently too much for the 3DS because only 50% of the memory are available and the remaining 50% are linear heap (for GPU and DSP buffers).
In sdl_con_audio_sin_mixer I modified the heap layout for the 3DS to 95%/5% because we only need memory for two DSP buffers and one texture.

@carstene1ns
Copy link
Member

@Ghabry: Is this heap layout change public yet? Did not find any documentation about that 50/50 fact either.

@Ghabry
Copy link
Member

Ghabry commented Feb 18, 2017

Oh, I'm just remembering that I locally patched ctrulib to achieve this and forgot to move it into the Player... The symbols are exported as attribute(weak) which means you can overwrite them by exporting your own but I couldn't get this to work.

A bit more detail:
The allocator is in libctru/source/system/allocateHeaps.c
When I wrote this comment the code was:
devkitPro/libctru@b96dd51#diff-0cf1ca9874863082c18d77aa29f45573R23

Looks like the current code is:
https://github.com/smealum/ctrulib/blob/d42efe636bb3223a2e1ab3c775486c55cd8654c5/libctru/source/system/allocateHeaps.c
Which means it gives 32 MB of Linear Heap and simple redeclaring "u32 __ctru_linear_heap_size" with a different value should assign the remaining memory to the newlib-heap.

@carstene1ns
Copy link
Member

This one needs retesting after merging #1100.

@carstene1ns carstene1ns added this to the 0.5.1 milestone Mar 12, 2017
@Ghabry Ghabry modified the milestones: 0.6.0, 0.5.1 Apr 1, 2017
@Ghabry
Copy link
Member

Ghabry commented Apr 1, 2017

Moved this to 0.6 because changing the heaps crashes for some reason on real hardware and I don't have a 3ds around before July to figure out why.

@Ghabry
Copy link
Member

Ghabry commented Sep 23, 2018

Tested now with a larger heap (+24 MB more). Stll doesn't boot.
Without any significant liblcf improvements it will remain unplayable.

@fdelapena fdelapena added the Performance Related to improvements on memory, less CPU or disk usage, battery savings, etc. label Nov 2, 2018
@Ghabry Ghabry modified the milestones: 0.6.1, 0.8.0 May 5, 2019
@xpirad
Copy link

xpirad commented Apr 28, 2020

I'm experiencing this problem with the latest release 0.6.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3DS Crash Performance Related to improvements on memory, less CPU or disk usage, battery savings, etc.
Development

No branches or pull requests

5 participants