mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-02-23 05:29:03 +00:00
tfv: split off gr_put_num
This commit is contained in:
parent
6a771b66bd
commit
386a719783
@ -75,7 +75,7 @@ TFV_WORLD: tfv_world.o
|
||||
ld65 -o TFV_WORLD tfv_world.o -C ../../linker_scripts/apple2_2000.inc
|
||||
|
||||
tfv_world.o: tfv_world.s zp.inc \
|
||||
long_wait.s \
|
||||
long_wait.s gr_put_num.s \
|
||||
tfv_overworld.s tfv_drawmap.s \
|
||||
tfv_battle.s tfv_battle_menu.s tfv_battle_limit.s tfv_battle_summons.s \
|
||||
tfv_battle_magic.s tfv_battle_enemy.s tfv_battle_draw_hero.s \
|
||||
@ -83,7 +83,7 @@ tfv_world.o: tfv_world.s zp.inc \
|
||||
help_overworld.s rotate_intro.s \
|
||||
sound_effects.s speaker_tone.s \
|
||||
graphics_map/tfv_backgrounds.inc \
|
||||
tfv_sprites.inc battle_sprites.inc number_sprites.inc
|
||||
tfv_sprites.inc battle_sprites.inc
|
||||
ca65 -o tfv_world.o tfv_world.s -l tfv_world.lst
|
||||
|
||||
graphics_map/tfv_backgrounds.inc:
|
||||
|
@ -1,3 +1,97 @@
|
||||
|
||||
;****** ** **** **** ** ** ****** **** ****** ****** ******
|
||||
;** ** **** ** ** ** ** ** ** ** ** ** ** **
|
||||
;** ** ** **** **** ****** **** ****** ** ****** ******
|
||||
;** ** ** ** ** ** ** ** ** ** ** ** **
|
||||
;****** ****** ****** **** ** **** ****** ** ****** **
|
||||
|
||||
;===========================
|
||||
; gr put num
|
||||
;===========================
|
||||
; damage in DAMAGE_VAL_LO/HI (BCD)
|
||||
; location in XPOS,YPOS
|
||||
|
||||
gr_put_num:
|
||||
lda #1
|
||||
sta gr_put_num_leading_zero
|
||||
|
||||
; put high digit first
|
||||
lda DAMAGE_VAL_HI
|
||||
beq gr_put_num_bottom_byte
|
||||
jsr gr_put_num_byte
|
||||
gr_put_num_bottom_byte:
|
||||
lda DAMAGE_VAL_LO
|
||||
; fallthrough
|
||||
|
||||
;=================================
|
||||
; print two-digit BCD number in A
|
||||
gr_put_num_byte:
|
||||
pha ; store on stack
|
||||
|
||||
gr_put_num_tens:
|
||||
|
||||
and #$f0
|
||||
bne gr_put_num_print_tens
|
||||
|
||||
; was zero, check if we should print
|
||||
|
||||
lda gr_put_num_leading_zero ; if 1, we skip
|
||||
bne gr_put_num_ones
|
||||
|
||||
pla ; restore value
|
||||
pha
|
||||
|
||||
gr_put_num_print_tens:
|
||||
|
||||
; we were non-zero, notify leading zero
|
||||
ldy #0
|
||||
sty gr_put_num_leading_zero
|
||||
|
||||
|
||||
; print tens digit
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
|
||||
|
||||
asl
|
||||
tay
|
||||
lda number_sprites,Y
|
||||
sta INL
|
||||
lda number_sprites+1,Y
|
||||
sta INH
|
||||
|
||||
jsr put_sprite_crop
|
||||
|
||||
; point to next
|
||||
lda XPOS
|
||||
clc
|
||||
adc #4
|
||||
sta XPOS
|
||||
|
||||
gr_put_num_ones:
|
||||
|
||||
; print ones digit
|
||||
pla
|
||||
and #$f
|
||||
|
||||
asl
|
||||
tay
|
||||
lda number_sprites,Y
|
||||
sta INL
|
||||
lda number_sprites+1,Y
|
||||
sta INH
|
||||
|
||||
jsr put_sprite_crop
|
||||
|
||||
rts
|
||||
|
||||
|
||||
|
||||
gr_put_num_leading_zero: .byte $01
|
||||
|
||||
|
||||
; Numbers
|
||||
|
||||
|
@ -326,101 +326,7 @@ battle_game_over:
|
||||
|
||||
|
||||
|
||||
;****** ** **** **** ** ** ****** **** ****** ****** ******
|
||||
;** ** **** ** ** ** ** ** ** ** ** ** ** **
|
||||
;** ** ** **** **** ****** **** ****** ** ****** ******
|
||||
;** ** ** ** ** ** ** ** ** ** ** ** **
|
||||
;****** ****** ****** **** ** **** ****** ** ****** **
|
||||
|
||||
gr_put_num_leading_zero: .byte $00
|
||||
|
||||
;===========================
|
||||
; gr put num
|
||||
;===========================
|
||||
; damage in DAMAGE_VAL_LO/HI (BCD)
|
||||
; location in XPOS,YPOS
|
||||
|
||||
gr_put_num:
|
||||
lda #1
|
||||
sta gr_put_num_leading_zero
|
||||
|
||||
; put high digit first
|
||||
lda DAMAGE_VAL_HI
|
||||
beq gr_put_num_bottom_byte
|
||||
jsr gr_put_num_byte
|
||||
gr_put_num_bottom_byte:
|
||||
lda DAMAGE_VAL_LO
|
||||
; fallthrough
|
||||
|
||||
;=================================
|
||||
; print two-digit BCD number in A
|
||||
gr_put_num_byte:
|
||||
pha ; store on stack
|
||||
|
||||
gr_put_num_tens:
|
||||
|
||||
and #$f0
|
||||
bne gr_put_num_print_tens
|
||||
|
||||
; was zero, check if we should print
|
||||
|
||||
lda gr_put_num_leading_zero ; if 1, we skip
|
||||
bne gr_put_num_ones
|
||||
|
||||
pla ; restore value
|
||||
pha
|
||||
|
||||
gr_put_num_print_tens:
|
||||
|
||||
; we were non-zero, notify leading zero
|
||||
ldy #0
|
||||
sty gr_put_num_leading_zero
|
||||
|
||||
|
||||
; print tens digit
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
|
||||
|
||||
asl
|
||||
tay
|
||||
lda number_sprites,Y
|
||||
sta INL
|
||||
lda number_sprites+1,Y
|
||||
sta INH
|
||||
|
||||
jsr put_sprite_crop
|
||||
|
||||
; point to next
|
||||
lda XPOS
|
||||
clc
|
||||
adc #4
|
||||
sta XPOS
|
||||
|
||||
gr_put_num_ones:
|
||||
|
||||
; print ones digit
|
||||
pla
|
||||
and #$f
|
||||
|
||||
asl
|
||||
tay
|
||||
lda number_sprites,Y
|
||||
sta INL
|
||||
lda number_sprites+1,Y
|
||||
sta INH
|
||||
|
||||
jsr put_sprite_crop
|
||||
|
||||
rts
|
||||
|
||||
|
||||
|
||||
victory_string:
|
||||
.byte 13,21,"EXPERIENCE +2",0
|
||||
.byte 16,22,"MONEY +1",0
|
||||
|
||||
|
||||
;====================================
|
||||
@ -485,3 +391,6 @@ victory_draw_done:
|
||||
rts
|
||||
|
||||
|
||||
victory_string:
|
||||
.byte 13,21,"EXPERIENCE +2",0
|
||||
.byte 16,22,"MONEY +1",0
|
||||
|
@ -43,6 +43,7 @@
|
||||
.include "gr_hlin.s"
|
||||
.include "gr_vlin.s"
|
||||
.include "gr_pageflip.s"
|
||||
.include "gr_put_num.s"
|
||||
.include "keyboard.s"
|
||||
.include "joystick.s"
|
||||
.include "gr_putsprite_crop.s"
|
||||
@ -75,7 +76,6 @@
|
||||
|
||||
.include "tfv_sprites.inc"
|
||||
.include "battle_sprites.inc"
|
||||
.include "number_sprites.inc"
|
||||
.include "graphics_map/tfv_backgrounds.inc"
|
||||
|
||||
;===============================================
|
||||
|
Loading…
x
Reference in New Issue
Block a user