BizHawk icon indicating copy to clipboard operation
BizHawk copied to clipboard

BSNESv115+ and original BSNES have different memory domain names, causing Lua scripts to fail

Open getCursorsExe opened this issue 2 years ago • 2 comments

Example: https://github.com/brunovalads/yoshis-island/blob/master/BizHawk/Yoshi's-Island-BizHawk.lua

getCursorsExe avatar Oct 03 '22 12:10 getCursorsExe

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...

YoshiRulz avatar Oct 03 '22 17:10 YoshiRulz

"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)

CasualPokePlayer avatar Oct 07 '22 10:10 CasualPokePlayer

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.

Morilli avatar Oct 15 '22 02:10 Morilli

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.

CasualPokePlayer avatar Oct 15 '22 10:10 CasualPokePlayer

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.

Morilli avatar Oct 18 '22 23:10 Morilli

Ideally the CARTRAM domain, along with any others which behave the same across cores, has the same name as Faust and Snes9x.

YoshiRulz avatar Oct 19 '22 03:10 YoshiRulz