krabobmkd / amigamame

Port of Mame106 (2006) to Amiga classic 68060, using bebbo gcc6.5 crosscompiler and cmake.
GNU General Public License v2.0
4 stars 0 forks source link

MameMiniMix crash on OS4PowerPC 68k emulation, (in some C++ map<> init) #14

Open samo790 opened 2 months ago

samo790 commented 2 months ago

Just tried to run the Mame test exe on my Sam440 with OS4, but apparently it need misc.resource As far as i know misc.resource is availible also on OS4, but only on classic machines! Is that really mandatory? Could we get rid of its usage?

krabobmkd commented 2 months ago

Hello, Thank you for your tests. I didn't even know OS4 could run 68000 codes , that's great.

You are totally right: this version search for misc.resource because of native Amiga classic parrallel port extra joysticks, and it should do that only if this is configured, and should not quit on failure. I bet this has to do with the GCC "implicit initialisations" system. I'll have a look.

That said, running on OS4 could take profit of the "ScalePixelArray()" and triple buffers functions, that are not complete on the current pistorm picasso drivers.

Also: this version rely 100% on lowlevel.library for the CD32 7bt joypad, and multiple mouse inputs. I know poseidon USB stack on amiga classic can "patch" lowlevel to declare USB pads as CD32 pads. Strangely, the original lowlevel form OS3.1 defines "4 CD32 pads" in its API, but only 2 are physically usable on A1200 and CD32. These 3 & 4 ports are a mystery. They are not the parallel extra joyport either,

So my question will be: Does OS4 does that ? Does it have a "lowlevel.library" of any form ? I guess there may be another prefered API to manage game inputs.

Thanks anyway.

samo790 commented 2 months ago

Yes, the input system used on AmigaOS4 is called AmigaInput and it also include a method to patch" the lowlevel to declare as USB pads ... as far as to be compatible CD32 pads is a metter to be seen :-)

krabobmkd commented 2 months ago

Great. You may test version Beta3b I've just released: Misc resource and parallel ports "should" be optional if present. Yet something else could block the OS4 run... I don't know. ... also, the sound mixer uses a "child" process the OS3 way, and I think MEMF_PUBLIC tag is surely missing for the process shared memory (because of the internal mame alloc system, I should bypass that) ... so you may test "no sound" if there is a problem.

https://github.com/krabobmkd/amigamame/releases/download/beta3b/Mame106MiniMixBeta3b.lha

samo790 commented 2 months ago

Ok, tested the latest binary from RAM, by try launching the preset rom game you included into the archive

It crash on both double only click only on Mame exe, or by instead starting it from shell by also trying to load the rom from its path

Crashlog_Mame106_2024-09-17_16-51-52.txt

krabobmkd commented 2 months ago

Thanks for the log but I coul'nt get anything from it. So if the GUI is not reached, something on the init does that. You may try to run a command line with just "Mame106 arkcrsn5" to try to directly load the rom, without the path. This just squeeze the MUI part. I'll try to do a log version if you are still interested in "debugging by dichotomy " :)

samo790 commented 2 months ago

Hi mate,

Just tried to put the rom file into the main directory as you suggest, the relaunched from shell.... but got the same crash

Still crashed at startup even by try to starting the Mame106 exe standalone, on both double click on its icon or via command line

Also tried from shell:

Mame106 -help

It crashed aswell :-(

Same with -nosound option

Thanks for the log but I coul'nt get anything from it. So if the GUI is not

reached, something on the init does that. You may try to run a command line with just "Mame106 arkcrsn5" to try to directly load the rom, without the path. This just squeeze the MUI part. I'll try to do a log version if you are still interested in "debugging by dichotomy " :)

— Reply to this email directly, view it on GitHub https://github.com/krabobmkd/amigamame/issues/14#issuecomment-2357928052, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOBDVAMHJ6VCUS44CSHS623ZXFAAHAVCNFSM6AAAAABOE7ATH2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNJXHEZDQMBVGI . You are receiving this because you authored the thread.Message ID: @.***>

samo790 commented 2 months ago

Is current binary compiled specifically for 68060 + 68882 FPU ? Not sure if this may create problem under emulation on OS4

samo790 commented 2 months ago

Btw, is the MorphOS version be any usefull for you? Its GUI is based on MUI aswell and it contain some optimized code parts that maybe could be reused in your port

http://fabportnawak.free.fr/mame/

krabobmkd commented 2 months ago

Hello, you may try Beta3c, that outputs all the init sequence, so we may find out the cause of the OS4 crash. https://github.com/krabobmkd/amigamame/releases/download/beta3c/Mame106MiniMixBeta3c.lha

samo790 commented 2 months ago

Ok here the shell output i have just before the crash:

Processo: Shell 4 4.AmigaOS4:> System:Giochi/Mame106/ 4.System:Giochi/Mame106> Mame106 arkcrsn5.zip hello Open graphics 39 Open intuition 39 Open utility 0 Open keymap 36 Open asl 36 Open lowlevel 0 Open cybergraphics 1 Open gadtools 1 gadtools_init misc resource initTimers gui_gadtools_init() getMainConfig().init()

Crashlog_Mame106_2024-09-26_19-36-10.txt

krabobmkd commented 1 month ago

Hello, You may try beta3d, which have more logs at the crashing points. Yes, dichotomy debugging is ridiculous. At this point there is some C++ object construtors and a loop that collects informations from a table and construct namesin another table. I recoded more explicitly these constructors, it may be a compiler issue or an allocation not doing the right thing,...

https://github.com/krabobmkd/amigamame/releases/tag/beta3d

samo790 commented 1 month ago

Just tried beta3d, but i have another break

Processo: Shell 4 4.AmigaOS4:> System:Giochi/Mame106/ 4.System:Giochi/Mame106> Mame106 arkcrsn5.zip hello Open graphics 39 Open intuition 39 Open utility 0 Open keymap 36 Open asl 36 Open lowlevel 0 Open cybergraphics 1 Open gadtools 1 gadtools_init misc resource initTimers gui_gadtools_init() getMainConfig().init() MameConfig::Display::Display() MameConfig::Audio::Audio() MameConfig::Controls::Controls() MameConfig::Misc::Misc() MameConfig::Help::Help() MameConfig::MameConfig() initDriverIndex() 1

Then it crash --> crashlog attached

Crashlog_Mame106_2024-10-17_08-16-45.txt

samo790 commented 17 hours ago

Any news about this? Tested the latest beta 4 but still got an instant crash at startup:-/

Crashlog_Mame106_2024-12-02_00-35-15.txt

krabobmkd commented 7 hours ago

... For the record it seems the OS4 emulated crash came from a c++ map<string,struct> init nested in a constructor. Yet, works either in UEA or Emu68. If this happens, it is likely to happen again on another C++ constructor. I moved it out of the constructor, it's always better to not do much inside. I think there is sometimes problem in GCC6.5 68k bebbo for values returned by d0 and its ccr flags. not sure. I can't do more at that point. Thanks for the logs anyway. I will rename the thread and let it here.

samo790 commented 17 minutes ago

For next version could you maybe reintroduce the log output also for the non-debug binary? I think it will be pretty usefull for end users, even something toggable on/off would be nice Aniway any chance for you to install a copy of AmigaOS4 for testing? Maybe under UAE