|
;[FC][最终任务mapper1切页程序]
6 F4 s0 Q' L0 `! @ .ORG $CD9B7 c4 ^; H4 V$ o3 V% g$ n- ^
BANK_START:. ~$ A( y7 j/ R* g Z( h
STA $708 g" b, A3 a( [+ l( |9 U
TXA' B$ l2 B1 Y% ^0 ^; P! }
ASL
: g, w7 Y( _2 K; Q TAX
: g% e0 m1 b7 t v3 R/ @" T7 i6 RPORT_SET:( `" c. o# j6 v' ^. g. ?# S0 Q2 F/ c
LDA BANK_DATA,X2 G3 E7 `. W' O [
STA $6E( E: C% f# C+ u) E
LDA $CDB8,X$ N5 u' o/ h( g, H3 G& W
STA $6F
% @" G3 ~7 D; b: d LDY #$00
0 Y/ y0 W6 A' ` LDX #$05
% s# t0 @8 i; f! }6 p4 f6 z LDA $70. b; c! O* L _2 _
PORT_WRITE: z7 E- v! w" U5 h6 f1 y% b0 V. f
STA ($6E),Y/ t) Q( x. N3 u0 D! y5 P1 d
LSR8 n$ @- b% a2 ]( K
DEX
# ?( l4 X/ J* Q0 ?+ d( m( f4 ~" o BNE PORT_WRITE
( z/ S9 ~5 Z5 C( s RTS9 e0 ^! I+ I4 Y, @9 O
6 S W- f( @2 J1 ]* k. ~$ I9 q - F$ N# Q/ y# h
BANK_DATA:. U% N. w, y: l( y1 O& c. p0 X
.BYTE $00,$80,$FF,$BF,$00,$C0,$FF,$FF
0 d7 _$ H" g1 e' H
4 d- w9 e& s2 f8 c
* H6 D' e1 r5 y3 q! u7 b;[FC][最终任务mapper1转mapper4切页程序]1 a( s# N6 u3 X7 l
.ORG $BFD2 ;初始化跳转
?7 V9 E+ t! W$ w4 A/ m% \ JSR $FFC00 U' A0 U3 r4 m# M8 J: \
' X2 q8 `. Q+ j) M7 ?, F1 X
# d$ ]( `* k8 j) U/ a6 O+ m
.ORG $FFC0 ;切页# H, |/ d+ d/ u% M2 P% ?4 y3 n7 @5 n
LDA #$062 X# _3 {; y( Z' l' Y
STA $80002 B/ x. l, e0 T
LDA #$0E: F3 w h d) I( r" l3 y" @
STA $8001' n( l+ z9 j' R! H& x. }2 `
JSR $8000
$ D) d, a& m, P% Y( b RTS
# Y9 X) m9 A+ c- c2 T ( o8 b9 y, D! r- o' M# y
.ORG $8000 ;数据复制$ }1 [5 d2 K% y; I" |; M* F7 c
LDA #$80, W" d6 I. r7 B, Q: U" S( ]3 v3 b
STA $A001 ;启用SRAM- N+ o- Y5 S! y2 H: j
PHA
0 T' Y3 Z, |4 J4 j0 d1 h' H TXA+ e2 u0 _4 P; R: T3 b2 t
PHA
+ u" D6 L6 N' O" K LDX #$00- U- g$ i( }2 g8 I& J
DATACOPY: ;数据复制. ?% u1 l* \% H$ K- y2 W
LDA $8100,X; o% w9 h M& ]0 l7 W! i
STA $7200,X. \) R6 Z% a8 _4 s6 ~
INX
4 s9 ^* B$ i6 _1 Q9 m; Z* v8 H+ | CPX #$00: v8 r: S( \5 ~8 D, {+ c
BNE DATACOPY; M1 X# c; B+ K f- w( ]( P# d* i
PLA
6 h5 X! F ?( j$ d2 Y5 ]3 H TAX
, }6 |" I3 l4 P( B4 t1 y PLA
" X5 _8 n& m, j. A( [ i2 h RTS
0 t$ e. a( m5 m Y1 P' l. H # J8 s& ^4 ^: J4 _9 b- s
.ORG $CD9B ;跳转到转换的切页程序
+ w4 C& r5 h, P/ v/ e" D# u STA $70: o+ G8 V" F4 p
JSR $7200
2 a, s! V* f5 z! q) Z& C RTS
7 J7 a( ^# ]( C. c- E }
( I+ ]0 N0 C: R+ Y .ORG $7300: B C; R8 |- o' V
M1_TO_M4: ;切页程序3 x' p2 [/ s( q
CPX #$002 p$ f/ j1 y; N: ]! i
BEQ REG_SET1 q. V& b- R, |1 E: `$ x" l$ N
CPX #$019 s' e! J+ f: D" O
BEQ PPU_BANK_0000
* e' U" J9 v. V1 c& G4 r CPX #$02- E# h9 }4 c# l; j% ^2 B
BEQ PPU_BANK_10008 r5 B2 L. e) C& a* T. I9 A
CPX #$038 ]4 k/ N W% [& x; d% R: m
BEQ PRG_BANK
4 ]. y% k0 V/ ]; S/ ~REG_SET:
0 q- G7 ?, H1 T! _. U STA $A000
8 O% L$ R N4 K2 o RTS: e9 U" K; j3 p4 b/ T7 U: P
.ORG $7320! A+ ^, D0 |( H! X0 ?
PRG_BANK: ;PRG切页
8 z" J& m5 d4 ~( w+ h* t PHA+ f: n9 h* n' g
LDA #$06
# w% P6 ]3 E& S( Y! p# Z STA $8000
, K! g' c0 p. a; \+ u PLA
- k. T5 H2 c- \, t ASL
5 i, L3 y) q5 L7 W4 `$ C7 S STA $8001
2 e: z, P1 o1 c0 m ORA #$01+ f" s! a* B8 x& E: z s$ c
PHA+ }3 S' B) H: r# ?1 E! B& C
LDA #$07
+ p1 T9 K/ B# z0 M+ R/ V STA $8000
" R. c3 f. z# U% z6 z PLA
( h% [/ Z: m2 P6 `3 }: F1 Z" _ STA $8001
% \& M0 S) c b( S% q! D RTS2 D2 \# Z5 b, i+ m/ v
.ORG $7340
n9 z, \% y7 H4 ^PPU_BANK_0000: ;精灵切页
( v/ {# \: b4 }, `% g& h- z {4 D PHA
6 u' F' t6 L5 D1 J7 }' I# t: h ASL
- T1 c( ~6 E: n; G* h& z ASL( x7 N6 q6 G+ i1 B4 T
PHA$ i V# W6 ^6 E0 T0 _7 d
LDA #$00
( F: t1 ?; Q" S STA $8000- ]& D2 z7 `/ E. l4 E: _# M' ^+ r
PLA
2 _) M; p( ?7 n$ I STA $8001/ o& V b$ D0 |: }* d$ ~0 P8 `
ADC #$02
! e+ Y" ?# j; P* A* t# @ PHA
( @6 _, b6 @8 R. g8 X LDA #$017 W: z( E7 p. F4 a! V0 _! |
STA $8000, x7 f3 K% M/ S9 M8 f
PLA n6 v4 [1 A) C# L6 f
STA $8001" p1 l8 J$ D; @$ J. W) m4 [
PLA
' `" S) y9 a. t3 c# h: M RTS
6 ]: O1 O7 ~. e4 f
0 C: a8 D5 l0 D$ N! b' T3 d .ORG $7360
7 m' x9 z' t0 H0 D/ z* KPPU_BANK_1000: ;背景切页
' \; Z. f- ^. x L" V PHA/ z: N8 S: }1 C, ]4 l1 g
ASL
" _ T3 v2 s3 O6 L; i' P ASL- K9 Z+ ^ ]9 h; i
PHA& _$ K* D4 l8 Z! _2 E' D
LDA #$02# o+ [+ b* B$ n4 h4 @' R* v
STA $8000
, S# ^1 O: R4 b# m4 j3 k& n PLA
* R2 o* L. Y) }) A STA $8001
^9 V: D1 _( A- f w; Z8 g# Z ADC #$01
' L* O" [, {# W& R& ~9 A" n# O PHA
9 r$ e1 o8 U: _! L6 `$ l2 l LDA #$03( n3 D8 O& N1 D8 A
STA $80000 Z- \' n, d4 I4 ]% \( G
PLA
- b4 ?0 R8 A$ S- A STA $8001
9 d, A4 B ]% g) R, n. c2 _ ADC #$01
. M- G) j6 R+ m7 O% N; O PHA
; d! G1 Q) r5 _. I LDA #$04/ r$ X. t& \3 W; K! e
STA $80003 o; A( ~' W7 j1 b
PLA5 }& l7 S- A( C# D+ n
STA $8001+ g, `, e/ C4 J$ J) `
ADC #$012 R4 N6 |7 h! t @! @* ~# f
PHA0 G* s5 O! }/ A! q: ]) ]
LDA #$05
( j, C9 X' o5 a& A% g STA $80001 o' ~ z# _# l4 I l, `+ J9 T
PLA/ Z4 n5 Q5 O! a$ e
STA $80017 g! l. p V! }! W
PLA; D. p# ?0 ^9 W- T B, U
RTS3 I8 O. U4 @+ ^! @8 W* `
% D5 _1 K! a9 g7 ` |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|