News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Complications with source code patching  (Read 312 times)

F4NB0Y3N1NT3ND0

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Complications with source code patching
« on: September 13, 2020, 06:24:05 pm »
About a year ago, Kaze Emanuar came out with a hack for Mario 64 that fixes the camera. I've noticed that recently and wanted to apply it to other rom hacks. He linked the source code in the description in case anyone wanted to do that, but it's never worked for me. Every time I tried, I always got a bunch of errors. I'll link both the source code and the error logs in case anyone can figure it out.

Source code:
Spoiler:
.org 0x41c84
!1:
jal $370000

.org 0x41ca4
!1:
jal $370000

.org 0x41cb4
!1:
jal $285F60


.org 0x41cc4
!1:
jal $370000


.org 0x41cd4
!1:
jal $370000


.org 0x41ce4
!1:
jal $370000



.org 0x41cf4
!1:
jal $370000


.org 0x41d04
!1:
jal $370000


.org 0x41d14
!1:
jal $370000


.org 0x41d24
!1:
jal $370000



.org 0x41d34
!1:
jal $370000



.org 0x41d44
!1:
jal $370000



.org 0x41d54
!1:
jal $370000




.org 0x7d0000
!main:
addiu sp, sp, $ffe8
sw ra, $14 (SP)
lui t0, $8034
lhu t7, $c778 (T0)
//put rotation in t7
lwc1 f2, $afb0 (t0)
lui at, $4120
abs.s f4, f2
mtc1 at, f6
nop
c.lt.s f4, f6
nop
bc1t !dontrotate
nop
cvt.w.s f2, f2
mfc1 t2, f2
sll t2, t2, $4
add t7, t7, t2
lui t3, $8033
lw t3, $d5e4 (t3)
lhu t2, $0012 (t3)
andi t2, t2, $fffc
sh t2, $0012 (t3)

andi t7, t7, $ffff
lui t0, $8034
sh t7, $c714 (T0)
sh t7, $c716 (T0)
sh t7, $c75a (T0)
sh t7, $c774 (T0)
sh t7, $c778 (T0)

!dontrotate:
!skp:
JAL $00281588
nop
lw ra, $14 (SP)
jr ra
addiu sp, sp, $0018







.org 0xfb9d4
!load:
SW RA, 0x0010 (SP)
LUI T5, 0x8039
LW T6, 0xBE28 (T5)
addiu t7, t6, $0010
sw t7, $be28 (T5)
LW A0, 0x0004 (T6)
LW A1, 0x0008 (T6)
JAL 0x802786F0
LW A2, 0x000C (T6)

lui a0, $8037
lui a1, $007d
jal $278504
ori a2, a1, $8000

lw ra, $0010 (SP)
jr ra
nop

