tfv: rotate into battle!

This commit is contained in:
Vince Weaver 2021-01-19 13:51:00 -05:00
parent 3711c5431e
commit 7ae2556983
5 changed files with 117 additions and 58 deletions

View File

@ -83,16 +83,20 @@ tfv_world.o: tfv_world.s zp.inc \
help_overworld.s rotate_intro.s rotozoom.s \
sound_effects.s speaker_tone.s \
graphics_map/tfv_backgrounds.inc \
graphics_battle/battle_graphics.inc \
tfv_sprites.inc battle_sprites.inc
ca65 -o tfv_world.o tfv_world.s -l tfv_world.lst
graphics_map/tfv_backgrounds.inc:
cd graphics_map && make
graphics_battle/battle_graphics.inc:
cd graphics_battle && make
###
clean:
rm -f *~ TITLE.GR *.o *.lst TFV_CREDITS TFV_TITLE TFV_FLYING TFV_WORLD HELLO LOADER
cd graphics_battle && make clean

View File

@ -29,7 +29,7 @@ $04-$07 lores page 1
$08-$0b lores page 2
$0c-$0f background graphics
$10-$1f ??
$20-??? code
$20-??? code B6-20 = 38.4k
$B6-$BD multiply tables

View File

@ -1,7 +1,7 @@
#include ../Makefile.inc
PNG2RLE = ../../gr-utils/png2rle
PNG2GR = ../../gr-utils/png2gr
PNG2RLE = ../../../utils/gr-utils/png2rle
PNG2GR = ../../../utils/gr-utils/png2gr
LZSA = ~/research/lzsa/lzsa/lzsa
all: battle_graphics.inc

View File

@ -28,10 +28,6 @@ do_battle:
sta ENEMY_DEAD
sta ENEMY_ATTACKING
; FIXME: set limit break
; lda #3
; sta HERO_LIMIT
; start battle count part-way in
lda #20
sta BATTLE_COUNT
@ -47,7 +43,36 @@ do_battle:
;========================
; zoom to battlefield
; jsr zoom_battlefield
lda #0
sta ANIMATE_LOOP
battlefield_zoom_loop:
lda ANIMATE_LOOP
asl
tay
lda plains_animation,Y ; lda #<(plains_battle)
sta getsrc_smc+1
lda plains_animation+1,Y ; lda #>(plains_battle)
sta getsrc_smc+2
lda #$c
jsr decompress_lzsa2_fast
jsr gr_copy_to_current
jsr page_flip
lda #200
jsr WAIT
inc ANIMATE_LOOP
lda ANIMATE_LOOP
cmp #11
bne battlefield_zoom_loop
;=============================
; Init Enemy
@ -57,56 +82,8 @@ do_battle:
;==========================
; Draw background
;==========================
; Draw sky
; jsr draw_battle_background
ldx #0 ; blue from 0 .. 10
battle_sky_loop:
lda gr_offsets,X
sta GBASL
lda gr_offsets+1,X
clc
adc #$8 ; store to $C00
sta GBASH
lda #$66 ; COLOR_MEDIUMBLUE
ldy #0
battle_sky_inner:
sta (GBASL),Y
iny
cpy #40
bne battle_sky_inner
inx
inx
cpx #10
bne battle_sky_loop
; green from 10 .. 40
battle_ground_loop:
lda gr_offsets,X
sta GBASL
lda gr_offsets+1,X
clc
adc #$8 ; store to $C00
sta GBASH
lda #$CC ; COLOR_LIGHTGREEN
; FIXME: should be GROUNDCOLOR
ldy #0
battle_ground_inner:
sta (GBASL),Y
iny
cpy #40
bne battle_ground_inner
inx
inx
cpx #40
bne battle_ground_loop
; Draw some background images for variety?
; update bottom of screen
jsr draw_battle_bottom
@ -414,3 +391,80 @@ victory_draw_done:
victory_string:
.byte 13,21,"EXPERIENCE +2",0
.byte 16,22,"MONEY +1",0
.if 0
;==========================
;==========================
; Draw battle background
;==========================
;==========================
draw_battle_background:
;==========================
; Draw sky
ldx #0 ; blue from 0 .. 10
battle_sky_loop:
lda gr_offsets,X
sta GBASL
lda gr_offsets+1,X
clc
adc #$8 ; store to $C00
sta GBASH
lda #$66 ; COLOR_MEDIUMBLUE
ldy #0
battle_sky_inner:
sta (GBASL),Y
iny
cpy #40
bne battle_sky_inner
inx
inx
cpx #10
bne battle_sky_loop
; green from 10 .. 40
battle_ground_loop:
lda gr_offsets,X
sta GBASL
lda gr_offsets+1,X
clc
adc #$8 ; store to $C00
sta GBASH
lda #$CC ; COLOR_LIGHTGREEN
; FIXME: should be GROUNDCOLOR
ldy #0
battle_ground_inner:
sta (GBASL),Y
iny
cpy #40
bne battle_ground_inner
inx
inx
cpx #40
bne battle_ground_loop
; Draw some background images for variety?
rts
.endif
plains_animation:
.word plains_anim01
.word plains_anim02
.word plains_anim03
.word plains_anim04
.word plains_anim05
.word plains_anim06
.word plains_anim07
.word plains_anim08
.word plains_anim09
.word plains_anim10
.word plains_battle

View File

@ -87,6 +87,7 @@
.include "tfv_sprites.inc"
.include "battle_sprites.inc"
.include "graphics_map/tfv_backgrounds.inc"
.include "graphics_battle/battle_graphics.inc"
;===============================================
; Sound