Puzzle: routines and param blocks

This commit is contained in:
Joshua Bell 2017-09-11 23:16:29 -07:00
parent 460204bcab
commit a71c3e9594

View File

@ -716,7 +716,7 @@ bail: rts
bne :+ bne :+
jsr find_click_piece jsr find_click_piece
bcc bail bcc bail
jmp L0FBC jmp process_click
;; close box? ;; close box?
: cmp #A2D_ELEM_CLOSE : cmp #A2D_ELEM_CLOSE
@ -847,11 +847,13 @@ nope: clc
hole_piece := 12 hole_piece := 12
L0FBC: lda #$00
.proc process_click
lda #0
ldy hole_y ldy hole_y
beq L0FC9 beq L0FC9
L0FC3: clc L0FC3: clc
adc #$04 adc #4
dey dey
bne L0FC3 bne L0FC3
L0FC9: sta draw_rc L0FC9: sta draw_rc
@ -863,10 +865,10 @@ L0FC9: sta draw_rc
beq L1014 beq L1014
lda click_x lda click_x
cmp hole_y cmp hole_y
beq L0FE2 beq :+
L0FE1: rts L0FE1: rts
L0FE2: lda click_y : lda click_y
cmp hole_x cmp hole_x
beq L0FE1 beq L0FE1
bcs L1000 bcs L1000
@ -879,7 +881,7 @@ L0FF4: lda position_table-1,y
dey dey
dex dex
bne L0FF4 bne L0FF4
beq L1055 beq row
L1000: lda click_y L1000: lda click_y
sec sec
sbc hole_x sbc hole_x
@ -889,7 +891,7 @@ L1008: lda position_table+1,y
iny iny
dex dex
bne L1008 bne L1008
beq L1055 beq row
L1014: lda click_x L1014: lda click_x
cmp hole_y cmp hole_y
beq L0FE1 beq L0FE1
@ -906,7 +908,7 @@ L1026: lda position_table-4,y
dey dey
dex dex
bne L1026 bne L1026
beq L104A beq col
L1035: lda click_x L1035: lda click_x
sec sec
sbc hole_y sbc hole_y
@ -919,16 +921,20 @@ L103D: lda position_table+4,y
iny iny
dex dex
bne L103D bne L103D
L104A: lda #hole_piece
col: lda #hole_piece
sta position_table,y sta position_table,y
jsr draw_col jsr draw_col
jmp L105D jmp done
L1055: lda #hole_piece row: lda #hole_piece
sta position_table,y sta position_table,y
jsr draw_row jsr draw_row
L105D: jsr check_victory
done: jsr check_victory
bcc L106E bcc L106E
;; Yay! Play the sound 4 times
ldx #4 ldx #4
L1064: txa L1064: txa
pha pha
@ -939,7 +945,8 @@ L1064: txa
bne L1064 bne L1064
L106E: jmp find_hole L106E: jmp find_hole
rts rts ; ???
.endproc
;;; ================================================== ;;; ==================================================
;;; Clear the background ;;; Clear the background