Working on my open world rpg (no issues of scale - have to thank Tepples for that link). I've been able to solve just about every NES-related problem I've come across so far, but this one is flummoxing me: how can I tell whether to inc or dec the hi byte of a 16bit unsigned number after adding a signed byte to the lo byte of the same 16 bit number?
Assembly:
CameraCurrentY is the unsigned low byte of a 16bit scroll value.
delta is a signed byte with values from -4 to 4. ($fc ~ $04)
Which flags do I check to see if the low byte carried (greater than 255)? How do I check to see if the low byte rolled over the other direction (less than 0)?
Sincere thanks!
Assembly:
Code:
clc
lda CameraCurrentY
adc delta
sta CameraCurrentY
lda CameraCurrentY
adc delta
sta CameraCurrentY
CameraCurrentY is the unsigned low byte of a 16bit scroll value.
delta is a signed byte with values from -4 to 4. ($fc ~ $04)
Which flags do I check to see if the low byte carried (greater than 255)? How do I check to see if the low byte rolled over the other direction (less than 0)?
Sincere thanks!