From 3711c5431eecf8f20b972352ed72256458c4d36d Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Tue, 19 Jan 2021 12:20:53 -0500 Subject: [PATCH] tfv: get rotate always working --- games/tfv/README | 20 ++++++++++++++++++++ games/tfv/multiply_fast.s | 16 ++++++++++------ games/tfv/rotate_intro.s | 6 +++--- games/tfv/tfv_battle.s | 4 ++-- games/tfv/tfv_overworld.s | 3 +++ games/tfv/tfv_world.s | 6 ++++++ 6 files changed, 44 insertions(+), 11 deletions(-) diff --git a/games/tfv/README b/games/tfv/README index 194434ab..1c95fe6d 100644 --- a/games/tfv/README +++ b/games/tfv/README @@ -17,6 +17,26 @@ populate all 48k of RAM). + + + +Memory Map +~~~~~~~~~~ +$00 zero page +$01 stack +$02-$03 ?? +$04-$07 lores page 1 +$08-$0b lores page 2 +$0c-$0f background graphics +$10-$1f ?? +$20-??? code +$B6-$BD multiply tables + + + + + + Mode7 Optimization Notes ~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/games/tfv/multiply_fast.s b/games/tfv/multiply_fast.s index ccebde03..b6f39511 100644 --- a/games/tfv/multiply_fast.s +++ b/games/tfv/multiply_fast.s @@ -29,13 +29,13 @@ ; square2_hi = >(((I-255)*(I-255))/4) ; Note: DOS3.3 starts at $9600 +; I/O starts at $c000 + +square1_lo = $B600 +square1_hi = $B800 +square2_lo = $BA00 +square2_hi = $BC00 -.ifndef square1_lo -square1_lo = $8E00 -square1_hi = $9000 -square2_lo = $9200 -square2_hi = $9400 -.endif ; for(i=0;i<512;i++) { ; square1_lo[i]=((i*i)/4)&0xff; @@ -44,6 +44,10 @@ square2_hi = $9400 ; square2_hi[i]=(( ((i-255)*(i-255))/4)>>8)&0xff; ; } + + ; note, don't run these more than once? + ; why not? oh, smc that we don't reset + init_multiply_tables: ; Build the add tables diff --git a/games/tfv/rotate_intro.s b/games/tfv/rotate_intro.s index 923bd59c..83b0cb17 100644 --- a/games/tfv/rotate_intro.s +++ b/games/tfv/rotate_intro.s @@ -6,7 +6,7 @@ rotate_intro: ; init the multiply routines - jsr init_multiply_tables +; jsr init_multiply_tables ; first copy current screen to background @@ -59,8 +59,8 @@ done_rotate: ; gr_copy_current_to_offscreen 40x40 ;========================================================= ; Copy draw page to $c00 - ; Take image in 0xc00 - ; Copy to DRAW_PAGE + ; Take image in DRAW_PAGE + ; Copy to $c00 ; Actually copy lines 0..39 ; Don't over-write bottom 4 lines of text gr_copy_current_to_offscreen_40x40: diff --git a/games/tfv/tfv_battle.s b/games/tfv/tfv_battle.s index 95ff99fb..2e839ae3 100644 --- a/games/tfv/tfv_battle.s +++ b/games/tfv/tfv_battle.s @@ -29,8 +29,8 @@ do_battle: sta ENEMY_ATTACKING ; FIXME: set limit break - lda #3 - sta HERO_LIMIT +; lda #3 +; sta HERO_LIMIT ; start battle count part-way in lda #20 diff --git a/games/tfv/tfv_overworld.s b/games/tfv/tfv_overworld.s index 4f3e3e59..68b054a1 100644 --- a/games/tfv/tfv_overworld.s +++ b/games/tfv/tfv_overworld.s @@ -35,6 +35,9 @@ handle_overworld: lda #$1 sta REFRESH + lda #3 + sta HERO_LIMIT + lda #5 sta MAP_X diff --git a/games/tfv/tfv_world.s b/games/tfv/tfv_world.s index 9bda52d7..72b0a96b 100644 --- a/games/tfv/tfv_world.s +++ b/games/tfv/tfv_world.s @@ -10,6 +10,12 @@ ; Clear screen and setup graphics ;================================ + ;================================ + ; Init Variables + ;================================ + + jsr init_multiply_tables + ;===================== ; Handle Overworld ;=====================