I would like to break one value (a variable in RAM) so that it can be displayed in two graphical numbers on the screen. The variable in RAM will have a value of up to 64 (40hex). Two sprites will be used for this purpose.
Showing values 0-9 is easy, but I do not know how to code so that it automatically split into two digits.
Showing values 0-9 is easy, but I do not know how to code so that it automatically split into two digits.
Code:
LDA #$F0 ;this is the starting tile number in SPR CHR ROM (F0 = 0, F1 = 1 ...- F9 = 9)
CLC
ADC variable ;ram byte 00-40hex)
STA DIGIT1_T ;one of two DIGIT SPRITE TILES (DIGIT1_X,S,T,Y and DIGIT2_X,S,T,Y)
CLC
ADC variable ;ram byte 00-40hex)
STA DIGIT1_T ;one of two DIGIT SPRITE TILES (DIGIT1_X,S,T,Y and DIGIT2_X,S,T,Y)