From a91dd48187634c5cb72700cc25aa055f8ab0ba8b Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Tue, 5 Nov 2019 23:09:00 -0500 Subject: [PATCH] ds: add text to open book --- demosplash/demosplash.s | 4 +- demosplash/gr_clear_bottom.s | 80 ++++++++++++++++++++++++++++++++++++ demosplash/keyboard.s | 2 +- demosplash/open_book.s | 43 +++++++++++++++---- 4 files changed, 118 insertions(+), 11 deletions(-) create mode 100644 demosplash/gr_clear_bottom.s diff --git a/demosplash/demosplash.s b/demosplash/demosplash.s index 352a3207..128e506f 100644 --- a/demosplash/demosplash.s +++ b/demosplash/demosplash.s @@ -185,8 +185,10 @@ wait_until_keypressed: .include "gr_copy.s" .include "gr_offsets.s" -;.include "text_print.s" +.include "text_print.s" .include "gr_pageflip.s" +.include "gr_clear_bottom.s" + .align $100 .include "gr_fast_clear.s" .include "gr_overlay.s" diff --git a/demosplash/gr_clear_bottom.s b/demosplash/gr_clear_bottom.s new file mode 100644 index 00000000..8b99a3d0 --- /dev/null +++ b/demosplash/gr_clear_bottom.s @@ -0,0 +1,80 @@ +;clear_screens: +; ;=================================== +; ; Clear top/bottom of page 0 +; ;=================================== +; +; lda #$0 +; sta DRAW_PAGE +; jsr clear_top +; jsr clear_bottom + +; ;=================================== +; ; Clear top/bottom of page 1 +; ;=================================== +; +; lda #$4 +; sta DRAW_PAGE +; jsr clear_top +; jsr clear_bottom +; +; rts + +;clear_bottoms: + +; lda DRAW_PAGE +; pha + + ;=================================== + ; Clear bottom of page 0 + ;=================================== + +; lda #$0 +; sta DRAW_PAGE +; jsr clear_bottom + + ;=================================== + ; Clear bottom of page 1 + ;=================================== + +; lda #$4 +; sta DRAW_PAGE +; jsr clear_bottom + +; pla +; sta DRAW_PAGE + +; rts + + ;========================================================= + ; clear_bottom + ;========================================================= + ; clear bottom of draw page + +clear_bottom: + clc ; 2 + lda DRAW_PAGE ; 3 + + adc #6 ; 2 + sta __cbf2+2 ; 3 + sta __cbf2+5 ; 3 + adc #1 ; 2 + sta __cbf2+8 ; 3 + sta __cbf2+11 ; 3 + + + ldy #120 ; 2 + lda #$a0 ; Normal Space ; 2 +clear_bottom_fast_loop: +__cbf2: + sta $600,Y ; 5 + sta $680,Y ; 5 + sta $700,Y ; 5 + sta $780,Y ; 5 + + dey ; 2 + cpy #80 ; 2 + bpl clear_bottom_fast_loop ; 2nt/3 + + rts ; 6 + + diff --git a/demosplash/keyboard.s b/demosplash/keyboard.s index 4ece3811..87a18be4 100644 --- a/demosplash/keyboard.s +++ b/demosplash/keyboard.s @@ -452,7 +452,7 @@ change_state_clear_gait: starbase_keypresses: ; in room 0 .byte 'L',180 ; start charging laser, wait 180 - .byte 'L',2 ; release, blasting door, wait 2 + .byte 'L',10 ; release, blasting door, wait 2 .byte 'D',20 ; walk right .byte 'D',180 ; run right .byte 'A',2 ; walk left ; turn diff --git a/demosplash/open_book.s b/demosplash/open_book.s index fbe64ec8..71dec760 100644 --- a/demosplash/open_book.s +++ b/demosplash/open_book.s @@ -8,10 +8,7 @@ open_book: ;=================== ; init screen -; jsr TEXT -; jsr HOME - bit KEYRESET - jsr gr_clear_all +; jsr gr_clear_all ;=================== ; init vars @@ -21,13 +18,36 @@ open_book: ; GR part bit PAGE0 - bit FULLGR ; 4 + bit FULLGR - ;================================================ - ; Display Loop - ;================================================ + lda #book00_rle + sta GBASH + lda #$4 + jsr load_rle_gr + + jsr clear_bottom + bit TEXTGR + + lda #open_book_text + sta OUTH + + jsr move_and_print + jsr move_and_print + + + lda #200 + jsr long_wait + lda #200 + jsr long_wait + + + ; continue with animation -book_open_loop: lda #open_book_sequence sta INTRO_LOOPH + bit FULLGR ; 4 + jsr run_sequence lda #100 @@ -73,3 +95,6 @@ open_book_sequence: .byte 0 .word book10_rle +open_book_text: + .byte 1,21,"MEANWHILE AT A DISTANT STARBASE PRISON",0 + .byte 3,22,"AN INTERESTING PACKAGE IS RECEIVED",0