|
本帖最后由 yandagui 于 2017-4-2 13:21 编辑 # |6 ]! X, U9 b) m( `
2 }0 q# C) n1 M
[FC][忍者神龟2][END选关]" t$ O1 @& Y5 j! \2 O
+ X7 p, H/ K3 q( Y) U时间:2017.3.31
% \# x# ~8 L' y1 d% {# Q0 A作者:FlameCyclone- .ORG $B9E0
3 U& F9 V* H* W! U/ e F/ i - ora_data:
1 Z- P c9 B1 z( ] T/ E7 o: D - .BYTE $08,$04,$02,$01,$80,$40,$20,$104 \1 X% I+ b: i' {$ g7 r
- and_data:
9 n' |) h/ N+ ]( x3 F" H - .BYTE $F7,$FB,$FD,$FE,$7F,$BF,$DF,$EF
& D- s" t/ U3 u$ [ - 6 ?9 Y0 o, C p& ^' A8 t
- button = $F8% h! x9 j1 ^0 p* D* `
- flag = $6000
& `7 t2 p1 H# I. | - pause = $3D
0 q# m4 H' U# ?4 t: |. X - - @/ _: ~6 f: M9 x
- .org $BA00* q% I$ r2 p3 d2 A( ?( o. V
- & B" ~) U& x! v9 I1 T% l
- PHA; s/ R4 Z! ?; J1 e
- TXA
& ~8 o' P4 @8 A' F$ ^" b/ m+ D - PHA
+ H5 j0 u" n! K8 y7 k/ _* v; C' B/ Y - TYA
4 Q2 L# v+ R& p0 v7 ~: R5 X _ - PHA
% ^' d! G& w }* R- T3 p1 F - JSR KEY_OPERATE5 v( ?& y M2 ]) f
- JSR INV
- c$ s7 B% K( L; Q5 E7 G7 p - JSR LIFE/ b/ M3 [9 A5 ~2 n3 i( c7 {
- JSR BLOOD1 R5 Z* Y0 }% c) C! W! N1 O$ i
- PLA
" x, N+ Q& p3 x) m - TAY+ b1 M) }, ?7 [
- PLA: @" A" I/ S+ c! ?/ G+ S- P
- TAX! F* |3 G( E: d) i* A
- PLA8 i5 H/ c. C: m4 h8 i
- RTS+ ^$ l9 i3 \. d# g
- KEY_OPERATE:
" _3 k' o/ c' A* m8 l0 A6 G; m - data_protect:
$ ^, M8 c; i M" N! D# a" } - PHA
3 b, Z, n: m' W - TXA' H" i' w1 R/ D
- PHA
# y# Q% \9 V/ r- Y% h9 b' S - TYA/ {5 @( |8 f: q4 v
- PHA
- q' K* O, ^, G- J! Y
. k0 T- g/ m4 o6 g7 `! p- FLAG_CMP:
' h7 E+ ?0 O, j - LDA $600F; ]2 C9 ~! n! ^- d. V
- CMP #$7F ;标志数据初始化条件判断) p7 }6 T/ t% F/ E4 i e4 O. g
- BEQ pause_cmp6 S3 Z. D9 G9 z y4 [
- LDA #$800 C+ g. I# u- h8 H* I( ~ R3 {
- STA $A001 ;6000-7FFF写入启用
1 Y* D' V$ Y' f1 C" C1 l: Y - LDA #$00
8 `( p+ P6 Y- W& n- D& k) w% ^ - STA $6000 ;数据初始化9 J$ }. B: {9 |
- STA $6001 ;数据初始化- s* [! n$ @) \1 b) s
- LDA #$7F
8 d0 G/ h9 L C) v7 J/ f - STA $600F s2 p# m& T" s. B1 T0 N) K T
- pause_cmp:
: W- B! `) M2 K. F3 @! d6 S - LDA pause
; u) D4 G& R) M& j( ^/ _. v! n) n - CMP #$016 T! |) r7 ^1 T i! j8 J
- BEQ button_press" W. h) Y) w: y, k( }
- PLA/ \6 Z9 }# F+ y* c- A
- TAY- o0 |, Y. y. z" O
- PLA5 P) P5 E3 ~2 s: P' o' F2 {
- TAX
- o: | g6 w; v% \9 c3 Q - PLA* O; f/ ^9 N4 @8 u: Z$ e& j
- RTS
( b" q, U+ w" G. c7 G - - h! g8 t1 b$ d9 q8 e9 ?! k
- button_press:+ K9 n- v7 h8 G+ j* X! [* {
- ini_Y:3 Z& ]* W: O; c' p W, j
- LDY #$00; k4 g V, s, l- ~6 M: v8 M7 }
- button_cmp:
8 G9 b) J& G2 k* z7 h d - LDA button,X' ^; b; \6 e1 G' e4 O7 C; w
- CMP ora_data,Y
/ P1 D! C% W* l5 l2 w - BNE count_Y_cmp
& J+ f0 P) p$ y3 w - flag_cmp:/ Z1 J8 f3 Q' d3 q/ N: {& c. \
- LDA flag,X
/ t9 L, d M. P4 o: t- j" { - AND ora_data,Y6 o6 `3 p; p# v1 T7 M$ Z
- BNE flag_and) W5 A# ~5 }9 |9 l* \
- flag_ora:
* e( ~5 d: _: Y9 n - LDA flag,X6 Q7 |; w% i: s) Q
- ORA ora_data,Y7 D5 J0 F+ C! G6 m" R4 X( T+ F
- STA flag,X
1 a- W4 \1 ?4 g" P. g+ w - BNE count_Y_cmp
; u+ P1 C- ^0 n" J& w- ~ - flag_and:" E7 j) ]0 w+ ?9 {3 F, g3 }" K
- LDA flag,X' k* w5 {2 g! K( F+ _5 R6 M" M
- AND and_data,Y
7 `2 U! W; } k X - STA flag,X
! S, e+ O6 a2 M2 l; M% Q( m - count_Y_cmp:
) M5 A( D! U* z6 B - INY
; i2 m% R: k z: h - CPY #$08
% [$ Y; S s% [0 y' w - BCC button_cmp
# D+ o c/ d" N, n) _8 O - + o3 g( ?2 S1 I6 r
- data_extract:$ j; c1 `7 O# G0 Z9 Y, `
- PLA# Q: t7 {$ I5 w$ t' V- X! n+ s7 F& i" f
- TAY! J+ S" m, G" C3 \
- PLA
0 y0 O% d; M9 V/ j G - TAX
$ G$ ]" a0 t( b - PLA% W5 o5 `' @" \; x- K+ h
- 7 k' m3 r+ h8 N9 ^' Z7 C
- return:
" }2 p; A6 X& R, [$ C# s, ` - RTS
9 B4 J& A! D4 I8 M; r2 [ - 9 r% E' u) }9 [0 q. i
-
B6 H, |0 j2 Q - INV: ;无敌
+ I3 V: ^7 _8 B$ F; r4 e - LDA $6000,X
* G5 y! C- O" j$ Q - AND #$08+ o* c5 v+ Y: C. f) w9 W
- BEQ INV_RTS) W! x9 q* R# x+ V+ Y
- LDA #$05
+ W" L1 K/ @4 C1 `4 V# i- l - STA $93,X. W1 ^8 f8 H& p* l" d, h m
- INV_RTS:
1 T' ?# L+ b& _ - RTS
8 F7 U+ X Z Z' N! { - / m3 Y+ Y# _: T# {* c/ ]
-
' V" u0 o1 r2 b) A5 Z) q( ` - LIFE: ;生命' H c* I0 w3 z' _* I
- LDA $6000,X% l: K* @( z3 ^* z
- AND #$04
( N2 b$ c4 L/ Z, L; p V - BEQ LIFE_RTS! j/ D2 O7 o# _7 k& M3 T' {% t+ v0 @1 ?
- LDA #$09, D! ~* h" Z8 I- _& [. ?1 N u# Y5 v
- STA $4D,X
4 Z0 o2 O3 i. J1 o: q; @ - LIFE_RTS:' ^# k& _! C# P$ K) q
- RTS
$ g& j" l9 k9 Q% B6 ?, \& r- E
) c! J! G0 `) `" u3 }- % {' f- O" T: d x& Y& Z6 V
- BLOOD: ;血量6 w+ s6 j" S' W/ F
- LDA $6000,X" j( s& S$ n- V3 v6 V7 B
- AND #$01
7 B' \9 n$ A3 _" R7 p - BEQ BLOOD_RTS- w* C. f, ~. Z. m" E5 J
- LDA #$38
- h* Q! R$ h8 z8 b3 p, b+ b( h - STA $0568,X
4 u2 A5 \7 }7 X2 o - BLOOD_RTS:
5 n7 A$ l% z: ]2 l$ l# n i9 [4 S - RTS7 |# w7 u, O# U0 | b' p- T" e$ k7 j
- 5 b: n6 H/ N8 Q
-
* T5 P# F0 l, x. E8 }5 e6 g. X - .ORG $FEFE
4 E6 j4 Z8 W( ?' G# ?% n$ ? - JSR $FF60- C! e7 n0 x8 i1 A
- NOP2 b/ b. d+ u1 Q0 ~ d
- * H2 u/ X2 H, o( S! y) n
- .ORG $FF60
( P8 S( I0 Q& Y) W - STA $F8,X. Y0 y. O+ o- S7 E3 z# n; @# A, s
- STY $3A,X
?6 }1 @6 [% t& j# r8 \& \+ x - PHA
0 u' R1 Y, K2 c- o) C. M - TXA: n u! W. d0 s1 i7 M
- PHA
# U8 n7 l; H# a, g$ u9 u! w - TYA5 U1 Y8 F! h# Q" w+ x
- PHA
# }3 M7 m: E( ?2 S" E" f - LDA #$02' R! G. }/ _4 F% V
- JSR $DB11 ;调用系统切页: G4 M6 I( H7 V% M( p( K' r
- PLA" z9 J. E3 E. g5 I8 n% P) a3 Y
- TAY5 c! p4 M/ N7 @% t2 R) U
- PLA
' V" r: B1 |2 t1 I - TAX7 S- I6 w; O0 L# | w5 ~
- PLA/ `8 D4 r2 Z+ j
- JSR $BA00
4 \' b+ M6 l: s6 i" y# E+ |2 _ - RTS 2 U, k+ T0 I8 C& W
- * ?0 [$ u. \9 R2 [0 A+ i2 ?
- ;[FC][忍者神龟PPU][END]/ ?2 b# @1 b8 M2 w* ~+ W
- 2 v8 a2 p1 c F% S5 U' g5 m8 M5 C
- .ORG $BC00
( g D/ d/ ^; F( v) G L6 r3 a -
y- J* e5 r, ~( | - STY $4014 ;补上覆盖的精灵写入指令
) _- O' H% i4 x) q$ X; v/ S - PHA, Q I8 a0 A- |9 D, V0 r( K) ~
- TXA3 R" i3 r) [6 l1 B5 R& R
- PHA
: {2 n; T, Q4 t: T1 U5 K0 M4 _ - TYA
# z7 n9 r, d2 Q& o - PHA) o" X6 k3 F7 ?/ R; v
- LDA $018/ g9 N7 M/ D7 \
- CMP #$01 ;比较是否为标题画面
O- I/ B; x$ A: C - BNE RET
" m% E( \! ^/ Q8 {5 M - LDA $019. p0 l0 m" p5 C n$ U
- CMP #$01 ;比较是否为标题画面
. i' C7 t+ T% V% m/ Z" q - BEQ PPU_STAGE
R# E' C- |/ \( d' }( M - RET:
9 R- h. z; I9 H8 E+ c5 O - PLA( s5 }5 ?. X7 G
- TAY! L3 u1 ^% @; |& h. _5 ]+ c
- PLA9 h$ O, S( Z e7 F* _/ _% I
- TAX. L/ k3 U! P% L( O# ?9 R9 Q/ ~9 K
- PLA
9 M/ l$ r* T; h4 }, I - RTS5 f" n) K8 ~' G: X$ I! }0 A
- PPU_STAGE: ;STAGE显示程序5 B) K" A+ e5 x) W) F. \7 P% ]) V
- LDA PPU_ADDR_DATA9 b( e$ x& C3 d3 S9 H: V$ |
- STA $2006
$ f( n# \0 L4 [/ Q5 T1 S% \6 W - LDA PPU_ADDR_DATA+1
: g" X3 J( c9 Z ]( v' K - STA $2006 ;坐标设置
8 \2 n9 q0 a7 o; { - LDX #$00, ?, y1 c. p0 n0 a7 k
- PPU_STAGE_WROTE: ;写入STAGE字模1 B7 z3 R0 j- J0 w% ~
- LDA STAGE_DATA,X
$ q% Y, r6 B- ]# \ - CMP #$FF
4 ^3 M) Q1 h+ S- ?; \ - BEQ STAGE_CMP5 g4 T8 E, M" M5 z& r9 ~
- STA $2007
% B. G$ ] V, s0 I( I$ S/ b o1 g - INX
8 q% r, h% `. m, @9 E, m6 x6 K0 U - BCC PPU_STAGE_WROTE" x6 s, ?: U# K! A9 A: Q
- STAGE_CMP:; c$ p$ O6 b5 w4 R, B; |/ }2 E
- LDA $6010$ w( p8 M7 F/ h) O [8 `: N. \
- CMP #$FF ;关卡数据初始化条件判断0 j& V6 u* z* c" G! c" H: g/ Z
- BNE KEY_B
: b a# s& h" e! J' A* K; }. W - LDA #$00+ C4 P" K+ | H% j# U; b
- STA $6010 ;关卡数据初始化
5 ]) S" r4 B: s8 V& R n p2 A4 M - KEY_B: ;关卡减少0 d& h5 m E& ]4 w4 P1 a$ x
- LDA $F8+ d7 |) S- z$ ~! `9 X' S4 [* g
- AND #$42 ;按键B或左减关
$ d4 b( E0 w/ \/ O' `% N- [; y - BEQ KEY_A
( I. m7 ^& [ L; S' B: Q - LDA #$FF( D9 U Y7 o0 v6 W9 n
- STA $40
9 G" D; _5 b7 E- j9 j. M# [/ {6 e: g* | - LDA $6010. l2 q! i' a3 s
- CMP #$00 ;关卡比较
f/ {- [9 p. d5 U6 G# e5 ` - BEQ KEY_A4 W0 @4 m- x. }
- DEC $6010 ;减关
; Y+ |8 E5 V+ g/ `% x - LDA #$57
& J: m& R4 w* m7 f+ w" n' y - JSR $DB52 ;按键音效2 c6 y7 o( B) h
- KEY_A: ;关卡增加! d+ Q" l f7 _1 ~ k5 k+ O
- LDA $F8* f7 I( X9 J$ r9 W9 z) a
- AND #$81 ;按键A或右加关
4 n6 J5 Y8 D, z- [9 G% l: C% g - BEQ PPU_NUM_WRITE
0 j% U+ |9 z7 L+ t0 r. Q2 A - LDA #$FF+ @% S' }4 d5 ~
- STA $404 R' @# \. m2 @2 x
- LDA $60102 b5 f6 c2 J$ V6 W9 W ~$ r: n0 E
- CMP #$0B ;关卡比较& H" N* s8 w# @ r; ]
- BEQ PPU_NUM_WRITE
% P5 A9 H6 F8 U - INC $6010 ;加关0 s$ z4 Z- S" N9 f3 c
- LDA #$57) g$ [) `8 V5 ^* A. W+ ?! ^
- JSR $DB52 ;按键音效) l: Y$ u# Y! q/ x" Y( N J
- PPU_NUM_WRITE:
9 g3 f1 k. L, `. Z - LDA PPU_ADDR_DATA9 W: X; [& l2 b
- STA $2006$ Q2 o( I R& X
- LDA PPU_ADDR_DATA+1
& @+ C( {. I |; g$ ?/ }( o. b - CLC
/ ^: b4 p9 m& g7 _$ J - ADC #$06
/ F' Z. T9 p( G' f) f' V& v- M - STA $2006 ;坐标设置
6 |6 ?; a5 g; R- W1 X/ `8 p! Y - LDA $60100 _ ]3 r& U/ ?: d" V
- TAX# S' Q8 m3 j6 C, y! D
- LDA STAGE_D1,X ;写入数字' e @1 A3 D# h* C: M" K( N0 O; `
- STA $20079 z, v; ?4 M0 D v F! U
- LDA PPU_ADDR_DATA z( ?! ~& @ G8 ^$ h
- STA $2006
/ i/ E- K; Q5 A5 j) p1 B4 Z( U4 `! S! L - LDA PPU_ADDR_DATA+15 }5 t, l! ~, w& s9 N% ?
- CLC
; t% s! ?9 t$ E6 d, Q - ADC #$0B
/ \7 n5 b" A& `( Y, ^8 L - STA $2006 ;坐标设置
% p. G+ M7 }/ e6 A/ M/ Y; | - LDA $6010
2 Y7 v5 c9 [% P7 W9 I" S6 i - TAX
( M2 L5 \( a" x5 ], Q9 m8 d - LDA STAGE_D2,X ;写入数字
9 c4 B& e) F6 F9 V- u& \: v( U - STA $2007
) @6 g" L% N7 I9 T/ Q% N# B* U - STAHE_WRITE:
; ^# Y$ d |; n - LDA $60105 e. C. h( s T
- STA $42 ;初始关卡写入2 g7 \+ L' L! V' C# e' i
- PPU_RTS:
6 I8 D2 W4 q7 D% K - PLA# g" Y$ q' y/ I' F; \* L4 R
- TAY
4 i$ a( [; l- O4 P" V/ r) I - PLA! K2 G6 ~2 l0 L/ H
- TAX5 ^" k5 R8 d8 M, F
- PLA
4 ~# h: Y. q C" P+ y7 Z& ?1 Z - RTS
; T" e, `" L& Q$ W -
6 m( I. G$ c) S8 ? - . h2 r9 g; m+ B
- STAGE_DATA: ;关卡文字S,T,A,G,E,X,-,X字模数据
" F. v' U) W# |& H$ E8 z0 e0 K( e - .BYTE $1D,$1E,$0B,$11,$0F,$00,$00,$00,$1E,$19,$00,$00,$00,$FF
0 w2 g' N5 J2 s - : b" W j8 K8 f" N
- STAGE_D1: ;关卡数字/ B/ V" K1 \: \( m
- .BYTE $02,$02,$03,$03,$04,$04,$05,$05,$06,$07,$08,$08
# K4 K. q3 _$ q* b0 u! i3 [ - , |0 f. l- z1 S+ w* `9 a, v
- STAGE_D2: ;场景数字
8 ^* ?' @: F' L9 h9 F9 c7 J - .BYTE $02,$03,$02,$03,$02,$03,$02,$03,$02,$02,$02,$03
" Z) y% T D. d$ Z - / p+ T. F' E2 b* w
- PPU_ADDR_DATA:
0 f3 M' x$ I! o - .BYTE $23,$4B
: v( Z/ f6 U3 C# O1 m - ?9 }5 n4 H( g& M
- 7 c+ u# B( `6 i" c1 P
- % |9 f9 z% \; ]9 `6 _" L
- 5 f4 N. P9 Y; l; x
- E9 z' C9 G2 ]) }9 h, e0 a
- .ORG $FE21
9 n" \# G7 {: y! n4 ? T - JSR $FF40 i) p- g z( G# p, R( b
-
7 s1 F! a/ e4 U0 O" t4 I1 B+ ` - .ORG $FF40" ~9 N" c" N6 J: Y: k
- LDA $BCDF
+ M$ H3 Q/ W2 q. R0 M; p+ D3 u1 k - CMP #$7F) ~( q6 K% m* j. f' s6 v
- BNE ADDRFF56, ^6 P& Z% F! u$ s+ y8 q% d
- LDA $0018
6 E& H/ ?3 I& C - CMP #$04
9 J0 a% Z( d1 p4 M: s - BNE $FF52# b0 y4 I; P$ j9 b) o' w
- LDA $6010% A$ \0 _; } `3 `$ J6 t; x
- STA $0042
; x2 C2 q0 U+ p' M, b7 f - JSR $BC00! p6 m0 i. A0 V. n, r
- RTS5 b) @4 @/ b' {. d
- ADDRFF56: " ^3 N7 b4 D: e7 I' V
- STY $4014
8 y7 G( k# _. K2 J2 i - RTS
4 V, d0 s& m% V/ R- W& T- Q - 6 _+ _, K1 t$ p* v& y3 \3 j4 Y
复制代码 内容:, e% o3 {2 e- }6 K; x
1.关卡选择: 标题时,左或B减,右或A加;
: A* m: J+ Y3 N 2.一击必杀: 暂停后,按B键切换;* e% w- B: Z% K# L4 Z6 R
3.无敌锁定: 暂停后,按上键切换;
% i% C7 A% D! C' D) U 4.生命加满: 暂停后,按下键切换;7 b' I& Z- \0 x
5.血量锁满: 暂停后,按右键切换;: i7 e) a7 |1 R, H( S, a
+ b. }4 z, `4 i) [" h6 w
* ?3 s2 o$ g) ]3 t( k0 _FlameCyclone.ys168.com. B( C/ V( H! y J; v3 [
www.nesbbs.com2 a# S+ k6 q4 I, O* l1 b. A8 T
) G" a4 O/ W- R |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
评分
-
2
查看全部评分
-
|