A85: Here's a good question
[Prev][Next][Index][Thread]
A85: Here's a good question
I am trying to have the choice of live in this game be 1-9. I can't figure
out what is wrong with the code. Instead of stopping at 1 or 9 it keeps going
down. What is wrong? Thanks
Greg Sharp
Here's my code:
Options:
ld (Lives),a
call CLEARLCD
ld hl,0
ld ($800C),hl
set 3,(iy+5)
ld hl,&Title
call D_ZT_STR
res 3,(iy+5)
ld hl,$3A02
ld ($8333),hl
ld hl,&Programmer
call D_ZM_STR
ld hl,$0802
ld ($8333),hl
ld hl,&OptTitle
call D_ZM_STR
ld hl,$1004
ld ($8333),hl
ld hl,&OptStr1
call D_ZM_STR
ld hl,$1704
ld ($8333),hl
ld hl,&OptStr2
call D_ZM_STR
ld hl,$1030
ld ($8333),hl
ld (hl),a
call M_CHARPUT
jr OptWait
OptionJp:
jr Options
OptWait:
call GET_KEY
cp K_PLUS
jr z,OptUp
cp K_MINUS
jr z,OptDown
cp K_ENTER
jp z,&MainInfo
jr nz,OptWait
OptUp:
ld a,(Lives)
inc a
cp 10
jr nz,OptChOkU
ld a,9
OptChOkU:
ld (Lives),a
jr OptionJp
OptDown:
ld a,(Lives)
dec a
jr nz,OptChOkD
ld a,1
OptChOkD:
ld (Lives),a
jr OptionJp
Follow-Ups: