mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-10-08 05:56:17 +00:00
tfv: put TFV sprite on the worldmap
This commit is contained in:
parent
9038593ef1
commit
9c4d95e6bc
@ -1,6 +1,14 @@
|
|||||||
ODD EQU $7B
|
ODD EQU $7B
|
||||||
DIRECTION EQU $7C
|
DIRECTION EQU $7C
|
||||||
REFRESH EQU $7D
|
REFRESH EQU $7D
|
||||||
|
ON_BIRD EQU $7E
|
||||||
|
MOVED EQU $7F
|
||||||
|
STEPS EQU $80
|
||||||
|
TFV_X EQU $81
|
||||||
|
TFV_Y EQU $82
|
||||||
|
NEWX EQU $83
|
||||||
|
NEWY EQU $84
|
||||||
|
|
||||||
|
|
||||||
; In Town
|
; In Town
|
||||||
|
|
||||||
@ -49,42 +57,221 @@ world_map:
|
|||||||
|
|
||||||
lda #$0
|
lda #$0
|
||||||
sta ODD
|
sta ODD
|
||||||
|
sta ON_BIRD
|
||||||
|
|
||||||
lda #$1
|
lda #$1
|
||||||
sta DIRECTION
|
sta DIRECTION
|
||||||
sta REFRESH
|
sta REFRESH
|
||||||
|
|
||||||
|
lda #15
|
||||||
|
sta TFV_X
|
||||||
|
|
||||||
|
lda #20
|
||||||
|
sta TFV_Y
|
||||||
|
|
||||||
|
;==================
|
||||||
|
; MAIN LOOP
|
||||||
|
;==================
|
||||||
|
|
||||||
worldmap_loop:
|
worldmap_loop:
|
||||||
|
lda #$0
|
||||||
|
sta MOVED
|
||||||
|
lda TFV_X
|
||||||
|
sta NEWX
|
||||||
|
lda TFV_Y
|
||||||
|
sta NEWY
|
||||||
|
|
||||||
|
|
||||||
worldmap_keyboard:
|
worldmap_keyboard:
|
||||||
|
|
||||||
jsr get_key ; get keypress
|
jsr get_key ; get keypress
|
||||||
|
|
||||||
lda LASTKEY
|
lda LASTKEY
|
||||||
|
|
||||||
cmp #('Q') ; if quit, then return
|
worldmap_handle_q:
|
||||||
bne worldmap_check_up
|
cmp #('Q') ; if quit, then return
|
||||||
|
bne worldmap_handle_up
|
||||||
rts
|
rts
|
||||||
|
|
||||||
worldmap_check_up:
|
worldmap_handle_up:
|
||||||
|
cmp #('W')
|
||||||
|
bne worldmap_handle_down
|
||||||
|
|
||||||
|
dec NEWY
|
||||||
|
dec NEWY
|
||||||
|
inc MOVED
|
||||||
|
|
||||||
|
worldmap_handle_down:
|
||||||
|
cmp #('S')
|
||||||
|
bne worldmap_handle_left
|
||||||
|
|
||||||
|
inc NEWY
|
||||||
|
inc NEWY
|
||||||
|
inc MOVED
|
||||||
|
|
||||||
|
worldmap_handle_left:
|
||||||
|
cmp #('A')
|
||||||
|
bne worldmap_handle_right
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
worldmap_handle_right:
|
||||||
|
cmp #('D')
|
||||||
|
bne worldmap_handle_enter
|
||||||
|
|
||||||
|
worldmap_handle_enter:
|
||||||
|
cmp #13
|
||||||
|
bne worldmap_handle_help
|
||||||
|
|
||||||
|
; jsr city_map
|
||||||
|
inc REFRESH
|
||||||
|
|
||||||
|
worldmap_handle_help:
|
||||||
|
cmp #('H')
|
||||||
|
bne worldmap_handle_battle
|
||||||
|
|
||||||
|
; jsr print_help
|
||||||
|
|
||||||
|
worldmap_handle_battle:
|
||||||
|
cmp #('B')
|
||||||
|
bne worldmap_handle_info
|
||||||
|
|
||||||
|
; jsr do_battle
|
||||||
|
inc REFRESH
|
||||||
|
|
||||||
|
worldmap_handle_info:
|
||||||
|
cmp #('I')
|
||||||
|
bne worldmap_handle_map
|
||||||
|
|
||||||
|
; jsr print_info
|
||||||
|
inc REFRESH
|
||||||
|
|
||||||
|
worldmap_handle_map:
|
||||||
|
cmp #('M')
|
||||||
|
bne worldmap_done_keyboard
|
||||||
|
|
||||||
|
; jsr show_map
|
||||||
|
inc REFRESH
|
||||||
|
|
||||||
|
worldmap_done_keyboard:
|
||||||
|
|
||||||
|
;===========================
|
||||||
|
; Handle Movement
|
||||||
|
;===========================
|
||||||
|
|
||||||
|
lda MOVED
|
||||||
|
bne worldmap_refresh_screen
|
||||||
|
inc ODD
|
||||||
|
inc STEPS
|
||||||
|
|
||||||
|
; Handle Collision Detection
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;============================
|
||||||
|
; Refresh screen if needed
|
||||||
|
;============================
|
||||||
|
worldmap_refresh_screen:
|
||||||
|
|
||||||
lda REFRESH
|
lda REFRESH
|
||||||
beq worldmap_copy_background
|
beq worldmap_copy_background
|
||||||
|
|
||||||
jsr load_map_bg
|
jsr load_map_bg
|
||||||
|
|
||||||
dec REFRESH
|
dec REFRESH
|
||||||
|
|
||||||
worldmap_copy_background:
|
worldmap_copy_background:
|
||||||
|
|
||||||
|
|
||||||
|
; Copy background
|
||||||
|
|
||||||
jsr gr_copy_to_current
|
jsr gr_copy_to_current
|
||||||
|
|
||||||
|
; Handle ground scatter
|
||||||
|
|
||||||
|
; Draw background trees
|
||||||
|
|
||||||
|
; Draw TFV
|
||||||
|
|
||||||
|
lda #1
|
||||||
|
bit ODD
|
||||||
|
bne standing
|
||||||
|
|
||||||
|
walking:
|
||||||
|
lda DIRECTION
|
||||||
|
bne walking_right
|
||||||
|
walking_left:
|
||||||
|
lda #>tfv_walk_left
|
||||||
|
sta INH
|
||||||
|
lda #<tfv_walk_left
|
||||||
|
sta INL
|
||||||
|
beq done_walking
|
||||||
|
|
||||||
|
walking_right:
|
||||||
|
lda #>tfv_walk_right
|
||||||
|
sta INH
|
||||||
|
lda #<tfv_walk_right
|
||||||
|
sta INL
|
||||||
|
bne done_walking
|
||||||
|
|
||||||
|
standing:
|
||||||
|
lda DIRECTION
|
||||||
|
bne standing_right
|
||||||
|
standing_left:
|
||||||
|
lda #>tfv_stand_left
|
||||||
|
sta INH
|
||||||
|
lda #<tfv_stand_left
|
||||||
|
sta INL
|
||||||
|
beq done_walking
|
||||||
|
|
||||||
|
standing_right:
|
||||||
|
lda #>tfv_stand_right
|
||||||
|
sta INH
|
||||||
|
lda #<tfv_stand_right
|
||||||
|
sta INL
|
||||||
|
|
||||||
|
done_walking:
|
||||||
|
|
||||||
|
|
||||||
|
lda TFV_X
|
||||||
|
sta XPOS
|
||||||
|
lda TFV_Y
|
||||||
|
sta YPOS
|
||||||
|
|
||||||
|
jsr put_sprite
|
||||||
|
|
||||||
|
|
||||||
|
; if (direction==-1) {
|
||||||
|
; if (odd) grsim_put_sprite(tfv_walk_left,tfv_x,tfv_y);
|
||||||
|
; else grsim_put_sprite(tfv_stand_left,tfv_x,tfv_y);
|
||||||
|
; }
|
||||||
|
; if (direction==1) {
|
||||||
|
; if (odd) grsim_put_sprite(tfv_walk_right,tfv_x,tfv_y);
|
||||||
|
; else grsim_put_sprite(tfv_stand_right,tfv_x,tfv_y);
|
||||||
|
; }
|
||||||
|
|
||||||
|
|
||||||
|
; Draw foreground scatter
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
jsr page_flip
|
jsr page_flip
|
||||||
|
|
||||||
|
;============
|
||||||
|
; Update Time
|
||||||
|
;============
|
||||||
|
; if (steps>=60) {
|
||||||
|
; steps=0;
|
||||||
|
; time_minutes++;
|
||||||
|
; if (time_minutes>=60) {
|
||||||
|
; time_hours++;
|
||||||
|
; time_minutes=0;
|
||||||
|
; }
|
||||||
|
; }
|
||||||
|
|
||||||
jmp worldmap_loop
|
jmp worldmap_loop
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
load_map_bg:
|
load_map_bg:
|
||||||
|
|
||||||
lda #$0c
|
lda #$0c
|
||||||
|
Loading…
Reference in New Issue
Block a user