libretro / mgba

mGBA Game Boy Advance Emulator
https://mgba.io/
Mozilla Public License 2.0
66 stars 71 forks source link

Memory Map for GB/GBC has gaps #185

Closed Sanaki closed 4 years ago

Sanaki commented 4 years ago

I'm not quite sure what's causing this, but after #182 was resolved, certain games still have distinct gaps in their memory causing achievement support to be non-viable. The first game I noticed this on was Kirby's Star Stacker. Jamiras spotted it in Super Mario Land 2: 6 Golden Coins as well. The games we've noticed the issue in seem to be having problems with the $A000 (cartridge ram) and $D000 (bank 1) ranges at least. @negativeExponent, you happen to have any idea what's causing this one?

negativeExponent commented 4 years ago

its possible that mgba delays initializing of a game has ram or is using CGB mode. check log window and see if those are mapped at start

Sanaki commented 4 years ago

Seems like it's mapping fine.

[INFO] [Environ]: SET_MEMORY_MAPS.
[INFO]    ndx flags  ptr              offset   start    select   disconn  len      addrspace
[INFO]    001 M1A1bC 0x7f95ffb7d000 00000000 00000000 FFFFC000 00000000 00004000 
[INFO]    002 M1A1bC 0x7f95ffb7d000 00004000 00004000 FFFFC000 00000000 00004000 
[INFO]    003 M1A1bc 0x7f9626c16000 00000000 00008000 FFFFC000 00000000 00004000 
[INFO]    004 M1A1bc 0x7f9626c0e000 00000000 0000C000 FFFFF000 00000000 00001000 
[INFO]    005 M1A1bc 0x7f9626c0e000 00001000 0000D000 FFFFF000 00000000 00001000 
[INFO]    006 M1A1bc 0x7f9626c1a2f4 00000000 0000FE00 FFFFFF60 00000000 000000A0 
[INFO]    007 M1A1bc 0x7f9626c1a0bc 00000000 0000FF00 FFFFFF80 00000000 00000080 
[INFO]    008 M1A1bc 0x7f9626c1a13e 00000000 0000FF80 FFFFFF80 00000000 0000007F 
[INFO]    009 M1A1bc 0x7f9626c1a13d 00000000 0000FFFF FFFFFFFF 00000000 00000001 
[INFO]    010 M1A1bc 0x7f95ffb5d000 00000000 0000A000 FFFFE000 00000000 00002000
negativeExponent commented 4 years ago

ok. see if this does anything:

https://github.com/negativeExponent/mgba/tree/add_gb_cheevos_support

Sanaki commented 4 years ago

No difference.

Sanaki commented 4 years ago

Hold on... something's odd here. I just popped an achievement correctly that depends on memory entirely in the area showing as 0s. Browsing through those addresses, it doesn't seem like any of them changed from 0. I'm not sure how that's possible.