|
本帖最后由 yandagui 于 2017-3-18 16:17 编辑
5 v1 ]2 c3 L# v7 a0 _' K7 N0 ]
1 w+ L: c# Z( j/ w' d# F2017.3.13* E; a9 B. z5 j0 y8 F- F, \4 K
0 P( h, }8 o1 O4 o9 q% |6 a* z8 K: @1 ~& @. g2 r0 K% y
4 a& G0 E' u- I# d) F1 O5 \1 D3 i
- .ORG $936E ;CONTRA(J)+ j) A* B( C! b' e% h) h" H
- LDA $25 Z; P' |7 _8 _: @' T0 S
- BEQ ADDR_93C9
( B4 B! U8 @5 A/ J- S& k - ADDR_936E: LDA $0022 ;读取地址$22数据到累加器A($22==0,单人模式,$22==01双人模式)
6 h1 c/ ^2 j v* b2 f# V( ~- B" q - ADDR_9370: LDY $001C ;读取地址$1C数据到寄存器Y
I' Z9 A, j# c# P0 ~3 t - ADDR_9372: BEQ ADDR_9376 ;Z==1?如果结果为零则跳过$2字节0 X, [( K9 V7 k/ }0 R4 u- q
- ADDR_9374: LDA #$01 ;读取地址$01数据到累加器A
2 x+ |( ?* z. R6 _ - ADDR_9376: STA $0000 ;将累加器数值送到地址$00
E# Q: Y9 f% ^' C4 j/ p# F5 X% A - ADDR_9378: LDX $0004 ;读取地址$04数据到寄存器X
$ Y& J& A. X3 `# f0 w* v4 k4 ~ - ADDR_937A: LDY #$08 ;读取立即数$04到寄存器Y7 V5 R, {! j- {& }( f- F
- ADDR_937C: LDA $001C ;读取地址$1C数据到累加器A
( R7 l( Z) n! W- ~ u2 D - ADDR_937E: BNE ADDR_9395 ;Z==0?如果结果不为零则跳过$15字节* K& d& |4 c" J) u6 Y5 ]1 `
- ADDR_9380: LDY $0000 ;读取地址$00数据到寄存器Y2 m4 }0 v- P) b- S8 m
- ADDR_9382: LDA $0038,Y ;读取地址$38,Y数据到累加器A($38==01,P1结束,$39==01,P2结束)1 d; A( I+ r$ i& y: H: ?% W' C+ l
- ADDR_9385: LDY #$08 ;读取立即数$04到寄存器Y
2 ~; u- M9 ]: J- K7 R8 m - ADDR_9387: LSR ;逻辑右移# N2 U7 i3 }7 a( E( b
- ADDR_9388: BCS ADDR_9395 ;C==1,有借位则跳过$B字节( t ^+ P3 r6 x
- ADDR_938A: LDY $0000 ;设置Y==#00- H+ G8 J8 F5 u( a+ s' ?, n" l
- ADDR_938C: LDA $0032,Y ;读取地址$32,Y数据到累加器A
1 S# g1 W2 |* x M; g* \ - CLC
* N6 o& e/ Z/ w" w - ADC #$02
1 D$ v7 ?) Y. m E9 | - ADDR_938F: LDY #$00 ;设置寄存器Y为$00
) i, ~4 e. c( `! m0 Z5 n - ADDR_9391: CMP #$08 ;比较Y==$04?
4 x& C0 c6 t! ^+ i - ADDR_9393: BCC ADDR_9397 ;C==0,有借位则跳过$2字节: W" C' R: E" M$ V
- ADDR_9395: LDA #$08 ;读取地址$04数据到累加器A
Q6 A# u& H, A/ O - ADDR_9397: STA $0001 ;送入地址$018 _8 s& z1 R" e! i q" V9 X
- ADDR_9399: DEC $0001 ;地址$01递减" f5 I9 T4 |/ e& e3 }
- ADDR_939B: BMI ADDR_93C3 ;N==1,结果为负则跳过$26字节8 M' a1 {& M: M/ y7 \" C
- ADDR_939D: LDA #$08 ;设置纵坐标数值% Z ^ z8 L3 q' w& p. g3 L
- ADDR_939F: STA $0200,X ;送入纵坐标地址: ]# @4 K2 E, r* o W* d) m
- ADDR_93A2: LDA ADDR_93CA,Y ;读取图快号数据 B4 B5 a% L u9 N
- ADDR_93A5: STA $0201,X ;送入图快号地址7 U0 l* n- D& ^8 L. Q7 G* \
- ADDR_93A8: LDA $0000 ;读取属性值数据
! l% o0 u( e/ B: N, S' j - ADDR_93AA: STA $0202,X ;送入属性值地址
6 a8 E8 z/ O' `5 e, M+ X - ADDR_93AD: LSR ;逻辑右移2 m5 } W1 @1 d! W. ~+ X" F
- ADDR_93AE: LDA ADDR_93D2,Y ;读取横坐标数值
* C# ?/ n2 r# t6 ^0 s - ADDR_93B1: BCC ADDR_93B5 ;C==0,有借位则跳过$2字节
6 c! m8 R' U( @ - PHA
* X& C" i& u7 N% U - TYA
% B& g6 f2 J/ H' ]; p0 z) X8 ^ - PHA. T% P& j+ d% ^! b) q+ V
- LDA #$D42 _# ?5 Z* Y' Q2 l; A
- STA $0200,X
0 @; }$ H4 B8 H, M0 _" Y4 c - PLA% Y6 n7 l3 _- E3 ]
- TAY
- N1 P {3 D+ ` p$ f N - PLA/ k" H! I$ T! n9 h& d5 I# ^. g1 W
- ADDR_93B5: JSR WEAPON6 V. b) |, p3 m7 I0 D. A
- ADDR_93B8: DEC $0007 ;地址$C7递减
& ~! |. p9 j) \ - ADDR_93BA: TXA ;X-->A, ]5 `+ R% c5 k7 f# E
- ADDR_93BB: CLC ;清除进位标志7 {) r/ Z7 C$ Q4 G2 f" O0 _
- ADDR_93BC: ADC $0010 ;加上地址$10的值+ [* Z* c3 p$ F
- ADDR_93BE: TAX ;A-->X
& `; @, U' G" d) r* i+ }# D0 I, Q% L - ADDR_93BF: INY ;设置Y++
8 K/ p7 n. b3 c1 ]4 `8 N2 G6 U - ADDR_93C0: JMP ADDR_9399 ;跳转到ADDR_93997 A5 i0 c1 n# F3 K" l
- ADDR_93C3: DEC $0000 ;地址$00递减* T- ^5 t) c2 ?2 o; k
- ADDR_93C5: BPL ADDR_937A ;N==0,结果为正数则跳回$100-$B3=4D字节4 G( C8 y1 G7 ]2 K, g
- ADDR_93C7: STX $0004 ;送入地址$04 g0 W$ {; O0 J1 F! t
- ADDR_93C9: RTS ;程序转回-----------------------------
: F9 y2 v% u- G) g) | - 9 T0 L' ^- J# Z
- .ORG $FB60
4 O) }( D; A8 P# b - ADDR_93CA: _% Y! X# A7 o* x$ @- z: ?. D& P5 n
- .BYTE $0A,$0A,$0A,$0A,$0A,$0A,$0A,$0A ;生命图块号
2 d* V7 m) o" _5 d0 S - .BYTE $02,$04,$06,$08,$FE,$FE,$FE,$FE ;GAME OVER图块号2 s1 ^! z U- h, _
- ADDR_93D2:
, ^- R7 b( }& F; A# Q; j$ ~ - .BYTE $14,$1C,$28,$34,$40,$4C,$58,$64 ;生命图块坐标 p' P2 j/ z$ j1 h" ?3 Z
- .BYTE $10,$1C,$28,$34,$40,$4C,$58,$64 ;GAME OVER图块坐标1 x# d% r8 x% t& K
-
# C6 Q! _: q1 t6 |5 J -
& z1 j B: v* K6 u; ~4 B" d - .ORG $FB80& `- `. k* k+ l1 ?6 C# U
-
8 d" @1 P- C0 I- y& f9 M - WEAPON:( N. l4 K, k; v; X
- STA $0203,X ;送入横坐标地址
* g( l$ c) y4 v( `3 i9 c - PHP
) i* ~% y: t6 p( w1 y/ c. N' G6 R - PHA- I: g- g/ w- I0 t, l
- TYA
8 p, o5 d) `) T& o. q2 C( v% e f# P - PHA' L- v( a3 Y5 a) h. ]* [
- CPY #$00
; e) Z8 P% T5 f2 @& D/ _ - BNE LB/ j+ o8 \) M i8 o/ I) N3 @) J
- JSR S_WRITE ;第一个精灵 \" }6 {- R3 i: J
- LB:
1 }: s8 Y7 }6 k, M) K" | - CPY #$01. o8 j- }5 N) D
- BNE RE' }4 J) s, r8 D4 @
- JSR D_WRITE ;第二个精灵
) E2 C. B5 @- W5 R" d - RE:
1 D" O) q1 s& X& f4 P - PLA
9 p2 e: K; K& O7 N, B - TAY
+ _1 s: V' v( j' m; k( q - PLA
4 Z: Y6 W. v8 e1 o/ O - PLP; ^- i, d7 U7 v/ d
- RTS% F* w9 @2 X `8 ]1 @9 l
-
+ G; W4 F5 y* o) i - S_WRITE:) {, E- S6 r* Z, ?# e
- PHA
K' T; e) D( d, a% e/ J, Y - TYA, F! Q3 y% L0 G+ B
- PHA
) p6 d9 V( C. ] - S_CMP:
7 {- ^. u. o z# Z) ?& w - LDA $00+ z- G6 W" l1 {( b/ D( d9 J
- TAY
9 i& Y5 [4 i8 S- C" n ~$ I - LDA $AA,Y ;读取武器值# @8 J. U. z" D& i
- AND #$101 b5 s" `8 |. d& S1 M( @
- BNE S_WEAPON% j# q! M6 F9 q5 j- ~5 r. c3 _3 D
- M_WEAPON: ;普通状态4 O2 ~, A8 Q% k* q9 g) g
- LDA #$264 K; g, {( d; Q( h: a* F) O4 D/ q
- STA $0201,X: c9 o3 Y9 }0 T$ c1 u
- BNE RETURN
& b" W* [$ W4 E# {8 x - S_WEAPON: ;加速状态6 \& P6 y! S. a
- LDA #$1C
- ^& Y7 F4 I1 @, K o; L O - STA $0201,X
' H! D( Z1 Y' m3 f, R( v$ b -
5 ?# b* U4 U! c& a+ V -
9 }1 m+ `2 E& B8 c/ V# }( D - RETURN:
7 O1 h6 l+ q* y7 y+ u# j, K - PLA
; C! O/ C, s9 ]# i( s' a$ I& x - TAY
' ] [, T; u, B% h0 ]) L - PLA* q* c2 P' o, W& _2 t: G
- RTS' r1 x- D, C/ @7 m& g3 y1 ^
-
" B2 J b! S* b! F7 d
' [, I0 m$ r& t. s# H; P- D_WRITE:
" O' I& E+ N9 q6 F - PHA
- h2 S% m4 T' k& ?% V# D0 v - TYA6 |6 ]' C& Y& A3 J
- PHA4 M5 _" a z2 [: X7 r
- WEAA:7 j( C6 \- w. B0 M; y1 r6 Q/ U: }; T
- LDY $00
: G; a7 `7 M0 w6 W - LDA $AA,Y2 e3 a6 C1 J& q
- AND #$0F, r% o2 V8 B: q9 R) W& X* \3 E
- TAY4 `( Q+ o, Y) p- H; U) k
- LDA DATA,Y. `- n' Z& v* o8 r# {
- STA $0201,X
9 V; v7 N- |7 U+ F. F5 Q8 f: ^9 a -
6 i3 n; o) Y0 b) b/ y, `3 e$ j - PLA3 v7 l+ X- o6 t7 C3 O' P3 l
- TAY
2 v+ c6 Y8 C3 j2 | - PLA
8 P5 ]3 L, m) p) g6 S' A; B9 k1 p+ h - RTS
7 k6 B' q7 j0 m% _8 m0 ] - & l" f0 H) K0 v/ Z
- DATA: ;武器种类图块9 p. f+ W X1 A; G! l
- .BYTE $24,$26,$20,$1C,$22
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|