|
本帖最后由 yandagui 于 2017-3-18 16:17 编辑
( k8 [' z0 q2 C j# Z6 j" x" L( N
, T6 P. G$ w: o4 _5 I- ^8 V) H2017.3.13) |9 h! x* k1 \7 q) X% _# T$ r
1 [1 G5 F) A7 n; V m2 ^8 \- A# ?# A9 _, Z; a/ }; D
2 y; z v" I% n3 t: r+ _% m- .ORG $936E ;CONTRA(J): y8 T7 x. w9 w# }4 Q
- LDA $25
7 _' O9 d& ^7 @: y/ [2 }# |& P - BEQ ADDR_93C9
+ w2 P8 S& p" B$ [ y - ADDR_936E: LDA $0022 ;读取地址$22数据到累加器A($22==0,单人模式,$22==01双人模式)$ R7 V. C+ q3 ~/ M9 X+ I
- ADDR_9370: LDY $001C ;读取地址$1C数据到寄存器Y7 H1 P3 ]- P$ L a9 R9 S
- ADDR_9372: BEQ ADDR_9376 ;Z==1?如果结果为零则跳过$2字节 G9 V" B4 ?, B& @! v* |# m$ O
- ADDR_9374: LDA #$01 ;读取地址$01数据到累加器A
+ l5 u; ^3 p/ Z) D2 Z - ADDR_9376: STA $0000 ;将累加器数值送到地址$00
& ^7 t+ r$ \4 u& o3 ] ?1 n2 E9 ` - ADDR_9378: LDX $0004 ;读取地址$04数据到寄存器X
8 w/ J( S+ T1 H - ADDR_937A: LDY #$08 ;读取立即数$04到寄存器Y% w) E, l3 ?2 e) m
- ADDR_937C: LDA $001C ;读取地址$1C数据到累加器A( J: y8 v) q( M/ y: s
- ADDR_937E: BNE ADDR_9395 ;Z==0?如果结果不为零则跳过$15字节
% \3 H \- s; B - ADDR_9380: LDY $0000 ;读取地址$00数据到寄存器Y3 n! W% P/ ^; z5 E4 X# {* M% {5 @* E; d
- ADDR_9382: LDA $0038,Y ;读取地址$38,Y数据到累加器A($38==01,P1结束,$39==01,P2结束)
- g1 P+ V* L5 F! a6 [+ L8 z - ADDR_9385: LDY #$08 ;读取立即数$04到寄存器Y) b4 A4 Z" P, h; u+ \& X
- ADDR_9387: LSR ;逻辑右移
% M9 i. o; q6 w5 Y2 d; A2 d" w - ADDR_9388: BCS ADDR_9395 ;C==1,有借位则跳过$B字节" _) O4 d6 x, w, ~6 N* u
- ADDR_938A: LDY $0000 ;设置Y==#00# H6 L* K% I- h- i+ J2 |
- ADDR_938C: LDA $0032,Y ;读取地址$32,Y数据到累加器A
6 z& P4 [% _8 @ - CLC
+ U9 c/ s/ j" I. U5 _ - ADC #$02
* r0 @9 z8 B& I - ADDR_938F: LDY #$00 ;设置寄存器Y为$00
# V7 Z6 b/ b; b - ADDR_9391: CMP #$08 ;比较Y==$04?
, c8 z# {) r+ ` - ADDR_9393: BCC ADDR_9397 ;C==0,有借位则跳过$2字节
/ s0 P# R9 n0 {- y# J" I# H - ADDR_9395: LDA #$08 ;读取地址$04数据到累加器A
/ {3 c, |) {- s! q: K0 S, Z - ADDR_9397: STA $0001 ;送入地址$01
* {" R- l ~( Z: M - ADDR_9399: DEC $0001 ;地址$01递减6 a3 e3 [* d9 g3 O
- ADDR_939B: BMI ADDR_93C3 ;N==1,结果为负则跳过$26字节
: J" u# N2 d( U6 i - ADDR_939D: LDA #$08 ;设置纵坐标数值
" I, Y1 g' W+ b& [- z - ADDR_939F: STA $0200,X ;送入纵坐标地址
2 e" f: V0 B5 ?' G6 Y - ADDR_93A2: LDA ADDR_93CA,Y ;读取图快号数据6 |- p! W. X" x* D: g l/ |& j
- ADDR_93A5: STA $0201,X ;送入图快号地址3 U( c' f! c; m1 ~
- ADDR_93A8: LDA $0000 ;读取属性值数据
1 j% h. c8 l- E; D7 H$ c g2 t - ADDR_93AA: STA $0202,X ;送入属性值地址
; R) {% r) ?0 D5 K8 e" l - ADDR_93AD: LSR ;逻辑右移
7 O1 n! F% n7 m! p5 p/ } - ADDR_93AE: LDA ADDR_93D2,Y ;读取横坐标数值
6 H0 D% H- [- k K, F; |5 U! i - ADDR_93B1: BCC ADDR_93B5 ;C==0,有借位则跳过$2字节! x9 ~8 B: l. v( p2 _
- PHA9 |. h4 s+ N3 s, I9 L
- TYA! N% m9 |) L* }/ O8 E
- PHA
G. O- v7 A( x" _+ u5 g1 n - LDA #$D47 s: o/ `3 e6 Z
- STA $0200,X
" m q% R' X) F- W/ ~$ s% | - PLA
7 t& ^- l% `+ [' X7 D& u7 M - TAY
4 G5 g& |' I$ U( h - PLA. g/ q0 ^6 d/ \. A' B9 N; M( t7 N3 Q/ [
- ADDR_93B5: JSR WEAPON0 G: p; o; e( f8 S7 f. r
- ADDR_93B8: DEC $0007 ;地址$C7递减
6 B: ?) X' k3 F4 L! o; y/ c7 M - ADDR_93BA: TXA ;X-->A
4 S2 m% U( Z6 m; \ - ADDR_93BB: CLC ;清除进位标志# I1 P4 o8 C( Q# w7 Z1 N t0 H
- ADDR_93BC: ADC $0010 ;加上地址$10的值
( k& z$ p( V, q' h. `7 I - ADDR_93BE: TAX ;A-->X9 j! s% p! Y( H
- ADDR_93BF: INY ;设置Y++3 U3 O8 L) i# |) T, v
- ADDR_93C0: JMP ADDR_9399 ;跳转到ADDR_9399
4 ^ Z0 r6 }$ [8 @' u0 S# |# _- R - ADDR_93C3: DEC $0000 ;地址$00递减
) |4 N. L8 v$ A: j J( M - ADDR_93C5: BPL ADDR_937A ;N==0,结果为正数则跳回$100-$B3=4D字节
% _+ p, B7 S- m+ K; Q9 i - ADDR_93C7: STX $0004 ;送入地址$04
# L* _: M: ~7 A3 L, f& K$ x - ADDR_93C9: RTS ;程序转回-----------------------------
+ a; o, x7 ]1 l( X$ k
6 ?0 s: K% x; r) B T0 l- .ORG $FB60" A2 g. {3 B" b, @
- ADDR_93CA:
2 K" _8 o, m3 K+ y7 v! O8 E5 t - .BYTE $0A,$0A,$0A,$0A,$0A,$0A,$0A,$0A ;生命图块号8 {5 _% S) o5 [+ _0 C' a
- .BYTE $02,$04,$06,$08,$FE,$FE,$FE,$FE ;GAME OVER图块号
4 z/ L1 a+ z5 @8 e1 U; l - ADDR_93D2:0 a+ u8 n, m! x. D \
- .BYTE $14,$1C,$28,$34,$40,$4C,$58,$64 ;生命图块坐标
: [1 j: h9 _2 M* b% U5 f" h, x - .BYTE $10,$1C,$28,$34,$40,$4C,$58,$64 ;GAME OVER图块坐标$ r$ J, K6 w$ J& z
- / u% k9 C6 g. g1 f# F2 r" U
-
( } H% R+ P, y - .ORG $FB80
; w m: A4 }2 P0 s -
" q4 W% N t0 u: J2 o - WEAPON:, K, `1 N1 f5 J1 m! N. C- Q
- STA $0203,X ;送入横坐标地址
1 }. z7 x$ Z9 J3 | - PHP' s# c( C9 O7 I/ O E$ O! T+ m
- PHA9 F w* T( M% l) v h$ [8 ?
- TYA! z8 L4 o* \0 W- w c, x, F! p$ p
- PHA% X9 g; t. X, s9 @( t
- CPY #$002 M0 T1 `0 t: [1 P; {0 i% G% l; T
- BNE LB
, Z9 h# \9 A; |" D: x& n; ] - JSR S_WRITE ;第一个精灵+ N. p- J7 e) y _( A
- LB:
4 |* q$ T! M. ` - CPY #$01
( x9 g. {0 t/ I6 H. Y5 Y - BNE RE
8 h6 t$ }; ^# X3 `4 {. \ - JSR D_WRITE ;第二个精灵+ F; y9 f* _0 p( m3 D$ {
- RE:5 i# O+ @4 K; ?2 s2 S
- PLA
$ c, l' U% r% a8 ` N2 B- r8 I - TAY7 Z2 A+ b" K9 a
- PLA0 @/ g* S7 D1 V% j0 w
- PLP) y+ S- m+ d2 I) I
- RTS
- G4 \, X7 a& T -
5 R0 [; e6 ~9 w% u4 s$ `( A - S_WRITE:
* H2 U; V2 x" N/ [ - PHA
& T+ |: P. H* K, p' d* s+ b - TYA+ [* z( B7 c1 I! p* \
- PHA
1 R1 j; G/ ^9 }1 K h) y) R$ T - S_CMP:4 ~% D: H! J4 w
- LDA $00* b6 L3 n" y9 [$ K/ T
- TAY0 c. l ^7 u& [( w3 R! ~
- LDA $AA,Y ;读取武器值
7 P3 y2 ^! X6 h3 Q" ~; q3 a# R7 O - AND #$10. g4 \/ _; ~9 m. j
- BNE S_WEAPON1 i: h0 Y9 r2 N* s
- M_WEAPON: ;普通状态2 l0 K/ k2 x: \9 u7 E m
- LDA #$263 e. {* a/ K1 H" L
- STA $0201,X2 u1 m3 _, u' o% Y* ]) \! ]; M
- BNE RETURN
4 U1 }6 h& P5 Z8 N% o - S_WEAPON: ;加速状态
/ y' N! `) w9 ~: Q - LDA #$1C5 x4 g3 I7 ~/ p' B$ D
- STA $0201,X! h j3 I8 R. g) j" A# l! J5 [8 ?
- . J- Y8 h2 O9 X4 K. e# z% K8 b
-
5 ]. |: D% l6 u! r$ g, R1 M2 Y - RETURN:) H7 F$ ]. C" ~0 }7 q' n! P" i) b
- PLA
{) G8 G! l( j" S - TAY
- c; ~2 K+ R) S - PLA: J2 V4 S. l" z0 |6 [( y
- RTS u) D9 s* s! e7 A, R& B
-
$ |. Y6 @6 L! C2 c* u
d$ E2 k: z' u0 Y Q; S3 C- D_WRITE:
& y% x/ A& b# g( `" y" i7 L y - PHA
& k+ X k( \( |8 ^5 W& L+ ]8 l9 J - TYA
4 h6 {/ x$ Y" I - PHA9 j" a5 a. s1 Z
- WEAA:6 D2 N# s+ c( a0 W' I6 v
- LDY $003 y9 e, A, h' N( j* P; n
- LDA $AA,Y' Z- f8 k; M: c- K
- AND #$0F
/ \& i- U) ]3 H - TAY! [+ h+ k' c3 C" n7 R! H
- LDA DATA,Y
0 K8 c6 w9 w: e+ a6 x9 A3 P0 \ - STA $0201,X
* A" g% ]# C: Q$ q0 t0 z - & r- m% M# @" P; r5 v- h+ \* @
- PLA5 y: v4 j) I2 H' G
- TAY- h" i0 R! A# o
- PLA3 H$ B. J+ M- m+ ^& l
- RTS8 x0 b7 M0 h% g5 `, R8 m: Y
- ; [) C# @& s( p0 w& k: p
- DATA: ;武器种类图块/ @7 M8 W: ~% V
- .BYTE $24,$26,$20,$1C,$22
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|