mirror of
https://github.com/robmcmullen/fujirun.git
synced 2024-06-01 03:41:32 +00:00
Cleanup of box painting and damage_maze
This commit is contained in:
parent
ca6452e48d
commit
b4d599d060
60
background.s
60
background.s
|
@ -27,36 +27,13 @@ check_dots nop
|
||||||
sta (mazeaddr),y
|
sta (mazeaddr),y
|
||||||
|
|
||||||
; update damage! Needs to update both screens
|
; update damage! Needs to update both screens
|
||||||
jsr damage_maze
|
jsr damage_char
|
||||||
|
|
||||||
lda #DOT_SCORE
|
lda #DOT_SCORE
|
||||||
jsr add_score
|
jsr add_score
|
||||||
?1 rts
|
?1 rts
|
||||||
|
|
||||||
|
|
||||||
; update both screens!
|
|
||||||
damage_maze nop
|
|
||||||
jsr damage_char
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; if box_painting[x] == 0:
|
|
||||||
; box_painting[x] = c
|
|
||||||
; box_painting[x + 1] = r1
|
|
||||||
; box_painting[x + 2] = r2
|
|
||||||
; box_painting[x + 3] = zp.current_actor
|
|
||||||
; break
|
|
||||||
lda c1
|
|
||||||
sta box_painting,y
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
; x += NUM_BOX_PAINTING_PARAMS
|
|
||||||
; pad.addstr(27, 0, "starting box, player @ %d %d,%d -> %d,%d" % (zp.current_actor, r1, c, r2, c + BOX_WIDTH))
|
|
||||||
|
|
||||||
|
|
||||||
save_index .byte 0
|
save_index .byte 0
|
||||||
|
|
||||||
; def paint_boxes():
|
; def paint_boxes():
|
||||||
|
@ -72,7 +49,7 @@ paint_boxes nop
|
||||||
rts
|
rts
|
||||||
|
|
||||||
; if box_painting[x] > 0:
|
; if box_painting[x] > 0:
|
||||||
?1 lda box_painting,y
|
?1 lda box_painting_c,y
|
||||||
beq ?skip
|
beq ?skip
|
||||||
; c1 = box_painting[x]
|
; c1 = box_painting[x]
|
||||||
; r1 = box_painting[x + 1]
|
; r1 = box_painting[x + 1]
|
||||||
|
@ -82,17 +59,11 @@ paint_boxes nop
|
||||||
inc debug_paint_box
|
inc debug_paint_box
|
||||||
|
|
||||||
sta c1
|
sta c1
|
||||||
sty save_index
|
lda box_painting_r1,y
|
||||||
iny
|
|
||||||
lda box_painting,y
|
|
||||||
sta r1
|
sta r1
|
||||||
iny
|
lda box_painting_r2,y
|
||||||
lda box_painting,y
|
|
||||||
sta r2
|
sta r2
|
||||||
iny
|
lda box_painting_actor,y ; player number
|
||||||
lda box_painting,y ; player number
|
|
||||||
iny
|
|
||||||
sty param_index
|
|
||||||
; box_log.debug("Painting box line, player %d at %d,%d" % (i, r1, c1))
|
; box_log.debug("Painting box line, player %d at %d,%d" % (i, r1, c1))
|
||||||
; pad.addstr(30, 0, "painting box line at %d,%d" % (r1, c1))
|
; pad.addstr(30, 0, "painting box line at %d,%d" % (r1, c1))
|
||||||
; addr = screenrow(r1)
|
; addr = screenrow(r1)
|
||||||
|
@ -136,24 +107,17 @@ paint_boxes nop
|
||||||
bcs ?finish
|
bcs ?finish
|
||||||
|
|
||||||
; box_painting[x + 1] = r1
|
; box_painting[x + 1] = r1
|
||||||
ldy save_index
|
ldy param_index
|
||||||
iny
|
sta box_painting_r1,y
|
||||||
sta box_painting,y
|
inc param_index
|
||||||
bne ?loop
|
bne ?loop ; always
|
||||||
|
|
||||||
?finish ldy save_index
|
?finish ldy param_index
|
||||||
lda #0
|
lda #0
|
||||||
sta box_painting,y
|
sta box_painting_c,y
|
||||||
beq ?loop
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
; x += NUM_BOX_PAINTING_PARAMS
|
; x += NUM_BOX_PAINTING_PARAMS
|
||||||
?skip iny
|
?skip inc param_index
|
||||||
iny
|
|
||||||
iny
|
|
||||||
iny
|
|
||||||
sty param_index
|
|
||||||
bne ?loop ; always
|
bne ?loop ; always
|
||||||
|
|
||||||
;
|
;
|
||||||
|
|
5
main.s
5
main.s
|
@ -178,11 +178,6 @@ forever
|
||||||
init_once
|
init_once
|
||||||
jsr init_screen_once
|
jsr init_screen_once
|
||||||
jsr init_actors_once
|
jsr init_actors_once
|
||||||
ldx #MAX_BOX_PAINTING
|
|
||||||
lda #0
|
|
||||||
?1 sta box_painting - 1,x
|
|
||||||
dex
|
|
||||||
bne ?1
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
clrscr
|
clrscr
|
||||||
|
|
40
maze.s
40
maze.s
|
@ -18,8 +18,7 @@ VPATH_NUM = 6
|
||||||
BOX_WIDTH = 5
|
BOX_WIDTH = 5
|
||||||
VPATH_COL_SPACING = BOX_WIDTH + 1
|
VPATH_COL_SPACING = BOX_WIDTH + 1
|
||||||
|
|
||||||
NUM_BOX_PAINTING_PARAMS = 4
|
MAX_BOX_PAINTING = 16
|
||||||
MAX_BOX_PAINTING = NUM_BOX_PAINTING_PARAMS * 16
|
|
||||||
|
|
||||||
|
|
||||||
; storage
|
; storage
|
||||||
|
@ -382,6 +381,14 @@ level_boxes = $bd00
|
||||||
init_boxes nop
|
init_boxes nop
|
||||||
lda #0
|
lda #0
|
||||||
sta next_level_box
|
sta next_level_box
|
||||||
|
ldx #MAX_BOX_PAINTING
|
||||||
|
lda #0
|
||||||
|
?1 sta box_painting_c - 1,x
|
||||||
|
sta box_painting_r1 - 1,x
|
||||||
|
sta box_painting_r2 - 1,x
|
||||||
|
sta box_painting_actor - 1,x
|
||||||
|
dex
|
||||||
|
bne ?1
|
||||||
rts
|
rts
|
||||||
;
|
;
|
||||||
;def start_box(r, c):
|
;def start_box(r, c):
|
||||||
|
@ -568,8 +575,9 @@ mark_box_for_painting nop
|
||||||
; box_log.debug("Marking box, player $%d @ %d,%d -> %d,%d" % (zp.current_actor, r1, c, r2, c + BOX_WIDTH))
|
; box_log.debug("Marking box, player $%d @ %d,%d -> %d,%d" % (zp.current_actor, r1, c, r2, c + BOX_WIDTH))
|
||||||
; x = 0
|
; x = 0
|
||||||
; while x < NUM_BOX_PAINTING_PARAMS * 16:
|
; while x < NUM_BOX_PAINTING_PARAMS * 16:
|
||||||
ldy #0
|
ldy #$ff
|
||||||
?loop cpy #MAX_BOX_PAINTING
|
?loop iny
|
||||||
|
cpy #MAX_BOX_PAINTING
|
||||||
bcc ?1
|
bcc ?1
|
||||||
rts
|
rts
|
||||||
; if box_painting[x] == 0:
|
; if box_painting[x] == 0:
|
||||||
|
@ -578,27 +586,15 @@ mark_box_for_painting nop
|
||||||
; box_painting[x + 2] = r2
|
; box_painting[x + 2] = r2
|
||||||
; box_painting[x + 3] = zp.current_actor
|
; box_painting[x + 3] = zp.current_actor
|
||||||
; break
|
; break
|
||||||
?1 lda box_painting,y
|
?1 lda box_painting_c,y
|
||||||
bne ?skip
|
bne ?loop
|
||||||
inc debug_mark_box
|
inc debug_mark_box
|
||||||
lda c1
|
lda c1
|
||||||
sta box_painting,y
|
sta box_painting_c,y
|
||||||
iny
|
|
||||||
lda r1
|
lda r1
|
||||||
sta box_painting,y
|
sta box_painting_r1,y
|
||||||
iny
|
|
||||||
lda r2
|
lda r2
|
||||||
sta box_painting,y
|
sta box_painting_r2,y
|
||||||
iny
|
|
||||||
txa ; player number
|
txa ; player number
|
||||||
sta box_painting,y
|
sta box_painting_actor,y
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
; x += NUM_BOX_PAINTING_PARAMS
|
|
||||||
; pad.addstr(27, 0, "starting box, player @ %d %d,%d -> %d,%d" % (zp.current_actor, r1, c, r2, c + BOX_WIDTH))
|
|
||||||
?skip iny
|
|
||||||
iny
|
|
||||||
iny
|
|
||||||
iny
|
|
||||||
bne ?loop ; always
|
|
||||||
|
|
5
vars.s
5
vars.s
|
@ -31,4 +31,7 @@ amidar_start_col .ds VPATH_NUM
|
||||||
round_robin_up .ds VPATH_NUM
|
round_robin_up .ds VPATH_NUM
|
||||||
round_robin_down .ds VPATH_NUM
|
round_robin_down .ds VPATH_NUM
|
||||||
|
|
||||||
box_painting .ds MAX_BOX_PAINTING
|
box_painting_c .ds MAX_BOX_PAINTING
|
||||||
|
box_painting_r1 .ds MAX_BOX_PAINTING
|
||||||
|
box_painting_r2 .ds MAX_BOX_PAINTING
|
||||||
|
box_painting_actor .ds MAX_BOX_PAINTING
|
||||||
|
|
Loading…
Reference in New Issue
Block a user