lemm: update so we update number of jobs left

irregularly placed, should re-draw the graphics to look better
This commit is contained in:
Vince Weaver 2022-04-02 23:28:45 -04:00
parent 26ee0aa451
commit 39a5627cf6
5 changed files with 130 additions and 7 deletions

View File

@ -167,6 +167,8 @@ lemm.inc: generate_common LEMM
./generate_common -a 0x6000 -s init_level lemm.lst >> lemm.inc
./generate_common -a 0x6000 -s draw_pointer lemm.lst >> lemm.inc
./generate_common -a 0x6000 -s erase_pointer lemm.lst >> lemm.inc
./generate_common -a 0x6000 -s update_remaining lemm.lst >> lemm.inc
./generate_common -a 0x6000 -s update_remaining_all lemm.lst >> lemm.inc
####

View File

@ -451,6 +451,9 @@ done_make_miner:
; make digger
;========================
make_digger:
lda DIGGER_COUNT ; only if we have some left
beq done_make_digger
; only do it if walking
lda lemming_status,Y
cmp #LEMMING_WALKING
@ -459,7 +462,10 @@ make_digger:
lda #LEMMING_DIGGING
sta lemming_status,Y
; FIXME: decrement digger_count
dec DIGGER_COUNT
ldx #7
jsr update_remaining
done_make_digger:
jmp done_keypress
@ -530,7 +536,7 @@ job_button:
; draw new
jsr update_menu
jsr update_selection
jmp done_menu

View File

@ -13,6 +13,17 @@ do_level1:
; set up stuff
;==============
lda #0
sta CLIMBER_COUNT
sta FLOATER_COUNT
sta EXPLODER_COUNT
sta STOPPER_COUNT
sta BUILDER_COUNT
sta BASHER_COUNT
sta MINER_COUNT
lda #20
sta DIGGER_COUNT
lda #9
sta DOOR_X
lda #36
@ -168,6 +179,9 @@ do_level1:
jsr init_level
jsr update_remaining_all
;=======================
; Play "Let's Go"
;=======================

View File

@ -1,12 +1,105 @@
;=============================
; update menu
; update remaining_all
;=============================
update_menu:
lda BUTTON_LOCATION
bne actually_update_menu
update_remaining_all:
ldx #0
ura_loop:
txa
pha
jsr update_remaining
pla
tax
inx
cpx #8
bne ura_loop
rts
actually_update_menu:
;=============================
; update remaining
;=============================
; X is which one to update
update_remaining:
txa
pha
jsr hgr_sprite_page_toggle ; toggle page (bg)
lda CLIMBER_COUNT,X
tay
lda littlenums_l,Y
sta INL
lda littlenums_h,Y
sta INH
lda remaining_x,X
sta XPOS
lda #169
sta YPOS
jsr hgr_draw_sprite
;
pla
tax
jsr hgr_sprite_page_toggle ; toggle page (bg)
lda CLIMBER_COUNT,X
tay
lda littlenums_l,Y
sta INL
lda littlenums_h,Y
sta INH
lda remaining_x,X
sta XPOS
lda #169
sta YPOS
jsr hgr_draw_sprite
rts
; X locations to print the counts at
; approximate, 7-bit boundaries where graphics are on 8-bit
remaining_x:
.byte 5,7,10,12,14,17,19,21
littlenums_l:
.byte <little00_sprite,<little01_sprite,<little02_sprite
.byte <little03_sprite,<little04_sprite,<little05_sprite
.byte <little06_sprite,<little07_sprite,<little08_sprite
.byte <little09_sprite,<little10_sprite,<little11_sprite
.byte <little12_sprite,<little13_sprite,<little14_sprite
.byte <little15_sprite,<little16_sprite,<little17_sprite
.byte <little18_sprite,<little19_sprite,<little20_sprite
littlenums_h:
.byte >little00_sprite,>little01_sprite,>little02_sprite
.byte >little03_sprite,>little04_sprite,>little05_sprite
.byte >little06_sprite,>little07_sprite,>little08_sprite
.byte >little09_sprite,>little10_sprite,>little11_sprite
.byte >little12_sprite,>little13_sprite,>little14_sprite
.byte >little15_sprite,>little16_sprite,>little17_sprite
.byte >little18_sprite,>little19_sprite,>little20_sprite
;=============================
; update selection
;=============================
update_selection:
lda BUTTON_LOCATION
bne actually_update_selection
rts
actually_update_selection:
ldx #7
stx HGR_COLOR

View File

@ -85,6 +85,14 @@ DOOR_Y = $91
INIT_X = $92 ; initial lemming position
INIT_Y = $93
CLIMBER_COUNT = $94
FLOATER_COUNT = $95
EXPLODER_COUNT = $96
STOPPER_COUNT = $97
BUILDER_COUNT = $98
BASHER_COUNT = $99
MINER_COUNT = $9A
DIGGER_COUNT = $9B
; done game puzzle state