Author Topic: Any news on Gameshark support yet?  (Read 11805 times)

0 Members and 1 Guest are viewing this topic.

Offline Kerr Avon

  • Hero Member
  • *****
  • Posts: 1745
  • Karma: +173/-3
    • View Profile
Any news on Gameshark support yet?
« on: August 05, 2013, 02:30 AM »
I was just wondering has anyone made any progress towards getting the ED64 to use Gameshark cheat codes? I know it must mean a *lot* of very complicated work, and so will take time to get working, but I'm hoping there's been some progress in the meantime?

Some N64 games have great Gameshark cheat/game altering codes, and being able to use them with the ED64 would be brilliant.

Offline Chilly Willy

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 505
  • Karma: +32/-3
    • View Profile
Re: Any news on Gameshark support yet?
« Reply #1 on: August 05, 2013, 09:49 PM »
I've had a lot of other things to work on, so I haven't gotten around to it. Sorry.

Offline Kerr Avon

  • Hero Member
  • *****
  • Posts: 1745
  • Karma: +173/-3
    • View Profile
Re: Any news on Gameshark support yet?
« Reply #2 on: August 05, 2013, 10:42 PM »
I've had a lot of other things to work on, so I haven't gotten around to it. Sorry.

Fair enough, mate, I know you've got lots of projects on the go. I'm hoping other people might have given this a try, as a working Gameshark engine would appeal to a lot of people. In a way it's a pity the N64 Gameshark doesn't work by altering the (virtual) ROM contents, as I believe Gamesharks worked on the NES (is that right?), as that way we could just patch the ROMs to include whatever cheat codes we wanted, and then transfer the modified ROMs to the SD Card, along with the unmodified ROMs.

Offline phoenixdownita

  • Sr. Member
  • ****
  • Posts: 441
  • Karma: +36/-7
    • View Profile
Re: Any news on Gameshark support yet?
« Reply #3 on: August 05, 2013, 11:53 PM »
... In a way it's a pity the N64 Gameshark doesn't work by altering the (virtual) ROM contents, as I believe Gamesharks worked on the NES (is that right?), as that way we could just patch the ROMs to include whatever cheat codes we wanted, and then transfer the modified ROMs to the SD Card, along with the unmodified ROMs.

What we all need to understand is that not all cheat codes work like that. Some codes work during the interrupt, to restore values, for those a ROM patch would amount to nothing. Example are implementations of infinite energy/life in which at each interrupt the PAR/GS resets the value. Many codes are done like that and they require active hooks not just patched ROM, it is possible to build the interrupt service routine in the game but such modification would be a much bigger change.

Some other codes instead work by changing once and for all a value and those are the only ones that could be done via simple ROM patching.

I do believe that the PAR/GS interrupt service routine is not too complicated (hooked up by the master code) but patching it in into the ROM is more work that is needed.
« Last Edit: August 06, 2013, 01:03 AM by phoenixdownita »

Offline Kerr Avon

  • Hero Member
  • *****
  • Posts: 1745
  • Karma: +173/-3
    • View Profile
Re: Any news on Gameshark support yet?
« Reply #4 on: August 07, 2013, 12:17 AM »
... In a way it's a pity the N64 Gameshark doesn't work by altering the (virtual) ROM contents, as I believe Gamesharks worked on the NES (is that right?), as that way we could just patch the ROMs to include whatever cheat codes we wanted, and then transfer the modified ROMs to the SD Card, along with the unmodified ROMs.

What we all need to understand is that not all cheat codes work like that. Some codes work during the interrupt, to restore values, for those a ROM patch would amount to nothing. Example are implementations of infinite energy/life in which at each interrupt the PAR/GS resets the value. Many codes are done like that and they require active hooks not just patched ROM, it is possible to build the interrupt service routine in the game but such modification would be a much bigger change.

Some other codes instead work by changing once and for all a value and those are the only ones that could be done via simple ROM patching.

I do believe that the PAR/GS interrupt service routine is not too complicated (hooked up by the master code) but patching it in into the ROM is more work that is needed.