Error log:
Spoiler:
line 2:0 token recognition error at: '!'
line 2:1 extraneous input '1' expecting {<EOF>, '[', OPCODE_RTYPE, OPCODE_RESER, OPCODE_RTYPE2, OPCODE_SHIFT, OPCODE_CLTYPE, OPCODE_SYNCTYPE, OPCODE_ITYPE, OPCODE_BASE, OPCODE_LUITYPE, OPCODE_BTYPE, OPCODE_BTYPE2, OPCODE_BTYPE3, OPCODE_BTYPE4, OPCODE_BTYPE5, OPCODE_BTYPE6, OPCODE_BTYPE7, OPCODE_JTYPE, OPCODE_JTYPE2, OPCODE_JTYPE3, OPCODE_HILOTYPE, OPCODE_HILOTYPE2, OPCODE_TRAP, OPCODE_TRAP2, OPCODE_CLATYPE, OPCODE_LITYPE, OPCODE_MOVTYPE, OPCODE_SUBI, OPCODE_FRTYPE, OPCODE_FMOVTYPE, OPCODE_FRTYPE2, OPCODE_FBTYPE, OPCODE_CONTYPE, OPCODE_ORGTYPE, OPCODE_ASCII, OPCODE_ASCIIZ, OPCODE_INCLUDE, OPCODE_INCBIN, OPCODE_NUMERIC, OPCODE_ALIGN, OPCODE_SKIP, OPCODE_NOP, OPCODE_TLB, OPCODE_TLBMOV, OPCODE_VR, OPCODE_VRMOV, OPCODE_LOADSTORE, HEXWRITE_OPC, TEXT, OPCODE_CTRL, OPCODE_BASE2}
line 6:0 token recognition error at: '!'
line 6:1 extraneous input '1' expecting {<EOF>, '[', OPCODE_RTYPE, OPCODE_RESER, OPCODE_RTYPE2, OPCODE_SHIFT, OPCODE_CLTYPE, OPCODE_SYNCTYPE, OPCODE_ITYPE, OPCODE_BASE, OPCODE_LUITYPE, OPCODE_BTYPE, OPCODE_BTYPE2, OPCODE_BTYPE3, OPCODE_BTYPE4, OPCODE_BTYPE5, OPCODE_BTYPE6, OPCODE_BTYPE7, OPCODE_JTYPE, OPCODE_JTYPE2, OPCODE_JTYPE3, OPCODE_HILOTYPE, OPCODE_HILOTYPE2, OPCODE_TRAP, OPCODE_TRAP2, OPCODE_CLATYPE, OPCODE_LITYPE, OPCODE_MOVTYPE, OPCODE_SUBI, OPCODE_FRTYPE, OPCODE_FMOVTYPE, OPCODE_FRTYPE2, OPCODE_FBTYPE, OPCODE_CONTYPE, OPCODE_ORGTYPE, OPCODE_ASCII, OPCODE_ASCIIZ, OPCODE_INCLUDE, OPCODE_INCBIN, OPCODE_NUMERIC, OPCODE_ALIGN, OPCODE_SKIP, OPCODE_NOP, OPCODE_TLB, OPCODE_TLBMOV, OPCODE_VR, OPCODE_VRMOV, OPCODE_LOADSTORE, HEXWRITE_OPC, TEXT, OPCODE_CTRL, OPCODE_BASE2}
line 10:0 token recognition error at: '!'
line 10:1 extraneous input '1' expecting {<EOF>, '[', OPCODE_RTYPE, OPCODE_RESER, OPCODE_RTYPE2, OPCODE_SHIFT, OPCODE_CLTYPE, OPCODE_SYNCTYPE, OPCODE_ITYPE, OPCODE_BASE, OPCODE_LUITYPE, OPCODE_BTYPE, OPCODE_BTYPE2, OPCODE_BTYPE3, OPCODE_BTYPE4, OPCODE_BTYPE5, OPCODE_BTYPE6, OPCODE_BTYPE7, OPCODE_JTYPE, OPCODE_JTYPE2, OPCODE_JTYPE3, OPCODE_HILOTYPE, OPCODE_HILOTYPE2, OPCODE_TRAP, OPCODE_TRAP2, OPCODE_CLATYPE, OPCODE_LITYPE, OPCODE_MOVTYPE, OPCODE_SUBI, OPCODE_FRTYPE, OPCODE_FMOVTYPE, OPCODE_FRTYPE2, OPCODE_FBTYPE, OPCODE_CONTYPE, OPCODE_ORGTYPE, OPCODE_ASCII, OPCODE_ASCIIZ, OPCODE_INCLUDE, OPCODE_INCBIN, OPCODE_NUMERIC, OPCODE_ALIGN, OPCODE_SKIP, OPCODE_NOP, OPCODE_TLB, OPCODE_TLBMOV, OPCODE_VR, OPCODE_VRMOV, OPCODE_LOADSTORE, HEXWRITE_OPC, TEXT, OPCODE_CTRL, OPCODE_BASE2}
line 15:0 token recognition error at: '!'
line 15:1 extraneous input '1' expecting {<EOF>, '[', OPCODE_RTYPE, OPCODE_RESER, OPCODE_RTYPE2, OPCODE_SHIFT, OPCODE_CLTYPE, OPCODE_SYNCTYPE, OPCODE_ITYPE, OPCODE_BASE, OPCODE_LUITYPE, OPCODE_BTYPE, OPCODE_BTYPE2, OPCODE_BTYPE3, OPCODE_BTYPE4, OPCODE_BTYPE5, OPCODE_BTYPE6, OPCODE_BTYPE7, OPCODE_JTYPE, OPCODE_JTYPE2, OPCODE_JTYPE3, OPCODE_HILOTYPE, OPCODE_HILOTYPE2, OPCODE_TRAP, OPCODE_TRAP2, OPCODE_CLATYPE, OPCODE_LITYPE, OPCODE_MOVTYPE, OPCODE_SUBI, OPCODE_FRTYPE, OPCODE_FMOVTYPE, OPCODE_FRTYPE2, OPCODE_FBTYPE, OPCODE_CONTYPE, OPCODE_ORGTYPE, OPCODE_ASCII, OPCODE_ASCIIZ, OPCODE_INCLUDE, OPCODE_INCBIN, OPCODE_NUMERIC, OPCODE_ALIGN, OPCODE_SKIP, OPCODE_NOP, OPCODE_TLB, OPCODE_TLBMOV, OPCODE_VR, OPCODE_VRMOV, OPCODE_LOADSTORE, HEXWRITE_OPC, TEXT, OPCODE_CTRL, OPCODE_BASE2}
line 20:0 token recognition error at: '!'
line 20:1 extraneous input '1' expecting {<EOF>, '[', OPCODE_RTYPE, OPCODE_RESER, OPCODE_RTYPE2, OPCODE_SHIFT, OPCODE_CLTYPE, OPCODE_SYNCTYPE, OPCODE_ITYPE, OPCODE_BASE, OPCODE_LUITYPE, OPCODE_BTYPE, OPCODE_BTYPE2, OPCODE_BTYPE3, OPCODE_BTYPE4, OPCODE_BTYPE5, OPCODE_BTYPE6, OPCODE_BTYPE7, OPCODE_JTYPE, OPCODE_JTYPE2, OPCODE_JTYPE3, OPCODE_HILOTYPE, OPCODE_HILOTYPE2, OPCODE_TRAP, OPCODE_TRAP2, OPCODE_CLATYPE, OPCODE_LITYPE, OPCODE_MOVTYPE, OPCODE_SUBI, OPCODE_FRTYPE, OPCODE_FMOVTYPE, OPCODE_FRTYPE2, OPCODE_FBTYPE, OPCODE_CONTYPE, OPCODE_ORGTYPE, OPCODE_ASCII, OPCODE_ASCIIZ, OPCODE_INCLUDE, OPCODE_INCBIN, OPCODE_NUMERIC, OPCODE_ALIGN, OPCODE_SKIP, OPCODE_NOP, OPCODE_TLB, OPCODE_TLBMOV, OPCODE_VR, OPCODE_VRMOV, OPCODE_LOADSTORE, HEXWRITE_OPC, TEXT, OPCODE_CTRL, OPCODE_BASE2}
line 25:0 token recognition error at: '!'
line 25:1 extraneous input '1' expecting {<EOF>, '[', OPCODE_RTYPE, OPCODE_RESER, OPCODE_RTYPE2, OPCODE_SHIFT, OPCODE_CLTYPE, OPCODE_SYNCTYPE, OPCODE_ITYPE, OPCODE_BASE, OPCODE_LUITYPE, OPCODE_BTYPE, OPCODE_BTYPE2, OPCODE_BTYPE3, OPCODE_BTYPE4, OPCODE_BTYPE5, OPCODE_BTYPE6, OPCODE_BTYPE7, OPCODE_JTYPE, OPCODE_JTYPE2, OPCODE_JTYPE3, OPCODE_HILOTYPE, OPCODE_HILOTYPE2, OPCODE_TRAP, OPCODE_TRAP2, OPCODE_CLATYPE, OPCODE_LITYPE, OPCODE_MOVTYPE, OPCODE_SUBI, OPCODE_FRTYPE, OPCODE_FMOVTYPE, OPCODE_FRTYPE2, OPCODE_FBTYPE, OPCODE_CONTYPE, OPCODE_ORGTYPE, OPCODE_ASCII, OPCODE_ASCIIZ, OPCODE_INCLUDE, OPCODE_INCBIN, OPCODE_NUMERIC, OPCODE_ALIGN, OPCODE_SKIP, OPCODE_NOP, OPCODE_TLB, OPCODE_TLBMOV, OPCODE_VR, OPCODE_VRMOV, OPCODE_LOADSTORE, HEXWRITE_OPC, TEXT, OPCODE_CTRL, OPCODE_BASE2}
line 31:0 token recognition error at: '!'
line 31:1 extraneous input '1' expecting {<EOF>, '[', OPCODE_RTYPE, OPCODE_RESER, OPCODE_RTYPE2, OPCODE_SHIFT, OPCODE_CLTYPE, OPCODE_SYNCTYPE, OPCODE_ITYPE, OPCODE_BASE, OPCODE_LUITYPE, OPCODE_BTYPE, OPCODE_BTYPE2, OPCODE_BTYPE3, OPCODE_BTYPE4, OPCODE_BTYPE5, OPCODE_BTYPE6, OPCODE_BTYPE7, OPCODE_JTYPE, OPCODE_JTYPE2, OPCODE_JTYPE3, OPCODE_HILOTYPE, OPCODE_HILOTYPE2, OPCODE_TRAP, OPCODE_TRAP2, OPCODE_CLATYPE, OPCODE_LITYPE, OPCODE_MOVTYPE, OPCODE_SUBI, OPCODE_FRTYPE, OPCODE_FMOVTYPE, OPCODE_FRTYPE2, OPCODE_FBTYPE, OPCODE_CONTYPE, OPCODE_ORGTYPE, OPCODE_ASCII, OPCODE_ASCIIZ, OPCODE_INCLUDE, OPCODE_INCBIN, OPCODE_NUMERIC, OPCODE_ALIGN, OPCODE_SKIP, OPCODE_NOP, OPCODE_TLB, OPCODE_TLBMOV, OPCODE_VR, OPCODE_VRMOV, OPCODE_LOADSTORE, HEXWRITE_OPC, TEXT, OPCODE_CTRL, OPCODE_BASE2}
line 36:0 token recognition error at: '!'
line 36:1 extraneous input '1' expecting {<EOF>, '[', OPCODE_RTYPE, OPCODE_RESER, OPCODE_RTYPE2, OPCODE_SHIFT, OPCODE_CLTYPE, OPCODE_SYNCTYPE, OPCODE_ITYPE, OPCODE_BASE, OPCODE_LUITYPE, OPCODE_BTYPE, OPCODE_BTYPE2, OPCODE_BTYPE3, OPCODE_BTYPE4, OPCODE_BTYPE5, OPCODE_BTYPE6, OPCODE_BTYPE7, OPCODE_JTYPE, OPCODE_JTYPE2, OPCODE_JTYPE3, OPCODE_HILOTYPE, OPCODE_HILOTYPE2, OPCODE_TRAP, OPCODE_TRAP2, OPCODE_CLATYPE, OPCODE_LITYPE, OPCODE_MOVTYPE, OPCODE_SUBI, OPCODE_FRTYPE, OPCODE_FMOVTYPE, OPCODE_FRTYPE2, OPCODE_FBTYPE, OPCODE_CONTYPE, OPCODE_ORGTYPE, OPCODE_ASCII, OPCODE_ASCIIZ, OPCODE_INCLUDE, OPCODE_INCBIN, OPCODE_NUMERIC, OPCODE_ALIGN, OPCODE_SKIP, OPCODE_NOP, OPCODE_TLB, OPCODE_TLBMOV, OPCODE_VR, OPCODE_VRMOV, OPCODE_LOADSTORE, HEXWRITE_OPC, TEXT, OPCODE_CTRL, OPCODE_BASE2}
line 41:0 token recognition error at: '!'
line 41:1 extraneous input '1' expecting {<EOF>, '[', OPCODE_RTYPE, OPCODE_RESER, OPCODE_RTYPE2, OPCODE_SHIFT, OPCODE_CLTYPE, OPCODE_SYNCTYPE, OPCODE_ITYPE, OPCODE_BASE, OPCODE_LUITYPE, OPCODE_BTYPE, OPCODE_BTYPE2, OPCODE_BTYPE3, OPCODE_BTYPE4, OPCODE_BTYPE5, OPCODE_BTYPE6, OPCODE_BTYPE7, OPCODE_JTYPE, OPCODE_JTYPE2, OPCODE_JTYPE3, OPCODE_HILOTYPE, OPCODE_HILOTYPE2, OPCODE_TRAP, OPCODE_TRAP2, OPCODE_CLATYPE, OPCODE_LITYPE, OPCODE_MOVTYPE, OPCODE_SUBI, OPCODE_FRTYPE, OPCODE_FMOVTYPE, OPCODE_FRTYPE2, OPCODE_FBTYPE, OPCODE_CONTYPE, OPCODE_ORGTYPE, OPCODE_ASCII, OPCODE_ASCIIZ, OPCODE_INCLUDE, OPCODE_INCBIN, OPCODE_NUMERIC, OPCODE_ALIGN, OPCODE_SKIP, OPCODE_NOP, OPCODE_TLB, OPCODE_TLBMOV, OPCODE_VR, OPCODE_VRMOV, OPCODE_LOADSTORE, HEXWRITE_OPC, TEXT, OPCODE_CTRL, OPCODE_BASE2}
line 46:0 token recognition error at: '!'
line 46:1 extraneous input '1' expecting {<EOF>, '[', OPCODE_RTYPE, OPCODE_RESER, OPCODE_RTYPE2, OPCODE_SHIFT, OPCODE_CLTYPE, OPCODE_SYNCTYPE, OPCODE_ITYPE, OPCODE_BASE, OPCODE_LUITYPE, OPCODE_BTYPE, OPCODE_BTYPE2, OPCODE_BTYPE3, OPCODE_BTYPE4, OPCODE_BTYPE5, OPCODE_BTYPE6, OPCODE_BTYPE7, OPCODE_JTYPE, OPCODE_JTYPE2, OPCODE_JTYPE3, OPCODE_HILOTYPE, OPCODE_HILOTYPE2, OPCODE_TRAP, OPCODE_TRAP2, OPCODE_CLATYPE, OPCODE_LITYPE, OPCODE_MOVTYPE, OPCODE_SUBI, OPCODE_FRTYPE, OPCODE_FMOVTYPE, OPCODE_FRTYPE2, OPCODE_FBTYPE, OPCODE_CONTYPE, OPCODE_ORGTYPE, OPCODE_ASCII, OPCODE_ASCIIZ, OPCODE_INCLUDE, OPCODE_INCBIN, OPCODE_NUMERIC, OPCODE_ALIGN, OPCODE_SKIP, OPCODE_NOP, OPCODE_TLB, OPCODE_TLBMOV, OPCODE_VR, OPCODE_VRMOV, OPCODE_LOADSTORE, HEXWRITE_OPC, TEXT, OPCODE_CTRL, OPCODE_BASE2}
line 52:0 token recognition error at: '!'
line 52:1 extraneous input '1' expecting {<EOF>, '[', OPCODE_RTYPE, OPCODE_RESER, OPCODE_RTYPE2, OPCODE_SHIFT, OPCODE_CLTYPE, OPCODE_SYNCTYPE, OPCODE_ITYPE, OPCODE_BASE, OPCODE_LUITYPE, OPCODE_BTYPE, OPCODE_BTYPE2, OPCODE_BTYPE3, OPCODE_BTYPE4, OPCODE_BTYPE5, OPCODE_BTYPE6, OPCODE_BTYPE7, OPCODE_JTYPE, OPCODE_JTYPE2, OPCODE_JTYPE3, OPCODE_HILOTYPE, OPCODE_HILOTYPE2, OPCODE_TRAP, OPCODE_TRAP2, OPCODE_CLATYPE, OPCODE_LITYPE, OPCODE_MOVTYPE, OPCODE_SUBI, OPCODE_FRTYPE, OPCODE_FMOVTYPE, OPCODE_FRTYPE2, OPCODE_FBTYPE, OPCODE_CONTYPE, OPCODE_ORGTYPE, OPCODE_ASCII, OPCODE_ASCIIZ, OPCODE_INCLUDE, OPCODE_INCBIN, OPCODE_NUMERIC, OPCODE_ALIGN, OPCODE_SKIP, OPCODE_NOP, OPCODE_TLB, OPCODE_TLBMOV, OPCODE_VR, OPCODE_VRMOV, OPCODE_LOADSTORE, HEXWRITE_OPC, TEXT, OPCODE_CTRL, OPCODE_BASE2}
line 58:0 token recognition error at: '!'
line 58:1 extraneous input '1' expecting {<EOF>, '[', OPCODE_RTYPE, OPCODE_RESER, OPCODE_RTYPE2, OPCODE_SHIFT, OPCODE_CLTYPE, OPCODE_SYNCTYPE, OPCODE_ITYPE, OPCODE_BASE, OPCODE_LUITYPE, OPCODE_BTYPE, OPCODE_BTYPE2, OPCODE_BTYPE3, OPCODE_BTYPE4, OPCODE_BTYPE5, OPCODE_BTYPE6, OPCODE_BTYPE7, OPCODE_JTYPE, OPCODE_JTYPE2, OPCODE_JTYPE3, OPCODE_HILOTYPE, OPCODE_HILOTYPE2, OPCODE_TRAP, OPCODE_TRAP2, OPCODE_CLATYPE, OPCODE_LITYPE, OPCODE_MOVTYPE, OPCODE_SUBI, OPCODE_FRTYPE, OPCODE_FMOVTYPE, OPCODE_FRTYPE2, OPCODE_FBTYPE, OPCODE_CONTYPE, OPCODE_ORGTYPE, OPCODE_ASCII, OPCODE_ASCIIZ, OPCODE_INCLUDE, OPCODE_INCBIN, OPCODE_NUMERIC, OPCODE_ALIGN, OPCODE_SKIP, OPCODE_NOP, OPCODE_TLB, OPCODE_TLBMOV, OPCODE_VR, OPCODE_VRMOV, OPCODE_LOADSTORE, HEXWRITE_OPC, TEXT, OPCODE_CTRL, OPCODE_BASE2}
line 64:0 token recognition error at: '!'
line 64:1 extraneous input '1' expecting {<EOF>, '[', OPCODE_RTYPE, OPCODE_RESER, OPCODE_RTYPE2, OPCODE_SHIFT, OPCODE_CLTYPE, OPCODE_SYNCTYPE, OPCODE_ITYPE, OPCODE_BASE, OPCODE_LUITYPE, OPCODE_BTYPE, OPCODE_BTYPE2, OPCODE_BTYPE3, OPCODE_BTYPE4, OPCODE_BTYPE5, OPCODE_BTYPE6, OPCODE_BTYPE7, OPCODE_JTYPE, OPCODE_JTYPE2, OPCODE_JTYPE3, OPCODE_HILOTYPE, OPCODE_HILOTYPE2, OPCODE_TRAP, OPCODE_TRAP2, OPCODE_CLATYPE, OPCODE_LITYPE, OPCODE_MOVTYPE, OPCODE_SUBI, OPCODE_FRTYPE, OPCODE_FMOVTYPE, OPCODE_FRTYPE2, OPCODE_FBTYPE, OPCODE_CONTYPE, OPCODE_ORGTYPE, OPCODE_ASCII, OPCODE_ASCIIZ, OPCODE_INCLUDE, OPCODE_INCBIN, OPCODE_NUMERIC, OPCODE_ALIGN, OPCODE_SKIP, OPCODE_NOP, OPCODE_TLB, OPCODE_TLBMOV, OPCODE_VR, OPCODE_VRMOV, OPCODE_LOADSTORE, HEXWRITE_OPC, TEXT, OPCODE_CTRL, OPCODE_BASE2}
line 71:0 token recognition error at: '!'
line 84:5 token recognition error at: '!'
line 104:0 token recognition error at: '!'
line 105:0 token recognition error at: '!'
line 119:0 token recognition error at: '!'

Jorpho

  • Hero Member
  • *****
  • Posts: 4549
  • The cat screams with the voice of a man.
    • View Profile
Re: Complications with source code patching
« Reply #1 on: September 14, 2020, 12:29:39 pm »
Looks like some kind of syntax issue. Maybe the answer is in one of his modding tutorials – but it seems a bunch of them have copyright strikes.

His site over here suggests you can try asking on his Twitch.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

F4NB0Y3N1NT3ND0

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Complications with source code patching
« Reply #2 on: September 14, 2020, 06:28:37 pm »
I see. In the meantime, the bps file seems to work well enough. Is there a way I could perhaps decompile it and see its source code so I can patch that to other roms? I imagine taking the time to look through the code and finding syntax errors would take a while, for me or for him.

Jorpho

  • Hero Member
  • *****
  • Posts: 4549
  • The cat screams with the voice of a man.
    • View Profile
Re: Complications with source code patching
« Reply #3 on: September 15, 2020, 01:22:29 am »
I see. In the meantime, the bps file seems to work well enough. Is there a way I could perhaps decompile it and see its source code so I can patch that to other roms?
The crude way would be to just apply the patch to a ROM, and then use a hex editor to compare a patched ROM and an unpatched ROM and see which bytes have changed.

Quote
I imagine taking the time to look through the code and finding syntax errors would take a while, for me or for him.
No, I mean, it's probably some completely trivial thing.

What exactly are you doing with the code?  Maybe your compiler expects MS-DOS CR-LF line terminators instead of Unix one-byte line terminators.
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

F4NB0Y3N1NT3ND0

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Complications with source code patching
« Reply #4 on: September 15, 2020, 09:39:38 am »
Quote
What exactly are you doing with the code?
I want to apply the patch to some of my other rom hacks. SM64 Star Road, for instance, could very much use that camera fix. Of course, it's impossible to apply a patch to an already patched rom, but I believe I can patch the source code directly to a hack with something like CajeASM or armips.


Quote
Maybe your compiler expects MS-DOS CR-LF line terminators
You may be right, but I have no idea how to fix that. it looks normal enough in visual studio and a text editor, but if that's the case and it uses one-byte line terminators, that may be the cause, as I'm on Windows.

Jorpho

  • Hero Member
  • *****
  • Posts: 4549
  • The cat screams with the voice of a man.
    • View Profile
Re: Complications with source code patching
« Reply #5 on: September 15, 2020, 11:04:25 am »
I want to apply the patch to some of my other rom hacks.
No, I mean, what are you doing with this code?  Are you using it in an emulator directly somehow, or are you using a particular compiler?

Quote
it looks normal enough in visual studio and a text editor, but if that's the case and it uses one-byte line terminators, that may be the cause, as I'm on Windows.
Indeed, a lot of text editors don't bother making the distinction.  Notepad++ can definitely do it (Edit->EOL Conversion).
This signature is an illusion and is a trap devised by Satan. Go ahead dauntlessly! Make rapid progres!

F4NB0Y3N1NT3ND0

  • Jr. Member
  • **
  • Posts: 5
    • View Profile
Re: Complications with source code patching
« Reply #6 on: September 16, 2020, 11:46:24 am »
Quote
what are you doing with this code?

I'm using an assembler to assemble the code into a rom. The assembler in question is CajeASM, though it shouldn't make a difference.