|
本帖最后由 yandagui 于 2017-3-18 16:17 编辑 % }/ x3 P0 ]- p
$ J2 l) E7 _- e$ G- x& T) ~/ W' r2017.3.132 o% c) N3 M4 D6 j7 U
+ ?( i" V- G, p8 S: N. n) c+ n. x5 s: P
4 L% L+ @# p, C# E0 h- .ORG $936E ;CONTRA(J)$ D |2 u& u c
- LDA $25* w$ d9 e- B3 @
- BEQ ADDR_93C9
( K/ {/ Z/ T4 T3 F - ADDR_936E: LDA $0022 ;读取地址$22数据到累加器A($22==0,单人模式,$22==01双人模式)* {* v' e& L' t% Z6 v" Z7 q
- ADDR_9370: LDY $001C ;读取地址$1C数据到寄存器Y6 u2 _9 \; i5 K! H1 `; N
- ADDR_9372: BEQ ADDR_9376 ;Z==1?如果结果为零则跳过$2字节
/ ~1 E! J9 x' j8 R8 G& [4 ]4 N- I# N - ADDR_9374: LDA #$01 ;读取地址$01数据到累加器A
' o8 t0 z5 G( @1 X - ADDR_9376: STA $0000 ;将累加器数值送到地址$00
# _0 J3 o+ q+ R; L- v7 m h - ADDR_9378: LDX $0004 ;读取地址$04数据到寄存器X
% [9 a4 \0 G5 j F - ADDR_937A: LDY #$08 ;读取立即数$04到寄存器Y3 P* k! d2 G+ P7 j# `+ E# p$ G
- ADDR_937C: LDA $001C ;读取地址$1C数据到累加器A
/ ?" {' [& g5 O+ y ^, D. }7 D - ADDR_937E: BNE ADDR_9395 ;Z==0?如果结果不为零则跳过$15字节! I# j8 j: |# J0 T" Z* G2 j
- ADDR_9380: LDY $0000 ;读取地址$00数据到寄存器Y1 U+ d# g. Y" ?8 \
- ADDR_9382: LDA $0038,Y ;读取地址$38,Y数据到累加器A($38==01,P1结束,$39==01,P2结束)1 Q- h- r: r( ?- P
- ADDR_9385: LDY #$08 ;读取立即数$04到寄存器Y- K1 k9 ^* v+ D0 _
- ADDR_9387: LSR ;逻辑右移
# H8 P- |4 z( E- C4 v% ?& z/ i& P* D9 ] - ADDR_9388: BCS ADDR_9395 ;C==1,有借位则跳过$B字节
1 _' h. v) Q# G' [! ?* r- Y - ADDR_938A: LDY $0000 ;设置Y==#00
1 ? i O( L/ Y - ADDR_938C: LDA $0032,Y ;读取地址$32,Y数据到累加器A
" o0 F0 Q/ L; C( L3 r2 [ - CLC
5 h6 g+ w; ~$ s/ @3 P - ADC #$02
/ |$ X4 }7 _, T( \* A - ADDR_938F: LDY #$00 ;设置寄存器Y为$00
6 O( t6 `3 ^4 Z2 _( _8 F ~8 O - ADDR_9391: CMP #$08 ;比较Y==$04?
$ X" x0 A. X6 ^2 B0 K4 T( x e - ADDR_9393: BCC ADDR_9397 ;C==0,有借位则跳过$2字节
' X: |6 V" k; R! k. s0 E! m( Y - ADDR_9395: LDA #$08 ;读取地址$04数据到累加器A4 F: K8 k* `3 n" ]8 w; L2 `
- ADDR_9397: STA $0001 ;送入地址$01 B! O8 A6 x; d0 K, q
- ADDR_9399: DEC $0001 ;地址$01递减
' z: J0 z& |: o1 w9 D6 h' Z0 k - ADDR_939B: BMI ADDR_93C3 ;N==1,结果为负则跳过$26字节9 P/ w$ d* u. f2 F/ @ e0 E- Q/ }
- ADDR_939D: LDA #$08 ;设置纵坐标数值
( R8 M2 W l9 T! n# Q; O9 B8 B - ADDR_939F: STA $0200,X ;送入纵坐标地址" n, H. Y, F, |+ g2 E. f
- ADDR_93A2: LDA ADDR_93CA,Y ;读取图快号数据
! {0 d$ q8 c6 N% S! P' a - ADDR_93A5: STA $0201,X ;送入图快号地址5 B# m, D* k& H% I( x4 h6 [
- ADDR_93A8: LDA $0000 ;读取属性值数据& I/ N. V% l8 @3 B5 t8 h: t
- ADDR_93AA: STA $0202,X ;送入属性值地址8 L$ i9 g6 _# J/ Y% y( M* x
- ADDR_93AD: LSR ;逻辑右移# v' W: n% Q. T) `6 x7 n. Q
- ADDR_93AE: LDA ADDR_93D2,Y ;读取横坐标数值& N$ x+ ^# Z0 p3 j5 h
- ADDR_93B1: BCC ADDR_93B5 ;C==0,有借位则跳过$2字节
6 f3 f, a: p8 w2 `1 W5 h, K2 W - PHA6 _- Z/ z6 s' w+ A% J
- TYA) L! L5 f# _; X' z3 V) T
- PHA
5 X& r- x+ L% ]8 M& N" S - LDA #$D4) ~: X( s5 `' ~& y1 G
- STA $0200,X
) p, H7 A1 ?2 [0 u5 |7 m - PLA2 Y, N" j+ R* |6 E2 [
- TAY" f% p- Q; k9 U( W! p( \( z
- PLA- ~2 h+ `2 u7 U, R+ g
- ADDR_93B5: JSR WEAPON
! `, e' p. }, d' I, \9 H5 o2 ^ - ADDR_93B8: DEC $0007 ;地址$C7递减
* H9 m# p2 U& T! b; }! N0 t+ ~ - ADDR_93BA: TXA ;X-->A8 H k3 L' e" V3 c( D$ P. A* L7 P3 R
- ADDR_93BB: CLC ;清除进位标志
9 {9 i0 i5 `. b" |. n - ADDR_93BC: ADC $0010 ;加上地址$10的值2 K9 ~5 c4 I4 r2 w7 M; M0 S5 `$ b
- ADDR_93BE: TAX ;A-->X) D3 G1 X5 l- v `
- ADDR_93BF: INY ;设置Y++/ E' f% f) d' o* P2 g
- ADDR_93C0: JMP ADDR_9399 ;跳转到ADDR_9399
/ P$ o" E( D0 m - ADDR_93C3: DEC $0000 ;地址$00递减7 ~ S4 O8 R- H9 X3 V2 B
- ADDR_93C5: BPL ADDR_937A ;N==0,结果为正数则跳回$100-$B3=4D字节
/ y; a N: g& O - ADDR_93C7: STX $0004 ;送入地址$04
0 G5 L- ?" V# o0 I - ADDR_93C9: RTS ;程序转回-----------------------------
- P* |: \' W8 {3 C
' b8 y$ p( o$ s2 {7 z- s j4 ^3 b- .ORG $FB60
. u+ w) q. M1 ~) x - ADDR_93CA:
! y. ~5 l/ L: L, y* l - .BYTE $0A,$0A,$0A,$0A,$0A,$0A,$0A,$0A ;生命图块号
, E; h/ j0 z/ p# r* C9 X - .BYTE $02,$04,$06,$08,$FE,$FE,$FE,$FE ;GAME OVER图块号
# t& m' k r. j, u7 \$ L$ d4 o - ADDR_93D2:2 b: A1 n. ~( N" G! @8 _) G- S9 h1 x
- .BYTE $14,$1C,$28,$34,$40,$4C,$58,$64 ;生命图块坐标' e# P# u" `: y4 Z, h3 `' F C: a) @$ i
- .BYTE $10,$1C,$28,$34,$40,$4C,$58,$64 ;GAME OVER图块坐标! d4 m7 p. Y; Y9 s, ^+ }6 j. y. y
- ! `8 e- D2 d/ V
- 3 G+ K5 \+ s3 r9 K
- .ORG $FB805 a1 g% D" _* A8 T' P/ A5 j
- 2 [ G* k8 [: X; P
- WEAPON:
* p- f* X+ `- O+ Z) @ - STA $0203,X ;送入横坐标地址+ o# J# T& M7 c3 o/ z4 O, j
- PHP8 @( ]- f, C" f6 I( E% w- K* d
- PHA8 p" W8 b# A# L! ^- ]4 T
- TYA1 }1 E( @3 I2 _* J% l* \5 k
- PHA
c7 R# X6 W/ } P - CPY #$00
5 ~* i" h* k& ?6 x. G - BNE LB: c! x1 F/ j, c9 m* x
- JSR S_WRITE ;第一个精灵
, u; `. ?' P. K0 o' T5 r - LB:) y& s3 ^, J ?9 v; k
- CPY #$013 S3 ?/ a' k7 }7 _7 F. `$ `2 \
- BNE RE, K& p- ?- C- j) ~9 g1 P
- JSR D_WRITE ;第二个精灵
+ d: d$ K4 _3 s. ~ - RE:
" d# H/ h2 G& }2 G( @- M6 P) K# q( w - PLA
5 Q2 ? j6 Z" b - TAY
! O8 y8 j' h2 \" ]2 C5 m - PLA
) X1 Q2 H) H6 I( `8 G4 G% g3 T - PLP
! j1 u! V# c; T; k - RTS4 n) n" p! l( p" t( Q9 a% v
- 2 k& R. T' p o8 x9 Z
- S_WRITE:
* [" C4 l! U; i% C/ L! C2 ~ - PHA# ~5 R7 `5 Q- i% P& U+ r# t
- TYA
' Q! Q0 R6 l/ a6 k" a - PHA
- \2 c( a* `7 u& Y/ c7 e) _2 j - S_CMP:
3 I" c8 t' Y9 c - LDA $00
2 q% [8 ~1 Y( b* R6 p/ M9 j - TAY
9 d% }: h! P6 ~ - LDA $AA,Y ;读取武器值/ ]: ~0 M. v& z& X
- AND #$10* M3 x* s8 U4 w* O& l3 H" M/ ~
- BNE S_WEAPON7 _0 F. Z5 Y; s; J8 ?
- M_WEAPON: ;普通状态% |5 m+ k& T& p: w! r
- LDA #$26
/ ^. p h! v/ y - STA $0201,X
- y0 Y* w4 w! |9 q# G5 C - BNE RETURN2 A: f5 }4 j6 ^, b$ E" k, d5 _
- S_WEAPON: ;加速状态& F1 v8 }4 a0 z- K7 [) [
- LDA #$1C
7 B5 Z4 s. P: \3 C* p% M) l - STA $0201,X. ?# p/ |/ l/ T' s: P5 [0 F$ _
- 9 i# {. z7 T; Q# e: o
-
}5 S+ y/ }) V1 S5 ] - RETURN:. I0 k7 N D0 ]8 M0 g
- PLA$ }' h, S/ r4 ?9 ]0 ]/ ^4 v$ W
- TAY. Y" c" O2 Q9 m
- PLA/ x F0 ]3 ]& D' P
- RTS
- a3 w- P3 O; S& V; F - ) s# d! |; Y4 N( \$ K
: |$ F2 M9 L! x9 T- D_WRITE:/ q3 E0 T' \3 i, C. h
- PHA, a7 w) s8 i" g: j. ^
- TYA
( ^6 p! h7 \- S% N% k$ P; G; b( A9 n. Z - PHA7 {- Z& n- f1 D6 Y. S
- WEAA:
2 {7 W+ Z0 H6 u - LDY $00 @/ ^% S! U/ ?- M
- LDA $AA,Y
' p& [( V% T% K+ P - AND #$0F( L: w1 n! `, j& z" ]" e! X* ?# O
- TAY
4 ]( `2 C2 F% V7 C - LDA DATA,Y% G/ s3 s" p" H
- STA $0201,X; i; q3 f1 i# y, o. ?
- , u" y4 p( q0 |% n2 q7 v! Q( o
- PLA4 b% t/ R8 c: k# \6 @8 V
- TAY
7 ^4 @. X, P; q* W - PLA
$ o1 U4 j2 N# h7 ~3 W! i4 N - RTS/ _& p4 v1 ]7 v- ^. L/ q
- ) @2 U- R7 S: v/ N( l
- DATA: ;武器种类图块
- E. M0 w+ f. k5 F% k) ` - .BYTE $24,$26,$20,$1C,$22
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|