Hi, i'm new in Assembling and NES programming(NESASM), and my english is not so good
I have experience in C++.
Here is a code:
The variables NumHousesUni and NumHousesDec works like 2 numbers(00 to 99)
I'm trying to change these variables to change the sprites in "real time"
Ex.:
NumHousesDec = 0
NumHousesUni = 1
diplay sprites (01)
NumHousesDec = 2
NumHousesUni = 3
diplay sprites (23)
but it doesn't work
what's the problem? can i do this?
the sprites only show the initial value (0 and 1)
I have experience in C++.
Here is a code:
Code:
DrawStats:
LDA #16
STA $0240
LDA #NumHousesDec
STA $0241
LDA #$00
STA $0242
LDA #8
STA $0243
LDA #16
STA $0244
LDA #NumHousesUni
STA $0245
LDA #$00
STA $0246
LDA #16
STA $0247
LDA NumHousesUni
ADC #1
STA NumHousesUni
CMP #9
BEQ AddDec
RTS
AddDec:
LDA #0
STA NumHousesUni
LDA NumHousesDec
ADC #1
STA NumHousesDec
RTS
LDA #16
STA $0240
LDA #NumHousesDec
STA $0241
LDA #$00
STA $0242
LDA #8
STA $0243
LDA #16
STA $0244
LDA #NumHousesUni
STA $0245
LDA #$00
STA $0246
LDA #16
STA $0247
LDA NumHousesUni
ADC #1
STA NumHousesUni
CMP #9
BEQ AddDec
RTS
AddDec:
LDA #0
STA NumHousesUni
LDA NumHousesDec
ADC #1
STA NumHousesDec
RTS
The variables NumHousesUni and NumHousesDec works like 2 numbers(00 to 99)
I'm trying to change these variables to change the sprites in "real time"
Ex.:
NumHousesDec = 0
NumHousesUni = 1
diplay sprites (01)
NumHousesDec = 2
NumHousesUni = 3
diplay sprites (23)
but it doesn't work
what's the problem? can i do this?
the sprites only show the initial value (0 and 1)