libretro / beetle-ngp-libretro

Standalone port of Mednafen NGP to the libretro API, itself a fork of Neopop.
GNU General Public License v2.0
11 stars 44 forks source link

[Android]Core don't support zipped .npc roms #47

Closed leoxxx closed 5 years ago

leoxxx commented 5 years ago

Hang in a white screen. These roms can work in NGP.EMU and NEOPOP.

stellarporter commented 5 years ago

All games work using latest git commit.

leoxxx commented 5 years ago

All games work using latest git commit.

78eb883 I'll try. I've tested. Still can't work. Do you test?

stellarporter commented 5 years ago

Compiled https://github.com/libretro/beetle-ngp-libretro/commit/78eb883d0e9efbb8a66be20f3938f1616453cea6 for {Windows} and all games above okay. In-game playable. No-intro verified set.

Should also mention using {msvc} compiler.

leoxxx commented 5 years ago

Please test in android.

stellarporter commented 5 years ago

Sorry, don't have way to compile or test Android port. First guess is some 32-bit to 64-bit conversion error. Or maybe memory mapping problem.

leoxxx commented 5 years ago

I‘m not a developer. So I don't understand the code. You can compare this code with NGP.EMU's code to find different. https://github.com/Rakashazi/emu-ex-plus-alpha/tree/master/NGP.emu

stellarporter commented 5 years ago

Thanks. Wow. That's surprisingly old code but nice for comparing. Still have to find way to compile Android test apps.

stellarporter commented 5 years ago

Try these 3 builds from some time ago. We'll keep narrowing it down from here.

https://github.com/libretro/beetle-ngp-libretro/commit/69aaf337fc4e38e20959b1307bcc30575b538c0b https://ci.appveyor.com/project/stellarporter/beetle-ngp-libretro/builds/23208933/artifacts https://github.com/libretro/beetle-ngp-libretro/commit/17f972acec20e5e9aa11400a10399874d4c47bd9 https://ci.appveyor.com/project/stellarporter/beetle-ngp-libretro/builds/23208936/artifacts https://github.com/libretro/beetle-ngp-libretro/commit/441e91c0baa1ff1a9c30a5c5ffe0f744d9207842 https://ci.appveyor.com/project/stellarporter/beetle-ngp-libretro/builds/23208938/artifacts

leoxxx commented 5 years ago

Test all armv7 cores. Still white screen.

stellarporter commented 5 years ago

Don't know what cause is yet for either issue.

Here's test1: force byte alignment. https://ci.appveyor.com/project/stellarporter/beetle-ngp-libretro/builds/23344109

stellarporter commented 5 years ago

VMWare Player + Android CM x86 13.0 r1 = Retroarch x86 android now playable on a virtual tablet. It works decently well to my surprise.

Results of using stock Android x86 NGP core:

Dark Arms - Beast Buster 1999 = no problem yet
SNK Gals' Fighters = hangs on throw
(todo: test others)
stellarporter commented 5 years ago

Android x86 = okay, sha-1 hashes

    Neo Geo World Cup 98 Plus = A8BB64F093B418A88E674D9FAB62A34FC220EA9F
    SNK Vs Capcom - Card Fighters Clash - Capcom Version = 2A95AB1FE62B6A9DC30A05131AD212BA2DE5C3CD
    Dark Arms - Beast Buster 1999 = 727D8100FA7C4A39A6BE9133BD903B868B4CC834
    Dive Alert - Burn Edition = 66624028EC986084A95237C74173849A8A729398
    Dive Alert - Rebecca Version = AC81DE4F9C1473C5ECD761DC449AE5AF0E98915F
    Densha De Go! 2 = CEE5FA9DC0ACFBA95EE6BD802A0FF80D4ECACC79

@leoxxx What are your ROM hashes? If they match no-intro set above, it's some special arm-eabi behavior. No one else seems interested testing armeabi-v7a or arm64-v8a.

side-note: test1 fails to fix SNK Gals' Fighters on x86 Android.

leoxxx commented 5 years ago

SNK Vs Capcom - Card Fighters Clash - Capcom Version.npc 3B1D5AC5B4AAF1AA04479E46961C4D7C458D70FB Others are same.

No one else seems interested testing armeabi-v7a or arm64-v8a.

Don't understand this. Andorid phone use the ARM SoC. But why is NGP.EMU O.K. ?

side-note: test1 fails to fix SNK Gals' Fighters on x86 Android.

It's the bug only for android.(Maybe. Not test in linux, IOS and so on.) NGP.EMU has the same bug.

stellarporter commented 5 years ago

