MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Pages: 1

joemagiera
MAME Fan
Reged: 04/16/08
Posts: 71
Loc: Evanston, IL, USA
Send PM


RAM editing, Is this possible in MAME (and if so, how?)
#393854 - 04/24/22 04:35 PM


For the game Atari Crystal Castles, in the manual, it says if you reset everything, paid coins stats are never reset. On PDF page 10 (manual page 1-3), under “GAME OVERVIEW” section, in “GAME PLAYFIELD COLOR CHANGES”, it mentions the castles changing colors every 100 paid games (which are never reset).

The paid coins info is kept in the X2212's, at locations 4A & 4B.

Would it be possible to edit MAME to change the number of paid coins so that you can see impact on castles changing colors? I really don't want to have to manually continually rack up 100 credits to see what happens.

If so, how do you go about doing this?



PM's turned off. If you want to reach me, direct email please.

Joe (joemagiera at ameritech dot net)
[email protected]



Heihachi_73
I am the Table!
Reged: 10/29/03
Posts: 1074
Loc: Melbourne, Australia
Send PM


Re: RAM editing, Is this possible in MAME (and if so, how?) new [Re: joemagiera]
#393856 - 04/24/22 04:58 PM


> For the game Atari Crystal Castles, in the manual, it says if you reset everything,
> paid coins stats are never reset. On PDF page 10 (manual page 1-3), under “GAME
> OVERVIEW” section, in “GAME PLAYFIELD COLOR CHANGES”, it mentions the castles
> changing colors every 100 paid games (which are never reset).
>
> The paid coins info is kept in the X2212's, at locations 4A & 4B.
>
> Would it be possible to edit MAME to change the number of paid coins so that you can
> see impact on castles changing colors? I really don't want to have to manually
> continually rack up 100 credits to see what happens.
>
> If so, how do you go about doing this?

Run MAME with -debug and you can open the memory viewer and manually poke the bytes e.g. click on 4A, and assuming it's a 16-bit value (given that it says 4A and 4B) type a reasonably large number like 0x5555 as a test - don't use FFFF as it will just overflow back to 0 on the next coin, and values above 7FFF (or FF7F depending on endian) might be considered a negative number depending on how it was programmed (think Super Mario 1, where 127 lives + 1 becomes -128 lives and an instant game over if you die).

On a side note, it would be better if a cheat was made for each color variation rather than poking the RAM in the debugger. Assuming a cheat hasn't already been made for it.



joemagiera
MAME Fan
Reged: 04/16/08
Posts: 71
Loc: Evanston, IL, USA
Send PM


Re: RAM editing, Is this possible in MAME (and if so, how?) new [Re: Heihachi_73]
#393857 - 04/24/22 06:05 PM


> Run MAME with -debug and you can open the memory viewer and manually poke the bytes
> e.g. click on 4A, and assuming it's a 16-bit value (given that it says 4A and 4B)

I "kind of" understand what you are saying. I never tried MAME with -debug before. I just started that up, but I don't know what to do next.

I may have confused things when I said the X2212's were at 4A & 4B. I meant they are at positions 4A & 4B locations on a real physical board.

When I look at memory in the MAME debugger, I have no idea where the data for the X2212's would be located.

Can anyone tell me the storage location addresses for the two X2212's would be? And how big is the storage for each X2212? (I'm guessing 4 bytes)

Thanks,

Joe

Edited by joemagiera (04/24/22 06:05 PM)



PM's turned off. If you want to reach me, direct email please.

Joe (joemagiera at ameritech dot net)
[email protected]



Rotwang
Life is too short to be little...
Reged: 03/21/17
Posts: 109
Send PM


Re: RAM editing, Is this possible in MAME (and if so, how?) new [Re: joemagiera]
#393858 - 04/24/22 06:20 PM


With the amount of key presses it took to type all this you could have inserted hundreds of coins.



joemagiera
MAME Fan
Reged: 04/16/08
Posts: 71
Loc: Evanston, IL, USA
Send PM


Re: RAM editing, Is this possible in MAME (and if so, how?) new [Re: Rotwang]
#393859 - 04/24/22 08:22 PM


> With the amount of key presses it took to type all this you could have inserted hundreds of coins.

A reasonable suggestion, but I wouldn't learn anything doing that. Plus I want to try numbers in the thousands to match my real PCBs.



PM's turned off. If you want to reach me, direct email please.

Joe (joemagiera at ameritech dot net)
[email protected]



Rotwang
Life is too short to be little...
Reged: 03/21/17
Posts: 109
Send PM


Re: RAM editing, Is this possible in MAME (and if so, how?) new [Re: joemagiera]
#393860 - 04/24/22 09:08 PM


Sounds good. I poked at this a bit, not sure exactly what's going on, but if you open the game up in debug mode, open a new memory window and set the device to "Xicor X2212 256x4 NOVRAM/:nvram_4B/0/m_sram" Every time you add a credit, $15 increments, and every time you get game over $1B is incremented. These values get overwritten when I try to manually edit them, but it's a start. Good luck.



joemagiera
MAME Fan
Reged: 04/16/08
Posts: 71
Loc: Evanston, IL, USA
Send PM


