mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-03-11 21:37:37 +00:00
lemm: clean up the text a bit
This commit is contained in:
parent
64d38d1cc2
commit
ccf6cf974d
201
games/lemm/gr_fast_clear.s
Normal file
201
games/lemm/gr_fast_clear.s
Normal file
@ -0,0 +1,201 @@
|
|||||||
|
;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_top
|
||||||
|
;=========================================================
|
||||||
|
; clear DRAW_PAGE
|
||||||
|
; original = 14,558 cycles(?) 15ms, 70Hz
|
||||||
|
; OPTIMIZED MAX (page0,48rows): 45*120+4+6 = 5410 = 5.4ms 185Hz
|
||||||
|
; (pageX,40rows): 50*120+4+6 = 6010 = 6.0ms 166Hz
|
||||||
|
; 50*120+4+6+37 = 6055 = 6.0ms 166Hz
|
||||||
|
clear_top:
|
||||||
|
lda #0 ; 2
|
||||||
|
clear_top_a:
|
||||||
|
sta COLOR ; 3
|
||||||
|
clc ; 2
|
||||||
|
lda DRAW_PAGE ; 3
|
||||||
|
|
||||||
|
adc #4 ; 2
|
||||||
|
sta __ctf+2 ; 3
|
||||||
|
sta __ctf+5 ; 3
|
||||||
|
adc #1 ; 2
|
||||||
|
sta __ctf+8 ; 3
|
||||||
|
sta __ctf+11 ; 3
|
||||||
|
adc #1 ; 2
|
||||||
|
sta __ctf2+2 ; 3
|
||||||
|
sta __ctf2+5 ; 3
|
||||||
|
adc #1 ; 2
|
||||||
|
sta __ctf2+8 ; 3
|
||||||
|
sta __ctf2+11 ; 3
|
||||||
|
|
||||||
|
|
||||||
|
ldy #120 ; 2
|
||||||
|
lda COLOR ; 3
|
||||||
|
clear_top_fast_loop:
|
||||||
|
__ctf:
|
||||||
|
sta $400,Y ; 5
|
||||||
|
sta $480,Y ; 5
|
||||||
|
sta $500,Y ; 5
|
||||||
|
sta $580,Y ; 5
|
||||||
|
|
||||||
|
cpy #80 ; 2
|
||||||
|
bpl no_draw_bottom ; 2nt/3
|
||||||
|
__ctf2:
|
||||||
|
sta $600,Y ; 5
|
||||||
|
sta $680,Y ; 5
|
||||||
|
sta $700,Y ; 5
|
||||||
|
sta $780,Y ; 5
|
||||||
|
no_draw_bottom:
|
||||||
|
|
||||||
|
dey ; 2
|
||||||
|
bpl clear_top_fast_loop ; 2nt/3
|
||||||
|
|
||||||
|
rts ; 6
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;=========================================================
|
||||||
|
; 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
|
||||||
|
|
||||||
|
|
||||||
|
;clear_screens_notext:
|
||||||
|
;===================================
|
||||||
|
; Clear top/bottom of page 0
|
||||||
|
;===================================
|
||||||
|
|
||||||
|
; lda #$0
|
||||||
|
; sta DRAW_PAGE
|
||||||
|
; jsr clear_all
|
||||||
|
|
||||||
|
;===================================
|
||||||
|
; Clear top/bottom of page 1
|
||||||
|
;===================================
|
||||||
|
|
||||||
|
; lda #$4
|
||||||
|
; sta DRAW_PAGE
|
||||||
|
; jsr clear_all
|
||||||
|
|
||||||
|
; 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_all
|
||||||
|
;=========================================================
|
||||||
|
; clear 48 rows
|
||||||
|
|
||||||
|
clear_all:
|
||||||
|
clc ; 2
|
||||||
|
lda DRAW_PAGE ; 3
|
||||||
|
|
||||||
|
adc #4 ; 2
|
||||||
|
sta __caf+2 ; 3
|
||||||
|
sta __caf+5 ; 3
|
||||||
|
adc #1 ; 2
|
||||||
|
sta __caf+8 ; 3
|
||||||
|
sta __caf+11 ; 3
|
||||||
|
adc #1 ; 2
|
||||||
|
sta __caf2+2 ; 3
|
||||||
|
sta __caf2+5 ; 3
|
||||||
|
adc #1 ; 2
|
||||||
|
sta __caf2+8 ; 3
|
||||||
|
sta __caf2+11 ; 3
|
||||||
|
|
||||||
|
|
||||||
|
ldy #120 ; 2
|
||||||
|
clear_all_color:
|
||||||
|
lda #' '|$80 ; 2
|
||||||
|
clear_all_fast_loop:
|
||||||
|
__caf:
|
||||||
|
sta $400,Y ; 5
|
||||||
|
sta $480,Y ; 5
|
||||||
|
sta $500,Y ; 5
|
||||||
|
sta $580,Y ; 5
|
||||||
|
__caf2:
|
||||||
|
sta $600,Y ; 5
|
||||||
|
sta $680,Y ; 5
|
||||||
|
sta $700,Y ; 5
|
||||||
|
sta $780,Y ; 5
|
||||||
|
|
||||||
|
dey ; 2
|
||||||
|
bpl clear_all_fast_loop ; 2nt/3
|
||||||
|
|
||||||
|
rts ; 6
|
@ -1,11 +1,27 @@
|
|||||||
|
|
||||||
|
;=====================================
|
||||||
|
; print the intro message for level1
|
||||||
|
;=====================================
|
||||||
|
|
||||||
intro_level1:
|
intro_level1:
|
||||||
|
|
||||||
|
; clear text screen
|
||||||
|
|
||||||
|
jsr clear_all
|
||||||
|
|
||||||
|
; print non-inverse
|
||||||
|
|
||||||
|
jsr set_normal
|
||||||
|
|
||||||
|
; print messages
|
||||||
|
|
||||||
lda #<level1_intro_text
|
lda #<level1_intro_text
|
||||||
sta OUTL
|
sta OUTL
|
||||||
lda #>level1_intro_text
|
lda #>level1_intro_text
|
||||||
sta OUTH
|
sta OUTH
|
||||||
|
|
||||||
|
; print the text
|
||||||
|
|
||||||
ldx #8
|
ldx #8
|
||||||
text_loop:
|
text_loop:
|
||||||
|
|
||||||
@ -14,6 +30,8 @@ text_loop:
|
|||||||
dex
|
dex
|
||||||
bne text_loop
|
bne text_loop
|
||||||
|
|
||||||
|
; wait until keypress
|
||||||
|
|
||||||
jsr wait_until_keypress
|
jsr wait_until_keypress
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
@ -391,7 +391,7 @@ load_song_chunk_good:
|
|||||||
.include "wait_keypress.s"
|
.include "wait_keypress.s"
|
||||||
|
|
||||||
; .include "print_help.s"
|
; .include "print_help.s"
|
||||||
; .include "gr_fast_clear.s"
|
.include "gr_fast_clear.s"
|
||||||
|
|
||||||
|
|
||||||
.include "hgr_14x14_sprite.s"
|
.include "hgr_14x14_sprite.s"
|
||||||
|
@ -60,86 +60,23 @@ done_print_string:
|
|||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
; set normal text
|
||||||
|
set_normal:
|
||||||
|
lda #$80
|
||||||
|
sta ps_smc1+1
|
||||||
|
|
||||||
.if 0
|
lda #09 ; ora
|
||||||
;================================
|
sta ps_smc1
|
||||||
; move and print a list of lines
|
|
||||||
;================================
|
rts
|
||||||
move_and_print_list:
|
|
||||||
jsr move_and_print
|
; restore inverse text
|
||||||
ldy #0
|
set_inverse:
|
||||||
lda (OUTL),Y
|
lda #$29
|
||||||
bpl move_and_print_list
|
sta ps_smc1
|
||||||
|
lda #$3f
|
||||||
|
sta ps_smc1+1
|
||||||
|
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;================================
|
|
||||||
; move and print a list of lines
|
|
||||||
;================================
|
|
||||||
move_and_print_list_both_pages:
|
|
||||||
lda DRAW_PAGE
|
|
||||||
pha
|
|
||||||
|
|
||||||
lda OUTL
|
|
||||||
pha
|
|
||||||
lda OUTH
|
|
||||||
pha
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
sta DRAW_PAGE
|
|
||||||
|
|
||||||
jsr move_and_print_list
|
|
||||||
|
|
||||||
pla
|
|
||||||
sta OUTH
|
|
||||||
pla
|
|
||||||
sta OUTL
|
|
||||||
|
|
||||||
lda #4
|
|
||||||
sta DRAW_PAGE
|
|
||||||
|
|
||||||
jsr move_and_print_list
|
|
||||||
|
|
||||||
pla
|
|
||||||
sta DRAW_PAGE
|
|
||||||
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;=======================
|
|
||||||
; print to both pages
|
|
||||||
;=======================
|
|
||||||
print_both_pages:
|
|
||||||
lda DRAW_PAGE
|
|
||||||
pha
|
|
||||||
|
|
||||||
lda OUTL
|
|
||||||
pha
|
|
||||||
lda OUTH
|
|
||||||
pha
|
|
||||||
|
|
||||||
lda #0
|
|
||||||
sta DRAW_PAGE
|
|
||||||
|
|
||||||
jsr move_and_print
|
|
||||||
|
|
||||||
pla
|
|
||||||
sta OUTH
|
|
||||||
pla
|
|
||||||
sta OUTL
|
|
||||||
|
|
||||||
lda #4
|
|
||||||
sta DRAW_PAGE
|
|
||||||
|
|
||||||
jsr move_and_print
|
|
||||||
|
|
||||||
pla
|
|
||||||
sta DRAW_PAGE
|
|
||||||
|
|
||||||
|
|
||||||
rts
|
|
||||||
.endif
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user