This is the routine for plotting the Life points that you keep requesting, sorry for delay...
Code: Select all
;Update Life Levels
;Both Koenig(0) and Helena(1) have life bars of the same size and byte allignment
;110101010101010101010100
;110101010101010101010100
;110101010101010101010100
;110101010101010101010100
;000000111111000000111111
;Life points will change colour as follows
;7-10 Green
;5-6 Yellow
;3-4 Magenta
;0-2 Red
;A==Life Points (0(Dead)-10(Healthy))
;X==Player1(1) or Player2(2)
;All Registers corrupted
PlotLifeBar
;
ldy LifeBarScreenOffset-1,x
tax
lda LifeBarColour,x
sta $A000+40*127,y
sta $A000+40*128,y
sta $A000+40*129,y
sta $A000+40*130,y
lda LifeBarImage0,x
sta $A000+1+40*127,y
sta $A000+1+40*128,y
sta $A000+1+40*129,y
sta $A000+1+40*130,y
lda LifeBarImage1,x
sta $A000+2+40*127,y
sta $A000+2+40*128,y
sta $A000+2+40*129,y
sta $A000+2+40*130,y
lda LifeBarImage2,x
sta $A000+3+40*127,y
sta $A000+3+40*128,y
sta $A000+3+40*129,y
sta $A000+3+40*130,y
lda LifeBarImage3,x
sta $A000+4+40*127,y
sta $A000+4+40*128,y
sta $A000+4+40*129,y
sta $A000+4+40*130,y
rts
LifeBarScreenOffset
.byt 0
.byt 34
LifeBarColour
.byt 1+128,1+128,1+128,5+128,5+128,3+128,3+128,2+128,2+128,2+128,2+128
LifeBarImage0
.byt %01110000 ;0 - Red
.byt %01110100 ;1 - Red
.byt %01110101 ;2 - Red
.byt %01110101 ;3 - Magenta
.byt %01110101 ;4 - Magenta
.byt %01110101 ;5 - Yellow
.byt %01110101 ;6 - Yellow
.byt %01110101 ;7 - Green
.byt %01110101 ;8 - Green
.byt %01110101 ;9 - Green
.byt %01110101 ;10 - Green
LifeBarImage1
.byt %01000000
.byt %01000000
.byt %01000000
.byt %01010000
.byt %01010100
.byt %01010101
.byt %01010101
.byt %01010101
.byt %01010101
.byt %01010101
.byt %01010101
LifeBarImage2
.byt %01000000
.byt %01000000
.byt %01000000
.byt %01000000
.byt %01000000
.byt %01000000
.byt %01010000
.byt %01010100
.byt %01010101
.byt %01010101
.byt %01010101
LifeBarImage3
.byt %01000000
.byt %01000000
.byt %01000000
.byt %01000000
.byt %01000000
.byt %01000000
.byt %01000000
.byt %01000000
.byt %01000000
.byt %01010000
.byt %01010100
And only 132 Bytes and no loops.
I hate to look stupid, but how can I insert that .byt data in the sources so it is loaded in the screen?
I've tried to set *=$a000 just before the data, but it seems not to work...
Yep, sure that is a problem. I believe Dbug had a solution, but not sure how you did it before?
In what format would you prefer?
In addition, which is the new address/positions of the cursors?
The new addresses are...
$B5E1 for Top left cursor (Koenig)
$B5E4 for Top Centre Cursor (Koenig)
$B5E7 for Top Right Cursor (Koenig)
$B889 for Bottom left cursor (Koenig)
$B88C for Bottom Centre Cursor (Koenig)
$B88F for Bottom Right Cursor (Koenig)
$B5FD for Top Left Cursor (Helena)
$B600 for Top Centre Cursor (Helena)
$B603 for Top Right Cursor (Helena)
$B8A5 for Bottom Left Cursor (Helena)
$B8A8 for Bottom Centre Cursor (Helena)
$B8AB for Bottom Right Cursor (Helena)
And the items top left should be...
$B631(Koenig) and right in steps of 3
$B64D(Helena) and right in steps of 3
Phew!, i think thats right.