Re: RAM editing, Is this possible in MAME (and if so, how?) new [Re: Rotwang]
#393861 - 04/25/22 02:28 AM


> Sounds good. I poked at this a bit, not sure exactly what's going on, but if you open
> the game up in debug mode, open a new memory window and set the device to "Xicor
> X2212 256x4 NOVRAM/:nvram_4B/0/m_sram" Every time you add a credit, $15 increments,
> and every time you get game over $1B is incremented. These values get overwritten
> when I try to manually edit them, but it's a start. Good luck.

Thanks for the info. I am unfamiliar with doing any of this, but I will give it a try and report back. Might take me some time.

Joe



PM's turned off. If you want to reach me, direct email please.

Joe (joemagiera at ameritech dot net)
[email protected]



joemagiera
MAME Fan
Reged: 04/16/08
Posts: 71
Loc: Evanston, IL, USA
Send PM


Re: RAM editing, Is this possible in MAME (and if so, how?) new [Re: Rotwang]
#393862 - 04/25/22 02:44 AM


> Sounds good. I poked at this a bit, not sure exactly what's going on, but if you open
> the game up in debug mode, open a new memory window and set the device to "Xicor
> X2212 256x4 NOVRAM/:nvram_4B/0/m_sram" Every time you add a credit, $15 increments,
> and every time you get game over $1B is incremented. These values get overwritten
> when I try to manually edit them, but it's a start. Good luck.

Wow, this is pretty cool. I credit it up and I see $15 gets incremented. When the game finished for me, I see $1E being incremented. Oh, I think I figured that out. In the accounting test screen, it counts the game played in a "time length of game" slot. So my game obviously took a different length of time than your game and incremented the appropriate memory spot.

When I go to edit, I get it overwritten too. Bummer. Anyone know how to get around this?



PM's turned off. If you want to reach me, direct email please.

Joe (joemagiera at ameritech dot net)
[email protected]



Rotwang
Life is too short to be little...
Reged: 03/21/17
Posts: 109
Send PM


Re: RAM editing, Is this possible in MAME (and if so, how?) new [Re: joemagiera]
#393864 - 04/25/22 03:45 AM


Ah, I was getting game over as fast as possible for testing. I didn't play around with it for very long. Possible that it's copying a value from somewhere else in memory and overwriting any changes.

One thing I did notice was that changing the values in the middle of a game (not sure which address did this) made the next castle load with different color walls.

Edited by Rotwang (04/25/22 03:46 AM)



AJR Hacker
MAME Developer
Reged: 02/01/16
Posts: 144
Send PM


Re: RAM editing, Is this possible in MAME (and if so, how?) new [Re: joemagiera]
#393870 - 04/25/22 07:08 PM


> When I go to edit, I get it overwritten too. Bummer. Anyone know how to get around
> this?

The values probably get overwritten because the game mirrors them in main RAM.

One easy way to get around this problem is to open nvram/ccastles/nvram_4b outside MAME in a hex editor, since X2212 has nonvolatile backup for its own SRAM. Editing it is not so simple: the game code stores three copies of the same data, with simple XOR modifications, to check its integrity. Also keep in mind that this memory type is only 4 bits wide; in this case, the high nibbles are in 4A and the low nibbles are in 4B.



joemagiera
MAME Fan
Reged: 04/16/08
Posts: 71
Loc: Evanston, IL, USA
Send PM


Re: RAM editing, Is this possible in MAME (and if so, how?) new [Re: AJR Hacker]
#393871 - 04/25/22 09:48 PM


> > When I go to edit, I get it overwritten too. Bummer. Anyone know how to get around
> > this?
>
> The values probably get overwritten because the game mirrors them in main RAM.
>
> One easy way to get around this problem is to open nvram/ccastles/nvram_4b outside
> MAME in a hex editor, since X2212 has nonvolatile backup for its own SRAM. Editing it
> is not so simple: the game code stores three copies of the same data, with simple XOR
> modifications, to check its integrity. Also keep in mind that this memory type is
> only 4 bits wide; in this case, the high nibbles are in 4A and the low nibbles are in
> 4B.

Yikes, that doesn't sound pleasant at all. Sounds like it's going to be way more trouble than it's worth. Wish there was some cheat screen or something so this field could be manually (safely & correctly) entered. I would think this would be applicable for many games that use X2212. Thanks much for the info though.

My real PCB has a 30,000 count for one coin count and a 20,000 count for the other coin count. I guess I'm not simulating this after all.



PM's turned off. If you want to reach me, direct email please.

Joe (joemagiera at ameritech dot net)
[email protected]



Sthiryu
MAME Fan
Reged: 03/09/16
Posts: 117
Send PM


Re: RAM editing, Is this possible in MAME (and if so, how?) new [Re: joemagiera]
#393876 - 04/27/22 03:14 AM


By the way, is it possible to edit a mame save state to change the score, number of lives, time...?

I've tried with an hex editor but it doesn't seem to work.

Edited by Sthiryu (04/27/22 03:14 AM)



RETRODANUART.COM


Pages: 1

MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Robbbert, Tafoid 
0 registered and 178 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 424