I know, that's why I said "the N64 Gameshark doesn't work by altering the (virtual) ROM contents". Some of the cheat codes for the N64 Gameshark could be converted to patches for the game ROMs, but that would be rather complex, as it would often mean introducing a new routine into the game's main loop, or a complete alteration of the actual code, to achieve the same effect as the original code but in patched ROM format, i.e. as you say, a Gameshark code might constantly load address x with the value y, thereby keeping the value of your (in-game) shield at maximum, but if you want to patch the game ROM to achieve always full shield value, then you'd remove the instruction that depletes that value, or stop the routine that checks and depletes the shield, from being called at all, etc. None of which is trivial, given the size of the game ROM, and how the N64 is supposedly tricky to program. One of the beauties of the Gameshark is that it allows you to find your own codes without knowing a thing about programming in general, or the game's code in particular.

Gamesharks are fantastic, it's just a pity that (a) they don't work with the Everdrive 64 (which isn't the ED64's fault, it's down to how the GS reacts when it detects a non-game cartridge in the N64, apparently), and (b) Gamesharks are so unreliable, probably down to them being so cheaply made. They are a lot of fun, though.

Offline saturnu

  • ヽ(^o^)丿
  • Hero Member
  • *****
  • Posts: 1188
  • Karma: +156/-0
    • View Profile
    • :D
Re: Any news on Gameshark support yet?
« Reply #5 on: August 07, 2013, 12:40 AM »
You could have a try and just copy and paste chillywillys simulate_pif_boot function into my menu source that you can find on github.
i just deleted the cheat support out of the function, because i was to lazy to progam a cheat input screen. :>

Offline Chilly Willy

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 505
  • Karma: +32/-3
    • View Profile
Re: Any news on Gameshark support yet?
« Reply #6 on: August 07, 2013, 02:47 AM »
You could have a try and just copy and paste chillywillys simulate_pif_boot function into my menu source that you can find on github.
i just deleted the cheat support out of the function, because i was to lazy to progam a cheat input screen. :>

There's a bit to making the cheats work - main.c has a function called get_sd_cheats() that parses the cheat file for the rom, building a cheat list that simulate_pif_boot() uses when making the cheat codes for the game. It then shows a list of the cheats, and allows the user to enable/disable cheats, and change values of cheats that take a value.

On my main menu, you have an option for each game that allows you to turn all cheats off, start with all cheats off and select which ones to turn on, or start with all cheats on and select which ones to turn off. When the user starts the game, the game data is loaded from SD, then get_sd_cheats() is called. If the cheats are off, it just returns. If they are enabled but start all off, the cheat file is parsed with the initial setting set to off, then the loop allowing you to navigate the cheats and change them is entered. Similar for enabled but start all on, but during parsing, they are all turned on. After you are done enabling/disabling individual cheats, it calls neo_run_psram() as usual, which sets up the myth hardware and calls simulate_pif_boot().

Offline saturnu

  • ヽ(^o^)丿
  • Hero Member
  • *****
  • Posts: 1188
  • Karma: +156/-0
    • View Profile
    • :D
Re: Any news on Gameshark support yet?
« Reply #7 on: August 07, 2013, 09:30 AM »
yes i saw that, that's very comfortable for the user. what i wanted to say is, that for basic cheat support, a cheat input screen is the minimal solution. ^^
but you are right, some gs codes are quite long. maybe it's better to implement a cheat browser as well to make it a usefull feature.
« Last Edit: August 07, 2013, 06:09 PM by saturnu »

Offline Kerr Avon

  • Hero Member
  • *****
  • Posts: 1745
  • Karma: +173/-3
    • View Profile
Re: Any news on Gameshark support yet?
« Reply #8 on: August 07, 2013, 06:01 PM »
You could have a try and just copy and paste chillywillys simulate_pif_boot function into my menu source that you can find on github.
i just deleted the cheat support out of the function, because i was to lazy to progam a cheat input screen. :>

Sadly, my programming days are a couple of decades behind me (sadly it's a good thing, if you see what I mean, since my output varied between very bad and terrible  :(). And now I wouldn't even know what language to use, before I even started working my way up to lousy  :(



yes i saw that, that's very comfortable for the user. what i wanted to say is, that for basic cheat support, a cheat input screen is the minimal solution. ^^
but you are right, some gc codes are quite longe. maybe it's better to implement a cheat browser as well to make it a usefull feature.

A good idea might be to make any cheats be read from a master text file, called something like "cheats.txt" in the SD Card's root directory, and each game's cheats could be divided in the text file by an entry like "[Game = game file name.extension", i.e.;


[Game = Super Mario 64 (PAL).z64]
then everything that follows is the game cheats for the ROM with this filename, until the next "[Game = " is encountered. This way the user could add cheats even for ROMs of games or game hacks that don't yet exist, since it's much easier for the user to use the file name rather than a checksum value for each ROM.


And in the game load menu, if the user starts a game as normal, then no cheats are used.

If the user instead presses C-Right (or whatever key you choose to use for "Load this game with cheats") then if there are no cheats for the game then the N64 says "No cheats found", but if there are cheats then the user is given the menu;

Start game with all cheats
Start game with no cheats
Select individual cheats for use
Return to game list


If the user selects "Return to game list" then the N64 goes back to the game select menu. If the user selects "Select individual cheats for use" then the user is given a menu where (s)he can select which cheats to activate. There are sometimes some codes that MUST be used when other Gameshark codes are used in a given game, so it's probably pointless to list them in the menu, since they definitely will be used anyway. Maybe these codes can be marked  in the cheats.txt by a proceeding exclamation mark or whatever, so the program (and the user, when (s)he looks through the cheats.txt file on a PC) knows that this code must be used if any other codes are used for this game.

Offline rimsky82

  • Avid Cheater
  • Newbie
  • *
  • Posts: 40
  • Karma: +1/-0
    • View Profile
    • GameHacking.org
Re: Any news on Gameshark support yet?
« Reply #9 on: August 12, 2013, 03:25 AM »
 I like the idea of a single file for cheats, but I'm partial to using checksums simply because of the amount of badly named roms out there.  PJ64 uses a simple cheat file.  I'd almost say support for that cheat file could be implemented as long as PJ64's (which recently became public) license allows.

I know I've mentioned this before, but I'm the lead web developer at http://gamehacking.org , and I have implemented a system there that generates files for emulators using cheats selected at the site.  Basically, someone could look up a game, pick some cheats, select "everdrive", and download a file to include on the SD card.  I'm not trying to shamelessly plug, but just offer a solution to easily providing cheat files for the everdrives.

ChillyWilly, did you write a cheat engine similar to the GameShark's?

I haven't had a lot of time myself lately, but I'd like to offer my input in integrating cheat support.

Offline Chilly Willy

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 505
  • Karma: +32/-3
    • View Profile
Re: Any news on Gameshark support yet?
« Reply #10 on: August 12, 2013, 11:08 PM »
ChillyWilly, did you write a cheat engine similar to the GameShark's?

I haven't had a lot of time myself lately, but I'd like to offer my input in integrating cheat support.

For the N64 Myth flash cart menu (which I do most of the work on). Need to update it sometime.  :)

Anywho, folks have asked me to help make GS cheating for the ED64 as well, which I plan to when I can. I'm trying to add SD support for both ED64 and Myth to libdragon... just need to find more time to work on that, too!  :D

Offline saturnu

  • ヽ(^o^)丿
  • Hero Member
  • *****
  • Posts: 1188
  • Karma: +156/-0
    • View Profile
    • :D
Re: Any news on Gameshark support yet?
« Reply #11 on: August 13, 2013, 12:35 PM »
yesterday i added chillywillys cheat engine to my menu ^^
at the moment it loads a cheatfile named after the rom (/ED64/CHEAT/romanme.cht) and activates every cheat in it.

perhaps i should add a selection menu for cheats that allow to modify values ^^

but it's working :>
if you guys can't wait to try some cheats and chillywillys gameshark engine, i can upload a beta of that half baked nightly build :>
« Last Edit: August 13, 2013, 12:43 PM by saturnu »

Offline Kerr Avon

  • Hero Member
  • *****
  • Posts: 1745
  • Karma: +173/-3
    • View Profile
Re: Any news on Gameshark support yet?
« Reply #12 on: August 13, 2013, 03:47 PM »
yesterday i added chillywillys cheat engine to my menu ^^
at the moment it loads a cheatfile named after the rom (/ED64/CHEAT/romanme.cht) and activates every cheat in it.

That is fantastic! Working Gameshark codes on the ED64 is a dream come true!

Quote
perhaps i should add a selection menu for cheats that allow to modify values ^^

Yes please. It will make things much easier for us, otherwise we'll have to keep plugging the SD Card into our PC/Macs to rename/edit the cheat files, when we want to test a cheat or try a different cheat(s). A simple menu that allows the user to (de)select each cheat would be fantastic.

Quote
but it's working :>

Yes!!!  :) :) :) :) :)


