Author Topic: Patching GameShark Codes with n64hijack (Testers needed)  (Read 14941 times)

0 Members and 1 Guest are viewing this topic.

Offline Kyle

  • Sr. Member
  • ****
  • Posts: 461
  • Karma: +55/-0
  • Game Genie Guy
    • View Profile
I added support to Game Genie Guy! to patch GameShark codes into N64 roms.

http://srktt.com/files/GGGN64.zip

Open GGGuy
Open a .z64 rom (.n64 and .v64 are unsupported for now)
Paste GameShark codes from http://gamehacking.org/?sys=n64
Codes should look like this - 810F0890 3F90
Hit Patch

Let me know of success or failure. I have no clue what compatibility is like. n64hijack is doing all work:

https://github.com/jfktrey/n64hijack
« Last Edit: April 14, 2015, 03:00 AM by Kyle »

Offline saturnu

  • ヽ(^o^)丿
  • Hero Member
  • *****
  • Posts: 1168
  • Karma: +150/-0
    • View Profile
    • :D
Re: n64hijack
« Reply #1 on: April 11, 2015, 10:32 PM »
i just compiled n64hijack
http://a.pomf.se/yjrtdd.zip

https://github.com/mikeryan/n64dev/tree/master/util/u64asm


don't download this ^^
use the bundle below
« Last Edit: April 12, 2015, 01:12 AM by saturnu »

Offline pcfreak324

  • Full Member
  • ***
  • Posts: 175
  • Karma: +13/-0
    • View Profile
« Last Edit: April 11, 2015, 11:10 PM by pcfreak324 »

Offline saturnu

  • ヽ(^o^)丿
  • Hero Member
  • *****
  • Posts: 1168
  • Karma: +150/-0
    • View Profile
    • :D
Re: n64hijack
« Reply #3 on: April 11, 2015, 11:42 PM »
oh, sorry!
this happens all the time :D
i was uploading this in a hurry, 'cause i wanted to see a movie ^^

EDIT:
changelog
- static n64hijack (windows port)
- static u64asm (windows port - removed drjr support, this was easier than fixing it ^^)
- fix: the github n64.exe wasn't working on 64 bit systems
- fix: n64hijack system() call under windows

bundle n64hijack + u64asm :>
n64hijack_win32 bundle
« Last Edit: April 12, 2015, 01:14 AM by saturnu »

Offline Hexatendo

  • Sr. Member
  • ****
  • Posts: 302
  • Karma: +6/-0
    • View Profile
Re: n64hijack
« Reply #4 on: April 12, 2015, 03:29 AM »
N64 hijack? So basically, I can make debug roms? SWEET!

Offline Kyle

  • Sr. Member
  • ****
  • Posts: 461
  • Karma: +55/-0
  • Game Genie Guy
    • View Profile
Re: n64hijack
« Reply #5 on: April 12, 2015, 03:58 AM »
n64hijack_win32 bundle
Thanks a ton! This seems straightforward enough. I just need to append text to the end of patcher.asm. Is there a distinction between pre-boot and in-game codes? To me it looks like this is all commented out.

Code: [Select]
cheat_list:

    ; BEGIN PRE-BOOT CODES

    ; Insert codes here

    dw $00000000   ; END OF LIST
    dw $0000

   

    ; BEGIN IN-GAME CODES

    ; Example code: play as a glove in Super Mario 64
    ; dw $8133B4D6
    ; dw $3C4C

    dw $00000000   ; END OF LIST
    dw $0000

Could this just be simplified to this?

Code: [Select]
cheat_list:
    dw $8133B4D6
    dw $3C4C

Offline Hexatendo

  • Sr. Member
  • ****
  • Posts: 302
  • Karma: +6/-0
    • View Profile
Re: n64hijack
« Reply #6 on: April 12, 2015, 06:36 AM »
Nope, does NOT work on windows 8.1. How can I do this? Thanks!

Offline saturnu

  • ヽ(^o^)丿
  • Hero Member
  • *****
  • Posts: 1168
  • Karma: +150/-0
    • View Profile
    • :D
Re: n64hijack
« Reply #7 on: April 12, 2015, 10:55 AM »
Could this just be simplified to this?

Code: [Select]
cheat_list:
    dw $8133B4D6
    dw $3C4C

Hm, no i don't think so

Code: [Select]
cheat_list:

    ; BEGIN PRE-BOOT CODES

    ; Insert codes here

edit: here are the codes that are patched in in pre boot
    dw $8155B2D6 ;i'm optional
    dw $3523 ;i'm optional

