|
;[FC][最终任务mapper1切页程序]' W0 M. N. K% w# c% m; E' W
.ORG $CD9B
& l1 k6 u) V! z7 i1 f$ R" l% D' m9 e+ eBANK_START:
7 q% H: N3 ~, [. f STA $70
2 O% C5 h' x: y' E4 b6 z' u; u TXA! `" D; ]1 D5 Q: p) T/ a
ASL
5 w k$ Q$ t; p* Y TAX
" c3 X. s! @3 v0 F" p; }3 b# }PORT_SET:' M; K! i1 q# }. G
LDA BANK_DATA,X
8 e% j& O9 S+ x$ G" M* i0 a7 K' {& M STA $6E
) K6 ], _+ v F0 a) i* }0 y+ ~ LDA $CDB8,X
9 g8 s l5 q4 `( Z STA $6F5 r g, P) @- G. f: K
LDY #$00. J7 T' _. \6 c8 |1 l
LDX #$05
, F2 x9 d4 r8 K0 h& w LDA $706 u. R7 X* E3 a5 `
PORT_WRITE:/ @! u! C' |9 x
STA ($6E),Y. |& \# D$ \: ~
LSR
5 ]% R5 i: C% W! {- b0 D p DEX7 T4 |: x& t- l* n1 v
BNE PORT_WRITE0 Z, j* {3 N- m" _5 R) J
RTS
6 R. t7 x- Z+ W. x5 ?* S 4 c; u; g! \6 J7 Y4 C
( F9 W' |& Y0 R+ A6 W' M
BANK_DATA:2 Z) F( ?2 u) |" ^
.BYTE $00,$80,$FF,$BF,$00,$C0,$FF,$FF
7 d/ y8 s: ~ b3 n0 R) E
& ]. y i" P# A; C6 \
; @$ ?4 e+ N: a$ h% K5 k;[FC][最终任务mapper1转mapper4切页程序]
# a1 K, T* ?3 H7 B( Y% e0 ]) S .ORG $BFD2 ;初始化跳转/ a; A8 @& o$ l
JSR $FFC0
# {$ A/ D% `* g6 z
8 A; @, S( q/ i
: V" |$ |9 [4 J4 O1 f .ORG $FFC0 ;切页
- }" }7 M) n F: h LDA #$06: L. s* G( ~2 P( y4 m' \& q
STA $8000
7 M: M$ u$ b4 `: x9 } LDA #$0E7 K! V+ D& y( {8 R
STA $8001
1 T' p- ~6 \5 L4 V: ] JSR $8000 J7 G5 B/ U. e( ]2 ~1 R ]9 y& q
RTS 8 t$ m0 J3 R* ~0 m0 P5 u
# j5 i* W. }: @; Z7 E4 a
.ORG $8000 ;数据复制5 @- H* P) [( D% ?
LDA #$80
8 l- Z0 k5 o2 ? STA $A001 ;启用SRAM
# Z! Y% f/ u. |) b% @ PHA
4 G/ ^0 F$ p; y# T5 m+ G$ ^ TXA
# D/ R% s0 {3 S Y# b0 i* O$ \ PHA. j' ~$ ^; i; w9 d
LDX #$00
; [ Y& e+ Y) [ KDATACOPY: ;数据复制2 t' S2 H4 C0 z: P
LDA $8100,X
; R3 W6 A2 S# n n8 |( ?9 Y STA $7200,X; |+ X; J% O; P w/ N% C
INX, `0 j+ l7 L+ O/ i* f
CPX #$00
2 S4 P6 O- @1 G4 W( ^( I BNE DATACOPY- R" `: \! x9 C
PLA/ g+ m p3 k& h4 z* ~3 F f1 d
TAX8 J" J" [0 u4 ~7 U# q1 Q: E" ]
PLA2 w. D% Q a% h1 D. }: w
RTS7 h# v6 L, E. T G% a# j6 p" I
3 f/ ^# j% _: b, I/ c5 }( `" @ .ORG $CD9B ;跳转到转换的切页程序
. K2 r& F, X$ N STA $70: L" G' z2 {% \ Q' P' |+ B
JSR $7200) `4 }0 J8 \# t! M% P- [/ a; Z2 n& u
RTS% i( {' H/ n" ^+ r3 H
: Z+ C: S: `0 s; X, _/ L- M .ORG $7300
, e; _2 }- v8 ?; {# tM1_TO_M4: ;切页程序) V3 D' o& J, P p4 w+ ?
CPX #$00& v- }6 J" ~6 N
BEQ REG_SET
$ c/ v- ]# g P% }' W CPX #$01) F( j6 i, v% V" h
BEQ PPU_BANK_0000- h( k8 V! J4 @
CPX #$02
% I9 |! _ O+ t+ H3 V: y/ ` BEQ PPU_BANK_1000
: G7 b" j0 S: s2 y8 q4 T CPX #$03. i9 P: K' ~3 k/ h
BEQ PRG_BANK
" r* Y w w& c5 @REG_SET:/ H0 t! d. M7 U, S- y, W v9 j! s
STA $A000
! g; ?: g& E2 L$ D$ z RTS$ y9 u, Y& ]0 |6 F2 f3 D
.ORG $7320, n# }6 G n1 n. |2 L
PRG_BANK: ;PRG切页/ l7 f7 m& v. O4 ]) w
PHA' F1 a* T. }: w2 ]! _" b
LDA #$06
" J+ W S" o; E; Z1 N STA $80002 d/ t* T$ _/ i: A" n
PLA# u- ]9 F, [" o% N0 x
ASL5 l2 Y; P" o- {8 t# i: a; S
STA $8001
) f$ t( j1 ]9 c! r ORA #$015 @1 a I5 n( l7 `/ Z
PHA5 ^# Y. ^9 l1 j! l
LDA #$07
7 c) E# U9 ^' W0 O STA $8000
4 |9 i! D6 [# C0 ~- ? PLA- K$ V" e" H; U9 A/ {, Z
STA $8001
; ~" T4 Z: E6 Y+ [: J8 B7 t% M RTS
" |: e* a+ n3 `, ^' o& ^* n .ORG $7340
( e" o& s+ v2 [: }' q, MPPU_BANK_0000: ;精灵切页# f: P) M' @( q: e; W7 y
PHA
3 [5 a" p* A3 Z- y+ P ASL7 k* ?& O5 X% ~1 X2 d
ASL4 _0 E3 A& [3 ^& F
PHA
3 K8 m" K, b1 Q' H9 k$ V LDA #$00
- p; z& z4 ? g* x4 |( W STA $8000( T5 d0 v3 O) [+ W G9 i) Z
PLA" v6 P/ A( j+ R( s2 o% w p F
STA $8001
( A6 x5 U0 @7 G" _ ADC #$02- \: d' q- \ G5 Z' c# i6 P! X
PHA
% p0 P0 ?6 }6 W a! @; s LDA #$01
3 |# J" o* z6 ?/ Z) i( Y, Y STA $8000* y, p8 u5 r6 ~: B- _. J3 `( l; C
PLA' l* |) V+ S- z$ v5 F) J! l c
STA $8001
* {0 D! U2 o8 L; g2 k% H9 D PLA! H Q. B, x! @. H: X( B6 }1 Q
RTS- K3 d, x: T: a0 I: N4 j1 Q7 n3 R
, |, F% B2 x0 Q" D, c* \
.ORG $7360$ i6 c+ f8 U( |6 L( o' L3 a
PPU_BANK_1000: ;背景切页
/ V3 N3 `0 _: x6 t PHA$ Y3 O4 g; ]) ]% Q4 o4 O0 @" ^
ASL
$ o3 z3 a8 u, N+ t' k ASL: q( r) ~1 A* A! i/ C) d/ @5 _) L
PHA4 A2 ?6 }/ C! Q/ O! [( o5 y$ Z- i
LDA #$02
$ K. A0 a( S2 B0 N STA $8000
! @# J4 }( U7 y8 Y PLA
; N& Z4 x% m+ X+ O5 F* S2 L) D STA $8001- [0 v& A W: O0 y& X; D
ADC #$01
! B1 b* V% V( a, W+ T8 U PHA+ _8 }$ N4 r6 c. w) d- H- x
LDA #$03+ q2 S0 K5 M2 L
STA $8000( o% v8 E$ m9 i* R }
PLA9 `# v' d5 h) S9 n+ z+ O7 O6 r
STA $8001
) V3 B* P% x$ _* f ADC #$017 f4 T& w/ X/ p8 p
PHA$ l3 g* i* ~ L" i7 F& _
LDA #$04, @+ c# L. t& f. b6 F( Q
STA $8000. P* l( e1 R3 ^
PLA/ F' d) `0 i% H& r, V8 \* T
STA $8001
\) k/ g' I8 }( ? ADC #$01$ y: ]4 J$ H0 w) m i7 ]5 U$ w: n
PHA
8 \3 ]) b) A! C, { LDA #$05! [% K" J2 q* F; H1 F
STA $8000) r1 o) U1 e* {; x' {% X
PLA
: ?# w$ d2 Y; \: @ X/ y STA $8001
0 ~* u' \9 v9 h' ?+ ` PLA" |) p5 V+ Y& n5 q5 e E* ^
RTS$ n" x, u3 I9 z6 p. z2 B8 I# ?
$ R7 o9 _. u2 z$ Y
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|