From 960339242d33836c7af72962e85049ffae6b4757 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 31 May 2023 17:06:35 -0400 Subject: [PATCH] sb: fix up scroll intro --- games/sb/Makefile | 2 +- games/sb/hardware.inc | 11 ++--- games/sb/hgr_logo_scroll.s | 88 ++++++++++++++++++++++++++++++++++++++ games/sb/purple.s | 5 +-- games/sb/title.s | 14 +++--- 5 files changed, 106 insertions(+), 14 deletions(-) create mode 100644 games/sb/hgr_logo_scroll.s diff --git a/games/sb/Makefile b/games/sb/Makefile index 65c860c0..d75bfeaf 100644 --- a/games/sb/Makefile +++ b/games/sb/Makefile @@ -78,7 +78,7 @@ TITLE: title.o title.o: title.s zx02_optim.s \ zp.inc hardware.inc \ - hgr_vscroll.s audio.s \ + hgr_logo_scroll.s audio.s \ purple.s lc_detect.s \ sound/purple.btc.zx02 \ graphics/czmg4ap_title.hgr.zx02 \ diff --git a/games/sb/hardware.inc b/games/sb/hardware.inc index 83a10a6c..bcc421c4 100644 --- a/games/sb/hardware.inc +++ b/games/sb/hardware.inc @@ -23,12 +23,13 @@ PADDLE_BUTTON0 = $C061 PADDL0 = $C064 PTRIG = $C070 -;; BASIC ROUTINES - -NORMAL = $F273 - -;; MONITOR ROUTINES +;================= +; ROM ROUTINES +;================= +; note we can't use these if language card RAM switched in +NORMAL = $F273 +HGR = $F3E2 HLINE = $F819 ;; HLINE Y,$2C at A VLINE = $F828 ;; VLINE A,$2D at Y CLRSCR = $F832 ;; Clear low-res screen diff --git a/games/sb/hgr_logo_scroll.s b/games/sb/hgr_logo_scroll.s new file mode 100644 index 00000000..31cb4e5b --- /dev/null +++ b/games/sb/hgr_logo_scroll.s @@ -0,0 +1,88 @@ + ;================================ + ; HGR vscroll + ;================================ + ; image to scroll in is in $4000 + ; + +hgr_vscroll: + + ldx #191 ; 2 + stx SCROLL ; SCROLL = 0 ; 3 + +vscroll_loop: + + ;==================== + ; draw bottom part + + lda #0 ; 2 + sta SCROLL_OFFSET ; offset in logo ; 3 + ldx SCROLL ; offset in screen ; 3 +vscroll_bottom: + + cpx #192 ; 2 + bcc regular_scroll ; 2/3 + + lda #$20 + sta vscroll_in_smc+2 + sta vscroll_out_smc+2 + lda #$00 + sta vscroll_in_smc+1 + sta vscroll_out_smc+1 + beq done_scroll_setup + +regular_scroll: + ldy SCROLL_OFFSET ; 3 + lda hposn_high,Y ; 4 + eor #$60 ; $20->$40 ; 2 + sta vscroll_in_smc+2 ; INH ; 4 + lda hposn_low,Y ; 4 + sta vscroll_in_smc+1 ; INL ; 4 + ;==== + ; 21 + + + + lda hposn_high,X ; 4 + sta vscroll_out_smc+2 ; OUTH ; 4 + lda hposn_low,X ; 4 + sta vscroll_out_smc+1 ; OUTL ; 4 + ;==== + ; 21 +done_scroll_setup: + + inc SCROLL_OFFSET ; 5 + + + ldy #39 ; 2 +vscroll_bottom_line: + +vscroll_in_smc: + lda $A000,Y ; 4 +vscroll_out_smc: + sta $2000,Y ; 5 + dey ; 2 + bpl vscroll_bottom_line ; 2/3 + ;===== + ; 2+40*(14)-1 + ; 561 + + inx ; 2 + + txa + sec + sbc SCROLL + cmp #58 + bcc vscroll_bottom + ;========== + ;5+96*(42+561+7)-1 + ; 58564 + +done_scroll: + + ;===================== + ; scroll whole screen + + dec SCROLL + bne vscroll_loop + + rts diff --git a/games/sb/purple.s b/games/sb/purple.s index f84428d2..80476aa0 100644 --- a/games/sb/purple.s +++ b/games/sb/purple.s @@ -25,10 +25,9 @@ play_purple: ldx #PURPLE_LENGTH ; 28 pages long??? jsr play_audio - ; read/write RAM, $d000 bank 2 + ; read ROM/no-write - bit $c08B - bit $c08B + bit $c082 done_play_purple: rts diff --git a/games/sb/title.s b/games/sb/title.s index 7ed4b06d..e4b52355 100644 --- a/games/sb/title.s +++ b/games/sb/title.s @@ -14,10 +14,11 @@ hires_start: ;=================== jsr HOME - bit HIRES + jsr HGR +; bit HIRES bit FULLGR - bit SET_GR - bit PAGE1 +; bit SET_GR +; bit PAGE1 ;==================== ; set up tables @@ -64,6 +65,9 @@ yes_language_card: jsr full_decomp + ; read ROM/no-write + bit $C082 + no_language_card: @@ -86,7 +90,7 @@ scroll_logo: sta ZX0_src+1 - lda #$A0 + lda #$40 jsr full_decomp @@ -152,7 +156,7 @@ done: .include "zx02_optim.s" .include "hgr_tables.s" - .include "hgr_vscroll.s" + .include "hgr_logo_scroll.s" .include "audio.s" .include "purple.s" .include "lc_detect.s"