|
;[FC][最终任务mapper1切页程序]7 b1 x7 b7 z; Q. P1 R s
.ORG $CD9B% W+ x4 ^/ L2 I7 R
BANK_START:( Z7 g4 _' @3 _, ^# n
STA $70
" w0 L$ |9 ~9 }; z8 A TXA
- `$ S! k7 X# U2 X9 |6 P! n' s2 P9 p ASL+ t* P5 t; {6 o/ ~. b
TAX# @7 \' b( N. N# d/ ~: g) g& h7 [
PORT_SET:
# |; |3 o. g( J" P8 X LDA BANK_DATA,X, N+ H9 T5 r0 f! S: I
STA $6E9 ~: p& V6 [/ D! q
LDA $CDB8,X
2 T( @! M; n% f& H* C STA $6F
. Y0 ?/ W# U* @. ~! K! p; N9 U LDY #$00
5 b( }' c- v! Y o, O LDX #$050 d* T2 S4 U0 A6 ]6 U0 R6 @ s
LDA $706 f- e2 ]5 a6 u9 T7 h* K- r0 p( r
PORT_WRITE:7 B. b# ^, p3 `; y
STA ($6E),Y Y4 ^8 [% y( @
LSR+ T6 f. B2 N [4 c' {
DEX
! i2 {( | h; d2 `( n# _. d+ _4 o BNE PORT_WRITE
F3 U% F( v! x( h3 A RTS+ q2 [# e9 I; R6 X9 J: o" H
, Y/ n7 }: j6 O$ \ F& f4 o
% T+ f% Y& U2 \: M. HBANK_DATA:
* D( ~$ h6 c2 F1 G, T .BYTE $00,$80,$FF,$BF,$00,$C0,$FF,$FF
. ^; ?4 X! I0 z & {7 h! q/ G. l6 `7 A! A
( E% `: O1 Y: _5 r;[FC][最终任务mapper1转mapper4切页程序]$ r' ]8 t3 p# {! X' j: N
.ORG $BFD2 ;初始化跳转# K# I# B; A/ W
JSR $FFC0. W% W+ z3 H0 g$ N
: U! @* ~& ~& J; Z3 F# @
; L) z- n) s4 {. u( X .ORG $FFC0 ;切页
" j/ ^& s! `9 X7 n, ~) s+ C: P6 N: q LDA #$06
* u7 V. t) O- }0 U$ v* l. c" o7 O STA $8000
: X" x, j" `2 { LDA #$0E/ K6 ~" l' \( ?& s
STA $8001& U4 ^5 h# a6 |! m( p! D0 z7 B
JSR $8000* g+ P; b, L# f( m
RTS $ _" C- W1 s4 o& A. h2 C& X$ c
& n: E- N5 B2 ]% s
.ORG $8000 ;数据复制4 D6 m9 K- Z# z* L$ W ^
LDA #$80+ I* I1 o% T/ S7 h( c$ W% n
STA $A001 ;启用SRAM. ~/ X6 l& [" O' i9 e& o/ u' M4 D
PHA5 ~' w$ H. d1 M5 B9 d
TXA5 M2 }/ B0 v6 ~6 B
PHA* {6 z: q U$ k2 j, h X' ]
LDX #$00
; \1 f; o: l, A) @DATACOPY: ;数据复制+ S# M9 l0 m9 @
LDA $8100,X
j2 u, Z: I1 n. K ?, V, f3 U STA $7200,X
) H m2 x5 U3 E; }2 F1 l+ c INX' [: k7 O* w7 |: d, J& f6 o8 I
CPX #$00
0 b" Z+ g* @% Q! q) \& t/ l BNE DATACOPY0 B& J V) j e" P) \
PLA+ o% j) e Z3 s9 l, F6 H7 u( m8 k
TAX
+ ^6 F( W9 x# ], F( o" M PLA
9 ?: m! k6 V. m/ T4 g$ O, ] a RTS
0 h2 b7 k1 [2 M8 y3 y% ]
7 j7 o4 U- N% N: Q" \0 S .ORG $CD9B ;跳转到转换的切页程序
: ]- o9 ?8 D. V8 i( H* i0 w STA $703 D% y" C/ Y+ |2 r6 K8 i- {* Z
JSR $7200
: S+ Y9 O a! b8 K' v1 h, {: K RTS
% x0 a& c+ i$ ]" O$ }7 t. i - \) ]: s f( t9 H5 |4 L; a5 ~
.ORG $7300* H3 i7 [6 ?$ P& \! O
M1_TO_M4: ;切页程序
3 c- z6 d" K/ J7 G CPX #$00
: i' N9 q$ U4 P2 @/ ~ BEQ REG_SET" d' C- i. y" o! q4 p. F. _6 I. ]
CPX #$01
% v1 ~4 E& K2 c+ w) c5 h% T BEQ PPU_BANK_0000
0 w1 k- r% ?/ `6 |% @; I7 k CPX #$02
+ T' {: H( i. _" ? BEQ PPU_BANK_1000( n# T$ S' @; l& }
CPX #$03
W" `, H; F8 A6 U# ]* {& P BEQ PRG_BANK: |5 x, m$ G; I3 I% l. P; C' S
REG_SET:
/ R m, ]8 e- Q. ^ STA $A000
. L! S4 [1 m6 T RTS4 d( X% F9 C' K) `* w
.ORG $7320! G5 F% j0 a; C2 W
PRG_BANK: ;PRG切页: k) f& \- W- i5 U Z
PHA
3 L* e9 m# ~$ e) l6 Z LDA #$06% z# b' V8 G1 [' \
STA $8000, Q3 [& r. D: a4 e1 g8 ^
PLA
6 ]1 Z. G- o2 p! v8 G+ ] ASL
/ I1 ^4 w2 }9 Q7 A# h4 g STA $8001, c3 [. f( G% ~0 {( O" |1 O) c1 d
ORA #$014 b( e& Z& b4 H1 J+ ]2 i" ]$ O
PHA
. a$ y4 l* d; G/ ^ LDA #$07
% X3 o/ |! ^$ x% l* m4 z STA $8000* o! q" I @# M9 b1 ~4 X A. d+ S. u4 W
PLA3 {4 [0 T7 o0 v' n# k
STA $80018 E: O! q7 Z: `0 E
RTS: X) y* |9 i; @5 L8 S
.ORG $7340% F' t# k' Z. V* k3 E
PPU_BANK_0000: ;精灵切页6 v |! Y% }- C6 m
PHA
E! I' ^! l* x5 c ASL4 V( Z8 v" {6 h! M. y6 T! f
ASL
5 i: N" v, ^8 y% p PHA
$ L% l* S) m0 G( Y LDA #$00
4 U% P. z, J$ F, i STA $8000
t' [; V/ E, \, W/ p PLA
7 c `4 O; d0 z! }) n STA $8001
8 x& S& P3 {- G( `" Y9 @8 R ADC #$02+ i0 N' B) \# V1 F: O4 S6 ^
PHA
/ J1 [- y" F0 T LDA #$019 U$ i6 a- B% U# O& r
STA $80002 z9 y8 Z: p6 t1 p8 O& g
PLA
9 m/ i2 m2 A3 B8 ?& e1 r# K; } STA $80017 `$ A" b4 S4 X- H6 d
PLA
& m; a8 Q* c9 X) g! P) I z RTS' O1 J, }, V0 L1 X6 w
. H' {/ M: f1 Y# S2 r6 e9 M
.ORG $7360( y$ O* R# s# z) e4 o6 ^7 C1 T0 c
PPU_BANK_1000: ;背景切页 ~1 _) k7 G4 f* o e& j
PHA2 L. t4 R" l- \4 z: Y6 p# c/ \
ASL
1 Q/ l% g9 `0 O ASL+ }% P& D- W" O" N% T; Y$ p8 |9 A& R
PHA
- M% M' D% ]; W: g% {/ n LDA #$02
6 j0 K2 ^& O7 t STA $8000
: C; H0 L' t* r; V$ `3 Q4 j PLA
) M8 U8 c; v4 z* \% G3 B STA $8001
+ C+ i9 d( i' D/ K5 I9 G ADC #$01' P$ B& w6 g$ G" z1 w' I2 O% Z
PHA- v l8 N3 e7 n% d0 Q2 V3 m
LDA #$03
" D8 D2 i# ^7 B. J/ l STA $8000
0 y1 n9 o4 U' T* C PLA, g; }, T0 M; |1 ?# N
STA $8001" H+ V3 B! `& o1 [# ]
ADC #$01' O5 ?5 C; C' V8 j( u
PHA
4 j6 x" J t' d7 N; c LDA #$04
5 K2 a0 P2 h- n% v STA $8000
% ?, h5 j2 z- d5 F) u2 k PLA2 T4 J `( i6 A% M3 H& x! O4 y
STA $8001
6 G, ~+ j' ?/ J& K% m ADC #$01
p* B+ o- S( b+ j" o" b; ^ PHA5 \/ L1 B0 b& {1 [) K+ X8 {
LDA #$05( h* W$ E6 q& Y5 j( N( c* a
STA $8000
1 o g$ ?2 J; X& D% q: D PLA
& y! K) v$ u! _, X STA $8001
/ }+ f/ g' p2 _1 I( K9 d! Q. ~ PLA
5 V9 c. O$ u2 }/ ~! Z {; m5 ^ RTS
3 D/ n6 q& |4 u+ i
2 ?: A; s9 r( ~. }5 r' B" I |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|