|
本帖最后由 yandagui 于 2019-12-4 21:31 编辑 2 S" R1 q7 `5 x) h7 E- X
; F$ q4 x1 I: i3 I" |1 S; `5 d, e4 q[FC][魂斗罗][最佳可视化]
: b `2 h5 e$ E! `- o% T时间:2019.11.30
/ t5 A4 S# C% B L4 l- ~作者:FlameCyclone
$ X' s5 ]1 n$ C1 o9 X内容:# E+ |/ W, P2 n- Z. ~7 s6 e& c
1.可视化:
8 _3 X7 [# b$ h; N3 c2 T (1)暂停时按选择键进入菜单+ }6 B+ M; L, L$ \% S4 \/ ~. {
(2)方向键选择功能: B键开启: A键关闭: 选择键交换,开始键退出
1 q6 ] [7 a' y7 V* }8 Z 1.1.透明无敌: 透明无敌4 M" I% B( h; g8 S% f2 G
1.2.加强无敌: 金身无敌" K" l6 [- p6 a# `$ N& g
1.3.生命锁定: 生命锁定3条
; ^& x' ^- i0 I, w4 `1 X 1.4.武器锁定: 武器保持不变
: f2 Q5 @) a ^! R/ l/ F 1.5.武器切换: 游戏时按选择键切换武器* G0 B) r' X! k' T& ] J" N; s
1.6.无限跳跃: 跳跃无限触发/ L: U$ l8 u$ u6 t& f* n/ v7 C
1.7.快速移动: 行走速度加倍3 C' k' N( I* {
1.8.皮肤切换: 交换玩家肤色% A! X" Z }2 |) X
1.9.公平子弹: 玩家子弹可以与敌人子弹对打5 ]7 U7 F1 F; V
1.10.强力子弹: 子弹打中敌人后继续穿透
" `8 l5 A, v0 x( L9 z. S% D4 w" J" k 1.11.一击必杀: 敌方中弹一发必死
6 p, o9 ~5 J. Y! y 1.12.全屏击杀: 开枪时全屏可击中目标必死+ Y' w! K: x, R
1.13.玩家双控: 两个玩家的任意一方均可同时控制两个玩家) V* m$ v8 `# s6 W! |
1.14.移除电网: 移除2,4关的电网
: P, c6 s1 D0 p6 q# b 1.15.掉坑不死: 掉坑后不会死亡
$ n# }3 s% [4 r8 n w/ y 1.16.跳过关卡: 跳转到下一关6 q7 t' D! h ]7 [, K' c
- ;[FC][魂斗罗][最佳可视化]/ E$ \) L( P {4 [
- ;20191129
. |" }$ T1 b/ z* D( t
6 x$ E8 U$ m' X. G; F1 [- ;程序开始地址
: i p& f7 C0 Y4 L1 p% ?% j$ T - .ORG $9000
" ^( t6 O, s4 |! B, P* d4 j - 8 P. U+ \' B- L a# O
- ;==================================================/ k0 h4 p5 J9 M# C
- ;==================================================
( M4 |: L% e) S* o - ;是否双人玩家
3 h0 n$ ~7 r+ I! |0 j% w- d# Q* U - FC_IS_DOUBLE_PLAYERS = 1
2 R- h1 W R8 T/ i - , K3 Y: H g# z3 i, m
- ;==================================================" q$ j# h; \7 E! w! t
- ;PPU缓冲地址配置
3 e- _. R7 R4 }; H. B - FC_PPU_Buffer = $0300$ l/ g, C+ k5 B$ y+ [" {: H% P N' g
- ;PPU地址配置( H9 u& z+ v N. I
- FC_PPU_Cursor = $00
8 B! \5 o5 v- m' }; ]$ L) [ - FC_PPU_Status = FC_PPU_Cursor+$016 N m( g, h v2 O0 {
- FC_PPU_Data_Cnt = FC_PPU_Status + $017 }; ]" P3 }- R$ Z5 C
- FC_Data_Port_A_L = FC_PPU_Data_Cnt + $01
" E& ^, {8 {9 Q4 R( o& j7 _ - FC_Data_Port_A_H = FC_Data_Port_A_L + $01
) F' b( i% I5 p - FC_Data_Port_B_L = FC_Data_Port_A_H + $01" k/ r2 |' u& |, @: _
- FC_Data_Port_B_H = FC_Data_Port_B_L + $01
( x( h1 J2 l2 S: f V - ;==================================================1 ~2 u9 Q, U4 h W- X
5 y; ]0 V, u5 e, U7 C/ k. A, W- ;==================================================
- B' H: O ?/ Z5 Z) m - ;选择项地址配置! B) V' G/ J) T
- FC_Select_Index = FC_Data_Port_B_H + $01. N1 ~1 K0 s+ U
- FC_Select_Temp = FC_Select_Index + $02- @2 @5 ^( Q! I; ~; K6 y
- ;NMI循环计时器0 I9 U! S' T) Z* s
- FC_Time_Count = FC_Select_Temp + $018 t* Q' ]: e/ H: X
- ;==================================================2 ?0 @. y% E* E8 @: d$ M" @
( v5 X( n% Q; m( y% K4 V$ {3 ?- ;==================================================( u, `$ b4 H5 m. I+ o
- ;光标配置" l0 A; _9 g4 X" |, [. g% z
- FC_Cursor_Addr_L = FC_Time_Count + $01
( [9 y$ J E1 F$ m: g% Q4 S/ \# M - FC_Cursor_Addr_H = FC_Cursor_Addr_L + $01
6 _( D3 c6 C8 L0 L$ ` - FC_Cursor_X = FC_Cursor_Addr_H + $01, ?/ \. }8 ^' i& F3 y
- FC_Cursor_Y = FC_Cursor_X + $01+ O; E6 @1 h3 F) _- `0 n) U" W7 ~' E
- ;----------------------------------------
I) Y+ B( n6 h6 {* H9 i* R - ;光标图形号
* J0 L) w& T. W0 ]" E" O/ z- A, H5 U - FC_CURSOR_TILE = $3E4 r+ R! S* P1 m! T" c
- ;光标偏移像素值! \; _2 u% Q3 r3 K) N( m
- FC_CURSOR_OFFSET_X = 12$ Q/ o+ K7 I' w& z: e
- FC_CURSOR_OFFSET_Y = 1, B! @5 ], N0 ~! v- R8 ]
- FC_FUNCTION_OFFSET = 216 U1 A: W# n4 h+ k' s* u/ G# V
- FC_ON_TILE = $3D
' E' e7 b7 T5 h9 Z& U3 p& Y+ B - FC_OFF_TILE = $3C" D' T6 x. l( l" a) I
- ;==================================================' Y# H( {9 [+ q: f8 B
6 x. |0 \* x! Q' ]! J. k- ;================================================== g4 k7 j5 A2 F5 B$ e, }+ c2 Q
- ;翻页配置
9 K; i) W8 O! _ - FC_Page_Old = FC_Cursor_Y + $01
& y2 n6 L, J; Y& ` - FC_Page_Cur = FC_Page_Old + $01
1 p9 t( {/ x% [1 E - FC_Page_Item_Count = FC_Page_Cur + $011 F) D" n3 T( i& X) Q& A4 M
- FC_Page_Item_Buffer = FC_Page_Item_Count + $01
: U) T. j/ z% K+ O0 T0 ? - ;----------------------------------------" w+ B3 a9 \! K8 } p5 L2 K
- ;翻页属性' Z4 W/ y; M9 [
- FC_PAGE_SIZE = 10
6 I. g j3 |3 O5 ` - ;PPU单次写入缓冲项数
. }" \6 d6 t1 m$ x g6 Z: P* R - FC_PAGE_BUF_SIZE = 2
+ d- Y1 R6 }$ W# v1 S! t4 | - ;----------------------------------------$ x0 _+ N; V# S
- ;显示项最大索引属性3 G7 @& N# h0 e6 t. {) q
- FC_ITEM_SUM = 16 - 11 h; h0 @4 L3 a9 ^; ^
- ;最大页索引属性; m( w0 d" g5 `4 n+ Y9 j
- FC_PAGE_MAX = FC_ITEM_SUM/FC_PAGE_SIZE*FC_PAGE_SIZE* m8 S$ {3 {, s' T( t( A
- ;==================================================$ O% g; E2 a9 j
; B- N6 ~) T5 v- ;================================================== v/ C! n f0 u3 G9 V5 I
- ;按键配置
# ^! K; E- m- t* i - Button_Keep = FC_Page_Item_Buffer + $01
( _8 {4 D: Q9 ?& |: X - Button_Once = Button_Keep+$02 t; J1 U" n6 N6 E% |; g3 K0 D
- Button_Temp = Button_Once+$02
! T- u& N4 a b8 _# E, E6 }3 E - Button_Buf = Button_Temp+$02
/ v6 b" k$ G; b( W2 T9 w& v& w( e - Button_Status = Button_Buf+$02
% ~0 P3 @$ R9 l* a7 p9 | - Button_Auto_Delay = Button_Status+$02
" f% x5 b9 E9 n5 `5 ^& d - ;----------------------------------------- R+ C7 j" @) n6 W
- BUTTON_DELAY_MAX = $18$ L. Y! B- P8 ]% F- X/ }. Z. Y, c$ i
- BUTTON_DELAY_SPEED = $08; f+ i" _, j- A3 J ^
- # L9 g2 e8 S( }! r, _
- BTN_UP = $08
3 k; g: e2 G) F) K9 M6 O - BTN_DOWN = $04
0 V) q- b% x, a# t, y - BTN_LEFT = $022 O: [0 o K) \1 M" ^4 l
- BTN_RIGHT = $01* Z/ h; g% ]4 s* K& g: k
- BTN_SELECT = $20
2 h3 Z8 M$ J; w - BTN_START = $10; u& |5 R/ ]% G _* t# ^# D
- BTN_B = $409 U5 Q0 E* q2 Z2 y/ w( c
- BTN_A = $80+ `) z$ k) B) u9 U
- ;==================================================
* ]5 @5 w7 k2 k, e6 w8 q8 b. u8 E9 I
E" r2 i1 ]' [3 r3 L) C) l% T- FC_Copy_Addr = Button_Auto_Delay + $019 m9 i, J0 m; i: E8 O+ t; A8 S6 O) i
- ;----------------------------------------
. l) j+ R! @8 N+ z3 O% c3 ? - FC_Clear_Val = FC_Copy_Addr+$00 ;清除模式覆盖值
; }6 M6 g1 X2 X+ i - FC_Cpy_From_L = FC_Copy_Addr+$00 ;复制来源地址低位
1 [+ x6 C! S; T9 y - FC_Cpy_From_H = FC_Copy_Addr+$01 ;复制来源地址高位) \/ l. S% q4 D& u2 L
- FC_Cpy_To_L = FC_Copy_Addr+$02 ;复制目的地址低位
" g: ~" i, ?0 c% u, a; e4 O7 r5 R" S - FC_Cpy_To_H = FC_Copy_Addr+$03 ;复制目的地址高位* u0 G2 {" L. q" V
- FC_Cpy_Count_L = FC_Copy_Addr+$04 ;复制长度低位
! ?& p" `* K, B( a! v% D - FC_Cpy_Count_H = FC_Copy_Addr+$05 ;复制长度高位
. R9 E. t' x; \1 e# ?+ O - FC_Cpy_Port_L = FC_Copy_Addr+$06 ;配置地址低位
% T. G$ y; U0 [; m8 t - FC_Cpy_Port_H = FC_Copy_Addr+$07 ;配置地址高位$ n, Q. q+ F% N8 B1 D8 o
- ;----------------------------------------$ Q3 L2 U0 s6 b; v; G- n
- FC_MODE_RAM_TO_RAM = $00 ;复制RAM到RAM模式0 Z% V* d1 n/ h
- FC_MODE_RAM_TO_PPU = $01 ;复制RAM到PPU模式
4 X% K1 z6 ~% g% ` - FC_MODE_PPU_TO_RAM = $02 ;复制PPU到RAM模式3 A0 s; K' j5 `! v# o* Z
- FC_MODE_PPU_CLEAR = $03 ;清除PPU模式
6 S8 z8 V# t# {* s5 o3 x. Q0 I - t% O9 z0 U: h# y
- ;==================================================: F: z. ?: N0 G% f
- Rom_Nmi_Addr = $FF
4 v$ o" E6 }' @2 L1 O" H - Rom_Btn_Once = $F5
3 P. ]. w. r: g7 h6 }7 Y D - Rom_Btn_Keep = $F99 j$ ]/ h& n$ O' v8 k
- Rom_Pause_Addr = $25; a+ c, k, c: W3 I. }, ^
- Rom_Pause_Val = $01
2 n/ ~/ i% `3 r5 A - Rom_Pal_Addr = $07C0
' _. d& z8 Q) v - ;----------------------------------------
9 E, p }7 M" ^5 H* g - Save_Zero_Addr = $6200/ a9 o5 C# F* F: A$ i/ q2 `
- ;==================================================' j+ `; H: P& N) J: s
- ;==================================================0 ]. @4 P0 h6 f
) x. j. _& a' ~4 J5 Q, J" b1 Q# {/ G- ;程序入口( G2 s# K) H0 ]+ @" [
- Enter:, R/ R5 R! M' i: Z3 v$ g' x
- LDA Rom_Pause_Addr
4 Q" K5 T5 o& O1 a/ q - AND #Rom_Pause_Val
, K1 d* W1 g5 x# } - BEQ Quit_End
) T7 Z1 {# P) K/ a2 ^ - LDA Rom_Btn_Once
, r+ T; E) l6 T - CMP #BTN_SELECT7 o8 ]+ R: Q7 ^% r; L3 |
- BNE Quit_End
1 k% }& P# D( d4 l- d - PHA
$ p3 n9 d6 ^2 L3 w% } - TXA% z1 z6 ?, A% Y5 t7 o
- PHA7 [# X" \4 ]& {% d- J7 _
- TYA1 y9 Q1 i4 K& g
- PHA
, R& d$ w' z1 I. q5 K3 ] - JSR Wait_Sound_Stop
" B7 i2 r. c( _% F( p2 N - JSR Save_Screen
8 M5 ^8 G9 |: r- P% c - JSR Program_Begin$ O T% x. Q. h4 a7 ^. U
- JSR Load_Screen# ?/ U3 ~( b; d2 o0 b ]
- LDA #$10
. `+ _- ?7 S8 l' e0 a% `# o - STA Rom_Btn_Keep1 d0 Q S; J2 z6 g" A5 F- M* ~
- LDA #$00
. F% u' S: k5 l8 ?. Y- u - STA Rom_Btn_Once
4 |8 S; ]# \! ^- m+ J1 e; R8 i - Quit:2 s7 r, C7 m: Y
- PLA6 j6 K2 D; T( a: g9 u. K. K0 [! @/ O
- TAY
# b$ u# u$ [+ g, n1 V& L5 N - PLA+ \& ], @( w7 L+ F. z1 A
- TAX1 E) j) f0 Q6 t$ C9 Y& a/ S! |7 B
- PLA
; N2 y2 a! e$ h$ a; w8 Y! _ - Quit_End:
/ O( R2 n6 {! T6 D - RTS9 p& z' f2 N) W# x$ ~0 J
- / w, ?: l4 f, X$ [( @! w# a& d( B! g
- ;==================================================
3 o) F: z3 i9 K( d5 @ - ;等待音乐结束6 e) u7 ?& ?0 K1 R0 t8 d5 G
- Wait_Sound_Stop:
% y( ]! k, V. k* u- u - Wait_Sound_Stop_Check:
! J W9 N0 a0 ~# f# F/ t" c - JSR NMI_Wait
" d8 M% V; V6 ]7 W7 m - JSR $F825
5 m2 c; p$ q: x - LDA $010A1 f8 [: n b1 D* ^
- BNE Wait_Sound_Stop_Check% p7 m) {0 f' S! V, K7 U
- RTS
% T) }+ M% t4 _" o. R; }& ~# x - , \: b# O" h+ r, b, ?6 t: R
- ;==================================================, \: U5 t7 J9 G+ Y$ P
- ;保存屏幕数据
0 D7 {1 z) J1 b - Save_Screen:6 M& I* j3 Q7 A; j# W* K
- JSR Screen_Off
0 W5 x& u( K% I - JSR Save_Zero
6 M y6 U6 ]; e, u1 y+ a7 V3 _ - JSR Save_Ram
! H6 H- G: J* ?+ A [) e - JSR Save_Ppu
) K$ l, U4 d$ p7 I s D9 i - JSR Ram_Init
- W: s" v z" r; ~4 o! A0 } - JSR Sprites_Init6 r( J' @4 B" [0 @
- JSR Clear_Ppu
7 o- w2 t6 v" r" i5 e - RTS; h# K5 r2 R* P' p+ k" b5 w+ k
8 x6 ?* A& N9 ?/ K/ }3 B6 t% H- ;==================================================6 X5 s% ^% J- `: k
- ;加载屏幕数据
9 s8 p0 r8 v4 S! \5 [ - Load_Screen:) u1 `$ _# U+ a4 O3 X
- LDA #$00
6 g _7 S! L5 Q2 r( \8 @6 j* q - STA $2001
m/ W- G# G# b; Z. y8 t( j; @ - JSR NMI_Wait5 N* ~0 E% X$ v$ _
- LDA #$02
3 C& b" S* _( s6 w: P4 k9 @" \ - STA $4014- Y& @" d! G6 _3 ~* i, @
- JSR Load_Ram
/ g" v5 a6 q2 D - JSR Load_Ppu( |+ j' r3 v! A0 A2 Z$ j2 d
- JSR Load_Zero7 s0 n: o& k& y/ g0 Z
- JSR NMI_Wait
( U4 W- e. C. Y* Z! ^ - JSR Load_Palette
) B/ l: c. i* b7 M0 N1 v$ T - JSR Screen_On
+ `( r& l( E3 `, q8 H - RTS
; P: Q( V4 k+ f; N+ n3 Z- Y0 {
$ h! t4 R; T$ _) S. n- ;==================================================% O4 E2 g* a0 b2 N8 V; C" s( _
- ;关闭屏幕$ A" Z! ~2 p( q
- Screen_Off:
' Q. {, W# `1 k* o - LDA Rom_Nmi_Addr
: [7 G1 M, m' K4 d - AND #$7F
1 n0 y z/ O. i5 \* o - STA $2000
9 K+ M p+ S$ }0 h - JSR NMI_Wait, z# m, [& g0 C" Z N6 }
- LDA #$00
9 P3 a% A# i8 k9 s; w4 j. t) s5 b - STA $2000
2 I, D @' e S - STA $2001; O, [( ?0 S+ u4 H1 k/ }
- RTS
+ d! @: ^2 j* |
' O1 K8 F: W$ b0 D- ;==================================================
, i% t" K& u0 `0 w4 X, I: x. q - ;开启屏幕# E5 S2 M f* d2 g; r. ?
- Screen_On:, E# h/ d |1 R5 ^. ?+ c
- LDA Rom_Nmi_Addr( v. M* v( R7 B+ o
- STA $2000! h1 E9 p* ~3 B' c' H
- RTS, h9 J) V/ [2 Q- D8 X
: ?: D5 y5 c5 a- K7 `0 o, P# Q- ;==================================================; t5 ?0 G4 E2 R% b; E1 {. F
- ;清空占用RAM
" h* R: ^* o% `1 F6 C3 Z5 j - Ram_Init:
a6 x% N! Q* B, C/ _0 m# Z: E0 j - LDX #$006 ]$ E6 R4 x% F
- LDA #$00* K7 n' s) L" W
- Ram_Init_Set:+ ?* k; Y* ]! }, s o1 i0 u/ v
- STA $00,X6 T, ?* x- ~) |' R
- INX
1 b# v# a# x) @2 u7 j' u - CPX #$40- I+ }0 P: x9 w! \5 d
- BCC Ram_Init_Set' Y3 i: N0 Z; z0 P2 _: E2 B
- RTS
4 N2 a0 i" R0 d9 G) M - # v6 ?+ d8 a9 {% s4 w9 C$ q. \4 \
- ;==================================================
6 M$ ]; r; ^9 f2 M S! q - ;清空占用RAM
4 Y# C' F W0 f7 K- d - Sprites_Init: B y; n* O3 y1 v
- LDA $2002
( Q8 [9 H/ B% n8 n) f1 T7 M - LDX #$00+ V% B" f6 M0 m" `( _) M' D
- STX $2003
5 C7 ~1 e% P6 a& }" K3 m" c9 N - LDA #$F82 n) P4 H6 J" c; f. U
- Sprites_Init_Set:9 k) y: ?& `* e
- STA $2004, w9 k, k V' T1 ?; @: D6 A! M
- INX
& u. q2 d1 f* A5 z; s/ e( F - BNE Sprites_Init_Set& l, @+ F; |% b H+ X
- RTS& {* P" C3 b* L9 E6 \
& r1 V, d e1 c5 d) `6 ? A- ;==================================================
6 w4 M$ r- ^/ |! i" c - ;保存零页数据
0 n# T6 A! \" z3 }; C - Save_Zero:
$ \% |7 T% ]8 `& y, G: W7 ? - LDX #$00
; x0 J8 ]: Y9 |% _ - Save_Zero_Set:3 V6 q( ^+ v8 t z) [
- LDA $00,X
2 v7 O' ~2 h3 I8 Z$ U3 @. T# p. T" i - STA Save_Zero_Addr,X
7 y4 E# v5 {1 _4 v - INX8 D! q% ?/ i9 l2 g! V; D
- BNE Save_Zero_Set
+ ^3 ^: J m( t - RTS
5 X/ }8 \; B5 d8 N5 i' I - % g6 S, k$ {- {! ]: s
- ;==================================================
3 K$ g' f! N3 Y - ;加载零页数据
8 T" ~# _* `& t( p - Load_Zero:
0 ~% I6 q6 r3 R F - LDX #$00
' A0 C8 O+ ?+ D4 J; V - Load_Zero_Set:, c8 T1 b" f# \3 X$ _, g9 e/ M- j8 i
- LDA Save_Zero_Addr,X
- B2 v% K3 t; v+ F - STA $00,X
* \/ w5 @* m# g6 A1 ` - INX* G6 S3 \5 i* ]- g
- BNE Load_Zero_Set
1 |- [5 z9 A+ P- x% h& ^ - RTS _8 `& [9 R8 L7 z. O
- 9 E4 f& W2 r6 `& L4 z' O! T3 q8 I
- ;==================================================
6 U0 X0 E- A3 r+ s; _" j, | - ;恢复调色板4 O `! H9 g2 |& |
- Load_Palette:
% w8 q/ b/ Z* J# b - LDA #$3F
. g+ i, a1 V: m - STA $2006# `1 k4 d5 t( p8 l6 c6 F! _
- LDA #$00
" ^7 X' d, H9 P( g6 d7 f( z/ j - STA $2006& Y3 M. u+ Q" K3 l2 Z' S, a
- LDX #$00: R8 x& l& q4 R' A' U
- Load_Palette_Set:8 |9 Z5 ~' R' A0 W. {4 J- \
- LDA Rom_Pal_Addr,X
4 \4 T4 h. n+ a. \7 n - STA $2007
) {9 O2 U: s( J6 O - INX9 S; j0 ?- d! U
- CPX #$204 U) U2 _6 h' ]4 Q& @
- BCC Load_Palette_Set
; G/ Q. \# D; S: k3 j+ _7 x3 c1 _ - RTS
8 Z+ ]: T0 Y0 A# z2 f: t6 `& N
/ Y7 ]0 w) u w: L( L* c* W4 A- ;==================================================% d: P, z& I& U- R) r5 N5 p
- ;==================================================
+ ?( ~$ F' A6 a( C* s0 j* ^% } - 7 ]7 A( @( R: u5 x' {* A
- ;==================================================
, i6 h7 A, F- V; A - ;程序开始3 G, \' C* W2 \- u2 g( I. g
- Program_Begin:
: w7 h, \# R" l& |# { - ;==================================================
f( F! R3 s" _% ]+ v - ;图形设置( v" E0 }( `# C3 ~7 v
- JSR CHR_Set
% H0 w* m, J& u" }: S* Y - JSR NMI_Wait2 `" _. v9 T% x& v* z5 ?
- JSR Palette_Set
9 f) _3 U3 N' X0 q+ r' f+ B/ O - JSR PPU_Data_Page_Show
+ D* d+ k. ]7 H. t -
- @/ \9 z4 N" y- k - ;==================================================2 s! z3 H0 g1 h! w; N$ W
- ;开启显示# Y, q/ M( i7 ~9 q p$ q) i% N
- LDA #$1E' i" K+ B4 W2 n
- STA FC_PPU_Status+ S$ t5 n$ M7 i$ l
-
% ^9 f; m3 S6 u7 a - LDA #BTN_SELECT
7 p: i5 S2 W* U/ ]/ W! L- p0 T - STA Button_Keep9 i: k; j! D7 G% c
- ;==================================================% c0 `& _# {8 a% }5 ^
- ;模拟NMI循环
" E ?: v! d' H/ W9 ]3 f - NMI_Loop:2 X' h! z6 X6 y+ k/ i/ M Z0 I
- JSR NMI_Delay
% }/ B, L/ M/ U" ~ F. v- a - JSR Button_Process
9 \2 \9 u- k7 |. B6 H; h$ Z7 s0 p - JSR Button_Auto_Press* J5 g0 U- u0 A, p/ u
- JSR Change_Select_Item. B! _- I) Q7 A3 F+ Y. z, } E9 p; n
- JSR Change_Function
4 S6 w4 ]) c$ c' w6 F7 p* _ ? - LDA Button_Once2 e5 U( K) `) H
- CMP #BTN_START- Q! [( o; l4 g4 q; b
- BNE NMI_Loop% c- S/ B) O4 R+ S; q( [
- RTS
# ]: g6 G8 O/ A: _5 B! d - 7 V0 J9 t2 ?. u% g3 N
- ;==================================================
# U4 Z9 _- s2 u. x/ [ A - ;模拟NMI中断
! G: S i/ B. n: W# T - NMI_Delay:$ m6 {) ?5 H, o
- JSR NMI_Wait% m& Y P2 q$ d1 Z. k% U7 O- l2 B
- JSR Show_Select_Cursor
: |' G7 w3 y; M. l n0 _& q - JSR FC_PPU_Process1 R+ ]: p8 U9 J- q
- RTS
: ~: V! k: q/ { ?- C -
+ K' f" h' i% b0 @6 \ - ;==================================================
; x/ k! `/ c3 A* O+ @ - ;等待NMI中断
+ N( v% J, f( T1 K8 T4 L8 m2 ^8 C - NMI_Wait:
]' H6 n0 A( I1 ? - LDA $2002) x9 v# n F- m; K
- BPL NMI_Wait
y: q1 }* l1 Y9 i. | - DEC FC_Time_Count: [( f$ ], S/ z D+ [3 ~ j
- RTS5 u8 Y" D( I' \- w) z
- / v7 O4 I; R: P5 B! j5 n0 f/ G5 W- H
- ;==================================================
, L, h1 L6 N! L5 F7 R% m - ;PPU写入模式配置属性3 U ~) d4 l+ W: Y
- FC_PPU_MODE_CNTL = $FE ;带计数行写入
9 ] v! e% ? I+ k - FC_PPU_MODE_CNTC = $FC ;带计数行清除% l0 H$ ]7 f0 E1 h. M" j! h( r! X
- ;-------------------------------------------------* F& r: I7 d7 T% L, {
- ;PPU处理; U+ f( p* B5 R
- FC_PPU_Process:
# ^7 m2 Q: R: g1 d' _7 h - LDA FC_PPU_Buffer
5 b& b* i, x4 C* E- D7 N! x' s - BEQ FC_PPU_Process_End
& _" |- [3 Z& E, V - JSR FC_PPU_Process_Beg* F( E- k4 \ t# l
- FC_PPU_Process_End:* W) x# ?/ O: B; w, q
- LDA #$00 g4 k% I `& @8 ?$ ^& @2 f
- STA FC_PPU_Buffer
u: x+ F d0 _6 f- q$ K% E/ [ - STA $2006 J' I- y2 ?. z, a4 p
- STA $20068 s% V* p: M1 Z t- P" N# _) y: m
- STA $20056 k* w; p) E, R
- STA $2005
# i; L C9 E2 w, l! y6 \6 b" s; S - LDA FC_PPU_Status g0 P+ w0 [# J6 v2 d; }/ i8 }2 x
- STA $2001
( T7 z, y% }- i6 x7 t) h6 S6 C - RTS K+ a7 n, E: K. ^4 f1 `
- ;----------------------------------------; _6 R; Z0 T8 v! o
- ;PPU处理开始- i% Z! {8 d7 y, X2 }& }
- FC_PPU_Process_Beg:
* R, {+ T; m' W! |; n - LDX FC_PPU_Cursor: S; b0 ^3 T$ V
- LDA #$00
5 t( H) H& z: s) Y - STA $20011 {6 I! L- U( g) G" ]0 j3 p
- STA FC_PPU_Buffer,X1 ]; P5 L' g4 q
- STA FC_PPU_Cursor
7 Y# _ m9 }6 `6 b7 M - LDX #$FF
+ m0 t% |( {& Q3 `" p - CLV8 ?/ f/ K- d) B
- FC_PPU_Process_Mode_Select:
% d1 X7 Y' U+ w* j - INX) |1 z, | n& _! Z- t" `9 b
- LDA FC_PPU_Buffer,X
, y/ R0 \7 S/ l" i( z2 N - CMP #FC_PPU_MODE_CNTL+ R- _- s: `( z0 f- C% i3 T7 B) p
- BEQ FC_PPU_Process_Mode_CountLine
4 g6 e2 z0 l( }/ n - CMP #FC_PPU_MODE_CNTC
% w# p; T" I/ r, z- Q - BEQ FC_PPU_Process_Mode_CountClean
; z7 t3 C% Y; M+ F6 ` - RTS
- h; u& O5 V$ c4 `' X' [8 |3 _ - ;----------------------------------------
/ ]& l3 ^9 d% \ - ;计数行写入模式
3 X/ O$ o, h% A( P - FC_PPU_Process_Mode_CountLine:
( a! A9 _3 Y$ C* Q - JSR FC_PPU_Process_Set_Addr_And_Count
$ R/ O# X; H* |7 M$ j( F& \2 D' f - FC_PPU_Process_Mode_CountLine_Write:7 ^6 @( J' _& F% Q
- INX; h3 |9 N) D* u
- LDA FC_PPU_Buffer,X2 S# g w o: }& ?1 N3 e
- STA $2007
) b; m: `9 O1 K- s1 o7 b; g+ { H - DEY
% z- O( A4 H: f5 B* G! K - BNE FC_PPU_Process_Mode_CountLine_Write
9 T) P. g1 C) ]% N( a% m. \: U: I - BVC FC_PPU_Process_Mode_Select
0 G# v* V8 d% n' S$ s - ;----------------------------------------
1 N: S- `7 O1 @! [ - ;计数行清除模式- Z7 L& A! u. ^" n
- FC_PPU_Process_Mode_CountClean:
9 C5 f& O' S- J$ x - JSR FC_PPU_Process_Set_Addr_And_Count4 I" b4 r- A/ ~1 i+ D
- LDA #$002 v+ x& r. v6 @2 y
- FC_PPU_Process_Mode_CountClean_Write:9 x& t3 z' _4 I/ _' l* }
- STA $2007
! |3 E9 O2 i. ^2 [% H3 L - DEY
8 G x- D2 D9 Z+ J5 _. ?1 u - BNE FC_PPU_Process_Mode_CountClean_Write
! t5 ^7 ]* f! O( N! T" S - BVC FC_PPU_Process_Mode_Select7 K' c8 w _* r! N/ Y+ ?
- ;----------------------------------------3 k% G, W7 M- |- b# |4 a" L
- ;设置PPU地址和写入计数
# a9 c! X+ U( F Z1 u - FC_PPU_Process_Set_Addr_And_Count:% ~; r$ d* I0 o7 L' |$ G7 a3 M
- INX/ d# h( o8 ^4 ^! n* m
- LDA FC_PPU_Buffer,X! ]+ e3 `2 U' |7 ?: M* E
- STA $20064 \8 x& n- J- n3 y
- INX
: ~: {: y1 q; N) |0 ] - LDA FC_PPU_Buffer,X
& h3 p( l4 ^7 h& G5 S6 {; T - STA $2006
7 i3 E4 f3 G3 s' p( J$ S4 O5 s - INX2 F( T2 P* n1 {/ I5 g |
- LDY FC_PPU_Buffer,X; C& i2 w+ A. x, \, R
- RTS
9 G) c5 k7 Z8 P3 f
! H& m5 Y' Z7 o# C7 K9 t6 ?- ;==================================================
6 N; s( J: r6 G$ N5 M/ M - ;设置CHR图形4 C" F3 @ p; W( e
- CHR_Set:
1 Y9 E" C! b* r! X! B - LDX #$050 O8 x& s2 Q& G9 G3 O
- CHR_Set_Data:2 a" q0 M7 A9 E' `0 s3 t
- STX $80001 X/ M$ Q6 h- y% v- h: s7 }1 n9 A
- LDA CHR_Data,x5 N% [2 M5 L9 P% Z L0 a
- STA $80015 o# d3 G7 x6 \, R9 R% ~9 w
- DEX+ c8 Q" Y3 \% r- f8 x& T7 t8 w1 i
- BPL CHR_Set_Data, e" a! n f& t. p* f
- RTS
, Y; M, x4 s+ r - ;----------------------------------------* D" y: u+ o5 R4 ^5 q' T3 @* \
- ;CHR图形bank数据
* @5 i7 y0 \) S( j* l% p - CHR_Data:
/ c0 k3 E: n1 f, `, J& w7 K - .BYTE $00,$00,$00,$00,$00,$00
% I8 K4 z9 P- Q3 U1 c1 b+ { - / |7 x! j8 k; a/ {" M# l
- ;==================================================
$ f0 D) P, b, N, D - ;背景调色板设置
7 c5 c! D7 M% ` - Palette_Set:
/ M9 M9 R# }( A5 O - LDA #$3F/ p0 M/ ^3 a2 d6 l( Y0 v
- STA $2006 r2 ~: p+ m( t1 B
- LDA #$00# ^5 b7 B4 X& \/ ^! Z
- STA $2006
5 x. y/ h7 a/ k m - LDX #$00$ F. m( ?! M9 L6 U' A7 M3 i; l
- Palette_Set_Data:
. p+ e+ i8 M3 ]5 x1 ]& T - LDA Palette_Data,X/ n. P3 {% Y/ j$ e; z! V
- STA $2007( Q$ M' a$ I! v9 d8 C! p
- INX
% @8 m/ D- M8 X2 k7 b - CPX #$20) ?6 i) l* V4 A2 e
- BCC Palette_Set_Data6 A7 e0 z/ j5 P
- RTS' Y5 p9 S8 t, G# Z
- ;----------------------------------------; N0 \/ U2 ], m9 Z$ Z( Y8 Z" G
- ;背景调色板数据
6 b- }# C$ l% |* o& t' L8 b- P0 V - Palette_Data:0 x7 `/ R a. v* G1 f. ?. B
- .DB $0F,$29,$24,$24,$0F,$20,$20,$20,$0F,$26,$26,$26,$0F,$2A,$2A,$2A5 u$ k/ V) ?3 A) ~# ^; g
- .DB $0F,$20,$26,$16,$0F,$24,$24,$24,$0F,$26,$26,$26,$0F,$2A,$2A,$2A. c) `9 o; |- ]5 m3 g6 Z& J0 H; b
- 6 O( E4 N& S2 {* x
# R1 g5 ]9 I9 o- ;==================================================1 l! ^5 {. P8 W p1 x0 h
- ;按键扫描5 W7 `9 y7 p4 ~1 y8 U8 T
- Button_Process:* C6 ]6 v2 y" X I$ m
- LDX #$011 R0 c: q7 |5 w: D
- Button_Process_Beg:
' v- ?; a' q! S3 f; | - JSR Button_Scan* M& X! O6 q! D( O) q
- LDA Button_Keep,X; K, w7 |& }! {; A, s5 l
- STA Button_Temp,X
- P/ }, h* B4 y. N0 \1 \+ n# F9 ]% f( a- N - JSR Button_Scan
- L: E! H2 E! p3 R4 c% P - LDA Button_Keep,X+ a3 y7 [; y) P" q, ?6 C
- CMP Button_Temp,X
$ X: d" Y* R3 T# x - BEQ Button_Get_Once
6 L* Q% W3 @* [ - LDA Button_Buf,X* `+ Z1 @0 v6 W, |. x# `
- STA Button_Keep,X
7 ^: q! k( L# ?2 L! f* O( G- I' m - Button_Get_Once:
) j: G2 j! @6 P' B" p* T - TAY. j- \2 m! p' d! [, A2 X3 E
- EOR Button_Buf,X3 ?- P6 |+ o4 f
- AND Button_Keep,X# [4 v, K, d" v# u8 N5 q3 m
- STA Button_Once,X
0 {0 `& M# x a- W! w% `: e - STY Button_Buf,X2 `1 c9 R: E! ~6 b4 a( a# _( @
- DEX
1 e+ [+ |6 Z/ x, _ - BPL Button_Process_Beg
9 F. T" H* Q+ ?7 j" J1 e - RTS
+ _/ C9 b5 u& r( e% a- `( g& @ - ;----------------------------------------1 m9 P, N3 b; h# X! J6 k8 T4 P
- Button_Scan:
5 Q1 o/ {$ u: t' v: U) A - LDA #$01
/ Q/ h6 j6 e! p6 D( H% y - STA $4016; [- N0 K0 }9 d- Y" K- _# B& |
- LDA #$00+ Z- D1 F9 M5 G9 s8 ?1 g
- STA $4016! G5 d9 i E; R& h$ J( L
- LDY #$08
; g- N3 C& g* Y: G. C& z9 @# @1 h - Button_Value:3 N' r0 z( r. h3 B" x
- LDA $4016,X
) _( \9 _" `" F w# B! U - STA Button_Status,X% P1 X0 b u; |( z, k& L2 a j3 M) C
- LSR
& W/ }7 B$ j5 L( x# U# ` - ORA Button_Status,X
. W" G1 b- j% a: [ - LSR/ R F/ Q: j, c
- ROL Button_Keep,X) A7 d9 L% f4 W0 ~
- DEY
( @4 P; g8 n' _' m - BNE Button_Value" t* C- t6 o' h* x; U6 _
- RTS( S" q! p6 a2 Y: N% V* z2 F1 j% Z/ R
- 0 }2 E! H3 T. {4 [1 j
- ;==================================================9 G! a; U2 w. K/ ?
- ;按键自动按压, ~+ W' _: b0 J, B2 ]) }" N8 K' E
- Button_Auto_Press:
& }, h# L% B' d0 [ - LDA Button_Keep( B' F0 I5 [) b. ~; Z/ q
- ORA Button_Keep + 1
/ z2 _) g( ?" r B' a0 i( K! E - BEQ Button_Auto_Press_End' G2 `% ~7 O. t
- INC Button_Auto_Delay# m5 u. O* S( ~3 J. o$ _
- LDA Button_Auto_Delay
6 U$ f* h2 v; j# g4 D - CMP #BUTTON_DELAY_MAX5 W- W0 O! O$ D$ t7 S5 p$ b; G
- BCC Button_Auto_Press_No_Active
. O3 z4 p! Q2 ~ - LDA Button_Keep
1 I9 E2 O9 Z2 [) w8 `5 Y0 ], J - STA Button_Once
& J! s1 |$ Q: s - LDA Button_Keep + 1
3 ~( a/ P- {: L4 b- ^ - STA Button_Once + 1
4 a$ H! W# e" x2 d9 E$ [ G - LDA Button_Auto_Delay
/ c/ U3 d4 H2 K/ { - SEC( m5 c7 L2 L. Z% v7 L& T* Y
- SBC #BUTTON_DELAY_SPEED( ^% c8 _) V3 Q1 P/ C4 }" x
- STA Button_Auto_Delay% K5 I! m9 x. x3 g/ T
- Button_Auto_Press_No_Active:$ T8 _' a3 H6 P$ y
- RTS
2 V# R/ b) x0 ~$ @# X- y - ;----------------------------------------
! R7 Q* E1 b0 j. t* A0 [ - ;未按压按键
+ V1 E( \. p# V' L - Button_Auto_Press_End:
% ]* u- K; A4 Q( L( x; `* b. [9 n - LDA #$00+ w( `# I5 k# u) g9 \: p
- STA Button_Auto_Delay
/ Y# x: J4 B _" P( I0 i - RTS
/ `* g7 Z3 ~5 ]$ m5 ?, b - $ r# m" ~* L1 f8 w, q' H
- ;==================================================
& f8 o! a* `2 i# B: x3 | - ;设置PPU写入模式1 z, |$ _2 N; R1 C
- Set_PPU_Mode:4 n* N4 T- i) ?$ P
- LDX FC_PPU_Cursor. u1 O: X- u5 _' R
- STA FC_PPU_Buffer,X
5 c% b0 e; n2 ]9 }; S - INX. j+ b3 H: w p
- STX FC_PPU_Cursor
& G! x2 d2 B5 g% p - RTS
k4 p( m2 H: S. e( m! i/ e0 M
# f7 v) |& Q. ]; b- ;==================================================
7 T0 j V H: ]4 I+ C: ~ - ;写入单独一行文本
4 }/ }7 H( {% s9 Q' }8 Y7 u* a5 ~ - Set_Select_Addr:& N' I. o' q' z$ p7 p
- LDX FC_PPU_Cursor
1 ~. R- R/ i& W$ M8 a. i - LDA FC_Select_Temp$ m$ K# O+ ]! w! b; w; g+ P
- ASL$ R) Y( ]. @( @
- TAY6 @7 t6 n- a) D9 @, D$ {
- INY
}) D+ c f; [6 I+ }' R& D - LDA Text_PPU_Addr,Y
$ V) \$ f3 h8 s6 o. }! O0 a: r - STA FC_PPU_Buffer,X
' J) Y: @6 N: ~& q: r. v7 ~& w - INX
6 I3 S# V' k1 y3 _7 ?& ?" F \& x - DEY
. v/ B. y. I7 F) v# p; c - LDA Text_PPU_Addr,Y- U5 g& @/ X5 M9 C
- STA FC_PPU_Buffer,X1 @1 N) t8 m6 G* z& s* e
- INX
( `9 u( ~( Y; C- Y) f3 Z9 U - STX FC_PPU_Cursor& q+ O) C6 r3 m1 _; A
- RTS# Z$ O5 b8 J M" C9 a
- ' J' n! V' C$ F ^2 W
- ;==================================================
7 `9 U* x0 @' D; m5 c - ;写入单独一行文本
. ?$ k% T3 A; f( O( M) a: F$ [ - Set_Select_Data:4 j; {& M& |# V% T
- LDA FC_Select_Temp
. X: v( U1 n8 S( s - CLC- q2 W2 s+ w4 W( l/ i7 w$ l
- ADC FC_Page_Cur
# H/ _+ w/ W; P" i% M' ^$ O - ASL3 a; i, u* V. V4 q3 j1 v9 L
- TAY
; l$ E5 A/ t% K: o( r - INY# ?0 N' Q* l( g8 ~+ P* W% Q
- LDA Text_Data_Addr,Y
. S+ P, C5 D2 P4 u% C O& e! J" p! d - STA FC_Data_Port_A_H
) p* \. [; B5 E5 U+ m# P - DEY
8 u% X4 S9 u# g: }5 z& m8 I - LDA Text_Data_Addr,Y
0 c* N: F) G/ X6 @; N. g3 j* B& |! N - STA FC_Data_Port_A_L
6 \1 }2 d4 ?5 ^; J - RTS5 G, ^5 j# I* V( K2 P j8 M: M
- , E9 `4 z4 z7 {5 _9 {9 V2 Z o" W. D) t
- ;==================================================( ], i$ Y+ a N. {- r! _
- ;清除旧文本
* J( Y# h4 Z# z+ S9 h, X - Set_Select_Data_Clean:
" p b7 @1 l- }& E% a - LDA FC_Select_Temp9 Y7 V4 B1 p( F
- CLC
0 d Z. B9 a9 u5 s( [( u( J# X6 l - ADC FC_Page_Old9 _& {6 c+ N) s' p7 z" L
- ASL
) z! P& g/ H4 A+ ]* F6 o5 k - TAY9 y1 F4 W# Y9 K' t$ q# I# D
- INY
/ A& w4 v Z% v8 l - LDA Text_Data_Addr,Y, W0 t1 {' ]7 L0 r' c* F" r
- STA FC_Data_Port_A_H
& R1 z1 P- j' v; M - DEY+ A, t+ L# g1 i7 [9 o# [* S2 ~" L
- LDA Text_Data_Addr,Y% C$ W/ U6 a' y7 V$ {/ J- \4 v1 Y
- STA FC_Data_Port_A_L$ N. O3 O6 H: q! }
- RTS
! |/ \0 t4 ?' m
2 f6 T% C: i$ @# h3 j' Q3 P- ;==================================================; j+ i" x& j7 D- g. n+ W
- ;写入单独一行文本, O( b' [' h7 w3 ?0 s
- PPU_Data_Write_Item:
G2 x# z" n1 Y - LDA FC_Select_Temp' G" v) l$ \/ v1 ] c& o
- CLC+ [* k7 V9 a2 R9 W
- ADC FC_Page_Cur
. G& z. ?$ O) C3 k: T0 \& [' J - CMP #FC_ITEM_SUM2 V( T8 G1 E6 U8 ]( P
- BEQ PPU_Data_Write_Item_Set
5 P8 a7 e/ Z" c - BCS PPU_Data_Write_Item_End
6 N9 t4 g8 B+ e, I4 r/ l$ p - PPU_Data_Write_Item_Set:
. b; u! b, T1 g. ]# x8 o# c - LDA #FC_PPU_MODE_CNTL# v' ]) j2 @1 o7 e+ B
- JSR Set_PPU_Mode
( d# o% S) c. N0 G/ K& | - JSR Set_Select_Addr b* l9 B" s0 R; U% O
- JSR Set_Select_Data
( ~0 W& T: f( B/ } - JSR PPU_Data_Write_Line6 B: e3 i& V1 @( @+ ~
- PPU_Data_Write_Item_End:' n* J8 z) z8 ~7 ?$ T
- RTS5 ]3 Q" u; ]& e, B& g2 _& A
- 8 h6 C: e5 z. _1 h
- ;==================================================
5 K3 q" z" m% Z& ~, G. |% h7 X - ;清除单独一行文本
$ ]: _* p6 y7 @$ f0 l - PPU_Data_Clean_Item:; W6 ?. q6 ?- `2 Y" t3 d% I0 d
- LDA FC_Select_Temp. {7 a+ {* ?& V9 N
- CLC& m% E2 L3 [, M1 B
- ADC FC_Page_Old
7 N8 v. W' n, T - CMP #FC_ITEM_SUM/ g/ Z) ?- X# Z. O7 F; i) f2 p
- BEQ PPU_Data_Clean_Item_Set6 B3 l0 ^8 ? o5 ?, c! v
- BCS PPU_Data_Clean_Item_End# X2 G% Z# U" x2 R% ]/ d: T; X
- PPU_Data_Clean_Item_Set:
( o. B; T# u# _7 V S w - LDA #FC_PPU_MODE_CNTC
6 o& R8 {% @9 H0 B! S6 [/ K - JSR Set_PPU_Mode
! G4 |# r" g, G6 e2 \ - JSR Set_Select_Addr/ @* \& _+ ?/ `/ l8 U, {& U
- JSR Set_Select_Data_Clean I. T8 n4 P1 c1 J: F
- JSR PPU_Data_Clean_Line/ [* ~9 f: R. h3 P4 j
- PPU_Data_Clean_Item_End:4 a7 }4 l0 i! ^# ]7 e3 W8 \" i9 v
- RTS
( `3 A2 Q/ m! }
9 i+ D: N3 u5 c1 G- ;==================================================9 G7 M: G+ V) w1 Q: }
- ;页内容写入
7 ^0 q1 L- _1 W+ }* [7 L- |% }/ C - PPU_Data_Page_Show:
* y! H% b8 H/ Y6 N; s# e - LDA #FC_PAGE_SIZE
( X* ]# n" v* b' z- l - STA FC_Page_Item_Count# B! q) S; s$ U% r. M
- LDA #$00
/ e. S0 b# w: A7 B4 u I - STA FC_Page_Item_Buffer3 o. p3 @) \) } ]) C
- STA FC_Select_Temp+ P$ E. z+ E9 B. a- \* Q
- PPU_Data_Page_Item_Set:% @, {& u8 ~" s4 Q* B
- JSR PPU_Data_Clean_Item, t; s& `0 i t
- JSR PPU_Data_Write_Item
% z& ~8 S' T6 O* x4 s - JSR Function_Status_Clean
2 X: ?9 }2 y8 w. W: t; y - JSR Function_Status_Show: w! ~+ a# x. w' H4 X) u" n
- INC FC_Select_Temp8 d& O/ D: I1 N0 |* G; \
- INC FC_Page_Item_Buffer( g3 c, |' U/ \( t2 r
- LDA FC_Page_Item_Buffer
9 `; L. Q% N" {' n% I" e6 z - CMP #FC_PAGE_BUF_SIZE' i9 p. o! P; W+ A* y, E
- BNE PPU_Data_Page_Item_Set_Check
4 c( {. d7 }% S; o6 f- C - JSR NMI_Delay$ Q i: Y% y+ e* k* u; i0 f2 n6 X
- LDA #$00* Y" |1 ^9 m; n" m- x. _. N$ n
- STA FC_Page_Item_Buffer
% n; r: H/ A/ f" Q8 ]1 ]. T2 ? - PPU_Data_Page_Item_Set_Check:
. w2 y% m6 H6 c" d - DEC FC_Page_Item_Count* G& Q s" ]7 g5 p# ~
- BNE PPU_Data_Page_Item_Set* ~9 j3 D7 S f% g! e% p
- PPU_Data_Page_Show_End_Check:4 S/ o) L6 Z# ^) w4 u
- LDA FC_Page_Item_Buffer
% m2 [: w6 d4 o/ c: ~$ v - BEQ PPU_Data_Page_Show_End
' r! f) m4 i& `1 b1 g3 O" f$ c' Y - JSR NMI_Delay4 }2 h$ h/ p- O9 b
- PPU_Data_Page_Show_End:, p0 F2 ^( }' y9 D4 H
- RTS& x; ]' @/ v) g& N' S8 n
: b; ^' u4 K, N! p: @ B- ;==================================================
8 m: {$ M+ o, A6 F' C! G$ Y - ;PPU单行数据写入接口
: K- B5 Y' k% c - PPU_Data_Write_Line:% F+ S3 N& `; J
- LDX FC_PPU_Cursor: ] Y0 i& w* H/ e" C! w7 Q- j; X
- LDY #$00
F- |/ I2 {; S; J - LDA (FC_Data_Port_A_L),Y7 M- N. V, v7 S# u) u& U
- STA FC_PPU_Buffer,X
- C0 E& Y) [8 H e# s - STA FC_PPU_Data_Cnt3 p# Q+ r4 w: B% Y2 e! i
- INX( c* T7 d' K g" X7 Y) j
- STX FC_PPU_Cursor9 e3 t R& Y4 U$ G2 N
- INY
3 Y+ [$ ?3 m9 ^: ~; C3 g - PPU_Data_Write_Line_Set:0 F6 }( S u& M. y1 R) Q
- LDA (FC_Data_Port_A_L),Y
2 B! l/ U S. W3 Z% E8 r; j" g: i - TAX/ ?4 O2 J7 `! z5 X+ U9 [6 H
- LDA Char_Rom,X
: f" d# R( N3 Z% x1 v, U( s - LDX FC_PPU_Cursor
& l% G. ]+ }4 q3 e - STA FC_PPU_Buffer,X
# l+ C& V0 X( B5 U - INX
$ q& a. ]4 p) S. o& _ - STX FC_PPU_Cursor
$ j5 J _3 h: B8 |4 B& O$ L - INY
- ?" q) F' Z3 e+ J6 x' }0 x - DEC FC_PPU_Data_Cnt& w5 J2 \/ t2 {5 B) f9 ]. g f/ k
- BNE PPU_Data_Write_Line_Set
# ~) s' L5 u6 J# _ h" p/ ~ - STX FC_PPU_Cursor
& j% c! p& l1 L - RTS
2 H/ t' k( J7 w/ @9 r( X' F2 T - + s- b% r0 s: J8 M" V2 ?( @
- ;==================================================
0 C! ^& u$ y" v# T3 \- o - ;PPU单行数据清空接口; @4 Z) y; Q- }- }% H
- PPU_Data_Clean_Line:
. K9 H; i9 Z* a - LDX FC_PPU_Cursor7 f8 {6 A% F/ q; P5 |' [
- LDY #$008 n$ l2 |9 X( q: n! u
- LDA (FC_Data_Port_A_L),Y8 }% \6 ]- r7 w
- STA FC_PPU_Buffer,X
4 s, z! n* _' @& y# P0 e+ n - INX( E8 z: l9 g8 `& e( C1 ]( t3 L
- STX FC_PPU_Cursor0 R |9 X- F8 i3 P) r
- RTS
' u) v4 f. _1 _8 g3 z I
2 v$ {: u3 [4 E- h7 H# w( Q- ;==================================================7 V; v- P1 A3 [* o L ?; `/ `9 {
- ;更改选择项
; j$ ~* W/ I3 f0 f/ I - Change_Select_Item:
. q8 y% c3 V0 v - Change_Previous_Page:
4 i% k2 \7 C& g+ Q$ v" j - LDA Button_Once
2 L C7 z9 `" {) x; Z* I - ORA Button_Once + 1
2 z. T3 {# k3 f9 {6 U2 d% Q - AND #$029 p$ z9 D8 d" t# C% Q- F
- BEQ Change_Next_Page
# K) g) Q5 w: ] - JSR Change_To_Previous_Page9 M' a1 Y6 U& v4 Z1 C4 f9 R0 K
- Change_Next_Page:
6 ^1 A! _( C/ ]$ L5 n$ w6 R - LDA Button_Once/ ?, C. o9 |" v
- ORA Button_Once + 1: D2 ?5 \% H. B9 d- j
- AND #$01: g+ D" v8 X* o
- BEQ Change_Previous_Item
5 e7 g j! w9 i2 | - JSR Change_To_Next_Page
! E$ {8 F* k9 h! x; @( V* [. a! h - Change_Previous_Item:& a$ _# t/ c( k' `8 T7 k3 Q* R
- LDA Button_Once
, B' Q! Z% s0 A0 _$ R4 D - ORA Button_Once + 14 n2 |7 m' |4 k3 F/ a: D
- AND #$08+ \" g6 Z: c; C5 F$ `2 Y
- BEQ Change_Next_Item
+ m% v- Q2 m4 ~ p - JSR Change_To_Previous_Item) N& v' X) w; J$ ]9 {
- Change_Next_Item:
9 S. M( E8 k0 _7 J# h9 i) E - LDA Button_Once5 }: p2 e; m' Z w
- ORA Button_Once + 1
4 C2 B. k6 O$ b v, e* f - .IF FC_IS_DOUBLE_PLAYERS% m, j- d- m7 i
- AND #$04" H" K( e, g" u. a7 u
- .ELSE
6 t. n+ ^: v4 _7 G+ F8 l- T - AND #$24
2 l$ f5 L, @+ r% Y" o9 `' C8 m - .ENDIF6 H: w' Y9 R7 X5 N& {
- BEQ Change_Select_Item_End: [5 z+ H8 K9 s0 M/ u/ s- I K
- JSR Change_To_Next_Item' A, L* _- P# V W" A3 H6 s; o
- Change_Select_Item_End:
; l- `. M# N; _& L0 L - RTS
0 h, H( M7 O1 |4 p - $ j3 f2 O* y% F0 k
- ;==================================================
$ }/ \ r: |6 f& T! u) J6 [6 i - ;切换到上一个选项; X+ }; p6 n/ ]) i
- Change_To_Previous_Item:
3 `" q# r( ]6 A0 `7 u; d - LDA FC_Select_Index! F. F# r# C; n6 P5 p! N2 |
- BNE Change_To_Previous_Item_Set
! @: E8 U$ }" b1 w+ R4 B0 x - ;----------------------------------------: `( F3 r$ @# E
- ;切换到末页最后一项9 x- e$ q* a/ a0 P8 ^
- Change_To_Previous_Item_Set_Last_Page:% i3 z* P( P0 \6 `
- JSR Record_Last_Page_Index
7 K" h8 q2 F% w' f - LDA #FC_ITEM_SUM: E) j/ t. D5 e* Y
- STA FC_Select_Index2 @% u4 z" e2 [8 J
- LDA #FC_PAGE_MAX3 Q: y6 e1 h: c3 D3 A
- STA FC_Page_Cur
( O, J8 |% \+ P) ]- J - JSR Update_Page_Content, I* `& z$ G& ?) k @
- RTS
% G- h7 B+ v5 j. F9 h: C - ;----------------------------------------. m: r, s h. X. b6 ]8 c. p" w: G4 m
- ;切换到上一个% U! L/ H& S% y( j& C3 ?6 k
- Change_To_Previous_Item_Set:5 Q7 G- `/ H3 B6 {
- ;检查是否需要换页/ L Y3 ]% Y0 {+ B/ N( V& d, I
- LDA FC_Select_Index
5 v' ?, B! _, Z. _ - CMP FC_Page_Cur
" \& y% m2 _1 S! e+ j) ?6 l - BNE Change_To_Previous_Item_Set_No_Page
) U2 ^: _, p8 m9 i: R l - ;----------------------------------------, e9 Q* m' b9 [, M: C o
- ;切换到上一个(需换页)3 C6 h. I, d- d2 m3 m! H( U
- Change_To_Previous_Item_Set_Page:% C$ q0 D% _5 B* {) C5 u6 D
- JSR Record_Last_Page_Index
# P. u7 p/ _9 u* K& P8 l - LDA FC_Page_Cur2 s8 O3 [, w, T1 }
- SEC* K4 _4 \( g" `6 L2 `1 N3 ^
- SBC #FC_PAGE_SIZE8 n$ A: @0 p7 ]9 W# |! k* d
- STA FC_Page_Cur6 a& n6 e5 H" b: `6 e
- DEC FC_Select_Index6 Q1 F# `0 Q2 F5 A
- JSR Update_Page_Content0 K5 O# i: I; F; z+ {' G
- RTS I+ `" @7 e# \% G
- ;----------------------------------------
4 K" D2 o8 C/ T9 _. M& d0 k+ Y - ;切换到上一个(无换页)1 J, j4 J$ r/ h2 G" a
- Change_To_Previous_Item_Set_No_Page:6 }7 x- _1 F" n% v/ |
- DEC FC_Select_Index
- z- Z# `, M) l1 }+ R2 y - RTS
0 |. ]3 }9 T( I1 x) [' \3 V - 8 F" r: ]2 d. c5 ~5 D
- ;==================================================
& B+ n3 `9 g" ~ - ;切换到下一个选项# l* X, H5 m; |
- Change_To_Next_Item:$ X; D& R; r! S( ~1 t; v( ~
- LDA FC_Select_Index
. q" d i$ S$ C: T' _9 v - CMP #FC_ITEM_SUM+ b5 U* y' ^2 R5 x7 k) |: o
- BNE Change_To_Next_Item_Set: R: K5 \* A6 Y
- ;----------------------------------------2 X6 |/ a6 U7 V1 |* I4 I4 j
- ;切换到起始页第一个* O2 f7 p# B6 h M
- Change_To_Next_Item_Set_Begin_Page:* X+ }5 N) r9 Z. q( X6 x% w/ Q* H
- JSR Record_Last_Page_Index
, g2 ~) ^7 ?# V- K/ u* k - LDA #$00
' H& s3 y% D6 v p, v+ ?6 Y - STA FC_Select_Index
, @4 i, Z0 _& i0 { - STA FC_Page_Cur
e! F' R1 q" Q# c: y - JSR Update_Page_Content" v. t) E# {: X' w2 x
- RTS
1 ^/ b6 `& v0 q - ;----------------------------------------
0 @; x8 V* N! \ \/ i a ~+ q0 a - ;切换到下一个
' L0 i* d3 {5 n0 f - Change_To_Next_Item_Set:' Q7 I5 l' f9 ?4 x% ` F( ~/ j
- INC FC_Select_Index* h: v" h. R. ^8 x1 ^2 c
- LDA FC_Page_Cur) m" ?5 ~9 @$ a& y1 G; [+ P/ q+ E. U
- CLC
6 [" D% i$ I- m4 Z7 O - ADC #FC_PAGE_SIZE
( {. h2 [1 v9 F3 n - CMP FC_Select_Index
v* U- C& r. R+ p% @" B - BNE Change_To_Next_Item_Set_End
. \2 n7 {3 M, R, W0 ?4 y - ;----------------------------------------
& o. g9 P E" @ - ;切换到下一个(需换页)
V$ G, u7 V! ]! q. G9 Z - Change_To_Next_Item_Set_Page+ _8 ^2 t j0 D3 P
- JSR Record_Last_Page_Index
# h, `6 b* h9 m - LDA FC_Page_Cur# e# T1 I7 e9 M. M" W2 u' H
- CLC
% w" A7 t7 R0 a9 Q3 m \ - ADC #FC_PAGE_SIZE
2 y, L0 T. I& `( @- a; L3 @2 P - STA FC_Page_Cur
3 y7 B4 I; `, f* f" y - JSR Update_Page_Content
$ E8 J) A1 W% U7 R - Change_To_Next_Item_Set_End:, Q1 |0 ]: l' E5 w+ {, J, F
- RTS) V% N; S& _2 d2 T* q% n8 N
- + @" A. ^! d- f/ v0 E8 ?
- ;==================================================5 g: R/ n7 E, ]. F& f/ ]+ t
- ;切换到上一页
) w; S( N- ]' z8 }8 Q( y - Change_To_Previous_Page:
( `! a D( G4 ]+ m - LDA FC_Page_Cur5 L" j9 _0 j# `, Z+ k1 @7 h: c, k3 N
- BEQ Change_To_Previous_Page_Set_Last_Page1 L8 J8 S6 E$ H5 n
- JSR Record_Last_Page_Index
1 X5 p% {0 E. z. c$ t - LDA FC_Page_Cur0 y% {* H( L, A$ X9 g* a& n
- SEC
3 z5 H+ b( Q5 e* G0 a - SBC #FC_PAGE_SIZE/ G* D4 V. Y! K% w: y6 u& N+ t
- STA FC_Page_Cur( d) `, o. K4 u- B' p# B
- LDA FC_Select_Index2 n5 n& U* i- V0 k" v# `' l
- SEC
% @* u$ q' ?5 p# J5 D5 w+ E - SBC #FC_PAGE_SIZE
- n8 I7 X* _' z3 ` - STA FC_Select_Index, r6 z% R4 N) h Y% U- c- e. h* M
- JSR Update_Page_Content
6 H2 E$ M, K) P a" V+ x$ [ - Change_Select_Last_Page_End:* u+ {+ B: ?9 I/ {
- RTS% f1 C6 A& Y! B# T
- ;----------------------------------------. s$ L* U' w. U1 R' d8 w1 _+ j
- ;切换到最后一页8 x+ P! H& v5 _" C: r1 L
- Change_To_Previous_Page_Set_Last_Page:+ t, U1 P+ k. P
- LDA #FC_PAGE_MAX8 ^& v: a6 u, d8 _
- BEQ Change_To_Previous_Page_Set_Begin_Item' ~" A4 o3 l; U( B4 F9 p9 J
- JSR Record_Last_Page_Index
. U" {* h8 u' b# k- }1 z# Y - LDA FC_Select_Index/ J0 l# H, ^8 \3 H$ B
- SEC" l: ` l! W" `( R7 ]
- SBC FC_Page_Cur* K8 b3 E! r% s( P, `
- CLC
! j( i4 z4 ]$ @, b8 t8 ?+ L4 E - ADC #FC_PAGE_MAX* e6 M! @3 e! G$ x3 b2 ]: n
- STA FC_Select_Index
- b8 L( t, _4 _. t$ M8 w$ C- l - LDA #FC_PAGE_MAX4 v- d( U! t0 O* z8 E
- STA FC_Page_Cur' t& T0 @) F: M. O4 a# J
- LDA FC_Select_Index. W! C3 v; l; U- h r5 N9 o
- CMP #FC_ITEM_SUM5 q) }& G* M6 T9 g6 v9 `
- BCC Change_To_Previous_Page_Set_Last_Page_End( M5 X( o6 q. y0 k s7 I
- ;----------------------------------------0 l! E" W- ^- Q" O* j
- ;切换到最后一项9 _, u. j4 c1 S" y, T
- Change_To_Previous_Page_Set_Last_Item
( Y7 ~( J$ {1 G `8 {- t; h - LDA #FC_ITEM_SUM
# W6 I! D% z7 J. O* x/ } - STA FC_Select_Index
9 o4 c: p% G' o4 o, i - Change_To_Previous_Page_Set_Last_Page_End:+ ~! p+ D8 A( Q2 f# D
- JSR Update_Page_Content- Z& d" C Q, p' d% m& K
- RTS1 e0 l) n) K6 L9 P5 _6 A$ g+ r# W0 @5 x
- ;----------------------------------------1 J$ W6 h* P# n7 z! o; s; Z8 S; s
- ;切换到起始项(最大页只有一页时)/ M# r. X+ I8 D i7 @
- Change_To_Previous_Page_Set_Begin_Item:
8 Z# P, @6 D! g2 R; R3 z - LDA #$00; C% P/ ^6 z, o0 C5 X# C9 {' v
- STA FC_Select_Index
0 w- b$ c0 t4 Q" j3 Y( v+ u+ ^ - RTS
- f$ j9 o$ m/ u! H: f2 s
; b$ R' ?4 ^4 }3 K5 T5 i6 ?9 y- ;==================================================
4 @+ _$ O: k# ?6 ]3 z, A2 Y. C - ;切换到下一页- I9 w& n9 |) Q
- Change_To_Next_Page:( p1 Q3 @8 {# n5 q5 y, g
- LDA #FC_PAGE_MAX
) [& o9 A& H0 p* V - BEQ Change_To_Next_Page_Set_Last_Item
; Z* W3 k, u6 Z* y2 O - LDA FC_Page_Cur# m3 A" G3 o- d( S a4 G5 l f( @
- CMP #FC_PAGE_MAX8 p) j( P7 J7 G. D( v3 k; t5 ]
- BEQ Change_To_Next_Page_Set_Begin_Page) @7 m* [; Z% q/ K" T' |, t
- ;----------------------------------------
$ O# V l* D+ N4 F3 K - ;切换到下一页
" a! u- f( i$ t - Change_To_Next_Page_Set:+ p; m B) Z+ E& ~" v- a
- JSR Record_Last_Page_Index& v+ y9 ?' u. S2 r0 S6 K
- LDA FC_Page_Cur
; Z# g* a3 e" B0 C - CLC$ q6 ^4 z' q# y/ y7 X
- ADC #FC_PAGE_SIZE
6 A! |, O- c' h$ v6 Z" d+ c, T% \ - STA FC_Page_Cur
: U0 T2 o/ y- t1 |* c6 @9 j- g- M - LDA FC_Select_Index
" z+ O, O( u$ t' [7 S# Q( D4 y5 o) L - CLC6 r' ^* z! [8 ~+ ?
- ADC #FC_PAGE_SIZE
8 c- Q/ \6 J1 |1 ^- o - STA FC_Select_Index( V6 v6 \; r% c; K/ l4 {
- LDA FC_Select_Index) ]5 f: u5 u! X. G
- CMP #FC_ITEM_SUM1 o$ i* D1 I2 b* n M, _
- BCC Change_To_Next_Page_Set_End3 u7 C0 [, i j8 F! W
- ;----------------------------------------- j, K* R- o, |5 `8 E2 P
- ;切换到最后一项
; L- p% K; W0 a6 C5 j! @1 m/ J/ W - LDA #FC_ITEM_SUM5 s; F9 r" m* m. r0 D
- STA FC_Select_Index$ x0 _6 {% b/ d
- Change_To_Next_Page_Set_End:- o' n" t5 N6 }/ G: F
- JSR Update_Page_Content- d4 \$ L3 u% d7 C7 w
- RTS
/ a/ r# h7 @5 o/ f$ U0 ]% D - ;----------------------------------------
) \/ X9 M8 v9 h' ~; t. _; t - ;切换到起始页. c |' [3 ^$ W; i9 N/ G
- Change_To_Next_Page_Set_Begin_Page:6 o" Q* S) i* ]9 P) X+ X
- JSR Record_Last_Page_Index1 L4 m( _% x; t- M; T3 N
- LDA FC_Select_Index2 F! |; J9 r$ y' G {! e
- SEC" t/ S$ J n4 I8 e, N
- SBC FC_Page_Cur
" n- _8 g9 C7 `3 C3 a" {8 E% t - STA FC_Select_Index# C9 r! f' y' b" Q
- LDA #$00( D9 d9 N3 g7 ?
- STA FC_Page_Cur- [# J8 E1 a, y! ^' ?
- JSR Update_Page_Content9 k$ Q! \! I7 y2 Z
- RTS2 s/ C4 X- D1 u& j- @
- ;----------------------------------------
: l* Y0 R+ Q, N/ `9 _3 x - ;切换到最后一项(最大页只有一页时)
& G; e0 V9 d0 w3 Z$ G. S - Change_To_Next_Page_Set_Last_Item:; D5 q# ~/ S: o, J
- LDA #FC_ITEM_SUM
6 Z! K$ ]- @0 x1 b( R" l5 v+ A - STA FC_Select_Index2 F' m) h5 I% Z0 ~
- JSR Update_Page_Content
( f, C; o6 P/ y' f& \7 C3 _ - RTS* U4 B0 \( K9 Q) C5 C2 k: `$ E
- : r! f+ j4 Z; B: b ^& H
- ;==================================================
* V0 a$ F/ l% [& E - ;更新页面内容
7 n" k0 h$ t& C. n% o. H - Update_Page_Content:5 S! x7 K; f {8 q# X8 r1 x
- LDA FC_Page_Cur9 z. s5 t- x& q1 ?. Q+ d' u! c1 T
- CMP FC_Page_Old2 v9 _4 O& V2 g' B
- BEQ Change_Update_Page_End6 C! q! Y9 t% B. g, U% N5 x( d
- JSR PPU_Data_Page_Show
1 M3 i8 C+ M' n4 [ - Change_Update_Page_End:; I4 `# |2 u$ |$ `4 Z3 p, L
- RTS; s) s5 |1 Q1 d% J8 ~: j$ ]
! R! M5 x! S$ Q4 s- b$ _7 U) s- ;==================================================% Z, m' j" [; i$ L
- ;记录上次页索引. \6 j6 H0 L8 @- I
- Record_Last_Page_Index q& i8 j, H+ ^% G! t) H% u# v
- LDA FC_Page_Cur5 T0 {0 e" W! r) L- B, Z
- STA FC_Page_Old3 e4 F( `) h: p- `; ^# d, N
- RTS/ M. P% q* S* O* ^2 a
- / u) u' H3 i0 E9 `% X1 o- ^- \" y
- ;==================================================7 B" X; Z6 C# F
- ;显示当前选择项光标& n& l! B' {6 P) }
- Show_Select_Cursor:
7 c7 t: E S/ r - LDA FC_Select_Index
# R4 N- }) e- f( v' h - SEC
0 f4 o1 t/ a+ ^( t/ K! h9 x4 B3 M+ Q - SBC FC_Page_Cur# _: O8 f- L @/ l4 X4 T
- ASL
* S" s) i% q$ j, ?$ S4 Q - TAY G, `% \- u, i9 H
- INY! w3 n5 [% U3 L3 c; d
- LDA Text_PPU_Addr,Y0 k( c8 X& v8 V8 c, b7 T+ t3 D, Q) O
- AND #$03* _) K. w) P6 O& ~* @
- STA FC_Cursor_Addr_H8 [, s0 i" B4 m o
- INX9 D) g; Z! E# C5 _: V1 Y) b5 k8 w& f
- DEY
3 M: D' Z: _* M2 Q - LDA Text_PPU_Addr,Y
8 f0 T* H& ^( J* s8 y, ? - STA FC_Cursor_Addr_L
9 o. O1 q1 T- T$ T6 B$ V& n9 W% Y - ;----------------------------------------
& l- Y: ]& {! R; ^7 q3 _% h - ;计算光标X坐标
& ^$ [6 R1 ~+ M% O6 {7 B, a5 m - Show_Select_Cursor_Set_X:
/ s) s0 F+ R' n$ ?$ T* U" ? - LDA FC_Cursor_Addr_L
2 ?4 j A+ c, f* ~# d6 J" ~$ q8 p - AND #$1F( y$ |9 _1 a3 b. c* ^9 ~
- ASL
0 c' Y9 t& D+ }3 ?" x - ASL$ g5 g; ^9 O7 g
- ASL0 P0 Q/ _1 w* [) m. N
- STA FC_Cursor_X. G1 |6 A7 ^. o% ]: Z
- LDA FC_Cursor_Addr_L
" u# |, \: ^- K4 G8 n - AND #$E0) U& L% I0 ]3 a: f0 O
- STA FC_Cursor_Addr_L# V# C( I, b5 [
- ;----------------------------------------
( d+ A: @9 U: [# e - ;计算光标Y坐标! X* A! u, K \; B* ~# _
- Show_Select_Cursor_Set_Y:
* c7 E' X- l3 g - LDX #$05- L) m! f6 w9 Q1 Q" T, ~) H
- ROR FC_Cursor_Addr_H
/ Y- h/ {5 ^ y& u+ ? - ROR FC_Cursor_Addr_L
* T T' d& `+ B4 |2 R% j - ROR FC_Cursor_Addr_H: |& ?7 B5 C: x1 j* u) O
- ROR FC_Cursor_Addr_L
, ^ X% {& Y& G1 \% G, {) \ - LDA FC_Cursor_Addr_L
) Q; j0 s8 n4 `9 |" C9 W$ ~ - STA FC_Cursor_Y% n8 {" V0 W0 d: i8 l/ X
- ;----------------------------------------
* ?8 ]* g. D4 G; v1 U - ;写入光标
; x9 I' i- }# s. z& A; i+ a9 d - Show_Select_Cursor_Set:
. w$ {1 W7 [2 Y1 b - LDA #$00
" h! ]7 _& n. V7 I. | - STA $2003
( X/ T# W' g Z* a! L& U8 x( D) x h - LDA FC_Cursor_Y" O" e. i5 E0 |4 x
- SEC( L3 b- q" k E- K D- d% B B L
- SBC #FC_CURSOR_OFFSET_Y
: I9 W+ j6 @2 H) _9 E8 M) o) q - STA $2004
3 l! I( g/ x4 ?# I/ E/ d4 W! `! q - LDA #FC_CURSOR_TILE Y, Q- X6 o, Y9 n) @
- STA $20044 t6 R/ K2 B* E! f$ U
- LDA #$00
; F3 q4 p, f' g9 ~: t) C0 n - STA $2004& D" j* j" R0 z* k7 C1 H- w7 b% c* S0 Q
- LDA FC_Cursor_X" d. U; g6 H6 L" I( a3 S
- SEC" ^9 ~$ ]4 @& ~" U4 H
- SBC #FC_CURSOR_OFFSET_X
' j/ |5 @. r; f6 k - STA $2004
" i0 B2 q9 h _/ f9 l9 H - RTS. d9 ~& J( V$ \
2 o5 @% d1 K9 ]7 H. u- ;==================================================9 G2 s/ r/ i2 h6 u
- ;切换功能
3 K0 y8 B W1 s - Change_Function:3 c0 m) j' q }# [1 Z0 L5 p' G
- ;----------------------------------------5 B' T5 m# l1 h: E1 x3 w) _; U2 v
- ;开启功能A+ M5 C6 W2 v4 h b3 O
- Change_Function_On_A:
9 {$ _. ^7 \" H8 H& R1 L - LDA Button_Once
@- ] M# Y7 N5 ?' x' I2 [ - CMP #$40
, Q6 K; h& B. R h+ r' h - BNE Change_Function_On_B7 E( z& S4 c+ v3 A/ Z( C( r$ M7 w
- JSR Change_Function_To_On_A- k& D( P# I+ ~9 ~
- JSR Function_Status_Update5 L5 @+ _# s' c
- ;----------------------------------------
% k! {- c. |' z7 B - ;关闭功能B. ^2 V+ e, V! j2 O3 d* u
- Change_Function_On_B:
% H0 |9 x# d) Y4 n" h6 L2 \* i8 ` - .IF FC_IS_DOUBLE_PLAYERS
S _3 u% k1 i+ g6 _ - LDA Button_Once + 1
' o, `* J/ S8 U7 s5 r, E - CMP #$40, g+ r1 s# Z& _/ B- _
- BNE Change_Function_Off_A
" V% |% b4 K8 C! Y - JSR Change_Function_To_On_B8 Q; S) O o1 h3 P5 H
- JSR Function_Status_Update
- E1 O8 M5 P! {, l - .ENDIF
4 O9 M# M y7 \ Z- F: Y - ;----------------------------------------: q8 c9 B( }* v# ~& a* w
- ;关闭功能A
& o. h; B! j" r" i* {. T( v) V- L* M" X& b - Change_Function_Off_A:
( D: p5 H$ @- I - LDA Button_Once) X8 A% L f& r& ]8 j8 c
- CMP #$80
4 F' i7 |. g: R5 R9 h# e+ v - BNE Change_Function_Off_B
1 x/ V$ j0 ~' ]! P - JSR Change_Function_To_Off_A) P* h" F- F9 b1 P6 l5 t
- JSR Function_Status_Update
" y8 Q% Y: A" M& F6 K: r - ;----------------------------------------8 `5 v) \0 x- Q7 ?# g
- ;关闭功能B
( g/ \. U7 X) L8 A - Change_Function_Off_B:' X6 G C1 P. v/ V' d2 s
- .IF FC_IS_DOUBLE_PLAYERS3 [ d4 Z3 \- R
- LDA Button_Once + 1$ a" L% k6 A6 I" o; D- ?& s
- CMP #$808 y, C$ K4 b/ v/ U3 h0 `
- BNE Change_Function_Swap+ e; _0 u3 i4 r9 r, m
- JSR Change_Function_To_Off_B. P5 p8 o' ~5 D4 Z2 D7 j! `
- JSR Function_Status_Update$ ]# B; U9 T" S3 l8 N8 I2 U
- .ENDIF4 R* d$ q! S% @2 D
- ;==================================================
7 A2 z1 m. f& z" ? - ;交换开关
) d; J1 w: i+ k' b, f. t9 g* g: o - Change_Function_Swap:6 \: }! U% ]7 Y! w8 R
- .IF FC_IS_DOUBLE_PLAYERS
% W0 ?/ T5 t, i/ U0 A - LDA Button_Once
5 `4 v% H1 B" I! L) a - ORA Button_Once + 1 O3 G6 I6 D) N4 G
- CMP #$20* | s6 m8 ?8 h: F- K0 l
- BNE Change_Function_End, N+ |" C e9 |3 `2 |
- JSR Change_Function_To_Swap
7 Y; { I7 |9 N8 `0 e9 `# ]7 b/ L9 L - JSR Function_Status_Update
# I4 H, m! i b& v3 Q7 ~) w7 s - .ENDIF
; o. w5 u$ [2 |9 Y2 u4 A - Change_Function_End:* [, Z8 R6 z L2 h
- RTS: w- M2 v% E+ C! p$ d& ?, d
-
( y% K4 \# J% b, p$ ^% b! w - ;==================================================; g3 g: \- h1 S6 F Q+ @9 a0 c
- ;交换开关状态9 U% o. i }9 L0 ^3 K, a4 B9 I- r
- Change_Function_To_Swap:; o, S& e/ y5 x) r z4 a7 K
- .IF FC_IS_DOUBLE_PLAYERS
) n; Q6 o/ \) ]( K6 [* T2 u - LDA FC_Select_Index2 j1 Y: k( i. ]" @& y6 v: [5 ~
- SEC B( P( H( c Q. R: P3 Z
- SBC FC_Page_Cur+ F5 @/ J" Y% @1 w& H5 i* f3 O
- STA FC_Select_Temp
1 Z; v$ D. J3 z7 P9 M - JSR Set_Function_Port
, t. p2 c& m; F5 Q+ L - LDY #$00
. |& _" m( s, X: [4 m - LDX FC_Select_Index+ \+ ?8 _( W5 L$ B* i( J
- LDA (FC_Data_Port_A_L),Y
" Q) @" n5 o- [% Z) t9 Y - EOR (FC_Data_Port_B_L),Y
6 ?- D) H( a6 x/ C- _0 O - AND Function_Check,X
% U& C! ]# E& c! J9 Q - BEQ Change_Function_To_Swap_End8 @- D( r+ _9 e. n( z! f
- LDA (FC_Data_Port_A_L),Y
3 G5 u# A( u S6 L+ d - EOR Function_Check,X
6 `2 i2 O/ }) Y$ I, i) n( u: n; U - STA (FC_Data_Port_A_L),Y
- L' z8 X( ~1 y! _5 ~5 d - LDA (FC_Data_Port_B_L),Y
+ s, L7 O% A v4 J. N$ y - EOR Function_Check,X9 q! p1 s8 H: s# ?4 g. |, z5 Q
- STA (FC_Data_Port_B_L),Y& o# Y( S& Z# I3 p" I: Z! I9 x
- Change_Function_To_Swap_End:5 Q; A* y1 e! |! x& \; K
- RTS3 _, g5 ]4 E" p1 k8 k* Q+ {
- .ENDIF* F7 b$ |' ?5 g. @/ n, I5 o" J5 [0 k
- 9 u6 y6 Z3 y' Z
- $ I5 m% [$ m5 H3 ~; k( C3 B% A1 l
- ;==================================================$ R) H; N! h2 {# T3 e& `! A
- ;更新功能状态0 x; d# n6 ?. {9 l; m
- Function_Status_Update:* S6 T& F0 L) ^5 ~" `3 w
- LDA FC_Select_Index: x2 P% p- O5 V# q
- SEC
+ ?" Z/ D7 R! a - SBC FC_Page_Cur; l9 ` v: q0 A1 p; s0 Z$ }0 t9 \! D0 ?
- STA FC_Select_Temp% A, _* s1 [9 n, i4 V
- JSR Function_Status_Show9 a" X/ @& w5 S t$ p: Q
- RTS4 `& O( \2 K4 T, e) S7 Z- n
-
; z. y! o' b5 U! y7 ?' z - ;==================================================: g$ Y1 F8 A0 O- h
- ;设置功能地址端口6 L# \6 |* g. x: j( ^
- Set_Function_Port:
( J$ x# `9 r& L: @8 q5 Q - LDA FC_Select_Temp/ p& b6 H3 G* d0 G
- CLC" L/ ~) t1 Z& s) o0 S" G0 H
- ADC FC_Page_Cur+ x% |) X( f# G' n0 I$ b
- ASL( u3 K/ B$ v: C: I% {
- TAY
5 _7 i7 l$ V6 s - INY
) y( l. c. a; s4 R; h4 {& G- G - LDA Function_Addr_A,Y
' [ Y7 _; {5 X( K5 ~4 V1 ?* ~ - STA FC_Data_Port_A_H
3 Z4 @9 c& g/ L! m+ J u* r9 W - .IF FC_IS_DOUBLE_PLAYERS$ D+ L5 Q2 i0 h* {+ z6 K
- LDA Function_Addr_B,Y6 Z. T" k' H0 V6 F- S4 X
- STA FC_Data_Port_B_H
. j8 _. r. n8 `0 [' V - .ENDIF" t7 m- ?# \8 w; K; t
- DEY5 u m S: R3 \2 k0 U% p- Z
- LDA Function_Addr_A,Y( [$ N0 F5 g' T3 l
- STA FC_Data_Port_A_L
0 ?7 S8 y% z* ]% f4 m - .IF FC_IS_DOUBLE_PLAYERS
1 V' }% N6 ]! Z$ J# q, E7 f$ q, D - LDA Function_Addr_B,Y+ ?; K" ]2 U. n6 I& o
- STA FC_Data_Port_B_L
3 r) Y5 C) @+ [: n5 c - .ENDIF
( [. G& D/ l. y4 O7 n. b - RTS
3 a, b2 F3 V( O$ g0 ~- [& A% Y - 4 M& r a" R Y9 X/ O
- ;==================================================3 K1 ]6 q$ k: U0 ^2 K6 ] w7 k
- ;设置功能临时索引
- e' r: m- g4 ], _9 t) D - Set_Function_Temp_Index:
F! f; x. L6 [4 U - LDA FC_Select_Index
! K0 s4 E4 O0 L c# E - SEC
! K8 `& {+ L& Z8 O - SBC FC_Page_Cur
$ B4 n( {$ e) l; K$ m0 ~ - STA FC_Select_Temp
h* n7 l/ E* Q- _# b% T/ T5 w2 W. O - RTS
: c5 r9 i2 ]6 h; i - - K5 y( l$ w2 T8 P# T+ [& X
- ;==================================================
2 t7 l6 N( o: W - ;开启功能A
3 L8 M, F! U% j - Change_Function_To_On_A:4 E/ @+ J3 D4 J9 G1 r
- JSR Set_Function_Temp_Index
2 u5 |2 |5 s$ j: i% o - JSR Set_Function_Port
9 P e" k7 U0 D' \5 N3 Y - LDX FC_Select_Index7 @% m% o: `7 V3 O5 B1 M
- LDY #$00
" |' ~$ F9 L" B K" Y - LDA (FC_Data_Port_A_L),Y% M+ z- I1 \5 |9 R6 h
- ORA Function_Check,X
0 t: Y2 s: d/ f2 a* Q - STA (FC_Data_Port_A_L),Y
J1 D8 |! D9 g7 W1 p - RTS
4 n: T2 f: K# }7 q# y - ;----------------------------------------4 o; }2 H- ^% `, Y7 P
- ;开启功能B% I7 A: |4 Z5 H. b! @
- .IF FC_IS_DOUBLE_PLAYERS
" {& g# x& p2 r% a/ P - Change_Function_To_On_B:7 G0 D3 G1 u' l
- JSR Set_Function_Temp_Index
: B5 G8 Y, s5 p6 T; E0 u - JSR Set_Function_Port. m( ~0 h4 C, {1 B( K
- LDX FC_Select_Index
# P: [3 D J1 B# b* z' O0 p - LDY #$001 D/ x# C9 r0 Q9 a; q4 m
- LDA (FC_Data_Port_B_L),Y1 o5 v3 U: f5 E" P
- ORA Function_Check,X" ~% n- v+ K8 ^0 J/ h
- STA (FC_Data_Port_B_L),Y. Q2 V$ F: I% C' c$ |4 M
- RTS
, K! Y" t. H: h* W - .ENDIF( o# V7 o$ j. L8 n$ R+ [7 A' X* w: g
- ;----------------------------------------
! l0 o, r* l' q- P6 {/ e% o - ;关闭功能A! i% ]" J& `7 p) [; Y
- Change_Function_To_Off_A:! \ c9 H5 T* ~! a
- JSR Set_Function_Temp_Index7 b+ `. |4 @3 m. w, p
- JSR Set_Function_Port( D8 s$ U* b* w0 S
- LDX FC_Select_Index9 P9 T. ~/ O( c. J9 C
- LDY #$00' w$ D- o& e9 V$ w1 c" T# ]
- LDA Function_Check,X" p4 X5 f s3 v" X+ s2 L) M
- EOR #$FF/ F6 F3 U& ?1 A) C0 i
- AND (FC_Data_Port_A_L),Y6 p& S3 M& k# x1 S; |- H/ t5 W' n6 e
- STA (FC_Data_Port_A_L),Y% I1 k. l( [$ j- p `
- RTS
1 T J ~$ q$ I/ y9 B4 Q% s - ;----------------------------------------
% [* Z! O) Y) R7 K2 Z9 J - ;关闭功能B
( n+ t% X+ C, X - .IF FC_IS_DOUBLE_PLAYERS
( e Z7 O6 \0 X7 V( M% @ - Change_Function_To_Off_B:4 Y: O1 C1 g. d8 a3 c b# ^# T
- JSR Set_Function_Temp_Index
) S4 T& p) u a7 F' T$ Z. m- D - JSR Set_Function_Port
4 N) _6 K+ r9 [( s8 F V0 C - LDX FC_Select_Index! Z5 w; |$ n( F, W8 J! H- c
- LDY #$005 a, l9 G1 y9 [9 q3 C, ^8 v
- LDA Function_Check,X# F y8 v0 K- r6 v: F. T a6 s
- EOR #$FF2 Z0 D I( Z0 o3 }& h
- AND (FC_Data_Port_B_L),Y) N* ~+ ?- R5 @. V. h- n
- STA (FC_Data_Port_B_L),Y" ^! d, G+ a* V. c: ]+ H; Q
- RTS
8 i f$ c! b. E - .ENDIF
. L& l: H+ \) h( b: X
, o# v; J1 s, i l6 e- ;==================================================' _$ H- {, v- |
- ;设置功能状态PPU地址
5 x& r/ g' z% u0 n - Set_Function_Status_Addr:
% \/ Y4 s6 X! |, o& t - LDX FC_PPU_Cursor
3 v& j( P9 K1 e! R5 V - LDA FC_Select_Temp; x! `$ G6 `! q: O9 F- x
- ASL' z5 w) t- R7 p( B8 ~) B
- TAY
( |! b6 k$ ^: V3 k5 y - INY
9 h5 q. Q3 A4 \2 s - LDA Text_PPU_Addr,Y
3 ]+ N! O; Z7 Z9 T - STA FC_PPU_Buffer,X
8 I. u& u9 l% E/ S5 t8 V - INX
( C( ]' p5 _3 o0 q! u- g, E - DEY" k" K7 G1 }8 m6 ^; y
- LDA Text_PPU_Addr,Y
5 q3 w1 n+ F1 f0 C2 v' G - CLC
. ^4 S# {. A+ T* l0 t& l - ADC #FC_FUNCTION_OFFSET% P6 E; {" g- u/ q5 R( n* C3 }
- STA FC_PPU_Buffer,X+ _% Q$ y7 Y0 N' b) Z" f
- INX
. r2 W" u: H5 d7 {6 d: d - .IF FC_IS_DOUBLE_PLAYERS
6 Y9 |; k5 A0 _+ T) \4 X - LDA #$02
- I) o+ D- |6 ~ - .ELSE
; E; c- K5 n, c; J* m+ A; i - LDA #$01
" J: c7 x8 t2 n - .ENDIF
7 \3 Z, C) k7 w" w" |$ u. T) A - STA FC_PPU_Buffer,X5 k6 f5 \/ x% F# @& y8 N
- INX
' |0 z1 r0 l+ x$ D F' d$ V - STX FC_PPU_Cursor/ C3 z% z1 S) x* l- p+ u+ A
- RTS
2 s2 V3 G' U0 i& c( t$ `7 C8 Y) Z
7 o" ?7 S7 }( ^4 S f- a- ;==================================================
3 U! Q# y2 }8 n/ J- N - ;获取当前选择索引
5 P- G" } N* ~* V3 P - Get_Select_Index:
9 ?% V$ Z$ c# c! y. `" R - LDA FC_Select_Temp7 V- W( J$ }3 [' Y8 u" @
- CLC
: K/ K- x: ?* Z# v7 d/ f- Z4 G - ADC FC_Page_Cur) |6 T' L: M0 F( v
- TAX; g4 S( u' {* R8 U1 h. c' \% g! X
- RTS4 t$ F1 X( P' ^- }1 r0 v7 L
- & a6 w0 ^- w. b- Y5 E- y; `
- ;==================================================
4 z6 k) ~$ }; [! |5 e6 q - ;清除状态文本- d; p1 s( G; |
- Function_Status_Clean:7 `6 e" e2 Y; Y' _6 _5 T$ e9 i+ l" R
- LDA #FC_PPU_MODE_CNTC
3 b6 A6 i4 @ w* x2 i: Y- j$ V - JSR Set_PPU_Mode3 u8 `0 n" p: u- n/ b, f
- JSR Set_Function_Status_Addr# a0 f3 {3 }# B Q) b# w, K" n
- RTS1 Z+ }1 T+ Y: i5 G
( d5 i* z! z; x* p$ z& i' r- ;==================================================) _+ q# _) N5 _/ h k9 r
- ;显示开关状态
2 N6 y, q( S% D+ F, x$ U - Function_Status_Show:* Y+ Z$ _8 \1 ]2 r
- JSR Get_Select_Index
# F9 |3 @% A4 r9 c& y7 i& y) Q4 W; T, o - CPX #FC_ITEM_SUM
3 t3 T# X7 @$ [9 r5 e* o - BEQ Function_Status_Show_Set
$ ^; h- V, c# D. g7 t/ t2 o8 _/ P0 y - BCS Function_Status_Show_End
# t# G* G( J, `3 ?2 l - Function_Status_Show_Set:2 ? i5 T' X% ^, x7 x4 J
- LDA #FC_PPU_MODE_CNTL
" q* q& [: C' Z( P+ `% ] - JSR Set_PPU_Mode' _+ j. j2 r- P6 W1 c
- JSR Get_Select_Index* [' v: ~5 k0 X( O! Q
- JSR Set_Function_Status_Addr
/ e. P1 q' @( i, \% _ - JSR Set_Function_Port/ c+ `8 G8 P! Z S
- JSR Function_Status_Show_Check_A/ O6 {3 `/ e: L. K7 |! v/ n
- .IF FC_IS_DOUBLE_PLAYERS
/ O7 b; O u" K( ~$ x - JSR Function_Status_Show_Check_B
3 K' |! A' ~, ^# Y) B - .ENDIF& c% {' @" T& l$ V
- Function_Status_Show_End:
, P5 f% E. {' c6 X - RTS
+ U' T4 |( p7 ]) ~. A8 E' N - ;----------------------------------------
$ X3 Z1 X: Y' [1 b+ v+ p - ;检查功能A状态
! B7 O/ j- s9 t. F - Function_Status_Show_Check_A:
R6 @" C' c6 C# [- ^ - JSR Get_Select_Index
( C$ D9 C- r5 z+ S8 s5 j; | - LDY #$00# T* c8 @0 D! C
- LDA (FC_Data_Port_A_L),Y
* i- C1 l6 A) F4 `( Z1 N% h6 S - AND Function_Check,X
3 q. _, F; b6 _& u a0 ]" W - BEQ Show_Function_Status_Off# m9 |+ _ ]+ z: k
- JSR Show_Function_Status_On# _8 n( e. l X: F
- RTS
8 B; e; `0 p) r# O( r' x a9 e1 w" H - ;----------------------------------------
! |7 Y4 u Z0 m' a - ;检查功能B状态
9 T# n2 N+ ~. j - .IF FC_IS_DOUBLE_PLAYERS
4 E# a% h1 U2 F# H6 E4 R. H/ y7 h$ S - Function_Status_Show_Check_B:2 Y* N0 j+ T) _. U# x' _' x
- JSR Get_Select_Index: ~/ t" ~+ I4 M" i& H' ?! f
- LDY #$001 `# a( R) ]) D9 F* O
- LDA (FC_Data_Port_B_L),Y
5 b/ @# z# [ n/ }) A0 ^ - AND Function_Check,X
) }# i9 P2 f% d* q8 C7 d - BEQ Show_Function_Status_Off( n7 g" |; h0 ~: B; Y, f9 J
- JSR Show_Function_Status_On2 t2 I" S2 P, [: L w/ p' @' ~: n
- RTS& @1 p) y; Q; T1 L7 B, N+ t
- .ENDIF
8 K/ N6 P! X& O3 z* J( ?- ~7 d* q -
5 D" L' Q/ i$ f$ R - ;----------------------------------------; [1 Q+ [/ j/ X7 _$ f. |
- ;显示功能开启状态
9 d, U( ~; j. a) f - Show_Function_Status_On:
& X, r2 I/ t; [4 u- J - LDX FC_PPU_Cursor7 B* A! A6 i4 F
- LDA #FC_ON_TILE
+ `! e8 G6 j8 b* V0 ^* F. t - STA FC_PPU_Buffer,X
1 B0 ]+ i E% ~* H - INX
7 g- i7 F% O( f: }! q4 `% [ - STX FC_PPU_Cursor
7 d( X- { l3 X4 ?1 M - RTS+ j6 m+ w& ^- \6 p3 i7 N
- ;----------------------------------------
6 ~- ~5 m& u L7 E - ;显示功能关闭状态! G3 P, |- V. }
- Show_Function_Status_Off:, o: _& f5 ?6 O: U; }' K, @! I" D
- LDX FC_PPU_Cursor3 f, q. \% M+ P4 X" ?5 {0 I. r8 D
- LDA #FC_OFF_TILE
- C! Z" o/ N! {* W. v/ I - STA FC_PPU_Buffer,X
0 P9 X6 x: S+ H6 j - INX4 s7 f6 V0 C7 ]- n! K8 ]
- STX FC_PPU_Cursor
. C% B( N, j1 A' j# ^/ L( W& [ - RTS9 |5 X5 A9 F) i; }
- 3 A2 J. L+ P& X1 j% q, K
- & F9 H. S9 z7 V2 E! b# T
- ;-------------------------------------------------------------
7 t- u' a0 P5 \& _0 l; Y4 b - FC_Data_Copy: ;数据拷贝参数设置; `- `! Y/ k5 ~5 I) n
- STX FC_Cpy_Port_L
8 i( s/ R- u4 y' ~& S" @! [% e - STY FC_Cpy_Port_H
+ \; G' C& K* r9 s, T4 ^ - LDY #$00* G( g5 v% s# ^' m7 t
- LDX #$065 ^$ m" k( {% _
- FC_Data_Copy_Addr_Set: ;从指定地址读入参数
1 ]5 x; K, J& [) T _) L - LDA (FC_Cpy_Port_L),Y8 G( E" Z; s0 F9 ~! [
- STA FC_Cpy_From_L,Y& p; {1 X u5 }) t: }+ c
- INY. Z% Q# B* n# A+ P" H% V; I
- DEX
/ @9 f3 I8 K" k& I" z1 R - BNE FC_Data_Copy_Addr_Set
; H: b( z% Z- v$ o! C, v - LDA (FC_Cpy_Port_L),Y
3 |# k& k+ N+ _. f: P/ r+ v( } - CLV
! y3 B+ v' S- ?" w$ |$ _4 R! [ - LDY #$001 E: E7 e4 I G" `, }* F' u! e
- ;----------------------------------
: w5 z8 F* o8 n3 r$ C; [ - FC_Data_Copy_Mode: ;复制模式校验
9 ]6 O) A, [/ I+ ~$ {' _ - CMP #FC_MODE_RAM_TO_RAM
& J* |4 k# W/ H% t5 k - BEQ FC_Ram_To_Ram_Mode
$ o& D$ L S( d6 {$ m% j, E. W - CMP #FC_MODE_RAM_TO_PPU
4 g* u7 h+ w* U! J - BEQ FC_Ram_To_Ppu_Mode) _' D& A7 A8 }" m1 Y2 p
- CMP #FC_MODE_PPU_TO_RAM+ r w! N8 Y& {
- BEQ FC_Ppu_To_Ram_Mode4 ^) c8 i5 E$ A0 m$ x: W S
- CMP #FC_MODE_PPU_CLEAR
) Q# E8 h8 w# ]# k/ q4 U - BEQ FC_Ppu_Clear_Mode! G: ~) D' T' A( q9 e: `) F
- RTS0 f& J' j2 }* @6 O! g$ `$ ^ o
- ;----------------------------------------7 e1 `2 u D+ k6 T0 F9 W
- FC_Ram_To_Ram_Mode: ;复制RAM到RAM模式
% y: e, Q4 E; B/ g7 q - LDX FC_Cpy_Count_L0 |+ E% [8 J" B+ Q9 C
- INX/ Y: ?' K5 J" S8 Z t9 H3 e
- FC_Ram_To_Ram_Count: ;剩余计数检查
6 _) x: q h, u" c1 G: r - DEX8 W, m+ w: [; O+ I
- BNE FC_Ram_To_Ram_Copy
6 h1 `/ u. w2 H9 ]5 r8 t, }2 W. [9 E - DEC FC_Cpy_Count_H2 n; @' I" y/ R I/ L
- BMI FC_Ram_To_Ram_Over- H: ?$ d0 r2 n) a
- FC_Ram_To_Ram_Copy: ;开始复制数据/ ?, a8 {( P. O7 f. R3 T2 w
- LDA (FC_Cpy_From_L),Y
; ?& G7 D& w+ t% v - STA (FC_Cpy_To_L),Y m( `0 B4 K# M! u5 k" g; {
- FC_Ram_To_Ram_From_Set: ;源地址递增% M9 O8 y7 B$ l# i+ Y* ^
- INY. T9 p \6 n" R) K0 p* k! n
- BNE FC_Ram_To_Ram_Count2 x P8 r9 U5 V* m: [" v% O7 d
- INC FC_Cpy_To_H5 C: N' T; P) _9 N$ X
- INC FC_Cpy_From_H& S# x1 E$ z3 ^3 \5 p
- BVC FC_Ram_To_Ram_Count# z; C/ c7 n: k( j% q2 B2 _
- FC_Ram_To_Ram_Over: ;结束数据复制
$ @4 m) M h3 \+ R% A) |9 X7 } - RTS2 Z$ I* e# y" ^/ {" D
- : X' \8 z2 k& j6 O: V
- ;----------------------------------------* l$ H0 U$ j6 @
- FC_Ram_To_Ppu_Mode: ;复制RAM到PPU模式, Z6 R- T* l7 N3 }/ X
- LDA FC_Cpy_To_H
4 V9 G& L( f/ v1 N# d3 h2 E - STA $2006
- b+ E' A/ A& k1 E5 } - LDA FC_Cpy_To_L
: ~; e: @1 u/ W! S% { - STA $2006
) w: K* L5 k7 j# r1 j - LDX FC_Cpy_Count_L
8 j3 k( y' i R$ v7 S" K - INX
9 y. k2 y7 a$ m q8 U6 }3 p' e7 n - FC_Ram_To_Ppu_Count: ;剩余计数检查
) O; K( c9 n. ~" m* ` - DEX
$ Y5 X5 {' v9 V) w, \ - BNE FC_Ram_To_Ppu_Copy
( D. l# G3 a. z, J; V - DEC FC_Cpy_Count_H1 G+ P* {5 [1 } K% Q5 n6 d% i
- BMI FC_Ram_To_Ppu_Over5 s2 B$ }# i0 u; O$ o
- FC_Ram_To_Ppu_Copy: ;开始复制数据) b# b) W5 _4 w8 Q
- LDA (FC_Cpy_From_L),Y* O) k) ?! w/ j' j! d$ K, Y
- STA $20070 I0 @" d8 k6 m0 |- B
- FC_Ram_To_Ppu_From_Set: ;源地址递增3 H& m, Q8 L0 P% {" x/ b. N% ]
- INY
% D7 W- U, \+ |7 @! ` - BNE FC_Ram_To_Ppu_Count; m1 u9 `' `0 V3 Q0 K8 a
- INC FC_Cpy_From_H
' d* O4 q# q! @$ u; w - BVC FC_Ram_To_Ppu_Count# T: t1 V8 @" z
- FC_Ram_To_Ppu_Over: ;结束数据复制
5 U+ C6 }; F- M, `8 ~. K& z3 e - RTS
) @5 ]" O2 v- ~9 m
! T& q* Y6 \; ?9 K- ;----------------------------------------
2 {6 U( m5 b) G1 r. e8 k - FC_Ppu_To_Ram_Mode: ;复制PPU到RAM模式
9 v; r- Q6 u# T# c - LDA FC_Cpy_From_H& ^, \) U% g1 d& v& O, q' V
- STA $2006, I) W# l8 g! B/ U3 n' \0 J7 o% F
- LDA FC_Cpy_From_L
' S H/ U: w- _/ @8 T1 e - STA $2006
/ {5 z- @" u4 S B- F- g5 z3 r - LDA $2007- r, A: W% @: A) D( H
- LDX FC_Cpy_Count_L, o, k7 Z' ^/ u! ^4 x- A; M8 Y
- INX( {" N! T9 S/ v( F0 [/ v/ W
- FC_Ppu_To_Ram_Count: ;剩余计数检查
. r9 U9 _) |. V) s2 u1 u7 T/ ~ - DEX
8 p9 m6 q/ \* Y7 ]( c - BNE FC_Ppu_To_Ram_Copy& h) Q2 O, r& H G
- DEC FC_Cpy_Count_H/ v8 F K! b+ w. i4 Q! w
- BMI FC_Ppu_To_Ram_Over
- o1 ^2 E9 i) P6 d2 l! c - FC_Ppu_To_Ram_Copy: ;开始复制数据
$ y# r5 ?1 G1 _ I - LDA $2007
+ V* I) s# d4 @9 |2 E( u7 d - STA (FC_Cpy_To_L),Y6 i, `. S. y6 R/ Y' M' p; w X/ n
- FC_Ppu_To_Ram_To_Set: ;目的地址递增
1 e5 t B$ ^3 _, S+ p, R1 ] - INY
6 W- d: a# T& t - BNE FC_Ppu_To_Ram_Count+ n; B7 e0 E; _" G# a+ r4 D( e
- INC FC_Cpy_To_H' Q# w* u$ H5 b n* H* a( g9 [
- BVC FC_Ppu_To_Ram_Count
/ I5 x, S+ T9 p' Q9 e1 C- w - FC_Ppu_To_Ram_Over: ;结束数据复制
& W& d9 t/ w! t: y* C" K% R - RTS! F7 d j8 v0 C' H6 Q1 Q! Z6 F( g
- 6 o: K3 K# ~: j0 }3 Y- I3 e
- ;----------------------------------------3 d; ~# u* @5 V. |) ?7 }6 _
- FC_Ppu_Clear_Mode: ;清除PPU模式
6 p% P [+ K5 @- G( x - LDA FC_Cpy_To_H
2 f: N) z) C8 t+ D# A - STA $2006* w0 p& t4 s j
- LDA FC_Cpy_To_L
: P; j+ D/ r5 Q$ o2 n* g$ r2 r - STA $2006 Q2 W% B2 Y e
- LDX FC_Cpy_Count_H, z1 P3 `- F9 v& A
- LDY FC_Cpy_Count_L' M, F2 A- e; b, A
- LDA FC_Clear_Val5 o& D6 ^: s0 K/ Q: t% \
- FC_Ppu_Clear_Count: ;剩余计数检查
. K9 A! r! [' Z, B0 [- B - BNE FC_Ppu_Clear_Copy8 }9 W( x: K+ ?- A
- DEX c# @+ U H! j1 v5 s
- BMI FC_Ppu_Clear_Over: ~7 _. b# [& q( m
- FC_Ppu_Clear_Copy: ;开始清除PPU5 `% P& x+ x. `: c" K9 ?+ G2 K- T8 H
- STA $2007
B; \) L9 @8 Z. w7 ~( a5 S - DEY1 `8 k. P+ D$ w) f9 W
- BVC FC_Ppu_Clear_Count! ?, S, a `. ?5 |" y7 c
- FC_Ppu_Clear_Over: ;结束数据复制6 w' C! o' D( Q) J' R
- RTS) r a/ \$ l! G: Z0 Z* D
! X- R3 o* ~, w: @' S- ;==================================================% _' q( W0 K. G9 r3 r. P* N
- ;保存RAM数据* G n$ h& T, ^! g
- Save_Ram:
; t% m3 f+ e; j9 b8 q- W - LDX #<Save_Ram_Data
4 ~6 v! y+ I: h0 N9 W - LDY #>Save_Ram_Data' @& Z" K; w# X; W
- JSR FC_Data_Copy- L3 `/ ~# b: b& y0 v
- RTS
3 R9 l( |) z- f. m( W, M% d - & ^5 p! k3 k9 t9 O
- ;加载RAM数据3 z7 S* T; G6 N1 M0 w
- Load_Ram:; N( A" f4 h, J3 o7 s0 u3 ^
- LDX #<Load_Ram_Data
; q4 J# i3 ?/ h5 n3 |! \8 L - LDY #>Load_Ram_Data7 e" ^3 W# K3 }8 k% h
- JSR FC_Data_Copy
- y0 s h( j7 O/ ~; I. w - RTS
$ H9 S! @4 k* H; S8 m, O8 |* Z; S
) U: L3 @6 t+ w) w# A0 g- ;保存PPU数据/ v+ h& R: h ]* s; G. Y
- Save_Ppu:2 R) V& _2 N! p; U
- LDX #<Save_PPU_Data
* @; X- C, y" j/ x9 H- ] - LDY #>Save_PPU_Data1 U: ^3 R+ C1 m& _2 _
- JSR FC_Data_Copy
h: {) f4 {4 H% k% t" I - RTS+ G5 W3 ^ P2 O2 `- D: u
/ C( {6 j* f* i* g# y- ;加载PPU数据
" `. r& j% z( c% e' R+ O7 T - Load_Ppu:
# A9 D* i( b7 g' U3 x: v - LDX #<Load_PPU_Data
4 T$ i1 W6 K6 _+ |' b* d - LDY #>Load_PPU_Data
. a. }2 a; s( A: _- A* J' w/ {% ~$ g3 A - JSR FC_Data_Copy
y/ m; P8 ?5 O) ]( r: J9 o7 N2 Z - RTS
% q/ B7 z: m' m$ E. M8 A8 b - 4 k8 {: R' a% k' S6 v/ p7 x3 v
- ;清空PPU数据
y3 Z9 J! q* r9 b% _* _ - Clear_Ppu:: k1 K. e" S$ D1 R% r9 C. [
- LDX #<Cln_PPU_Data
5 L8 J, N! i0 c - LDY #>Cln_PPU_Data
6 _! \; Y4 U! j3 }* Y/ r - JSR FC_Data_Copy: k# J$ q0 x6 D. _6 {. b5 C
- RTS, w: Q" P: d3 d1 ~! x
- % c5 x( S/ @8 a) G
- ;==================================================$ r l, w" U. i. g
- ;数据配置
7 T# I) x2 w' k - Save_Ram_Data:
& H2 L# `5 r0 \ S& V/ W" D - .DB $00,$03,$00,$63,$00,$01,FC_MODE_RAM_TO_RAM6 h) V+ {* Q! u4 {
- Load_Ram_Data:( h( y/ w3 Y8 P6 u
- .DB $00,$63,$00,$03,$00,$01,FC_MODE_RAM_TO_RAM7 ~( o; U. {# e& K
- Save_PPU_Data:# |) c, e0 b5 O! E
- .DB $00,$20,$00,$64,$00,$04,FC_MODE_PPU_TO_RAM8 y Y5 S' s9 y; l* Y
- Load_PPU_Data:) A C/ W7 u+ l) ~, H( n. n4 J% P F
- .DB $00,$64,$00,$20,$00,$04,FC_MODE_RAM_TO_PPU
. `9 b W/ y9 f; O# {$ U. V: E - Cln_PPU_Data:
' P1 P* m6 P2 f( O6 D$ \ - .DB $00,$00,$00,$20,$00,$04,FC_MODE_PPU_CLEAR1 ^: ~+ v2 M8 }! a2 L! a
- 9 K% Y4 U, ~9 Q( a9 ]1 k* Y
- 3 I1 ]# ]8 M2 w; u( c
- ;==================================================$ m1 `* {& S% D& l+ @" Y0 d
- ;文本数据PPU显示地址- S' ]0 X0 }" q d- |) h
- Text_PPU_Addr:; i" h: @! C; j. w) U$ g
- .WORD $20C5: J2 r) X! r. Z! ?3 E- s$ I ~! c
- .WORD $2105
* g# A' {# e8 ~2 m5 Q - .WORD $2145) t) o1 w8 s8 E% ], C
- .WORD $21850 \! B3 o6 r: u$ W! [- T
- .WORD $21C5
2 Z7 U. F" W* K# C& a2 U' R - .WORD $2205% l( ^7 s/ z8 h1 o4 ~
- .WORD $22450 i0 y3 o8 X6 \0 A
- .WORD $2285
z' `+ t. l7 ?! s - .WORD $22C5
# L" f$ Z9 j; Q - .WORD $2305
# t) J; g7 j c4 r7 X+ a - .WORD $2345
2 I0 V# o* K: `0 ` -
. n! B6 Z, X' ?0 s- b. I' h - ;==================================================
6 n4 H0 {* H4 l8 p$ S4 q - ;文本数据PPU数据地址
5 @1 N# j9 |3 y/ t* E3 @ - Text_Data_Addr:6 ~# a- c6 y5 H9 _% L
- .WORD Text_Data_01
: T0 D. {) c K0 k' i - .WORD Text_Data_02' g9 H4 v6 \# Y% {' k2 e: ?! r
- .WORD Text_Data_03
6 `) r: l6 I5 ~2 g - .WORD Text_Data_04
4 w4 X* `# C# f$ @- K - .WORD Text_Data_058 K5 h- Y$ ]& U5 b4 Y5 K
- .WORD Text_Data_067 e8 F# B, ]0 p) {+ Q2 \
- .WORD Text_Data_078 X. u3 @( z8 g3 T% @$ e" ^
- .WORD Text_Data_08
% c' o$ |7 [8 l j# R# j8 C+ A - .WORD Text_Data_09' }9 @# R" O/ Y; k- V* s% U2 L
- .WORD Text_Data_102 A6 |# z; R' a1 \5 Z& B
- .WORD Text_Data_11& T1 h/ [9 C) t' \5 ~0 ^; i6 Y. F
- .WORD Text_Data_125 e! D6 q- F6 [( |" ~
- .WORD Text_Data_13
- }; D1 d% k9 p0 E2 B - .WORD Text_Data_14' o$ c5 d8 @: z* ]$ @7 _
- .WORD Text_Data_15- _' v& E. g9 _. Z, \9 j
- .WORD Text_Data_16
$ y/ V2 X+ o; E* ]& _8 u. q. z& S9 }
. Y4 V7 i& |! @' u9 e1 W- ;==================================================5 c' r/ C. H/ d/ K9 C* Z
- ;文本数据
3 P; P- A4 y0 C! e/ d( I - Text_Data:8 q& S$ \' @2 U6 ]
- Text_Data_01:
( c/ \- i6 `3 v5 [- }: w - .STR "01.INVINCIBLE" P' M+ u/ s, I, A& ^; L& e
- Text_Data_02:
3 b# X+ }) k! ~1 f J - .STR "02.INVINCIBLE PLUS"2 p2 G! c3 s; W/ k9 T1 V
- Text_Data_03:5 r; Q1 [0 I5 K
- .STR "03.LOCK LIFE"0 d% z: j1 W: c4 T J: |
- Text_Data_04:# N- D' w* K. k4 |
- .STR "04.LOCK WEAPON"2 R7 q. w) F" y
- Text_Data_05:
7 |. N$ T2 u) X# g, r, p1 p - .STR "05.SEL CHANGE WEAPON" L6 j( ?8 i; Y4 Q- ~; S; A
- Text_Data_06:
j. O% c; \4 B l5 n+ j - .STR "06.UNLIMITED JUMP"
4 S3 j1 f; O3 h# n2 Z* s6 [ - Text_Data_07: B' s8 h/ X1 B9 _3 d/ d$ j
- .STR "07.MOVE FAST"
6 Q) T% J% a& P) p2 ^5 c - Text_Data_08:% _+ Z @; x1 r4 s
- .STR "08.SWAP SKIN"
' k4 \3 \$ v( @3 k7 ?7 I0 Z - Text_Data_09:: ^; Y) e5 P; P, _$ ]$ O* h& B
- .STR "09.EQUAL BULLET"2 l$ d& I1 s" B: O* |
- Text_Data_10:
6 p9 O9 s( E, c3 e - .STR "10.STRONG BULLET". L% j7 B M( [) |# h. u. I! I8 s3 O
- Text_Data_11:
: w/ |+ K% d# x - .STR "11.KILL BY ONCE"* V$ S: z& D' y8 E# w7 R- R. M4 I
- Text_Data_12:) T4 F% u' k( \6 @5 t
- .STR "12.FULL SCREEN KILL"
7 s6 \& u; _* r; H, H8 F - Text_Data_13:
# D9 @5 z* M$ N7 k8 Q - .STR "13.DOUBLE CONTROL"
4 t$ P' f3 S5 q# [# k - Text_Data_14:* [" X: Y) {* f2 A
- .STR "14.REMOVE E-GRID"
) b |8 Y3 e; {+ Y; y - Text_Data_15:
& ^6 o& ?) Y8 I) z# o, m' @ - .STR "15.FALL INVINCIBLE"
& M' r, R/ m* p5 [0 F7 | - Text_Data_16:9 i5 z: ?" Y D8 i, k
- .STR "16.NEXT STAGE"
2 l* j5 ^5 f! u9 F# Z! {0 L0 A
& V, ^3 _3 {6 |+ [* s1 V- ;==================================================
0 ^, |3 [3 p* W9 d$ I% O - ;功能开关检查地址& n) K, e4 R! I& D$ h# A7 h! {
- Function_Addr_A:5 Z1 t1 m- ^) ^9 s
- .WORD $01C0: x7 e* v, Z! a6 r
- .WORD $01C0
$ j, O0 Z% _/ w5 N - .WORD $01C0
6 M I6 e7 ^+ v& k' i/ i& ? - .WORD $01C0) y! q3 P# a, l# h9 F! [" v
- .WORD $01C0
6 x$ ~# e4 E g! W - .WORD $01C0
! U- N/ `1 b& n8 u- A - .WORD $01C0
( H& h1 V0 ]( E0 M - .WORD $01C0
2 T+ W* _6 x+ j+ v+ L - .WORD $01C4+ k( R& ~3 @- m) u
- .WORD $01C4
0 a% j' G+ J. X - .WORD $01C4
) }0 s$ P E7 t: G# z3 G' I - .WORD $01C4
$ [/ | q4 o: o% W. t( G2 M. P - .WORD $01C4% X, o! _6 _" D3 Y
- .WORD $01C4
7 A0 D$ j- r& m- j2 @ - .WORD $01C2' q, I: v/ F& T, Y* T2 N; U6 `
- .WORD $01C48 J& z. g( r9 h. j$ D4 S2 m H
; h6 G/ S- T% i7 u3 C8 }- ;功能开关检查地址
* b* }% t m% U% O& G1 W" X - Function_Addr_B:
b( Y! G+ o, I0 t0 p4 @; R9 o - .WORD $01C1
' ^' l Z- |. q2 z - .WORD $01C1) {( S' p; U4 V6 {: t- u, Q
- .WORD $01C17 d7 \# l- c5 K6 M" T7 Q! S
- .WORD $01C1
, R) o* o* |0 @$ H" ^' g: y - .WORD $01C13 k7 Q# V! r; w/ M, X F" K( Q: D
- .WORD $01C1
6 y7 o# F7 _9 Q: B a' [# e - .WORD $01C1
3 N& Z/ ?8 f' x4 D, r9 l - .WORD $01C1' E4 ~ f$ i, l# V! z/ [
- .WORD $01C49 ~$ m, W( c3 r" a' Z, V
- .WORD $01C4
; O0 U$ d# W3 ]$ M$ b! [ - .WORD $01C48 r+ e) Q# r3 w8 j
- .WORD $01C4
7 w" h" `: }* V( b - .WORD $01C4
+ _* b) K- Z0 ?) a; B2 p0 V - .WORD $01C4
8 E- O' B; h& P) i% J - .WORD $01C3
9 c1 z( ^0 W& x: m - .WORD $01C4& {( j1 j5 R2 I- Y6 L
- 9 D1 D; O1 t1 F( j- g) l1 N
- ;==================================================
0 P5 s+ ^) A s7 U1 @0 ]8 d4 A: b - ;功能开关检查数据
9 @6 D p$ R+ d! I - Function_Check:7 f# \1 F" P- R% e$ J
- .DB $01 O, F$ b. \3 o1 H2 X& g
- .DB $02
! b- m7 e0 l. r5 h: l - .DB $04
) Q) `. U5 F. g6 J G, h9 B0 C7 n1 F - .DB $08
8 ~0 b- q' H9 B3 Y# c - .DB $10
9 |# }. P8 K9 [2 D' R - .DB $20
/ ]' ^# T7 X" y* @ - .DB $40
% l( i; L' l4 A8 i" C0 @ - .DB $80
$ I6 S+ f0 n. m6 w* R4 Z - .DB $01' k k' c) F l
- .DB $025 L: W% _' p* n
- .DB $04
) h4 `, r- K5 d* [% O# b8 g - .DB $08
* c1 w2 q3 |( w% _& O/ ^/ F" p - .DB $10) A S% V5 ~. ]+ s
- .DB $202 O. Y; \# P; ?+ _! l8 C
- .DB $40. j) J& t% f n& f4 t& V
- .DB $80$ m; U( ]" C' I% _! {* U
- n6 s3 _% \! ^% D0 S- Char_Rom:
$ |9 F3 D# M7 v6 a; {$ _- t" }) B - .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
0 {) A8 M, m: B, h. w - .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
6 l$ N6 E( ~" p9 w$ F! n - .DB $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$3B,$25,$00
1 p$ x3 ~8 j; J' a! v `2 @ - .DB $01,$02,$03,$04,$05,$06,$07,$08,$09,$0A,$00,$00,$00,$00,$00,$00: a' ]% D/ i2 B! j
- .DB $00,$0B,$0C,$0D,$0E,$0F,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19
" a7 b7 J) l3 ? - .DB $1A,$1B,$1C,$1D,$1E,$1F,$20,$21,$22,$23,$24,$00,$00,$00,$00,$00
3 ^. ?8 w. W% I: o6 k, L -
, S! Q# x! z% P. h5 h& ~- ` -
' p' Y1 \5 n2 t- G5 q$ g5 x -
复制代码
- _ Z* c! O1 B8 t( B& \* A4 B0 W3 ^8 R2 d! k7 }5 [: K
flamecyclone.ys168.com6 j' Q4 @) P6 y7 v& n) q
www.nesbbs.com |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
评分
-
2
查看全部评分
-
|