From 06d17bbbb30533b8a60c4fc33fbe0c0ee9fa40e2 Mon Sep 17 00:00:00 2001 From: Pecusx Date: Mon, 7 Aug 2023 09:51:35 +0200 Subject: [PATCH] Fade In/Out in manuals --- Manuals/manual.asm | 140 ++++++++++++++++++++++++++++++------------ Manuals/manual_pl.xex | Bin 35085 -> 35192 bytes 2 files changed, 102 insertions(+), 38 deletions(-) diff --git a/Manuals/manual.asm b/Manuals/manual.asm index 62e4de3..cc52273 100644 --- a/Manuals/manual.asm +++ b/Manuals/manual.asm @@ -22,6 +22,13 @@ STEREOMODE equ 0 .zpvar temp .word start + lda #0 + sta dmactls ; screen off + ldx #3 +@ sta COLOR0-1,x + dex + bpl @- + jsr WaitOneFrame jsr CheckPALorNTSC ldx #MODUL ;hi byte of RMT module to Y reg @@ -45,47 +52,30 @@ start mwa #man_text top_src vmain VBLANK,7 + + jsr MakeScreenCopy + + lda #@dmactl(standard|dma) ; standard screen width, DL on, P/M off + sta dmactls + jsr WaitOneFrame + jsr FadeIn main_loop bit escflag - spl:rts ; EXIT THIS WAY ---> - mwa top_src src - mwa #screen dest - - ldx #screen_height-1 -screen_copy - mwa top_src start_address - ldy #0 -@ - lda (src),y - cmp #$ff ; end of line marker - bne not_eol - sty next_line_begin - lda #$00 -@ sta (dest),y - iny - cpy #screen_width - bne @- - jmp next_line - -not_eol - sta (dest),y - iny - cpy #screen_width - bne @-1 - mva #screen_width-1 next_line_begin -next_line - adw dest #screen_width - ; adw src #screen_width - inc next_line_begin - clc - lda src - adc next_line_begin - sta src - scc:inc src+1 - - dex - bpl screen_copy + bpl NoEscape + ; EXIT THIS WAY ---> + jsr FadeOut + VMAIN XITVBV,7 ; jsr SetVBL (off user proc) + LDA #%01000000 ; DLI off + STA NMIEN + lda #0 ; screen off + sta dmactls + sta escflag + jsr WaitOneFrame + ; exit + jmp start +NoEscape + jsr MakeScreenCopy ; save the current end of the printed text source mwa src end_address @@ -137,6 +127,74 @@ scroll_up scs:mwa #man_text top_src jmp main_loop +;-------------------------------------------------- +.proc MakeScreenCopy + mwa top_src src + mwa #screen dest + + ldx #screen_height-1 +screen_copy + mwa top_src start_address + ldy #0 +@ + lda (src),y + cmp #$ff ; end of line marker + bne not_eol + sty next_line_begin + lda #$00 +@ sta (dest),y + iny + cpy #screen_width + bne @- + jmp next_line + +not_eol + sta (dest),y + iny + cpy #screen_width + bne @-1 + mva #screen_width-1 next_line_begin +next_line + adw dest #screen_width + ; adw src #screen_width + inc next_line_begin + clc + lda src + adc next_line_begin + sta src + scc:inc src+1 + + dex + bpl screen_copy + rts +.endp +;-------------------------------------------------- +.proc FadeIn + ldy #15 +FirstLoop + lda COLOR1 + cmp #13 + beq ColorOK + inc COLOR1 +ColorOK + jsr WaitOneFrame + dey + bpl FirstLoop + rts +.endp +;-------------------------------------------------- +.proc FadeOut + ldy #15 +FirstLoop + lda COLOR1 + beq ColorOK + dec COLOR1 +ColorOK + jsr WaitOneFrame + dey + bpl FirstLoop + rts +.endp ;-------------------------------------------------- .proc GetKey @@ -240,6 +298,12 @@ VBLANKEND jmp XITVBV .endp ;-------------------------------------------------- +.proc WaitOneFrame +;-------------------------------------------------- + waitRTC ; or wait ? + rts +.endp +;-------------------------------------------------- .proc CheckPALorNTSC ;-------------------------------------------------- lda $d014 ;http://www.myatari.com/nirdary.html diff --git a/Manuals/manual_pl.xex b/Manuals/manual_pl.xex index 07b808c86d52f6ecb20550c24909edd9b1cec46b..84a2151151443941872fdf88c96f2d51f37947a3 100644 GIT binary patch delta 199 zcmeC3#PnklljQ&Z0wT6zD;awAnHDk6JQ^I6vMia&dlLHvj*q4eN75VTdVe>Y|@OA*`wMU}> delta 93 zcmV-j0HXi+k^+sA0tx^B5ERlCAix!o88Z%wq7|tJAY9}uPB#z%V3Py^E&`7flQaP) z6{UcMhoymqh#(~u$q(=c$qw)?Oiq!WDgjQB$vFZ}6qA1eGy!~*v;k(bAp%#23sWFs