@leoxxx

  1. Delete all Retroarch Mednafen NeoGeo Pocket cores (libretro.so, mednafen_ngp_libretro_android.so)
  2. Download test build https://ci.appveyor.com/project/stellarporter/beetle-ngp-libretro/builds/23405580
  3. Run Neo Geo World Cup 98 Plus
  4. Make save state after crash; it should be > 1MB. If not, re-run step 1 again.
  5. Upload save state if > 1MB

It will create tracelog. Using this method, I've figured out maybe root cause of SNK GF problem (clang compiler out-of-order execution??).

Mednafen NGP uses lots of new code not in NGP.EMU so that could crash bulk of games listed.

leoxxx commented 5 years ago

@stellarporter SNK Gals' Fighters can get the state by 23405580, but others can't(Just test Neo Geo World Cup 98 Plus ). This core load rom have a longer lag than f9d6dbf, then hang in a white screen (the same as the first comment). Retroarch crash when you press the menu key. So others get the states by f9d6dbf, but they seem have the same size, 32.0 KiB. Here is the states by f9d6dbf:https://mega.nz/#!VUsHlCTS!FX2TNalgbpyfnzGBWbSO7ac8M9OHHcIuXukLM_cD3SY Here is the state by 23405580:https://mega.nz/#!MM9BUSrS!VswZC2t_V3A1Tj3vwAlCknLaEpE7CXOzvaHpaI0o-b8

stellarporter commented 5 years ago

@leoxxx Here's a new logger build for Neo Geo World Cup 98 Plus https://ci.appveyor.com/project/stellarporter/beetle-ngp-libretro/builds/23442550

It should create a trace in /storage/emulated/0/RetroArch/ngp_log.txt or /data/data/com.retroarch/ngp_log.txt. No save state needed. Just upload that after the hang is reached.

leoxxx commented 5 years ago

@stellarporter Here is the log file:https://mega.nz/#!1BlD3IZJ!m6EoTpAuFLbo8p8TfWDiuljFteosTgBGm3QemWbkeAQ This core don't crash, but so lag for these roms that hanging in a white screen after loading. Press the menu key, it popup for a while.

stellarporter commented 5 years ago

@leoxxx No idea why arm-v7 (thumb) starts at 4E0000 and others boot at normal 200040. New tracer: https://ci.appveyor.com/project/stellarporter/beetle-ngp-libretro/builds/23458408

This is probably going to take several more logging tries. I think it lags because it keeps running bad code forever.

stellarporter commented 5 years ago

@leoxxx After thinking about this for awhile, I've added 1 attempt to fix so far. https://ci.appveyor.com/project/stellarporter/beetle-ngp-libretro/builds/23466517/artifacts

It will create a ngp_log.txt like before if it fails. Okay to skip 23458408 unless 23466517 crashes and doesn't produce a log.

edit: This does not include the Ogre Battle speech hackfix. I'll add that for Android builds next time.

leoxxx commented 5 years ago

23466517 is better than before. No lag when press menu. And it create the log is small and clear. Great! You can add this debug mode to this core option. Log here.

Name:    o World Cup 
System:  Greyscale
Catalog:  8303 (sub 71)
Starting PC:  0x654E0000
ROM length:  0x075F89
4E0000
4E0001
4E0002
4E0003
4E0004
4E0005
4E0006
4E0007
4E0008

The name is so strange. I don't edit name to it.

stellarporter commented 5 years ago

Neo Geo Cup should be similar to this:

Name: NGC98+COLOR
System: Colour
Catalog: 57 (sub 14)
Starting PC: 0x200040
ROM length: 0x100000

Can you also produce logs for

Something is very wrong and I can't tell where.

edit: Are your roms (un)zipped? Wonder if frontend is mangling the bits.

leoxxx commented 5 years ago

@stellarporter The log can only save the last load rom. So l need load multi roms after move the log file to save one more. Sugesstion:change the save log way. override--->add the end of the log. Like cmd redirect output >>

Here are can't load roms' logs:

SNK Vs Capcom - Card Fighters Clash - Capcom Version

Name:     Capcom - Ca
System:  Color
Catalog:  8267 (sub 86)
Starting PC:  0x4E530000
ROM length:  0x0DF9D3
530000
530001
530002
530003
530004
530005
530006
530007
530008

Dark Arms - Beast Buster 1999

Name:    rms - Beast 
System:  Greyscale
Catalog:  27506 (sub 32)
Starting PC:  0x61440000
ROM length:  0x09C9DF
440000
440001
440002
440003
440004
440005
440006
440007
440008

Dive Alert - Burn Edition

Name:    lert - Burn 
System:  Greyscale
Catalog:  25974 (sub 32)
Starting PC:  0x69440000
ROM length:  0x09342D
440000
440001
440002
440003
440004
440005
440006
440007
440008

