|
本帖最后由 yandagui 于 2017-3-18 16:17 编辑 / c# k/ O1 x$ ~5 B5 Z1 G4 K
- j5 I- e5 d+ q' p) ~2017.3.138 ]7 ?, I; o6 ^1 O5 J
) x8 X" i( L$ O$ p: h/ `( Z
' ~& W4 s: U- O' E3 H4 w8 L% U# W+ }! Q) o' e) D
- .ORG $936E ;CONTRA(J)
& r. y. p9 G/ c$ u: X1 h6 d/ b - LDA $25
0 G9 n+ H8 ~3 \0 H - BEQ ADDR_93C9
& y( Z9 B3 `1 E8 D& D0 e - ADDR_936E: LDA $0022 ;读取地址$22数据到累加器A($22==0,单人模式,$22==01双人模式)
9 R# d5 ~) c, ]. a - ADDR_9370: LDY $001C ;读取地址$1C数据到寄存器Y
' ]# i4 a/ D: A7 n - ADDR_9372: BEQ ADDR_9376 ;Z==1?如果结果为零则跳过$2字节" `8 m& u% y, |: O4 l. o
- ADDR_9374: LDA #$01 ;读取地址$01数据到累加器A
/ C* w& P: K# k. U - ADDR_9376: STA $0000 ;将累加器数值送到地址$00
/ r A0 f1 U- j3 D - ADDR_9378: LDX $0004 ;读取地址$04数据到寄存器X Z; r. g1 r7 Y5 ~
- ADDR_937A: LDY #$08 ;读取立即数$04到寄存器Y
' q' E& Z. R* { - ADDR_937C: LDA $001C ;读取地址$1C数据到累加器A! | B4 O y: g, W4 @
- ADDR_937E: BNE ADDR_9395 ;Z==0?如果结果不为零则跳过$15字节/ S9 s- ^3 T: Q* l
- ADDR_9380: LDY $0000 ;读取地址$00数据到寄存器Y
! N# k1 }/ h0 ~* F. S4 D) s - ADDR_9382: LDA $0038,Y ;读取地址$38,Y数据到累加器A($38==01,P1结束,$39==01,P2结束)
6 d* e$ A& m" p: L: i - ADDR_9385: LDY #$08 ;读取立即数$04到寄存器Y
+ p, d" g( }; u5 N - ADDR_9387: LSR ;逻辑右移# \4 P2 F: x7 _! h, ^
- ADDR_9388: BCS ADDR_9395 ;C==1,有借位则跳过$B字节4 r( c' D$ E- ?# z6 o ~
- ADDR_938A: LDY $0000 ;设置Y==#00
. r2 r; F) t7 P) Y - ADDR_938C: LDA $0032,Y ;读取地址$32,Y数据到累加器A
6 b, {% G0 D* j2 y% V$ F5 X - CLC
4 i- f- [' E: J$ ^) N) B - ADC #$02
9 X) W5 c4 I8 g5 c8 ? - ADDR_938F: LDY #$00 ;设置寄存器Y为$002 H% ? C* N: b2 J4 k1 U3 M I2 J
- ADDR_9391: CMP #$08 ;比较Y==$04?
1 O- D l+ F6 V8 X - ADDR_9393: BCC ADDR_9397 ;C==0,有借位则跳过$2字节 i4 }, K& P6 R# E. W+ H q
- ADDR_9395: LDA #$08 ;读取地址$04数据到累加器A- | I5 o/ l9 ]' P( `
- ADDR_9397: STA $0001 ;送入地址$01
2 Y/ J: z8 p5 D4 D - ADDR_9399: DEC $0001 ;地址$01递减6 \* |, H2 G% B8 B" e1 e: i
- ADDR_939B: BMI ADDR_93C3 ;N==1,结果为负则跳过$26字节; V5 Q$ x: m; X, u
- ADDR_939D: LDA #$08 ;设置纵坐标数值* a: q: N, P' Q! ]- B" ]
- ADDR_939F: STA $0200,X ;送入纵坐标地址
# m. P2 F- e% {- R - ADDR_93A2: LDA ADDR_93CA,Y ;读取图快号数据4 f7 f6 _8 P- V* M a: H
- ADDR_93A5: STA $0201,X ;送入图快号地址& }+ j q/ {# ]& _
- ADDR_93A8: LDA $0000 ;读取属性值数据0 ?9 Q7 {# v" \* a8 ?! h
- ADDR_93AA: STA $0202,X ;送入属性值地址
/ J" q x% L. ?( R1 Q/ u - ADDR_93AD: LSR ;逻辑右移1 e1 z2 U1 m8 M' r6 @: m
- ADDR_93AE: LDA ADDR_93D2,Y ;读取横坐标数值6 X1 @$ a- z3 x) ?" ~
- ADDR_93B1: BCC ADDR_93B5 ;C==0,有借位则跳过$2字节
& a( {- Z9 B1 l% s' K - PHA
& M) H R# Y9 m: v. ^7 }4 X' A - TYA
( I2 ] g/ |6 y1 D! q5 D5 i D - PHA2 Y' [3 i6 |$ a+ b" F
- LDA #$D4) \( ~7 `/ t; p' s6 H3 s; e
- STA $0200,X
2 U1 s6 k( V1 Y$ Z+ w# Y# u - PLA
6 c9 d2 B3 I9 J: s% H8 H1 |3 H- ^" ` - TAY
9 _& l" r- v0 j, `* k- C! N - PLA
n. Y; z! G8 ]/ S! Q - ADDR_93B5: JSR WEAPON
1 W7 Y; c% d( H( L1 H, f" T$ ? - ADDR_93B8: DEC $0007 ;地址$C7递减
- j1 H7 @; @% V" E8 ^2 |' T0 A& i2 C/ ^ - ADDR_93BA: TXA ;X-->A
" k4 M( ?: ] J5 \, h! D - ADDR_93BB: CLC ;清除进位标志- W: W! l2 J/ b% Y( d
- ADDR_93BC: ADC $0010 ;加上地址$10的值9 ]! o5 Q- W1 E3 t, q
- ADDR_93BE: TAX ;A-->X
$ J+ t& D3 f6 ~: S - ADDR_93BF: INY ;设置Y++! C% G% i% d# W: e3 P
- ADDR_93C0: JMP ADDR_9399 ;跳转到ADDR_9399
9 R7 ^' ` \6 G5 u& S - ADDR_93C3: DEC $0000 ;地址$00递减
2 d/ p r4 z6 Y( q+ q - ADDR_93C5: BPL ADDR_937A ;N==0,结果为正数则跳回$100-$B3=4D字节0 Y9 }, }7 N7 p# {8 Q; m
- ADDR_93C7: STX $0004 ;送入地址$04
0 D8 s/ h, G& H: S - ADDR_93C9: RTS ;程序转回-----------------------------
: c1 L3 \4 O9 {+ u
( X7 U* M, q5 C5 K- .ORG $FB60# Y( O; C. X8 G9 C
- ADDR_93CA:1 q+ t0 D& v K/ q: O- \( Q
- .BYTE $0A,$0A,$0A,$0A,$0A,$0A,$0A,$0A ;生命图块号
* ^8 X; _- u% j9 T* l) | - .BYTE $02,$04,$06,$08,$FE,$FE,$FE,$FE ;GAME OVER图块号/ y. m2 l2 h5 \2 j) \
- ADDR_93D2:
# n: D4 M! M* q) _ - .BYTE $14,$1C,$28,$34,$40,$4C,$58,$64 ;生命图块坐标
0 @; ]4 O8 o4 y" u( m# n% { - .BYTE $10,$1C,$28,$34,$40,$4C,$58,$64 ;GAME OVER图块坐标
8 i( N6 }* `' \% D1 D -
5 c9 y/ w5 Q! a* |: ~0 Y# q -
) z+ F5 m' G8 k5 B% U, ?& u! ]( N4 u - .ORG $FB805 k5 {7 M0 S( g0 c- ^7 s9 \) s, ~
-
$ H0 f& ^! u7 E' x9 _9 @6 G - WEAPON:. q( C5 W9 d' s6 X; K/ V
- STA $0203,X ;送入横坐标地址
( g8 C+ E% S/ x1 v1 j - PHP: j/ G% v" O: K: ?
- PHA
7 t* Q$ V! Y" [3 X2 e0 |0 J. @8 ` - TYA
P1 }6 d: r9 Z) Z - PHA" X8 | \/ t% {3 B0 a
- CPY #$00; J+ E; q- |, N1 C
- BNE LB7 p( X# z9 |- m$ p
- JSR S_WRITE ;第一个精灵" D7 k7 k$ R4 m
- LB:5 c" K$ e1 v1 R. d* x- e# r5 E
- CPY #$01/ c! M. n* M% q$ F% I
- BNE RE
# J1 G$ x+ _' Y$ ^, u4 D" d7 N/ v - JSR D_WRITE ;第二个精灵
8 c+ r5 r' V. o, I2 O# v7 x - RE:& t8 L& j. ]( G% N4 H* x% z/ X) U
- PLA
% V" s! S0 q: m7 X - TAY4 v0 l9 d2 }6 w: \2 h3 W
- PLA
6 Z! G" S) F8 F5 s: R# c# r - PLP5 N" h+ y. d+ V1 Y, t, N8 s: D
- RTS& Y5 M2 h/ ]- H; w) y8 Q# I+ w5 V( B
-
3 V: P5 A1 u; R4 j Y - S_WRITE:
1 A5 j8 t7 O! E/ Y( M- O - PHA
1 h* e! K; w' O: }, q) p% ` - TYA, _6 N, b4 U# @5 Z
- PHA
* f- S+ y8 D. o! ~4 N: {8 Z - S_CMP:8 P$ Y$ K& M, x3 ^
- LDA $00
8 U8 @4 ~/ `! @: P4 I+ S - TAY7 r/ Y$ d5 ?; {& c1 \! T
- LDA $AA,Y ;读取武器值
; u* O' N- n) L/ X - AND #$10
9 B9 o4 P# z, `6 G6 a/ E' h9 `2 P - BNE S_WEAPON, Z$ a3 u. A( _) i* ~1 ?6 P7 E
- M_WEAPON: ;普通状态/ p- \7 {& n4 I! J8 F( v/ O
- LDA #$26
' K* D5 u3 [7 t% y; m; h$ u0 @ - STA $0201,X; o+ @6 x" L2 S0 P3 A S! d% r
- BNE RETURN
! k9 ~6 j5 h# g9 s6 e - S_WEAPON: ;加速状态
: X; P" G1 H: O% d8 L - LDA #$1C
/ z7 ?" N* Q% e1 v+ ~4 k: j7 l - STA $0201,X% S& d s$ }0 a6 t, D, h# M
- 8 V& n8 p/ w/ V; `5 l' O8 D
- 8 D( C% @5 R4 `$ K. P+ a4 j
- RETURN:- Y h+ I/ Y& K" ]( u
- PLA
7 _* k% K4 |& S4 }* g - TAY: |# c- v# a, ]' c% |3 r0 w
- PLA
' U$ K1 a/ u1 T* o - RTS
( M% U9 q1 X$ n) t( u3 R -
* ^% X% n( B6 P9 H! [8 r! X; |: _ - " L" |, p" C7 [, e% c
- D_WRITE:/ D3 O$ ^) L- ^( r6 y0 z5 P, Q7 {
- PHA
. T9 M+ P# ]5 z4 j- l - TYA0 v. I! e7 S( {8 S4 r4 V* |3 w
- PHA# t* K3 @' q9 L" h- t+ Q
- WEAA:# H+ C" b( D$ U6 p: C/ {& L- @% I
- LDY $00
; U1 {& V% F5 H: U( V: w3 P! a. \ - LDA $AA,Y
6 U5 X2 ?# W% L0 p9 a) @! B - AND #$0F' ]# [ r. Z( B% ~7 ?0 y
- TAY
]5 K5 l( a! X( l" [ - LDA DATA,Y- ^: ], p* i* D( c7 t& S
- STA $0201,X
. D ?5 H. j$ T -
! H% Q0 A2 Y* a3 M4 b - PLA" z. O( {$ S4 g( a5 V0 V
- TAY
% V: n/ |' P2 X3 w# p& |5 @ - PLA
$ W2 Y% `+ y' g# z% Q6 A - RTS( A7 n3 u6 S& h$ `& V+ i$ X
- ; _# p4 y4 [ Z4 H& Z
- DATA: ;武器种类图块) l% e' v" f7 V8 n2 H
- .BYTE $24,$26,$20,$1C,$22
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|