NESDev and Strangulation Records messageboards
Forum Index | FAQ | New User | Login | Search

Previous ThreadView All ThreadsNext ThreadShow in Flat Mode*


Subjecthelp understanding code  
Posted byAnonymous
Posted on7/30/04 6:02 PM
From IP198.124.16.2  



I am currently attempting to reverse-engineer Dragon Warrior 1, and have encountered a few questions. (FYI, DW1 uses MMC1 and has 4 pages of PRG-ROM.)

1. Does going to an interrupt push the current PC onto the stack? I am encountering an rts after tracing through reset for a while, and I have nothing on the stack. What is the difference between rti and rts?

2. I encounter the following lines in the code:

label1: lda $2002
bmi label1
label2: lda $2002
bpl label2
label3: lda $2002
bmi label3

What does this accomplish?

3. The first two commands of the reset vector are as follows:

sei
inc $FFDF

currently in the PRG-ROM, byte $FFDF is simply a defined byte (i.e. not part of an instruction) with an initial value of $80. Does the inc command cause $81 to be written to register 3 of MMC1? If not, what does this line do?

4. A while into the code, the program writes the value of #$03 to $FFFF (through the use of right shifts). However, the program has never written any value to any of the other registers, so which bank is being replaced by bank 3? How does the program know?

The answer to any of these questions would be greatly appreciated. God bless you all.



-
Entire Thread
Subject  Posted byPosted On
.help understanding code  Anonymous7/30/04 6:02 PM
.*Re: help understanding code  Eshin7/30/04 7:00 PM
.*Re: help understanding code  Disch7/30/04 6:45 PM
..*Re: help understanding code  koitsu7/31/04 2:51 PM
...*Re: help understanding code  Disch7/31/04 5:49 PM
....*Re: help understanding code  Anonymous8/1/04 1:38 PM
...*Re: help understanding code  Anonymous7/31/04 5:43 PM
....*Re: help understanding code  koitsu8/1/04 09:44 AM
.....*6502 vs. 65C02  tepples8/1/04 3:27 PM
......*Re: 6502 vs. 65C02  koitsu8/1/04 4:47 PM
.....*Re: help understanding code  blargg8/1/04 1:17 PM
......*Re: help understanding code  koitsu8/1/04 4:45 PM
Jump to

Memblers' homepage             Contact Me

Forums powered by WWWThreads Demo