Post subject: Question about memory domains and LUA
Editor, Player (54)
Joined: 12/25/2004
Posts: 634
Location: Aguascalientes, Mexico
Poking with the memory domain, I think I've found what I was looking for but still want to ask just to be sure. 1) Normally in other emulators, what you use for cheats are PAR codes which are just addresses in the WRAM. An example could be 7E0000, which is where the RAM starts (and it ends at 7FFFFF). 2) In SNES9x you can read directly from the ROM if you write something like:
Language: LUA

memory.readbyte( 0xC00000) -- Offset 0x000000 memory.readbyte( 0xDFFFFF) -- Offset 0x1FFFFF
If I understood correctly you can do this in Bishawk as follow: 1) You take out the first 2 digits (You subtract whatever your address is with 7E0000. e.g. 7E0B56 - 7E0000 = 0B56, which is what you use in Bizhawk but can't understand why you need to do this) 2) You have to change first the memory domain to CARTROM (which I'm not sure yet how) then you can read/write into the ROM & if you still want to jump into the WRAM, you have to move back, correct? http://tasvideos.org/Bizhawk/LuaFunctions.html ^ There's a function called mainmemory.getname(), which tells you which type of memory you're using, but there's no set function (or at least is not documented).
I'm the best in the Universe! Remember that!
Post subject: Re: Question about memory domains and LUA
AntyMew
It/Its
Encoder, Player (35)
Joined: 10/22/2014
Posts: 425
samurai goroh wrote:
^ There's a function called mainmemory.getname(), which tells you which type of memory you're using, but there's no set function (or at least is not documented).
It's there under memory. memory.usememorydomain(string domain)
Just a Mew! 〜 It/She ΘΔ 〜
Editor, Player (54)
Joined: 12/25/2004
Posts: 634
Location: Aguascalientes, Mexico
I see, I though that it should be called get and set as you name functions in Java (and I was looking at mainmemory tab and not also in memory tab) Thanks
I'm the best in the Universe! Remember that!
Post subject: Re: Question about memory domains and LUA
creaothceann
He/Him
Editor
Joined: 4/7/2005
Posts: 1874
Location: Germany
samurai goroh wrote:
e.g. 7E0B56 - 7E0000 = 0B56, which is what you use in Bizhawk but can't understand why you need to do this
Because Action Replay cheat devices use the bus value (the number placed into the CPU's address register). The bus is mapped to many devices though: WRAM, cartridge (which can have its own mapping too, e.g. SRAM), PPU (video), APU (audio), ... whereas in BizHawk you access the device's memory directly.
Editor, Player (54)
Joined: 12/25/2004
Posts: 634
Location: Aguascalientes, Mexico
Oh I see, that makes sense, thanks creaothceann. Only wonder why that is not documented. When the error is thrown, it does tell you the range you have to use, but if you're unaware (as I was) you'll be wondering why until you see that using RAM search also starts from 000000h (I was like, if that's how things are done around here, then okay lets do it also as such...)
I'm the best in the Universe! Remember that!
Editor, Emulator Coder
Joined: 8/7/2008
Posts: 1156
just use system bus memory domain and you dont need to understand any of this. nothing that happens is arbitrary and it doesnt need documenting. it's all based purely 100% on your memory domain selection, common sense, and snes documentation.