+  RHDN Forum Archive
|-+  Romhacking
| |-+  ROM Hacking Discussion
| | |-+  Something strange going on
Pages: [1]
Author Topic: Something strange going on  (Read 2 times)
Kagemusha
Guest
« on: December 19, 2009, 01:09:19 am »

Code:
$B4FC:B1 12     LDA ($12),Y @ $AB08 = #$C8 A:00 X:24 Y:FE P:NvUbdIzc
$B4FE:C9 FF     CMP #$FF                   A:C8 X:24 Y:FE P:NvUbdIzc
$B500:F0 41     BEQ $B543                  A:C8 X:24 Y:FE P:NvUbdIzc
$B502:85 50     STA $0050 = #$D0           A:C8 X:24 Y:FE P:NvUbdIzc
$B504:C8        INY                        A:C8 X:24 Y:FE P:NvUbdIzc
$B505:A9 00     LDA #$00                   A:C8 X:24 Y:FF P:NvUbdIzc
$B507:85 51     STA $0051 = #$00           A:00 X:24 Y:FF P:nvUbdIZc
$B509:A9 01     LDA #$01                   A:00 X:24 Y:FF P:nvUbdIZc
$B50B:8D 85 03  STA $0385 = #$01           A:01 X:24 Y:FF P:nvUbdIzc
$B50E:8C 25 03  STY $0325 = #$FD           A:01 X:24 Y:FF P:nvUbdIzc
$B511:98        TYA                        A:01 X:24 Y:FF P:nvUbdIzc
$B512:38        SEC                        A:FF X:24 Y:FF P:NvUbdIzc
$B513:E9 01     SBC #$01                   A:FF X:24 Y:FF P:NvUbdIzC
$B515:A8        TAY                        A:FE X:24 Y:FF P:NvUbdIzC
$B516:B9 F0 B1  LDA $B1F0,Y @ $B2EE = #$BA A:FE X:24 Y:FE P:NvUbdIzC
$B519:85 2C     STA $002C = #$B9           A:BA X:24 Y:FE P:NvUbdIzC
$B51B:B9 F1 B1  LDA $B1F1,Y @ $B2EF = #$25 A:BA X:24 Y:FE P:NvUbdIzC
$B51E:85 2D     STA $002D = #$25           A:25 X:24 Y:FE P:nvUbdIzC
$B520:20 C0 BF  JSR $BFC0                  A:25 X:24 Y:FE

Basically what's happening is that the next thing loaded becomes an $AA09 instead of $AB09. Is this because of the Y? There's not anything that tells the game to DEC the low byte of the address.
Tauwasser
Guest
« Reply #1 on: December 19, 2009, 08:00:10 am »

Quote from: Pennywise on December 19, 2009, 01:09:19 am
Basically what's happening is that the next thing loaded becomes an $AA09 instead of $AB09. Is this because of the Y? There's not anything that tells the game to DEC the low byte of the address.

Quote from: Pennywise on December 19, 2009, 01:09:19 am
Code:
$B511:98        TYA                        A:01 X:24 Y:FF P:nvUbdIzc
$B512:38        SEC                        A:FF X:24 Y:FF P:NvUbdIzc
$B513:E9 01     SBC #$01                   A:FF X:24 Y:FF P:NvUbdIzC
$B515:A8        TAY                        A:FE X:24 Y:FF P:NvUbdIzC

This will dec the low byte of the address. However, I think you mean high byte. If so, it seems you haven't included the part where the error actually occurs.
Basically, there might be code that changes the contents at $12, which should read 0x0A 0xAA now, to 0x0A 0xA9.

cYa,

Tauwasser
Parasyte
Guest
« Reply #2 on: December 19, 2009, 06:54:39 pm »

Tauwasser: You forgot about the INY just before that piece of code. Although, I agree, the code in the OP does not provide the full picture.
Tauwasser
Guest
« Reply #3 on: December 20, 2009, 07:49:14 am »

Quote from: Parasyte on December 19, 2009, 06:54:39 pm
Tauwasser: You forgot about the INY just before that piece of code. Although, I agree, the code in the OP does not provide the full picture.

Which is not relevant to the decrement? It increases, stores the byte, then decreases it.
If the INY was the problem, then it was formulated very fuzzily.

cYa,

Tauwasser
Parasyte
Guest
« Reply #4 on: December 20, 2009, 04:56:49 pm »

It's relevant; that decrement only cancels the increment. Not that it's the trouble the OP is experiencing. I'm curious why the decrement was not done with DEY.

This discussion is rather off track, anyway; Pennywise, we cannot help you without additional details.
Pages: [1]  


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