|
;[FC][最终任务mapper1切页程序]
. p# b6 j2 W) p6 b .ORG $CD9B$ x y: g9 d* O. d& f7 g
BANK_START:/ l6 X1 h1 A3 j
STA $70: c, f2 V. H' M- g
TXA
- Y! n- G5 Q# V' u ASL
+ K- h+ Y$ D! {: b t' L TAX
0 l# Y6 V. G7 J( Y, Q) h$ I9 jPORT_SET:" w) k) ]$ S7 B. G; J6 E
LDA BANK_DATA,X$ F3 o, r* B3 x! X
STA $6E5 V1 ]# b5 i! h
LDA $CDB8,X
7 I# Q$ A- U3 Z# g$ ~ STA $6F
+ ~! h6 \% `( y( w" v5 a# o* d LDY #$00
8 U9 B1 i F) a6 i O LDX #$05/ K) E& O9 @' R7 D6 u6 q6 S
LDA $70: O/ x& w' D+ g/ ~- R3 a. Y6 T
PORT_WRITE:
. o3 @+ |& o* R, @ STA ($6E),Y
9 L' z8 V& h& N; f6 r* x! Q LSR4 ]( I/ X- V. w. m% w; _
DEX
6 x& ^0 ]0 Y" I I- W; ]( p' d BNE PORT_WRITE2 y5 o+ `( d% i$ b6 W, `
RTS
* h4 U6 `3 }$ Z
7 `4 N$ Y. f1 m) J' l$ @8 [5 }5 s
8 S) M* e3 u6 kBANK_DATA:* b) O8 n7 u, K
.BYTE $00,$80,$FF,$BF,$00,$C0,$FF,$FF9 h/ n+ _! H9 v) Q8 `
4 Q C* G$ C2 }( K- f : E: L- f0 ?" s/ d2 r" K
;[FC][最终任务mapper1转mapper4切页程序]
& G* Z# p+ {4 n& I .ORG $BFD2 ;初始化跳转
5 S, a, O$ ~) X4 C2 a JSR $FFC0. C* k/ n! ]6 k8 U, j- A; d( a
, t3 Q( @& E J7 c
1 v# f2 ^! {' Y5 q0 M .ORG $FFC0 ;切页6 c- m- `* |* @% P% ?
LDA #$06
, X5 M+ G7 }0 E STA $8000
* r; S8 X, R( U6 h LDA #$0E2 W3 |6 m* Y2 O2 J' v" R
STA $8001
9 W9 c' h8 @$ H6 L$ n& ]' `+ ` JSR $8000
) p* {1 R! i' g `9 M; U RTS
+ X$ m2 f4 |. ^% @. n5 }& P
. Y2 d; m: }3 U2 }* ]5 w3 p .ORG $8000 ;数据复制4 J( t% g0 x# g* h" m9 @4 G$ `
LDA #$807 }$ l2 J6 w. Q: z" v7 n
STA $A001 ;启用SRAM
, s9 ?3 e; M2 W) D. S3 X PHA1 x9 C4 b s8 j& c7 |6 n- @
TXA
* I5 N; @9 \9 L# A- m' D" X3 x" B PHA7 j- }/ b. ^9 a* J
LDX #$00
% |5 ?2 i- C# JDATACOPY: ;数据复制
. T6 O3 x: X# ^ LDA $8100,X
# g G! W. y6 L' s1 M! U STA $7200,X
! n( M6 i1 L2 _ INX6 X5 D6 [. Z" y' l1 r# E
CPX #$00
6 Z) q: K- X, t/ O4 u% k9 r1 B3 G BNE DATACOPY6 D3 Q# `- w+ o) r1 @
PLA+ G' w! C5 ]( T5 I$ ]
TAX# b. y# { d% s G
PLA
" A( {3 B0 Z5 g7 Q- c( {. A" H! \/ ` RTS
7 t- N8 L6 P/ W/ ]8 b $ v( W$ L" G! J0 U0 E' K
.ORG $CD9B ;跳转到转换的切页程序$ n1 A5 v: |, Y b
STA $702 y% p+ z0 t- w e
JSR $7200
7 J' w3 U# _- { RTS
6 X$ C. W9 b! u3 R
& S2 g& H+ d, E8 d .ORG $7300
7 B" x# D; i' nM1_TO_M4: ;切页程序+ P' D" A2 {6 F5 e+ P0 o5 m9 H: [
CPX #$00
( r4 j' d* ?+ _* K3 Q BEQ REG_SET! |7 J5 L& K$ p3 K3 O6 g2 e. ~
CPX #$01 A% O# u8 F/ F2 j3 I7 L6 h7 U
BEQ PPU_BANK_00007 Y% z' K2 i& A( q
CPX #$02: @' E# f& F2 i0 V9 H3 U3 P8 l& n
BEQ PPU_BANK_1000
# g x# f( X$ H9 g q0 b& U% _3 @ CPX #$03* L# W' P; _: H1 _/ p" S! x8 v; I
BEQ PRG_BANK' d: K; X: P3 X5 g& |" r
REG_SET:
# F+ h( @( Z9 L. p STA $A000
# Z( A3 r! [+ ^ RTS. o! C# ~- c* R
.ORG $7320
8 U7 G1 o6 P% @2 TPRG_BANK: ;PRG切页
/ y# L5 [8 u( w7 z, |$ g2 ]( x PHA
7 H; z# @- Y/ |. B LDA #$06! Q+ `2 ]% |% i' y: } @5 m" \, ~
STA $8000
9 d# `% v4 ]+ N: k D8 j PLA8 G" u3 n8 {3 S0 B) y% t
ASL1 v1 h4 q1 E7 e: u4 y- C' d
STA $80012 H! t, x9 y) j9 N1 T5 i4 \6 i5 F
ORA #$01
, J- L+ P5 p- [& m PHA# D) d* N5 J' ~- Z+ I+ j$ Q# y# O
LDA #$07
: B: ^1 ~7 I7 N7 P& m. i STA $8000
O) T s! x# Z$ m: o- [ PLA
* h- ~% i' [$ Y& T. }% y8 U" B STA $80014 d* _% f/ S" K( A- g
RTS
1 m' r. c0 _% L1 V3 L .ORG $7340! j# O2 E" _0 s) \2 r2 |
PPU_BANK_0000: ;精灵切页
3 Y& t: t7 }7 ] PHA. I$ \3 l8 v) m* S2 [ h$ X7 [ T
ASL' e, t! d3 Z) x8 w( M. ^, D) Y
ASL; N2 U$ a# r0 e3 ~) {' k* s( }- l
PHA" R% h$ l( z$ q7 q
LDA #$00
9 ]7 F" \$ P3 v" \ STA $8000! y& s- j7 H# a8 g9 W3 ] o: P( G
PLA
5 [' Z( e9 J" s+ i0 k# ^$ J y STA $8001. ]2 y- b% V; g$ J
ADC #$02
, W! {. @7 C0 n" [4 O. M PHA
; `% q2 ~/ {5 a5 c& e' } LDA #$019 z8 W0 _# D$ i1 p6 Q) P
STA $8000! A7 [% r% I" @' m A
PLA
1 d9 H. B* U1 e) J: J* O$ i STA $80011 a m- Q: s" D$ c) s6 T
PLA8 c3 V, F6 s5 ~) }3 e5 r
RTS( [, Q; L5 r( f) w! s1 i8 F
* `8 b/ a/ F6 B .ORG $7360
4 E2 L2 w# P2 o! yPPU_BANK_1000: ;背景切页
/ l$ z; o6 Z; M PHA- w4 y( w$ u! j1 ?& y5 @1 u5 W
ASL
6 ~5 M% h7 C* N, K. D' D ASL8 I( M6 \5 h2 I- g
PHA) f' l5 A2 T& J% M4 U S6 b; e
LDA #$02$ B. m! Z, a" a2 G9 Z. K: t
STA $8000$ a3 Q* E; O3 {( f) w3 y
PLA
* H* _ Y0 }6 b: _7 ^( y/ Q* K7 v STA $8001
9 T$ ?8 d7 t6 ?3 F$ a$ P; u3 l- O+ b ADC #$01! J9 C7 m+ \8 l
PHA
: g; e3 m% E* p! O* t" S LDA #$03
( I) H) x! y$ w STA $8000
4 }. A1 s9 v% @! N" P PLA" W6 O. W+ w, e
STA $8001* @- I1 ?2 l9 P; O4 |' C6 {
ADC #$01
. ]$ T' b; E+ o9 S7 h PHA
+ `. T; O+ |2 `+ F/ _% C LDA #$04) E3 t; \6 q1 ^7 j# O- V6 s( S0 z
STA $80003 u: } k! u! P. V% S6 M- e. w$ H
PLA
! j4 N7 V8 j' q* _0 Z: Q! d# V STA $8001! V" L4 c$ w# n5 K* w6 h8 {$ R3 _
ADC #$01% K( t0 C6 x; M( {# x/ Z
PHA5 ?. R# I& [5 x: _) X2 I
LDA #$05* E6 ]; P5 U4 A. H
STA $8000' X8 H$ @, }7 R3 M; s% c+ E
PLA
2 Z" ]/ d: l) p) e& a STA $80019 x! j+ g+ D9 e; {3 i2 W$ k
PLA/ b" B3 [% A5 F% a6 z2 T
RTS" k: @( O% G3 N% \8 h
# c. i) T0 j2 y! H# f% Y/ I! N
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|