Points of Required Attention™
Smaghetti, a new Super Mario Advance 4 editor, is currently in development! Check out the thread HERE!

Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,317,779
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 03-29-24 10:01 AM
Guest: Register | Login

0 users currently in ROM Hacking | 1 guest | 1 bot

Main - ROM Hacking - Answered my own question - Please close New thread | Thread closed


RetroRain
Posted on 12-16-13 10:42 PM (rev. 3 of 12-17-13 02:09 AM) Link | Quote | ID: 155254


Fuzz Ball
Level: 66

Posts: 677/994
EXP: 2432544
Next: 29307

Since: 09-30-07

Last post: 1907 days
Last view: 929 days
When adding with carry (ADC), does carry have to be cleared before each use?

Here is the code I have. There is no problem with the code at all. It is constantly read, and it works fine for Stage 0 in my hack, but when I go to any other stage, there is something that is incrementing my $105 by 1. I have tried tracking it down in the debugger, by doing a step by step trace, and there is nothing that is incrementing $105 or $5F by 1.

So I was wondering if somehow ADC adds an extra 1, if Carry is not cleared.

LDA $1B        ; Load Screen ID
TAX ; Transfer Screen ID to X
LDA $9261,X ; Load Table Byte for appropriate Screen ID
ADC $5F ; Add table value with the value of the Weapons Address
STA $0105 ; Store into VROM address
RTS ; Return from Sub-routine


And if I do add a CLC, do I put it just before the ADC?

Any help would be greatly appreciated. Thanks.

UPDATE ON MEGAMAN UPGRADE PATCH

I had to be away from the computer for a few weeks due to a really bad eye strain. So no work was done on my hack. But yesterday, I resumed work on it. The CHR-ROM conversion is done. I added all of the final tables and code. However, there are some other things I'm considering doing, such as having the game save your completed stages and obtained weapons to SRAM, modifying the title screen, and adding scrolling stars to the boss preview screen. And the hack still needs to be beta tested. So that's where I stand with it.

EDIT - Apparently CLC did the trick! Should've just tried it before making the thread. Problem solved!

____________________
My YouTube Channel

Main - ROM Hacking - Answered my own question - Please close New thread | Thread closed

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.017 seconds. (342KB of memory used)
MySQL - queries: 37, rows: 58/58, time: 0.014 seconds.