BizHawk
BizHawk copied to clipboard
BSNESv115+ and original BSNES have different memory domain names, causing Lua scripts to fail
Example: https://github.com/brunovalads/yoshis-island/blob/master/BizHawk/Yoshi's-Island-BizHawk.lua
These are procedurally generated in new BSNES, so #wontfix? I guess we could revise the old BSNES but it's going to be removed soon...
"CARTRAM" is also used for Faust and Snes9x cores, BSNESv115+ is the odd one out having it CARTRIDGE_RAM instead. Renaming the enum would be enough to "fix" it for this case (other cases are probably as easy)
fwiw there's also a CARTRIDGE_ROM
domain which should be renamed as well if that's to happen... after looking at it though, I saw that the CARTRIDGE_RAM
domain isn't necessarily "real" cartridge ram (see https://github.com/TASEmulators/BizHawk/blob/f29113287e88c6a644dbff30f92a9833307aad20/waterbox/bsnescore/bsnes/target-bsnescore/bsnescore.cpp#L326-L330), so I'm not entirely sure whether renaming is the correct course of action. After all, the core is similar but not the same as the old core, so having different memory domain names doesn't seem like something that must be fixed.
Looking at it it seems that the old core would just use the same variable for the various chips for something like SaveRAM (so cartridge.ram itself was a generalized memory region for SaveRAM) while the new core split the memory regions up into separate variables which would need this generalizing function to have the old behavior.
This same variable for different chips' SaveRAM is also the same behavior in Faust and (mostly) Snes9x.
I'm not against renaming these domains if people think that's a good idea. I just copied the SNES_MEMORY
enum names from the old core definition, that's why they are named the way they are.
Ideally the CARTRAM domain, along with any others which behave the same across cores, has the same name as Faust and Snes9x.