Page 1 of 1

Cheats not working - no off/off switch, just code's description!

Posted: Fri Oct 02, 2020 6:50 am
by jmon
I'm using negaMAME (0.244.0-1, based on MAME 0.224.0) with Negatron EXTERNAL frontend (it was made in mind for that variant) and I managed to figure out through intuitive guessing...and filling in dots from other sources other guesses about syntax of cheat.simple:

Code: Select all

(cheat_simple.lua :
-- ram/rom cheat format:  <set name>,<cputag|regiontag>,<hex offset>,<b|w|d|q - size>,<hex value>,<desc>
-- only program address space is supported, comments are prepended with ;
-- size is b - u8, w - u16, d - u32, q - u64
--") 
and output.json. Even though I could decipher the first of two lines for Sonic CD, I could not entirely decipher the

Code: Select all

":segacd:40000000:FF1516:00000000:FFFFFFFF:-----SONIC CD----- Infinite Time" 
- what does "40000000" and "FFFFFFFF" mean in those "fields-or-whatever"? I got luck with THAT game ;) :D :) as far as getting those "fields" right, but apparently not on Hook (for Sega CD also BTW):

Code: Select all

segacd,:segacd:prgram,5E2A8,b,2D,-----HOOK----- Infinite Time
:segacd:40000000:5E2A8:0000002D:FFFFFFFF:-----HOOK----- Infinite Time
segacd,:segacd:prgram,5E29D,b,80,-----HOOK----- Infinite Fly Meter
:segacd:40000000:5E29D:00000080:FFFFFFFF:-----HOOK----- Infinite Fly Meter
Specifically I got error after closing negaMAME (cheat script error: missing region :segacd:prgram) because I could see description under tab-called main menu-->plugins-->cheat... :cry: but could not turn it on or off...like it was only parsing description not toggle switch! Is it because the "40000000" and "FFFFFFFF"? :idea: At least tell me what those mean. :| Sonic CD code has on/off toggle switch still (hint from output.json):

Code: Select all

"[{
    "space":{
      "cpup":{
        "tag":":maincpu",
        "type":"program"
      }
    },
    "script":{
      "run":" cpup:write_u8(16717078,0, true)"
    },
    "desc":"-----SONIC CD----- Infinite Time\r"
  },{
    "region":{
      "rom":":segacd:prgram"
    },
    "script":{
      "on":"\t\t\taddrs = {\n\t\t\t{addr = 385704, val = 45},\n--flag\n\t\t\t}\n\t\t\ton = true\n\t\t\tfor k, v in pairs(addrs) do\n\t\t\t\tv.save = rom:read_u8(v.addr)\n\t\t\t\trom:write_u8(v.addr, v.val)\n\t\t\tend",
      "off":"\t\t\tif on then\n\t\t\t\tfor k, v in pairs(addrs) do\n\t\t\t\t\trom:write_u8(v.addr, v.save)\n\t\t\t\tend\n\t\t\tend"
    },
    "desc":"-----HOOK----- Infinite Time\r"
  },{
    "region":{
      "rom":":segacd:prgram"
    },
    "script":{
      "on":"\t\t\taddrs = {\n\t\t\t{addr = 385693, val = 128},\n--flag\n\t\t\t}\n\t\t\ton = true\n\t\t\tfor k, v in pairs(addrs) do\n\t\t\t\tv.save = rom:read_u8(v.addr)\n\t\t\t\trom:write_u8(v.addr, v.val)\n\t\t\tend",
      "off":"\t\t\tif on then\n\t\t\t\tfor k, v in pairs(addrs) do\n\t\t\t\t\trom:write_u8(v.addr, v.save)\n\t\t\t\tend\n\t\t\tend"
    },
    "desc":"-----HOOK----- Infinite Fly Meter\r"
  }]"

Re: Cheats not working - no off/off switch, just code's description!

Posted: Fri Oct 02, 2020 3:03 pm
by Tafoid
jmon wrote: Fri Oct 02, 2020 6:50 am I managed to figure out through intuitive guessing...and filling in dots from other sources other guesses about syntax of cheat.simple
If you need to figure out how to add cheats not already made by Pusgy, you can head to http://www.mamecheat.co.uk/forums/ MAME itself has no control over its creation.

Re: Cheats not working - no off/off switch, just code's description!

Posted: Sun Oct 04, 2020 9:31 am
by jmon
I tried registering to his board, but I did not get activation email, so then I emailed him... NOTHING! :evil:

Re: Cheats not working - no off/off switch, just code's description!

Posted: Sun Oct 04, 2020 1:44 pm
by jmon
Finally answered email...STUPID SPAMBOTS! :evil: :evil: :evil: :evil: :evil: