+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Questions: Adding an SNES Intro
Pages: [1]
Author Topic: Questions: Adding an SNES Intro  (Read 1 times)
Rappa
Guest
« on: April 02, 2010, 01:36:42 pm »

Hello buddies

I've read "Adding an SNES Intro" by DaMarsMan and followed the instruction, the pic's data inserted into my Rom but there's no change when I start the Rom. I don't know where I was wrong, but I think somewhere the end of the document, which is a bit too vague.

Quote
One more last thing to do. In Intro.asm scroll down towards the bottom where you see this...

;old code from beginning of unchanged rom
CLC
XCE
SEI
REP #$10
JMP.l $008005 ;jump to fifth instruction

This code is all the instructions you are going to overwrite with our JMP opcode at the beginning of the Intro.asm. Open up Geiger's debugger and click Step Into about five times with your rom loaded. In the window you will see something like this....

I did start the Debugger, load the Rom, hit the Step Into button 5 times and here's the result

SEI
CLC
XCE
JMP $80917A [$80:917A]
SEP #$20
LDA #$80

As the screenshot below



The 5th instruction is SEP #$20, and according to the document

Quote
You need to add the first four instructions on the debugger screen to the Intro.asm and change the JMP.l $008005 to the location of the fifth instruction. Don't forget to delete my first four. It's going to be different depending on the game.

So I must rewrite the "old cold from begining of unchanged rom" section like this

SEI
CLC
XCE
JMP $80917A
JMP.l $00917E

Is it right or wrong?
I wonder if anyone can help.

Tauwasser
Guest
« Reply #1 on: April 02, 2010, 04:48:21 pm »

Quote from: Rappa on April 02, 2010, 01:36:42 pm
Is it right or wrong?
I wonder if anyone can help.

It is wrong. But we sure can be a helpful bunch around here.

Quote from: Rappa on April 02, 2010, 01:36:42 pm
Code:
SEI
CLC
XCE
JMP $80917A
JMP.l $00917E

If you think about what this piece of code essentially does, you will notice what the mistake is:
After JMP $80917A, consequently, it won't execute the jump you inserted after that, because it never returns. The fifth opcode in the tutorial was just relating to the example, where the original jump was the fifth opcode. You will need to redirect the original jump to jump to your intro routine. Then, at the end of the intro routine, you will need to jump to where the original jump went to start the game.

Code:
SEI
CLC
XCE
JMP $00917E\t<-- jump to your routine
SEP #$20\t\t<-- Be sure to restore the original code here, the game probably needs this as either code or data.
LDA #$80

At the end of intro.asm, jump to where the replaced jump would have led, 80:917A.

cYa,

Tauwasser
Rappa
Guest
« Reply #2 on: April 03, 2010, 10:36:38 am »

Thank you very much, Tauwasser. I got it know. But I still have a little doubt. There's a line (the 1st one) in the Intro.asm that defies the table. I wonder what is the purpose of the table file here?
Pages: [1]  


Powered by SMF 1.1.4 | SMF © 2006-2007, Simple Machines LLC