ootw: can walk to the left

This commit is contained in:
Vince Weaver 2019-01-14 12:44:26 -05:00
parent 1d1d2e2554
commit 3ac5dd4ba0
7 changed files with 203 additions and 77 deletions

View File

@ -15,7 +15,7 @@ ootw.dsk: HELLO OOTW
OOTW: ootw.o
ld65 -o OOTW ootw.o -C ../linker_scripts/apple2_1000.inc
ootw.o: ootw.s wait_keypress.s \
ootw.o: ootw.s \
gr_copy.s gr_fast_clear.s gr_pageflip.s gr_unrle.s gr_putsprite.s \
ootw_backgrounds.inc ootw_sprites.inc
ca65 -o ootw.o ootw.s -l ootw.lst

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@ -57,13 +57,16 @@ title_screen:
;=================================
; setup vars
lda #22
sta ADV_Y
sta PHYSICIST_Y
lda #20
sta ADV_X
sta PHYSICIST_X
lda #1
sta DIRECTION
lda #0
sta GAIT
game_loop:
; check keyboard
@ -74,33 +77,9 @@ game_loop:
jsr gr_copy_to_current
; draw adventurer
lda DIRECTION
beq stand_left
stand_right:
lda #>adv_stand_right
sta INH
lda #<adv_stand_right
sta INL
jmp done_walking
stand_left:
lda #>adv_stand_left
sta INH
lda #<adv_stand_left
sta INL
done_walking:
lda ADV_X
sta XPOS
lda ADV_Y
sta YPOS
jsr put_sprite
; draw physicist
jsr draw_physicist
; draw bad guys
@ -152,12 +131,16 @@ left:
lda DIRECTION
bne face_left
dec ADV_X
dec PHYSICIST_X
inc GAIT
inc GAIT
jmp done_keypress
face_left:
lda #0
sta DIRECTION
sta GAIT
jmp done_keypress
check_right:
@ -169,10 +152,14 @@ right:
lda DIRECTION
beq face_right
inc ADV_X
inc PHYSICIST_X
inc GAIT
inc GAIT
jmp done_keypress
face_right:
lda #0
sta GAIT
lda #1
sta DIRECTION
jmp done_keypress
@ -187,7 +174,48 @@ no_keypress:
;.include "wait_keypress.s"
;======================================
; draw physicist
;======================================
draw_physicist:
lda GAIT
and #$f
sta GAIT
tax
lda DIRECTION
beq facing_left
facing_right:
lda adv_walk_right_progression,X
sta INL
lda adv_walk_right_progression+1,X
sta INH
jmp draw_him
facing_left:
lda adv_walk_left_progression,X
sta INL
lda adv_walk_left_progression+1,X
sta INH
draw_him:
lda PHYSICIST_X
sta XPOS
lda PHYSICIST_Y
sta YPOS
jsr put_sprite ; make this a "jmp"?
rts
.include "gr_pageflip.s"
.include "gr_unrle.s"
.include "gr_fast_clear.s"

View File

@ -6,42 +6,41 @@ planet_rle: .byte $28 ; ysize=48
.byte $A4,$66, $77, $A4,$66, $67, $7F, $A0,$13,$66, $76
.byte $A4,$66, $22, $28, $22,$22, $99, $A5,$66, $67
.byte $A3,$66, $76, $77, $A0,$15,$66, $76, $66,$66, $A4,$22
.byte $89, $26, $A8,$66, $7F, $66, $76, $A0,$11,$66
.byte $16, $00, $06, $66,$66, $67, $22, $88
.byte $22,$22, $88, $22, $99, $A5,$66, $67,$67, $66,$66
.byte $22, $89, $96, $66, $76, $AD,$66, $A4,$00
.byte $66,$66, $22,$22, $28, $88, $89, $22,$22, $A9,$66
.byte $22, $88,$88, $A3,$66, $67, $66, $67, $66
.byte $67, $66,$66, $76, $66, $76, $A3,$66, $00
.byte $60,$60, $06, $66, $22,$22, $82, $22, $82
.byte $28, $22, $A9,$66, $82, $88,$88, $66, $87
.byte $A6,$66, $55, $96, $A4,$66, $67, $28, $A5,$88
.byte $22,$22, $28, $22, $28, $82, $22, $76
.byte $66, $76, $66,$66, $96, $A3,$66, $A3,$88, $66
.byte $88, $A5,$66, $86, $55, $59, $A5,$66, $62
.byte $A5,$28, $A5,$22, $88, $22, $82,$82, $66,$66, $67
.byte $55, $66, $67, $26, $88,$88, $29, $66
.byte $88, $66, $76, $66, $76, $66, $65
.byte $55, $95, $76, $A5,$66, $88,$88, $82, $22
.byte $88, $22, $88, $A7,$22, $A3,$66, $55, $66,$66
.byte $22, $88,$88, $22, $66, $88, $A5,$66, $58
.byte $55,$55, $66,$66, $67, $66,$66, $22, $A3,$88, $22
.byte $88, $22,$22, $28, $82, $A3,$22, $88, $82
.byte $28, $86, $A3,$55, $56, $52, $28, $88
.byte $22, $56, $88, $A4,$56, $A3,$55, $85, $55,$55
.byte $56, $26, $A3,$82, $88, $22, $88,$88, $A3,$22
.byte $88, $A3,$22, $28, $22,$22, $28,$28, $55,$55, $22
.byte $25, $22, $88, $82, $85, $88, $A6,$55
.byte $85, $88, $55,$55, $25, $82, $A4,$88, $82,$82
.byte $88, $A3,$22, $28, $A8,$22, $25, $A4,$82, $A5,$88
.byte $A5,$85, $88,$88, $85,$85, $82, $A8,$88, $A4,$22, $52
.byte $82, $55, $85, $AA,$25, $28, $A5,$25, $28
.byte $A8,$25, $85, $55,$55, $A4,$85, $22, $55, $88
.byte $55,$55, $85, $28, $A0,$1B,$22, $28, $85, $55
.byte $A3,$88, $A3,$55, $25, $58, $A7,$52, $72, $A3,$52
.byte $22, $52,$52, $72, $A8,$52, $22, $A6,$52, $72
.byte $55, $52, $55, $58, $A3,$82, $88, $82,$82
.byte $A3,$88, $A7,$82, $88, $A3,$82, $88, $A7,$82, $88
.byte $A4,$82, $88, $A6,$82, $A0,$28,$88, $AA,$28, $A4,$22, $A0,$1A,$28
.byte $A0,$A0,$00
.byte $89, $26, $A8,$66, $7F, $A0,$13,$66, $16, $00
.byte $06, $66,$66, $67, $22, $89, $22,$22, $88
.byte $22, $99, $A5,$66, $67,$67, $66,$66, $89,$89, $56
.byte $66, $76, $AD,$66, $A4,$00, $66,$66, $22,$22, $28
.byte $88, $89, $22,$22, $A9,$66, $88,$88, $55, $A3,$66
.byte $67, $66, $67, $66, $67, $66,$66, $76
.byte $66, $76, $A3,$66, $00, $60,$60, $06, $66
.byte $22,$22, $82, $22, $82, $28, $22, $A9,$66
.byte $88,$88, $55, $66, $89, $A6,$66, $55, $95
.byte $A4,$66, $67, $28, $A6,$88, $22, $A3,$28, $82
.byte $22, $76, $66, $76, $66,$66, $96, $A3,$66
.byte $88,$88, $55, $66, $88, $A5,$66, $A3,$55, $A5,$66
.byte $62, $A5,$28, $88, $A4,$22, $88, $22, $82
.byte $A3,$66, $67, $55, $66, $67, $26, $88,$88
.byte $85, $66, $88, $66, $76, $86, $76
.byte $66, $68, $55, $95, $76, $A5,$66, $88,$88
.byte $82, $22, $88,$88, $22, $82, $22,$22, $88
.byte $A3,$22, $A3,$66, $55, $26,$26, $22, $A3,$88, $22
.byte $88, $66,$66, $88, $26,$26, $A3,$55, $26,$26, $27
.byte $66,$66, $22, $A3,$88, $22, $88,$88, $22, $28
.byte $82, $22, $28, $22, $88, $82, $28
.byte $82, $A3,$55, $52,$52, $A3,$88, $52, $88, $52,$52
.byte $58, $52, $A3,$55, $88, $55,$55, $52, $26
.byte $A3,$82, $88, $22, $A3,$88, $22,$22, $88, $A3,$22
.byte $88, $22,$22, $88,$88, $55,$55, $82, $A4,$88, $85
.byte $88, $A6,$55, $85, $88, $A3,$55, $22, $A4,$88
.byte $82,$82, $88, $A3,$22, $28, $A6,$22, $28,$28, $25
.byte $A9,$88, $A5,$85, $88,$88, $85,$85, $8A, $82, $A7,$88
.byte $A4,$22, $52, $82, $55, $85, $AA,$25, $28
.byte $A5,$25, $28, $A8,$25, $85, $55,$55, $A4,$85, $22
.byte $55, $88, $55,$55, $85, $28, $A0,$1B,$22, $28
.byte $85, $55, $78, $88,$88, $A3,$55, $25, $58
.byte $A7,$52, $72, $A3,$52, $22, $52,$52, $72, $A8,$52
.byte $22, $A6,$52, $72, $58, $55,$55, $58, $A3,$82
.byte $88, $82,$82, $A3,$88, $A7,$82, $88, $A3,$82, $88
.byte $A7,$82, $88, $A4,$82, $88, $A6,$82, $A0,$28,$88, $AA,$28
.byte $A4,$22, $A0,$1A,$28, $A0,$A0,$00
.byte $A1

