|
;[FC][最终任务mapper1切页程序]
& m/ E: x. P! w; v( p0 L; O .ORG $CD9B* g9 R, G; p+ g& Y; `8 f# q
BANK_START:1 y" T0 W t/ L2 c3 f4 a' N
STA $70! o1 \$ M2 h/ v
TXA+ O) } w: @9 F
ASL
! t6 @$ q a) P2 v5 R0 X TAX
" i- p1 D. B: w# F0 \2 _5 yPORT_SET:6 Z' J) E& ^ u1 K$ I! w1 ]
LDA BANK_DATA,X) F* S- p: z R# ~$ c
STA $6E8 G: J# I s1 y- P& q
LDA $CDB8,X) r4 j6 u5 u' c' B: R+ Q' U [
STA $6F% g/ o6 T) C/ O, M; ]
LDY #$00
2 `7 \0 x0 J& g% E$ f% O LDX #$05
" J, C8 x3 T4 E4 J( v' g& Z LDA $70% s6 S' u! x. o, M! T" N
PORT_WRITE:" h7 z) N" y/ u! F% `. E
STA ($6E),Y* ?) Z/ l }' \& ]$ X' D1 Q
LSR- t) K8 o$ M7 i( p
DEX+ A( {" F: \7 o. B5 [, s
BNE PORT_WRITE8 J- p' Q1 x: V
RTS
G1 \/ g3 y$ ?2 e+ g ( ?; T; v9 n8 v( d, o6 V; A
; s! ^5 a0 x% A; O5 ]/ p; |BANK_DATA:
n4 q8 ]2 A- R0 l' F- ?8 v! [" f .BYTE $00,$80,$FF,$BF,$00,$C0,$FF,$FF7 F( l9 ~9 H& n& \3 J3 v% e' f
% |$ c' c4 X _( T p
& z- s3 _8 j' S
;[FC][最终任务mapper1转mapper4切页程序]( B$ q! U4 O0 s
.ORG $BFD2 ;初始化跳转
' B$ H% {$ Z/ d JSR $FFC0
, y- `8 [+ {/ I2 D0 M
4 n# a# u5 U; V# ?% J8 f
' S4 r5 x6 t" J- M9 a d .ORG $FFC0 ;切页
8 H' o5 x+ s* K; n; v LDA #$06
5 @* ?) X: C0 w9 h STA $8000
5 R0 c$ U- ^5 v LDA #$0E
/ t2 z4 W- S5 H3 u' P9 \ STA $8001
! W0 q* L9 T3 W$ y& K JSR $8000: i3 n0 M* U+ @, A
RTS ! U3 K0 F1 k. W/ F7 F
) I' c( u+ ]; E4 t8 o. O; F! W .ORG $8000 ;数据复制
& f0 V+ O2 d6 K! D4 I2 i LDA #$802 {3 k! s2 B& B" B4 h% V. c
STA $A001 ;启用SRAM
+ B9 Q: S0 l* F- C, b PHA
8 V5 H" a* g1 H# I% |6 T TXA
. W; U9 E( Y9 Q9 U$ T* P9 N. @7 U PHA# x7 C* V5 A( i$ ~/ z
LDX #$00, }8 }# ?# Y9 B9 N9 d# F
DATACOPY: ;数据复制
8 U9 }2 G% s2 } LDA $8100,X6 m: w! ]1 ^$ @0 {' I
STA $7200,X
% B, B# I) o2 V( ]! _ INX
9 p" f- y% o4 C2 ?- I: \1 e CPX #$00( O: ~4 Z& f5 T5 M4 i0 M* e
BNE DATACOPY
& B6 a6 }& s4 E( p k _1 C PLA1 E" k$ H0 D5 U) }. r
TAX1 W# _) D$ }# x2 `, m% B Z
PLA
" d3 [; t5 H1 _: d6 H2 ~ RTS- [% p. I& z: U" |' R
. H- m+ p( ^& {5 ] h0 W
.ORG $CD9B ;跳转到转换的切页程序& |7 w! r H( p" y9 L; t h
STA $70
' i4 p( Y4 s/ R% G0 d: ~$ S8 V% e JSR $7200
" r6 b" w# S: L ?' r RTS J% L( P* D2 @% @4 c: S
8 y+ j2 t: g/ G, X .ORG $7300& X2 O4 C3 n5 U- g* l- b. _1 }
M1_TO_M4: ;切页程序5 r' D/ c# l9 V1 T, L; u: k( r
CPX #$00 I4 M' m" \8 p* t
BEQ REG_SET; s3 H9 \! W1 K
CPX #$01
; D3 E( ~ k" Q BEQ PPU_BANK_0000
1 g. @$ e1 B9 ?4 T8 R CPX #$02
Q0 Q& C. Q; p# E0 ~' ? BEQ PPU_BANK_1000
- M7 f3 C. i9 A8 [ CPX #$032 d* e- o, I1 Q$ N
BEQ PRG_BANK
0 v. y- d4 m4 p$ t( S( H1 nREG_SET:
. I7 C2 u; H8 L' z STA $A000% k6 O$ d- |4 _) W- N8 ]
RTS
* k2 @, P& g& [/ e4 R& k% ^1 w .ORG $73207 }1 @( l" J5 i8 u
PRG_BANK: ;PRG切页
" r6 j* N8 U Q# q* a) s& Y: H PHA
2 U+ G% |6 S8 ~; r1 V LDA #$062 k$ E0 z! _9 L, G; R6 b; Q
STA $8000
* R% Y0 l5 c' K/ V PLA! H% U( Z1 Q7 @# l! b
ASL/ w- ^. \+ ]; O; f7 u: P( j9 j
STA $8001
) i% ~# }) R- V) D ORA #$01, F1 |! x& O; R) J% O6 ~
PHA
0 o z: P0 } v% }9 J! g LDA #$07: j* S6 n5 p( v2 d0 f
STA $8000
0 ~" o* y5 o( Q PLA
7 t4 E [0 E) w- v8 v STA $8001
j: y4 K( a% d3 c RTS2 d$ L$ ~* z N; W$ f
.ORG $7340/ A8 C3 H% ^7 k/ p$ ?0 M$ ]
PPU_BANK_0000: ;精灵切页0 A/ k9 d0 c8 a& b8 m. F3 ^1 E
PHA
1 W! l5 P( F' s8 H5 k5 ~% J1 j9 n U ASL5 v! q4 B1 N' e! L: Z
ASL0 s+ c7 n1 T4 r; ]: W4 h
PHA
; o: A5 K" ]5 x2 |* l* a; I LDA #$007 A' N% Z/ x% h
STA $8000# ^. ]% `8 S7 H H) U
PLA7 ?2 e! r. R: d1 n$ m- `
STA $8001 [2 I9 G6 z0 W/ l" D
ADC #$021 p1 E+ G' r, Q$ g. y
PHA6 X! z/ d. {0 [6 ?
LDA #$01
4 I( C* e/ j! e% N STA $8000
# {6 G; u% X$ c+ [ PLA* p& [9 N2 Y2 `
STA $8001% u& t) o7 L; T2 v7 z
PLA/ x w7 c9 S/ q9 C. V7 `
RTS( r3 G( |3 s, b1 j8 e, }
* m0 A' i5 D) s" S+ V( j4 |
.ORG $7360
; D* T3 e2 }5 j7 z2 h1 rPPU_BANK_1000: ;背景切页 Q+ A6 d$ R5 O4 S) R
PHA
, X+ N, J, h: n0 `. R" c8 A- U3 [ ASL0 C* B5 a, w4 ~4 C* p: x3 _4 Y
ASL. z/ |. z8 r z2 j
PHA
) o# H5 W: z2 _; ~ A. y LDA #$022 R1 K$ R( {9 n" ^3 A9 F1 L, |5 G$ X
STA $80002 v7 U2 b5 y3 b U. R- |3 C
PLA) F# a# k: [8 r$ e- A
STA $8001
4 v# D4 g! {7 b ^8 P, H4 @4 o ADC #$01* n5 s3 Q5 a! Z+ ^4 [6 k5 d
PHA2 N5 `( A$ W. N/ @( H2 R
LDA #$03
6 O" Y1 }5 D* g N) a STA $80003 x' c6 P9 y3 i3 |9 g* N
PLA5 k8 v6 q: q- h% b: e, M
STA $80013 k6 k, [& U6 Y' ^$ |" J
ADC #$01% F# l+ W! T% K4 J* ]( D3 {
PHA
7 F% e% I! d; h2 D8 A LDA #$04
# ]2 m) l$ J# S7 P- d0 ` STA $8000
( x9 o! c3 e7 o; W, R- b* Q0 O PLA' [9 C% s R6 s( D$ m
STA $8001$ S6 D* q' C6 G- Y" T
ADC #$013 _1 J- Z& [; c% k C4 z
PHA
+ V% g% x2 I; w& R LDA #$057 H8 K' B: \6 k8 K& ^
STA $80002 _$ I! ]! _) V% t0 Q! R7 C
PLA2 ^6 F M8 N" [3 Q# h
STA $8001
* P6 C$ _8 S# C7 X& u PLA
& x: ^( Z4 U/ X- u( V6 J RTS
$ y) }, |( F6 H. J, g s" Q; v
2 Q/ W7 o' l& g4 p. M- O/ }- | |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|