Quote
if you guys can't wait to try some cheats and chillywillys gameshark engine, i can upload a beta of that half baked nightly build :>

And here's where reality bites... I'm currently working away from home without my N64 (I usually take my N64 (the ED64 makes it so convenient to take every N64 game I want too) and my laptop when I'm working away from home, but this time I took my PS3 instead as I've been meaning to catch up on some PS3 games in my backlog. And I won't be home until Friday night (more realistically Saturday), so I'm currently hating my job even more than I usually do  :(

Ever get the feeling that the universe hates you?

Anyway, I look forward to trying this when I can (grrrr), so thanks for this, Saturnu and Chilly Willy. Saturnu, does your new OS start and save all games OK now, including Donkey Kong 64?

Offline saturnu

  • ヽ(^o^)丿
  • Hero Member
  • *****
  • Posts: 1188
  • Karma: +156/-0
    • View Profile
    • :D
Re: Any news on Gameshark support yet?
« Reply #13 on: August 13, 2013, 05:27 PM »
No it doesn't ^^
I'm not even sure if a can fix the save and romloading problems on my own. :D
But i think i could fix the other bugs and implement a cheat menu or a cover preview. :>

Known Bugs:
- naviagtion in large directorys is broken
- sram savegames aren't working with some games
- flashram isn't working at all
- some games won't boot at all
- jpeg backgrounds are broken
« Last Edit: August 13, 2013, 05:29 PM by saturnu »

Offline Kerr Avon

  • Hero Member
  • *****
  • Posts: 1745
  • Karma: +173/-3
    • View Profile
Re: Any news on Gameshark support yet?
« Reply #14 on: August 13, 2013, 08:23 PM »
No it doesn't ^^
I'm not even sure if a can fix the save and romloading problems on my own. :D


In that case, could you do what Chilly Willy was talking about in another thread, which is make the cheat engine a separate program (at least until the bugs in your OS are ironed out), please? That's where the cheat engine is a program that you load (if you want to use cheats) via the standard Everdrive 64 OS, and then, from the cheat program, you select the game you want to load, and the cheats you want to use, and the cheat program then loads up the game and applies the cheats?

I'd imagine that if this was made to work, then you could easily incorporate it's cheat code into your OS when the OS bugs were fixed to your satisfaction, so that, for example, in the game load menu on your OS, then when the user presses A or START the ED64 loads the selected game, but if the user presses C-Right then the cheat menu appears.



Quote
But i think i could fix the other bugs and implement a cheat menu or a cover preview. :>

Known Bugs:
- naviagtion in large directorys is broken
- sram savegames aren't working with some games
- flashram isn't working at all
- some games won't boot at all
- jpeg backgrounds are broken

Wouldn't Krikzz let you see the source code for the ED64's OS? It seems redundant you having to reinvent the techniques that Krikzz has already done so well, and Krikzz has proven to be very helpful and open.

Anyway, I look forward to trying your Gameshark cheat code, whether as part of the OS or as a separately loading program, and I am counting the days to the weekend!