edit: this is just a tag that the pre-boot cheat section is over and that the next cheats are for the cheat engine
    dw $00000000   ; END OF LIST
    dw $0000

   

    ; BEGIN IN-GAME CODES

edit: here are the codes that are used by the cheat engine
    dw $8133B4D6
    dw $3C4C

edit: this is just an end tag that the second part of the cheat list is over
    dw $00000000   ; END OF LIST
    dw $0000

this should be the minimal config:
Code: [Select]
cheat_list:
    dw $00000000
    dw $0000
    dw $8133B4D6
    dw $3C4C
    dw $00000000
    dw $0000


Nope, does NOT work on windows 8.1. How can I do this? Thanks!

I compiled it on windows 8.1 and tested it on windows 2003, too.
what problems do you encounter by running it?

Maybe this is a silly question, but you know that this is a commandline tool?
« Last Edit: April 12, 2015, 11:08 AM by saturnu »

Offline saturnu

  • ヽ(^o^)丿
  • Hero Member
  • *****
  • Posts: 1168
  • Karma: +150/-0
    • View Profile
    • :D
Re: n64hijack
« Reply #8 on: April 12, 2015, 11:13 AM »
Btw. i don't see any swap code in it, but the patcher assumes the z64 format
you can use ucon64 to do this.

Code: [Select]
ucon64 --z64 myrom.v64

Download
http://ucon64.sourceforge.net/

Offline Kyle

  • Sr. Member
  • ****
  • Posts: 461
  • Karma: +55/-0
  • Game Genie Guy
    • View Profile
Re: n64hijack
« Reply #9 on: April 12, 2015, 11:18 AM »
Thanks! That helps too. What is the distinction between the pre and in-game codes? Are most codes in-game? Is there a way I can determine the type by the code's syntax?

Offline saturnu

  • ヽ(^o^)丿
  • Hero Member
  • *****
  • Posts: 1168
  • Karma: +150/-0
    • View Profile
    • :D
Re: n64hijack
« Reply #10 on: April 12, 2015, 12:53 PM »
i assume that pre-boot codes are more like rom patches in general, but that you don't need to calc the file offsets by yourself.

Offline Hexatendo

  • Sr. Member
  • ****
  • Posts: 302
  • Karma: +6/-0
    • View Profile
Re: n64hijack
« Reply #11 on: April 12, 2015, 07:14 PM »
Maybe this is a silly question, but you know that this is a commandline tool?

You are right. It is a command line tool, but now my problem is how to get command line tool to work. Even I DO get it to work, I don't know how to open it. Any suggestions?

Offline saturnu

  • ヽ(^o^)丿
  • Hero Member
  • *****
  • Posts: 1168
  • Karma: +150/-0
    • View Profile
    • :D
Re: n64hijack
« Reply #12 on: April 12, 2015, 07:43 PM »
It sounds like Kyle wants to program a frontend or something for it? So in your case i wouldn't bother about the cmd line and just wait a little bit longer. ^^

Offline Kyle

  • Sr. Member
  • ****
  • Posts: 461
  • Karma: +55/-0
  • Game Genie Guy
    • View Profile
Re: n64hijack
« Reply #13 on: April 12, 2015, 10:51 PM »
Edit: moved to OP
« Last Edit: April 14, 2015, 03:01 AM by Kyle »

Offline saturnu

  • ヽ(^o^)丿
  • Hero Member
  • *****
  • Posts: 1168
  • Karma: +150/-0
    • View Profile
    • :D
Re: n64hijack
« Reply #14 on: April 13, 2015, 10:41 AM »
hey hey ^^

i made some bindiffs and it seems like it is working on z64 files
my idea would be to precheck and disable the checksum option

n64hijack includes crc fixing out of the box
https://github.com/jfktrey/n64hijack/blob/master/src/crc.h



with n64 files it's not working right
as i mentioned before you have to convert them to z64 files first

Btw. i don't see any swap code in it, but the patcher assumes the z64 format
you can use ucon64 to do this.

Code: [Select]
ucon64 --z64 myrom.v64

Download
http://ucon64.sourceforge.net/



as you can see, it just is inserting the same values as it would for z64 files




i would suggest to filter the file selection dialog to .z64 only

or even better to convert every (v64,n64,z64) file with ucon64 first.
this would be a good idea, bacause some z64 files have a wrong extension and are v64 files or whatever anyway.
ucon64 is checking the header before swapping, so if there is a wrong z64 file it's a real z64 file after converting. ^^

greetings, saturnu :D