View File

@ -1,3 +1,24 @@
adv_walk_left_progression:
.word adv_stand_left
.word adv_walk_left1
.word adv_walk_left2
.word adv_walk_left3
.word adv_walk_left4
.word adv_walk_left5
.word adv_walk_left6
.word adv_walk_left7
adv_walk_right_progression:
.word adv_stand_right
.word adv_walk_left1
.word adv_walk_left2
.word adv_walk_left3
.word adv_walk_left4
.word adv_walk_left5
.word adv_walk_left6
.word adv_walk_left7
adv_stand_right:
.byte $4,$8
.byte $aa,$9a,$9a,$aa
@ -20,6 +41,88 @@ adv_stand_left:
.byte $aa,$aa,$44,$aa
.byte $aa,$fa,$f4,$aa
adv_walk_left1:
.byte $4,$8
.byte $aa,$9a,$9a,$aa
.byte $aa,$bb,$99,$aa
.byte $aa,$aa,$0b,$aa
.byte $aa,$aa,$bb,$aa
.byte $aa,$ba,$0b,$aa
.byte $aa,$aa,$44,$aa
.byte $aa,$cc,$44,$aa
.byte $aa,$fa,$f4,$a5
adv_walk_left2:
.byte $4,$8
.byte $aa,$9a,$9a,$aa
.byte $aa,$bb,$99,$aa
.byte $aa,$aa,$0b,$aa
.byte $aa,$aa,$bb,$aa
.byte $ba,$ab,$00,$ba
.byte $aa,$aa,$44,$aa
.byte $aa,$cc,$44,$4a
.byte $aa,$a5,$fc,$f4
adv_walk_left3:
.byte $4,$8
.byte $aa,$9a,$9a,$aa
.byte $aa,$bb,$99,$aa
.byte $aa,$aa,$0b,$aa
.byte $aa,$aa,$bb,$aa
.byte $ba,$ab,$00,$ba
.byte $aa,$aa,$44,$aa
.byte $aa,$cc,$a4,$4a
.byte $5a,$5c,$fa,$f4
adv_walk_left4:
.byte $4,$8
.byte $aa,$9a,$9a,$aa
.byte $aa,$bb,$99,$aa
.byte $aa,$aa,$0b,$aa
.byte $aa,$aa,$bb,$aa
.byte $aa,$ba,$0b,$aa
.byte $aa,$aa,$44,$aa
.byte $aa,$aa,$c4,$4a
.byte $aa,$5a,$5f,$af
adv_walk_left5:
.byte $4,$8
.byte $aa,$9a,$9a,$aa
.byte $aa,$bb,$99,$aa
.byte $aa,$aa,$0b,$aa
.byte $aa,$aa,$bb,$aa
.byte $aa,$aa,$bb,$aa
.byte $aa,$aa,$44,$aa
.byte $aa,$44,$c4,$aa
.byte $af,$5f,$5c,$aa
adv_walk_left6:
.byte $4,$8
.byte $aa,$9a,$9a,$aa
.byte $aa,$bb,$99,$aa
.byte $aa,$aa,$0b,$aa
.byte $aa,$aa,$bb,$aa
.byte $aa,$ba,$00,$bb
.byte $aa,$aa,$44,$aa
.byte $aa,$aa,$44,$aa
.byte $fa,$f4,$5c,$5c
adv_walk_left7:
.byte $4,$8
.byte $aa,$9a,$9a,$aa
.byte $aa,$bb,$99,$aa
.byte $aa,$aa,$0b,$aa
.byte $aa,$aa,$bb,$aa
.byte $aa,$aa,$0b,$ba
.byte $aa,$aa,$44,$aa
.byte $aa,$aa,$44,$aa
.byte $aa,$fa,$f4,$5c
foreground_plant:
.byte $5,$5
.byte $aa,$00,$aa,$aa,$aa

View File

@ -1,5 +0,0 @@
wait_until_keypress:
lda KEYPRESS ; 4
bpl wait_until_keypress ; 3
bit KEYRESET ; clear the keyboard buffer
rts ; 6

View File

@ -147,12 +147,13 @@ DISP_PAGE = $ED
DRAW_PAGE = $EE
OFFSET = $EF
ADV_X = $F0
ADV_Y = $F1
PHYSICIST_X = $F0
PHYSICIST_Y = $F1
SPRITETEMP = $F2
XPOS = $F3
YPOS = $F4
DIRECTION = $F5
GAIT = $F6
TEMP = $FA
TEMPY = $FB
INL = $FC