EasyRPG / Player

RPG Maker 2000/2003 and EasyRPG games interpreter
https://easyrpg.org/player/
GNU General Public License v3.0
967 stars 183 forks source link

Allow EasyRPG Player on Wii to run from USB without crashing #3054

Open brunochanrio opened 1 year ago

brunochanrio commented 1 year ago

Hello, is possible to make EasyRPG Player on Wii to run from USB without crashing? is because i don't use a SD on my Wii, i run all the homebrew from USB

carstene1ns commented 1 year ago

Please attach a photo of the stack trace. And we need the exact version used, if not 0.8.

carstene1ns commented 1 year ago

Debugging the crashes @Mimigris reported:

80530720
0x80530720: _free_r at ??:?
80530578
0x80530578: _free_r at ??:?
8021c600
0x8021c600: std::unique_ptr<midisynth::synthesizer, std::default_delete<midisynth::synthesizer> >::~unique_ptr() at /opt/devkitpro/devkitPPC/powerpc-eabi/include/c++/13.1.0/bits/unique_ptr.h:403
 (inlined by) FmMidiDecoder::~FmMidiDecoder() at /var/lib/jenkins/workspace/player-wii/src/decoder_fmmidi.h:31
 (inlined by) FmMidiDecoder::~FmMidiDecoder() at /var/lib/jenkins/workspace/player-wii/src/decoder_fmmidi.h:31
80013528
0x80013528: std::unique_ptr<midisequencer::sequencer, std::default_delete<midisequencer::sequencer> >::~unique_ptr() at /opt/devkitpro/devkitPPC/powerpc-eabi/include/c++/13.1.0/bits/unique_ptr.h:403
 (inlined by) AudioDecoderMidi::~AudioDecoderMidi() at /var/lib/jenkins/workspace/player-wii/src/audio_decoder_midi.cpp:95
8001365c
0x8001365c: AudioDecoderMidi::~AudioDecoderMidi() at /var/lib/jenkins/workspace/player-wii/src/audio_decoder_midi.cpp:95
80019308
0x80019308: std::default_delete<AudioDecoderBase>::operator()(AudioDecoderBase*) const at /opt/devkitpro/devkitPPC/powerpc-eabi/include/c++/13.1.0/bits/unique_ptr.h:99 (discriminator 1)
 (inlined by) std::unique_ptr<AudioDecoderBase, std::default_delete<AudioDecoderBase> >::~unique_ptr() at /opt/devkitpro/devkitPPC/powerpc-eabi/include/c++/13.1.0/bits/unique_ptr.h:404 (discriminator 1)
 (inlined by) AudioResampler::~AudioResampler() at /var/lib/jenkins/workspace/player-wii/src/audio_resampler.cpp:231 (discriminator 1)
80019324
0x80019324: AudioResampler::~AudioResampler() at /var/lib/jenkins/workspace/player-wii/src/audio_resampler.cpp:231
80017e8c
0x80017e8c: GenericAudio::BGM_Stop() at /var/lib/jenkins/workspace/player-wii/src/audio_generic.cpp:97
800f2f18
0x800f2f18: Game_System::BgmPlay(lcf::rpg::Music const&) at /var/lib/jenkins/workspace/player-wii/src/game_system.cpp:112
80530720
0x80530720: _free_r at ??:?
80530578
0x80530578: _free_r at ??:?
801586b4
0x801586b4: Scene::MainFunction() at /var/lib/jenkins/workspace/player-wii/src/scene.cpp:175
80124e7e
0x80124e7e: Player::MainLoop() at /var/lib/jenkins/workspace/player-wii/src/player.cpp:238
801252b4
0x801252b4: Transition::instance() at /var/lib/jenkins/workspace/player-wii/src/transition.h:157
 (inlined by) Player::Run() at /var/lib/jenkins/workspace/player-wii/src/player.cpp:215
80233784
0x80233784: SDL_main at /var/lib/jenkins/workspace/player-wii/src/platform/wii/main.cpp:77
Ghabry commented 12 months ago

Our code to handle the endianess is wrong in liblcf.

Since CMake 3.20 it is possible to check if CMAKE_CXX_BYTE_ORDER == BIG_ENDIAN (and dkp also reports this here). Check should be adopted to use this variable.

https://cmake.org/cmake/help/latest/variable/CMAKE_LANG_BYTE_ORDER.html

carstene1ns commented 12 months ago

This is actually a problem since moving the lcf wii builder to cmake. The pr builder still uses autotools and has the right flag :D

Ghabry commented 8 months ago

The problem itself is fixed.

Another issue I remember is that the program fails to launch when no SD card is inserted (but USB is). Is this still an issue?

Mimigris commented 7 months ago

Another issue I remember is that the program fails to launch when no SD card is inserted (but USB is). Is this still an issue?

I've just tested on my Wii without using a SD card, by storing the Player on an USB stick, the Player seems to be detected but crashes on launch, so I guess that it may still be an issue (note that I didn't tested this USB stick for long on my Wii so the issue could come from somewhere else though).

Ghabry commented 7 months ago

Needs a retest after the changes by c1 which also touched some Wii paths.

Mimigris commented 7 months ago

Needs a retest after the changes by c1 which also touched some Wii paths.

Just gave it another try, and now it launches at least :+1:, though it's not entirely that. I've tried to play 3 games:

Ghabry commented 7 months ago

Okay I will test this further on my wiiu in January. Thanks :)