|
;[FC][最终任务mapper1切页程序]4 H {1 b/ K. E- u3 Z
.ORG $CD9B4 _, `3 ?- o: n$ X7 C& K
BANK_START:
+ P# d0 M: K+ Y" w2 f STA $70( k2 f! Y `) U4 H( Q7 N9 W
TXA
6 p; s7 c$ H8 e9 B+ Q ASL4 @+ [ A! z. a/ z4 H
TAX
# ^8 U* e# p% O XPORT_SET:
. G6 }% m/ z/ N, S M LDA BANK_DATA,X
/ C4 G2 H; i( X4 y: F6 {' k STA $6E2 \. f1 @ A1 A: R1 U
LDA $CDB8,X8 `" ~) @* y2 q+ F+ X7 N* Y
STA $6F
6 d6 W$ T" b8 S7 h# B- u LDY #$00: n% s( ^! X3 Q' V+ }* ~
LDX #$05
2 S% }$ x. W; [9 N5 ~ LDA $70) J) \( T* ^& Q5 ~) L
PORT_WRITE:+ l) ?% H2 U( o$ ~, j9 M+ } j4 X U
STA ($6E),Y8 _0 z( C" k/ |( @. e$ Z4 T
LSR' A5 f9 a% l1 @
DEX
9 y. |" Q6 ~" G9 n, | BNE PORT_WRITE/ }, q8 F2 _. w
RTS
8 ^3 Q' e I7 C M. x 1 b' X8 S J! g+ R' h: E K! b
2 L& v8 D& D2 R g
BANK_DATA:% ?; h$ s0 h) N5 ~9 b0 B6 i
.BYTE $00,$80,$FF,$BF,$00,$C0,$FF,$FF& R& U+ U, @; i. q- x% l
, f3 N# S8 k3 l X4 Z
3 Y# ~2 Q+ V) I: o% \;[FC][最终任务mapper1转mapper4切页程序]) z* t& @+ J8 z
.ORG $BFD2 ;初始化跳转% @& ~7 e( M, u' r; e
JSR $FFC0( J# e8 T- L* a- N! X
1 |- y) V3 i" j. ?% N$ y: H
( l" y) N% r/ ]& q+ g; q .ORG $FFC0 ;切页
: l0 J) o& |& k: J1 |3 H LDA #$06 ?: Y1 Q! ]2 s0 z
STA $8000
+ j! j& D: d2 b& Y% x4 e LDA #$0E* l/ U; e8 C- v7 M: o
STA $8001 [; r' Z, |: d- O" I: o, \
JSR $8000! c! u" n2 P# z/ W: f" _ I8 w# E
RTS 5 [; a5 r e7 }7 o
4 C( w) K3 B) A2 F& s6 t
.ORG $8000 ;数据复制
- s( D% d @: H$ d5 b LDA #$80) r( @ r' O6 I2 u7 I( d9 S
STA $A001 ;启用SRAM
! f. J: O) s( `7 M% t PHA
' [, h" E: X+ B TXA/ p' P% r) ?. W' ]' D, e. U- ]
PHA
& J4 G5 p. W) Q3 J# [5 J \- M, B LDX #$00
9 b- B+ P" J5 g7 LDATACOPY: ;数据复制& o: E$ T4 r' A) H
LDA $8100,X
! h* a* |. y' E( v; m$ k STA $7200,X
: r# R" g2 h* P; k2 L# Q+ ~6 ~4 u INX
( {' @; g9 A v8 v8 b6 A$ g& ~- z CPX #$007 `3 {9 S/ {% }' `
BNE DATACOPY3 s1 v7 c8 k' m
PLA
4 f H+ C! d" h) ?/ s TAX! u& A& x& E( Y$ V; U9 T8 I% H8 H
PLA
5 u2 V% O) V, B1 g9 \ RTS' X+ i; `1 x7 I' _$ S
! ^ p5 l: f& N4 ?5 b# J$ e0 S8 t .ORG $CD9B ;跳转到转换的切页程序9 }6 R. R0 @& F* b9 I
STA $700 ] O! B" ]$ v" }0 E" L* T, t: T
JSR $7200
% n9 C: q9 L, M6 i RTS, \1 s: ?6 ^& z0 v
/ V1 b2 k7 R6 `. U% }% f/ H .ORG $73001 U8 z) @1 r! C" _+ b
M1_TO_M4: ;切页程序
5 @9 d, J3 T _; Z7 \8 P& w# A CPX #$00
4 ?( M- o7 y* ?- a5 [ BEQ REG_SET, |- n7 U" Y4 n* g7 D. P- ~
CPX #$01
) E2 x- |5 U: Q0 L BEQ PPU_BANK_00003 u V* P/ u8 _2 K) @+ K- P
CPX #$02
8 O) t3 k) U/ `- c BEQ PPU_BANK_10002 q6 Z( ]& Y0 {9 ~6 M: c/ ~
CPX #$03
) E/ x+ j) [% e5 q7 |9 m3 I3 @7 P BEQ PRG_BANK: o1 I6 K! k* \/ d. Z/ O- |1 Q
REG_SET:
: c- D: f: X$ J0 p6 Q STA $A000% A% ~* E' f# Z/ [. f
RTS% U D. L8 N7 t! f
.ORG $7320
' k7 L; p a. ?( ^0 J$ }; _, LPRG_BANK: ;PRG切页, |/ y3 W, C* Q3 d
PHA
3 E' f, S1 h1 h5 ~7 T LDA #$069 f F/ E& X4 j8 m+ l* g7 c
STA $8000
2 ?- e! `1 e0 Z4 C: @ PLA5 [% E$ x/ m6 n& B7 w4 i
ASL& I) y2 f' q" n. |
STA $8001: }: N4 {7 A" _2 `) e1 Q+ P
ORA #$01% r$ ^4 {* n9 d# w) ^ r3 U" s/ I. W
PHA, Y4 O0 ]+ Q5 w2 T# W0 |" \5 L
LDA #$07! v3 ?; t( B/ T7 \- Z/ }
STA $8000
* U1 ]) A' I! T3 N% T4 L3 w PLA
/ ^( d3 t7 H) H STA $8001
, f; [, N0 y: T RTS- n: ~! v6 Y# L/ t o1 H1 f
.ORG $7340
r9 [" L% ~+ {PPU_BANK_0000: ;精灵切页8 [/ [0 _& j5 T) b
PHA
6 f% U! o/ |$ B2 n( o4 A ASL2 }' u m: t* F' S; k7 [! V
ASL( { r4 z9 S3 @
PHA
9 Z6 O% G3 Q$ s$ x% Q1 }+ ` LDA #$00+ F& ^5 x6 f8 O9 q( T
STA $80006 }5 r- A5 B2 Y7 u) ~
PLA
" D. }9 I/ ~3 ?5 \; h1 A& d STA $8001
2 }/ I+ P% z0 \+ o r \ ADC #$021 [! N& p) n: _; v( v8 K: |
PHA7 ~0 R) d& {/ l" x
LDA #$01# E# B9 j- ?0 a. u
STA $80003 S8 Y- h* [) s1 B
PLA3 x4 W4 h3 V2 x: g( j
STA $8001' X+ h+ {8 G# g/ W$ D. N% \" O
PLA
+ s W$ v5 g4 @; l# ? RTS! R7 ?* I! K5 c' f
S4 S0 {$ [% n
.ORG $7360# s* i& P" u1 V! J0 R
PPU_BANK_1000: ;背景切页
9 `9 T$ a3 M: i7 K2 K" s PHA( {* W3 t; y/ J
ASL: U- s7 L* _- C4 }, K" D
ASL$ f& s, x* ~1 O. F( ~
PHA
' R% N1 u: r9 S: ^ LDA #$02* }4 W q7 v% _( Y3 I& I
STA $8000
; b8 p5 t/ Y1 A) z. {7 z PLA
8 F- g: M1 v7 F% g* P" D5 I8 F STA $8001
& r- _/ R5 z$ E ADC #$01
! }- J7 _) M+ k% q- v9 `, ~! N4 o PHA. q) _) e8 K$ Q* |, O& f2 r6 _
LDA #$03
* ^& F1 J& \" j$ h+ g STA $8000
- ~/ }3 \8 r( e$ p( r PLA
8 W$ v0 h% g! e) W% L6 n STA $8001' ?$ P3 l/ p4 g9 Y8 }1 h
ADC #$01
* b+ H' U+ _) M5 }2 n# |, r PHA
7 I3 n; j j4 p6 @) Y+ n1 A0 n LDA #$04
( S; f3 U9 s7 `# b STA $8000% A+ _, h$ \. V: E+ q7 {/ m7 X
PLA6 h" y: N: B! [" ]+ |& T ~( X1 B
STA $8001
1 q5 Y4 U/ u7 A9 t0 p ADC #$01! a, m2 c2 {4 ], `: O9 F1 t
PHA
3 u5 X: y7 ~( t+ N" t LDA #$052 T5 h% u8 b7 s5 U
STA $8000
) s+ Z# l6 k1 n; v( Z, j PLA( V: D# k! @1 j1 \# l- m
STA $80018 P% L5 Z, e3 ^9 D7 T" u
PLA
" S% J7 p1 A+ @& U! i& n+ Y RTS
+ m3 h2 @8 A: J5 }' j/ \
3 h7 y4 t8 R: Z8 N9 p* X |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|