In the case of the williams driver the ROM total maybe under 64K but it is paged in with RAM which takes the default memory space 0000-CFFF (9000-CFFF is always RAM) and the ROM at d000-ffff is there all the time, but the ROM can be banked in to 0000-8FFF from maincpu region 10000-18FFF when needed. For paging it's actually one of the more straightforward examples.
0000-8FFF RAM (default) or ROM
9000-CFFF RAM
D000-FFFF ROM
From williams.cpp in the MAME source (looking at the source is often handy for stuff like this):-
Code: Select all
ROM_START( robotron )
ROM_REGION( 0x19000, "maincpu", 0 )
ROM_LOAD( "robotron.sba", 0x0d000, 0x1000, CRC(13797024) SHA1(d426a50e75dabe936de643c83a548da5e399331c) )
ROM_LOAD( "robotron.sbb", 0x0e000, 0x1000, CRC(7e3c1b87) SHA1(f8c6cbe3688f256f41a121255fc08f575f6a4b4f) )
ROM_LOAD( "robotron.sbc", 0x0f000, 0x1000, CRC(645d543e) SHA1(fad7cea868ebf17347c4bc5193d647bbd8f9517b) )
ROM_LOAD( "robotron.sb1", 0x10000, 0x1000, CRC(66c7d3ef) SHA1(f6d60e26c209c1df2cc01ac07ad5559daa1b7118) )
ROM_LOAD( "robotron.sb2", 0x11000, 0x1000, CRC(5bc6c614) SHA1(4d6e82bc29f49100f7751ccfc6a9ff35695b84b3) )
ROM_LOAD( "robotron.sb3", 0x12000, 0x1000, CRC(e99a82be) SHA1(06a8c8dd0b4726eb7f0bb0e89c8533931d75fc1c) )
ROM_LOAD( "robotron.sb4", 0x13000, 0x1000, CRC(afb1c561) SHA1(aaf89c19fd8f4e8750717169eb1af476aef38a5e) )
ROM_LOAD( "robotron.sb5", 0x14000, 0x1000, CRC(62691e77) SHA1(79b4680ce19bd28882ae823f0e7b293af17cbb91) )
ROM_LOAD( "robotron.sb6", 0x15000, 0x1000, CRC(bd2c853d) SHA1(f76ec5432a7939b33a27be1c6855e2dbe6d9fdc8) )
ROM_LOAD( "robotron.sb7", 0x16000, 0x1000, CRC(49ac400c) SHA1(06eae5138254723819a5e93cfd9e9f3285fcddf5) )
ROM_LOAD( "robotron.sb8", 0x17000, 0x1000, CRC(3a96e88c) SHA1(7ae38a609ed9a6f62ca003cab719740ed7651b7c) )
ROM_LOAD( "robotron.sb9", 0x18000, 0x1000, CRC(b124367b) SHA1(fd9d75b866f0ebbb723f84889337e6814496a103) )
The cheat write is built up like so:
[cputag.][space]size@address=value
cputag = eg maincpu,cpu1
size = b(yte):1 byte, w(ord):2 bytes, d(oubleword):4 bytes, q(uadword):8 bytes
space = p(rogram), m(emory), o(pcode), r(am)
address = self explanatory
value = self explanatory
p = program address space of CPU (default - only writes to RAM)
m = basically the same as above but it will write to ROM
o = opcode address space of CPU (R/W access to decrypted opcodes)
r = direct RAM space of CPU (always allows writes, even for ROM)
To sum up when you write maincpu.mb@14A02 = 39, you are actually writing to rom bank 5 which contains the rom robotron.sb5 which gets banked into 4000-4FFF when the ROM is switched on.
FYI, syndromtr has produced a nice professional pdf which I think you should find an interesting read -
http://cheat.retrogames.com/download/holycheat!.zip .