Dive Alert - Rebecca Version

Name:    lert - Rebec
System:  Greyscale
Catalog:  25974 (sub 32)
Starting PC:  0x69440000
ROM length:  0x093431
440000
440001
440002
440003
440004
440005
440006
440007
440008

Densha De Go! 2

Name:     De Go! 2.np
System:  Greyscale
Catalog:  29550 (sub 104)
Starting PC:  0x65440000
ROM length:  0x0E9334
440000
440001
440002
440003
440004
440005
440006
440007
440008

SNK Vs Capcom - Card Fighters Clash - Capcom Version is differnet from others.

Here are can load roms' logs:

SNK Gals Fighters

Name:    GalsFighters
System:  Color
Catalog:  101 (sub 48)
Starting PC:  0x200046
ROM length:  0x200000
200046
200048
20004D
264AD6
264ADB
264AE6
264AE9
264AEE
264AEF

SNK Vs Capcom - Card Fighters Clash - SNK Version

Name:    CARD FIGHTER
System:  Color
Catalog:  86 (sub 7)
Starting PC:  0x200040
ROM length:  0x200000
200040
200042
200044
242BB4
242BB9
242BC4
242BC7
242BCC
242BCD

Rom is zip file. If the mangling exists, how to set it in retroarch?

stellarporter commented 5 years ago

@leoxxx All I can suggest is to update Retroarch Android from here https://buildbot.libretro.com/nightly/android/

If fails, unzip your non-working games and run them again as raw files. This might not be a core issue. Bad logs are very broken and a bad sign.

stellarporter commented 5 years ago

@leoxxx Zipped some problem roms and examined in a hex editor. Frontend is not unzipping those roms to core. It is sending raw PK binary data to core. Matches logs above.

You'd have to file with https://www.github.com/libretro/Retroarch as it's not core problem.

leoxxx commented 5 years ago

THX. I'll test the .npc file later. You're right. The .npc file can load.

Name:    NGC98+COLOR 
System:  Color
Catalog:  57 (sub 14)
Starting PC:  0x200040
ROM length:  0x100000
200040
200046
200052
200055
200058
20005B
FF1030
20005C
2F6DB8
stellarporter commented 5 years ago

Here's 1 last Android test build that might work with problem zipped roms. Delete old libretro.so files. This one is correctly named and will be plug-and-play now.

https://ci.appveyor.com/project/stellarporter/beetle-ngp-libretro/builds/23475238

This is likely my last Android build which has everything included; buildbot may not update for awhile. Please try Ogre Battle also.

Thanks for taking the time to iron out all these issues.

Tag: https://github.com/libretro/beetle-ngp-libretro/issues/48

leoxxx commented 5 years ago

@stellarporter Ogre Battle is O.K. But these zipped roms still error. And how to describe the issue to Retroarch project?

stellarporter commented 5 years ago

I'll open the report up there. https://github.com/libretro/RetroArch/issues/8536

ghost commented 5 years ago

all these games loads fine on my crappy android 5.1, arm7a-neon device using latest code from buildbot.

leoxxx commented 5 years ago

@retro-wertz Zipped roms or .npc?

ghost commented 5 years ago

yes they are zipped, that is the test condition, right?

leoxxx commented 5 years ago

Yes. Emm, so strange. I use the npc file can load, but zipped can't. Maybe the zipped rom's problem? But they are O.K. in NGP.EMU and NEOPOP.

leoxxx commented 5 years ago

@stellarporter Maybe I find waht the issue is caused by. I check my all zipped roms. Find it have three format. They are .npc, .ngp and .ngc. These can't load roms are .npc. So RetroArch or this core can't recognize zipped .npc file correctly. Unzipped .npc file is O.K. I'll try to rename these file ext name to .ngp to load later. After renaming, they can load.

ghost commented 5 years ago

.npc are not supported, or at least not used in no-intro which the database is based on.. its probably some previously used extensions.

ghost commented 5 years ago

again... is .npc an official format? coz its not part of .info file or no-intro dats nevermind. try to edit your mednafen_neopop_libretro.info and make supported_extensions = "ngp|ngc|ngpc" to supported_extensions = "ngp|ngc|ngpc|npc"

in any case i find this confusing since libretro suppose to reject invalid extension and clearly .npc is not suppose to be supported in core currently as a valid extension to open it

leoxxx commented 5 years ago

@retro-wertz THX. I rename the roms. But why can the unzipped one be loaded? I'll close the issue.

ghost commented 5 years ago

unless a .npc has a different way of loading the rom, i have added PR to support this extension. just incase somebody else gets a hold of other .npc files and gets confused.