|
本帖最后由 yandagui 于 2017-4-2 13:21 编辑 " [) R* i# k8 Y; W
" q- G+ x, s. z7 w
[FC][忍者神龟2][END选关]
n3 s p1 j% \
4 z. J5 K, n9 z时间:2017.3.31# x; t c* K S# h0 M9 Q& U) a K
作者:FlameCyclone- .ORG $B9E0+ }0 y' e% |5 l3 D% b
- ora_data:6 ?, [7 T) S# g6 L/ [7 x6 R* L( e
- .BYTE $08,$04,$02,$01,$80,$40,$20,$10
* H: `) y& ?8 t/ |+ @) M" O. @9 [9 f% f - and_data:- q0 W; q5 f& N; a- }& f
- .BYTE $F7,$FB,$FD,$FE,$7F,$BF,$DF,$EF
' P# ?3 t7 M g o* p0 e1 S -
8 K& P4 p9 Q% q- a4 n: b0 P - button = $F8
4 J8 E3 W" e" }7 i( i; d - flag = $6000
: b, D) L B- w& c - pause = $3D
; Y4 {! K9 @. I9 T; D2 ~ - ! N9 c5 j [9 ]+ E) ?) c
- .org $BA00
3 C6 X; ?8 L9 x+ A& P( j4 J1 t
- v1 J( J* v9 l* V3 }2 ^5 ?- PHA
$ l) W4 ]* y- a) o; I4 ^9 P5 T+ _5 M6 N - TXA
! I4 q& X. k5 S& ^$ }/ v - PHA' K7 _* [4 P% f
- TYA
" h# }( q$ u! T- B$ ] - PHA: T& Y6 [ c! b$ d
- JSR KEY_OPERATE, w* K4 q2 O4 @
- JSR INV7 w, a2 J# h0 V& ]
- JSR LIFE
/ v) T# Y& Z# F F' i5 E$ J- k - JSR BLOOD
, L0 X$ O( [3 P2 W7 W/ G) L - PLA
# L: q+ |/ ? d& D; `7 [3 l - TAY
# S* h6 l$ v. R( c6 \" \ - PLA
& b4 J" y- O9 ]5 h4 A' z/ p - TAX
! X2 Q5 W- |6 ~# X; ] - PLA( y& J. {, V+ M
- RTS2 I" }% u( B" K' \
- KEY_OPERATE:/ D5 v( {' q5 S3 y5 A
- data_protect:( U8 {+ p, y9 t* K' F0 j; U
- PHA
# s. Y( _7 r" s0 |9 z5 E5 ?7 R - TXA9 Z) x* H J- g: S# P* d, o( f
- PHA1 a( M, M! D5 _# E1 H
- TYA
+ j* U6 J# F, [ - PHA( `; `* ?9 x+ ~3 q4 S
- , z( k( R6 l O+ t( G
- FLAG_CMP:
" M, y6 G2 r1 u6 f* H - LDA $600F
; U6 j& P, C4 K- o j( f - CMP #$7F ;标志数据初始化条件判断! y" M- c0 J$ K- u
- BEQ pause_cmp
2 Y4 I3 W/ v' u - LDA #$80
2 ~- r! S% L2 j, N. z - STA $A001 ;6000-7FFF写入启用
1 b! m: E+ o0 ^* k% g& n - LDA #$00
9 t. ?( N8 A* N - STA $6000 ;数据初始化
: E5 C( `, R, U* x: G0 B+ p - STA $6001 ;数据初始化
4 r# H; f. @, F/ l2 Z& G - LDA #$7F' g) |' u# K( O! U/ d5 F2 F0 w' g
- STA $600F
Q5 n; m1 [0 k2 |$ B- J+ v - pause_cmp:
( y" F" t% R0 k i: Y2 s% N. T - LDA pause
; ~9 s$ G3 d! j' V7 E5 a) W' d - CMP #$01" s P9 d" |$ I0 O& F% k
- BEQ button_press
% F1 ]2 }% M2 G8 W9 q# b0 p" a' I - PLA" V. W- \& [- _" t
- TAY! ]) ^2 n; U/ h! e: c
- PLA$ N& e* q8 k3 S( b" I/ O
- TAX- K0 o9 I) z1 \. W
- PLA* d1 a" g$ }( _/ V" ^; m: u
- RTS& ^+ D! p/ C( s/ c' V
- - R7 q, D. D4 q2 N3 r4 v
- button_press:
( W4 r0 v, _) s" f1 m - ini_Y:0 k* o+ I2 F p/ V7 u# z
- LDY #$007 H- @' J& o& H1 F$ b# h4 G5 | J
- button_cmp:! D; V* J* B* S
- LDA button,X# v, E+ g* D- I/ I2 P8 }
- CMP ora_data,Y' N8 @- \( K* v7 A% H# u, P7 ]
- BNE count_Y_cmp/ x; M4 n$ U3 H3 ~2 H
- flag_cmp:3 H+ n- }0 ^% x Z+ [
- LDA flag,X
8 z4 U0 Q: w* a+ T* a - AND ora_data,Y
; U9 S: `# [8 S5 h" s- p - BNE flag_and
% f" b/ A+ r. D% C9 Z2 E0 J$ i - flag_ora:
2 J. T4 a1 E' F6 f - LDA flag,X
% h# P% F3 G8 S' @ - ORA ora_data,Y
. m5 X) S" K$ \ - STA flag,X* i5 F, x. M! r7 h
- BNE count_Y_cmp! Q' l( Y4 m* ?" m. o) b! c9 n& p" {
- flag_and:0 m' ~$ Q4 f* A# Q( D
- LDA flag,X
( a0 Q) R, g1 t5 F, o) a; A/ U - AND and_data,Y
3 n( h" y7 z" b4 W1 n0 {$ y - STA flag,X, U4 F! N* K( M
- count_Y_cmp:
. t7 d3 k+ g4 g4 C - INY
% G% a X* n0 u2 d: ^# t* x2 M; w p - CPY #$08
1 K! x& g; @( _, ] - BCC button_cmp
' F$ {. |8 T" a3 a. D' k, g -
1 r" G7 e2 f9 V6 ]7 }/ ` - data_extract:
0 i; M! C; Q2 W& v" j - PLA
% [5 R+ V* i% ?; [1 t - TAY
: j; Q1 P8 _' i+ q& B* x/ h5 a - PLA
" E o9 H. G; K+ L2 M - TAX
: M- p! _1 j" j+ X2 E& E+ C% K - PLA
( g7 `# m% [! R9 U1 l2 n! f" i! q - ) `8 v& @( u7 w' |: C' a) X
- return:
4 m4 o- W, ~' }) `7 O - RTS8 Y9 S: \0 ^ F; X3 L3 v! H4 X
- - h1 j' c0 g' g3 V* ~
- 6 [; o) A/ F4 a. V0 q5 H9 A
- INV: ;无敌( n$ E& G% [# i: L2 D6 [% b
- LDA $6000,X
6 F; m X( W; ^3 `$ R# ^ - AND #$08
. C! l( V5 W, u& n/ n2 L- X$ E* K8 x - BEQ INV_RTS2 w: N" R" T z
- LDA #$059 l7 O \# n, R. k! L9 r
- STA $93,X! } b% L+ o7 \" M' Z
- INV_RTS:$ m' l8 N. _9 L. D# E6 X' J$ ~
- RTS+ C6 H1 S6 e- i6 M& ^8 D9 G
- 9 b8 J& C7 V: D4 v
- 4 b4 M/ o. t/ B. L4 D, l% q
- LIFE: ;生命
6 i9 g$ a/ ?& s. K! Z9 Z0 i( N - LDA $6000,X; T/ d: S# D: ^" W; r1 ^
- AND #$04' v, D- x8 W. i! Z; q4 v' p( b
- BEQ LIFE_RTS) J4 e) v% a8 I" Q- q( |
- LDA #$09
( u8 G, y* Q9 v U) W - STA $4D,X
. K. q. W2 I6 ]2 ~; n% v - LIFE_RTS:
+ _8 W7 c& C( u1 ~( e5 D; x/ k5 S H - RTS$ r+ F) u1 _: H e
- 3 T: A/ m" L1 q! C! ?
- 9 d$ e. ~' i* W3 s$ W
- BLOOD: ;血量% z, w# u$ w; i& V. v5 N
- LDA $6000,X7 Q+ U! |% @. ?7 m) w
- AND #$018 p/ r5 A9 Q$ D1 M! M
- BEQ BLOOD_RTS x, C, |7 K2 R5 {" w9 O
- LDA #$38
+ F7 z2 X5 W0 [5 K) U4 I' y - STA $0568,X1 G3 ^$ {0 w. r9 c0 b' v+ ~
- BLOOD_RTS:
e( o0 J9 B4 s - RTS
! z% Y" l% p& E4 A5 C& w* a) [ - 3 W/ o7 z W3 V/ G
-
* \: p: I* c3 [; c+ x' Y - .ORG $FEFE
m/ Q% j( Z% z+ ? - JSR $FF60
+ \7 m1 l! M% }9 C( U - NOP. h7 ]8 e i7 A/ }
-
$ e6 K# O, a$ l* k! [) T - .ORG $FF60
2 _& B9 M" u4 h# G; ~0 F" P( @$ z. ` - STA $F8,X
6 K/ ^( w2 |/ }7 c2 ^" S, B& T - STY $3A,X
3 L. [8 W3 i; x2 Z - PHA
; Q! l1 l$ S6 ? - TXA
! n, G. X4 `( S- ~# \ - PHA
, |, f J. i; N2 c, V' S( B1 P - TYA% O1 y/ s: ?/ u5 b* n* H& H
- PHA, y+ [$ H" {( P. E* F. g
- LDA #$02
9 V. S) d3 H! J& i' \ - JSR $DB11 ;调用系统切页
/ W2 U% c0 n- J - PLA- R3 G8 H1 t3 N( ^
- TAY
b6 x" C5 A/ W: B' o" w - PLA
6 ?8 g* x5 x5 _' d. d- K. H - TAX
; F& ~) s3 |6 p, x t2 z - PLA6 i' o; ?3 c2 I( y4 j' j5 q9 |. F
- JSR $BA00
! C1 N- ~# }! P; D0 u7 e - RTS 4 W- R, ~5 a" m( v* b8 b0 B
- ; A) ~$ _- F$ M# |, A9 k
- ;[FC][忍者神龟PPU][END]
# h" z; y6 X" @# b s4 D/ f - * p' u+ |! ?, }" A$ ^
- .ORG $BC00- X0 u0 n. Z6 F- r- A& |; J( O2 ?
- / d% O1 J, [6 H/ h6 x& I7 t
- STY $4014 ;补上覆盖的精灵写入指令
: y/ @. e# p9 O) g0 R - PHA7 C* F8 V4 T3 W8 p6 W& V$ e
- TXA
( E2 [8 P! G9 w% \+ {8 p, D - PHA
/ ]# H" P8 l# D, R - TYA: x7 s, U/ \- C) T
- PHA
3 z" v' ?# d3 l: P$ ~% X6 l$ q - LDA $0185 d: i/ c1 a, E; X
- CMP #$01 ;比较是否为标题画面% |' {4 ~' m4 p: Q+ m J& {* \6 K$ Y
- BNE RET
9 R+ }/ k# L. [2 q/ I/ G - LDA $019* i+ r4 V2 S T+ F+ @( M. u
- CMP #$01 ;比较是否为标题画面
# e1 o& i% I$ C0 t& Z( S* `6 V0 I - BEQ PPU_STAGE
( ~/ Q0 k: I% M6 ~ - RET:% S# \/ B' a+ o6 i
- PLA7 _8 i9 Q9 U3 L& D8 |
- TAY
. }6 a7 L7 {8 J! |" V - PLA$ S: T# o0 b2 }) b. S
- TAX/ {- B N& X( @! G5 t/ `
- PLA1 w) G* e2 W9 D: h& ^( D* n( S
- RTS
' I. T0 N. P3 V7 M/ x - PPU_STAGE: ;STAGE显示程序- t# d2 w/ I3 w) Q3 w0 M( e
- LDA PPU_ADDR_DATA0 ?; h; U- m! l: x3 v
- STA $20060 |( t% x. T: s+ f
- LDA PPU_ADDR_DATA+1) t& g8 b. j! k( T% _. W
- STA $2006 ;坐标设置
, c) F, J* Q* h8 q1 K" l8 j5 l - LDX #$00- W8 v/ r: z( X0 l
- PPU_STAGE_WROTE: ;写入STAGE字模' ]2 R1 f4 y- Z. G# q
- LDA STAGE_DATA,X
9 V: f" P2 ?% B7 h/ Z - CMP #$FF
0 ~5 t' o4 ?6 O( ^ - BEQ STAGE_CMP
5 s+ p6 l: Y; w' x" b - STA $2007; H; N( L6 b1 j; j! p7 S' s
- INX3 y, k! X, o7 q8 e$ S/ Y& D9 C8 `5 }
- BCC PPU_STAGE_WROTE
# g# P8 T1 P, ^ - STAGE_CMP:
3 O# _' f! ~; J - LDA $6010
- [$ k7 S7 L; a - CMP #$FF ;关卡数据初始化条件判断
u0 K" U" z+ P1 W4 J, [ - BNE KEY_B
0 {; R! {0 i5 ] Y g9 `7 i - LDA #$005 B4 j, x5 Y" t( @ Q
- STA $6010 ;关卡数据初始化/ q, G/ R: W- `3 i6 o B. X( K
- KEY_B: ;关卡减少& K) q& M+ e3 c
- LDA $F8
+ ]! t1 V5 }: i! U8 ^ - AND #$42 ;按键B或左减关
{( L0 N! F, R: @# Z( A% \( x - BEQ KEY_A$ l) r0 @3 F" S( y+ I; ?2 ^1 M
- LDA #$FF! t7 a: K% ]6 l3 _' j; K: a
- STA $40' j0 l% j R0 C4 r5 `+ e
- LDA $6010
# N/ e: E- @ S' g% e - CMP #$00 ;关卡比较
5 D: v- \& T0 R D( ?/ _' {. w - BEQ KEY_A, c; _5 g5 {- ?& {: G( H
- DEC $6010 ;减关1 x- ~; Z& }; }- I; e% O2 N
- LDA #$578 t( u; Q/ w! J8 c8 l, V
- JSR $DB52 ;按键音效
. c5 ]' V) }8 H5 Y- f1 m# s - KEY_A: ;关卡增加% h& B0 W$ A" [: L
- LDA $F8
+ u* B5 G1 {& ~2 {! B - AND #$81 ;按键A或右加关
' G- p& r9 G* {$ G$ {1 ?7 j - BEQ PPU_NUM_WRITE ?3 K0 S7 Y! p8 [1 g# N
- LDA #$FF
7 `$ i$ t5 k' A! H/ r" L3 P - STA $40
' A% w/ c+ @& R+ Z( z - LDA $6010
$ c5 w7 B2 w) v9 i% h2 F - CMP #$0B ;关卡比较# t( F5 @9 \( ^* f6 Z5 v
- BEQ PPU_NUM_WRITE& `' ^3 X/ A; v$ V
- INC $6010 ;加关
. M) @$ t% n' g8 J; l& x0 ^- r% m - LDA #$575 x$ x# k' O! l7 ~6 k
- JSR $DB52 ;按键音效
! I" `& H" u/ L; ?# | - PPU_NUM_WRITE:( B4 _! [7 R( o' |3 f# k; G# j" w
- LDA PPU_ADDR_DATA
3 Q: {' d5 H3 W, F4 @! ?# n - STA $20064 c+ _4 x4 W% ?# y: I2 a* d
- LDA PPU_ADDR_DATA+1
$ s0 w7 ~) |6 o4 V1 ~' ~ - CLC
6 k. A# h' h( j0 F7 T: y' X: S3 [ - ADC #$06: i5 e( H) }, C: v4 r8 P6 Z5 _. h
- STA $2006 ;坐标设置
: _* _- f2 k7 f3 z3 j8 ]% e6 B - LDA $6010) A; C8 z- w' `( p4 E' u8 O! S
- TAX
- |# L: G0 C4 q" y2 d. q+ w3 A - LDA STAGE_D1,X ;写入数字2 c' b( u2 z; F/ d
- STA $2007
; f$ `: W' Y' P4 p2 {. M7 Y - LDA PPU_ADDR_DATA
- X' e0 @, D$ m2 J1 F1 s" @1 y - STA $20063 z; i5 ~8 w0 G% h+ G% W8 s+ K
- LDA PPU_ADDR_DATA+1
V+ G" q# c5 m. S3 d0 Y - CLC
% `9 d* E& r+ D. c l - ADC #$0B' o: Q! k5 c# Z4 v
- STA $2006 ;坐标设置5 p" M, ?% `. q# G$ T2 n+ _
- LDA $60105 y' E1 h, X( j P) }$ `# _/ P
- TAX
7 x5 V% Y4 K' d - LDA STAGE_D2,X ;写入数字8 \1 D6 H% f) m4 e% i+ x, ?' ]
- STA $2007$ X/ r( t7 e8 \0 T. N
- STAHE_WRITE:
2 w0 c9 f. ]: A5 ^1 W& P0 |/ E. l7 c - LDA $6010
: Y& \9 i& ^, \ - STA $42 ;初始关卡写入6 d; T: b2 {* v8 U4 `
- PPU_RTS:8 t* r# e, }9 F8 \! N
- PLA' {6 Q9 f* H" v* O
- TAY
1 L: j* W: O, k0 S* Z2 N- V z - PLA4 O0 s/ X+ p% Y- N1 @
- TAX
! [ r- x# y' }. x6 ?- E - PLA
7 f) D" T4 d- ? - RTS
2 U1 H2 i/ U. `8 l' l+ q -
( V, V- p+ V! G% } J/ B - - L+ l- b7 i7 h. ~* x
- STAGE_DATA: ;关卡文字S,T,A,G,E,X,-,X字模数据) i! C2 g0 h3 |/ T7 w) K
- .BYTE $1D,$1E,$0B,$11,$0F,$00,$00,$00,$1E,$19,$00,$00,$00,$FF
% f0 N. |( m% g' b+ d7 `! }% F$ J- m" f
; O( O2 a7 M* z7 a0 [- STAGE_D1: ;关卡数字
}/ Z* C ]0 i) n! N - .BYTE $02,$02,$03,$03,$04,$04,$05,$05,$06,$07,$08,$08& @) B: ?5 k, ^. e/ x' O
' {% h; ]( H% Q1 J" h& |- z- STAGE_D2: ;场景数字* U+ I3 D4 M; ^- a6 N& {5 m, p
- .BYTE $02,$03,$02,$03,$02,$03,$02,$03,$02,$02,$02,$03( A+ ~8 J! z! T6 P) T- u5 u" f
- 9 k9 z. {! @3 i- D
- PPU_ADDR_DATA:0 j2 E3 c& ~( W$ u. T, z! P
- .BYTE $23,$4B/ M7 ]$ x k1 i# B: n/ z$ `" U: X1 T- V
- 4 G' l9 J; Q# P" A
- : U0 `4 J3 L& x6 [" N
( r5 C$ @4 G" N1 z4 t9 \- ! n6 d" I3 B) v
- 0 X6 |' l# {3 y
- .ORG $FE21
$ ?: p" N+ a; N8 I% T - JSR $FF40
" ^7 G% l; D$ E7 \" z7 E( W -
, r& G$ b% y, f1 U5 _( N; k3 t - .ORG $FF40
8 m% P) |0 Q+ V' X$ e9 m2 P( F - LDA $BCDF
' g; J" n! h5 t# Y% ? - CMP #$7F
' n) w8 y2 s6 v" }# T: [* V - BNE ADDRFF568 E3 S+ N6 z. m# i
- LDA $0018; o, s/ M8 F2 g
- CMP #$04
: l! O j; g- x. O8 g4 u. c- \ - BNE $FF52
- K/ L8 b4 S8 z- p* A/ p$ Z - LDA $6010 Z, V* A+ Y6 T6 N0 g, M" u
- STA $0042
( p/ E) m2 ?# E7 a5 i# u. E( \: Y# y \ - JSR $BC00
' \0 E) I5 ?% } - RTS
0 {, B6 Z+ j3 G - ADDRFF56: & M) @! Y- @4 A# t) ?3 t. N
- STY $4014
# k7 N9 M! l9 _- G E: k - RTS% q0 m# u5 x. l2 l0 b9 S7 V
-
1 C \2 y2 p1 D% I% N+ J
复制代码 内容:
$ {7 W3 G' U( Y& q 1.关卡选择: 标题时,左或B减,右或A加;) b& G* X1 I2 I1 \: d5 o' P
2.一击必杀: 暂停后,按B键切换;
/ {* _* v# B' g) G/ P5 [- q 3.无敌锁定: 暂停后,按上键切换;
8 E2 w4 e$ Q2 E; ]0 p- ~ 4.生命加满: 暂停后,按下键切换;! G8 Z8 i) J" _% Y4 k t8 k
5.血量锁满: 暂停后,按右键切换;# `3 y9 H) c D5 n0 x. `: H7 f
+ j+ u- C7 @ G4 V5 H' }
. z3 p" Q# {4 W: B0 ~8 zFlameCyclone.ys168.com; k; `; i* m# n/ K7 M. @ u
www.nesbbs.com
, p% A8 P" n8 l/ h" e
' ]) G' Y1 k8 J# j |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
评分
-
2
查看全部评分
-
|