megamusic: stable language card code

This commit is contained in:
Vince Weaver 2018-10-28 00:40:07 -04:00
parent 236736decd
commit d69c3a24c1
2 changed files with 29 additions and 19 deletions

View File

@ -150,20 +150,17 @@ page1_loop: ; delay 115+(7 loop)+4 (bit)+4(extra)
; -1 (+1-2) from above ; -1 (+1-2) from above
; -25 inc framecount ; -25 inc framecount
; -7 see if timeout ; -7 see if timeout
;-1031 play_music ;-1038 play_music
; -10 keypress ; -10 keypress
;================ ;================
; 3476 ; 3469
jsr play_music ; 6+1025 jsr play_music ; 6+1032
; Try X=9 Y=68 cycles=3469
; Try X=29 Y=23 cycles=3474 R2 ldy #68 ; 2
faloop1:ldx #9 ; 2
nop
ldy #23 ; 2
faloop1:ldx #29 ; 2
faloop2:dex ; 2 faloop2:dex ; 2
bne faloop2 ; 2nt/3 bne faloop2 ; 2nt/3
dey ; 2 dey ; 2

View File

@ -75,22 +75,35 @@ MB_FRAME = $94
MB_PATTERN = $95 MB_PATTERN = $95
; takes ; takes
; 4 + ; 7 load pattern
; 3 + 79 + ; 11 lang card setup
; 80 + 82 + 88 + ; 76 smc
; 80 + 82 + 88 + ; 3 loop init
; 80 + 82 + 88 + ; 910 play music 80 + 82 + 88 + 80 + 82 + 88 + 80 + 82 + 88 + 80 + 80
; 80 + 80 + ; 25 end
; 25 = 1025 ;==========
; = 1032
play_music: play_music:
; turn on language card
lda $C088 ; 4
; self-modify the code ; self-modify the code
lda MB_PATTERN ; 3 lda MB_PATTERN ; 3
and #$1f ; 2 and #$1f ; 2
tay ; 2 tay ; 2
; if > 16 use $D000 PAGE2 of language card
cpy #16 ; 2
bcs use_page2 ; 3
use_page1:
; turn on language card ; -1
lda $C088 ; 4
jmp done_lang_card ; 3
use_page2:
lda $C080 ; 4
nop ; 2
done_lang_card:
lda mal_pattern,Y ; 4 lda mal_pattern,Y ; 4
sta mb_smc1+2 ; 4 sta mb_smc1+2 ; 4
lda mah_pattern,Y ; 4 lda mah_pattern,Y ; 4
@ -115,7 +128,7 @@ play_music:
lda mnh_pattern,Y ; 4 lda mnh_pattern,Y ; 4
sta mb_smc11+2 ; 4 sta mb_smc11+2 ; 4
;======= ;=======
; 79 ; 76