Jump to content
Sign in to follow this  

I just added a cheat feature to jzintv

Recommended Posts

FYI, I managed to add a feature to jzintv to enable videogame cheats.  I have the code working on my machine (mac).  I can post the source if anyone is interested.


Here's how it works:


  1. You need to enable the debugger (-d).
  2. You then provide a cheatcode using a new cmdline parameter (--cheat).  The format of the cheat codes is a sequence of poke or enter debugger commands, separated by either a space or a '|' character.  For example to give yourself six lives in qbert the code would be: --cheat='p $173 06'.  For 255 lives on demon attack you can use: --cheat='p $181 ff' (NOTE: either use single quotes or escape the $ sign if you prefer double quotes.)
  3. You then need to map a key or controller button to a new type of event in the kbd hack file.  In this case the mapping I used looks like this: TAB   CHEAT1 which maps the first cheat provided on the cmdline to the TAB key.  If you provide more cheat codes on the cmdline, then they will be mapped to CHEAT2, CHEAT3 ... CHEAT8. (A max of eight codes can be entered.)


You then start the game as usual, and type r at the debugger prompt to get it going.


Once you get low on lives, you can then just the button you mapped during gameplay and the lives will be added.  (The display will not typically update the count till you die, or a full screen refresh is issued by the game.)


Like I said, I have this all working and debugged on my machine, and will post the code wherever it's appropriate if people are interested.


I'd appreciate someone letting me know what the official way to contribute code back to jzintv should be.


Also, I added the required cmake files to get the project to build in the CLion IDE.



In this screenshot you can see that I have five lives in QBert before even getting a single point. (I had to kill myself to get the screen to redraw.)





Let me know what you guys think.


  • Thanks 1

Share this post

Link to post
Share on other sites

I know you can poke the rom with commands in the rom cfg file.


Just contact Joe with your contributions.  His email address is in the readme file.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...