|
本帖最后由 yandagui 于 2017-3-18 16:17 编辑 $ @* k# r- W8 v3 I
" i0 A4 I7 k, r; {' _4 @% G0 Q j3 B
2017.3.13' R! Z/ p: H6 p1 J# p
+ Z8 [) B* l# S! u* C, Y
% [% @- q& L- B) F7 `* M
. O7 V4 [6 D" ~) N X M" q- .ORG $936E ;CONTRA(J)
0 V6 o8 }% x+ ^! E, q - LDA $256 M& E$ s" P+ }6 T0 w
- BEQ ADDR_93C96 @9 q: M- Z, i `+ G! u
- ADDR_936E: LDA $0022 ;读取地址$22数据到累加器A($22==0,单人模式,$22==01双人模式)
/ A: ^0 Y8 m; I2 _* y - ADDR_9370: LDY $001C ;读取地址$1C数据到寄存器Y3 v6 z* R- n) p: _% M- B, \
- ADDR_9372: BEQ ADDR_9376 ;Z==1?如果结果为零则跳过$2字节& l8 G4 Q6 f7 ^
- ADDR_9374: LDA #$01 ;读取地址$01数据到累加器A
1 G. l& W' a: N - ADDR_9376: STA $0000 ;将累加器数值送到地址$00/ w$ R! W* n/ n! r; o) Y: }) c9 A4 r! U
- ADDR_9378: LDX $0004 ;读取地址$04数据到寄存器X
: u' p M: d0 G$ N& B8 H$ I! } - ADDR_937A: LDY #$08 ;读取立即数$04到寄存器Y; x; V& q; |3 a, T0 G
- ADDR_937C: LDA $001C ;读取地址$1C数据到累加器A
& | k& `7 Z4 ^9 g& r; Y# k( a q - ADDR_937E: BNE ADDR_9395 ;Z==0?如果结果不为零则跳过$15字节- F% \1 H- k" S+ O7 B
- ADDR_9380: LDY $0000 ;读取地址$00数据到寄存器Y9 f' z$ s0 p+ f- l) T4 l
- ADDR_9382: LDA $0038,Y ;读取地址$38,Y数据到累加器A($38==01,P1结束,$39==01,P2结束)
$ l3 N3 E$ d# O' l - ADDR_9385: LDY #$08 ;读取立即数$04到寄存器Y4 P* l. ^9 e/ s' Q8 }+ j& h
- ADDR_9387: LSR ;逻辑右移
7 `$ r" a( t. p( H) ~ - ADDR_9388: BCS ADDR_9395 ;C==1,有借位则跳过$B字节0 o- r9 P& h: R, x/ c
- ADDR_938A: LDY $0000 ;设置Y==#00
5 |9 O! p. a. \% A - ADDR_938C: LDA $0032,Y ;读取地址$32,Y数据到累加器A
5 \* N3 y0 ^" S" X - CLC
6 ?6 L0 g6 I1 o0 ]9 L( c. F7 s - ADC #$02
8 `' l, H h! R0 _ - ADDR_938F: LDY #$00 ;设置寄存器Y为$00
. A* N! z2 g% @$ B% F$ X- [$ P - ADDR_9391: CMP #$08 ;比较Y==$04?
- t; j, Q) S& ~# Y - ADDR_9393: BCC ADDR_9397 ;C==0,有借位则跳过$2字节( V' G8 Q! }# @9 l$ T6 ]
- ADDR_9395: LDA #$08 ;读取地址$04数据到累加器A
+ k6 G& P- I" l7 C1 d; o' f4 _ - ADDR_9397: STA $0001 ;送入地址$01
9 n! u3 ?: u, x7 ?2 K3 L; O - ADDR_9399: DEC $0001 ;地址$01递减7 d) N; P- y) b' o& C& I0 _
- ADDR_939B: BMI ADDR_93C3 ;N==1,结果为负则跳过$26字节
1 t% ?+ ~; f- I6 \1 p% ^5 J - ADDR_939D: LDA #$08 ;设置纵坐标数值8 \4 f9 W" _& P6 q( r
- ADDR_939F: STA $0200,X ;送入纵坐标地址
: p; W# N2 N# y& J - ADDR_93A2: LDA ADDR_93CA,Y ;读取图快号数据
7 ^- X7 ^/ ?3 I( `6 L' B - ADDR_93A5: STA $0201,X ;送入图快号地址: m4 F# r# ?: M* V
- ADDR_93A8: LDA $0000 ;读取属性值数据7 }, K: v2 q; A5 @
- ADDR_93AA: STA $0202,X ;送入属性值地址
& s C0 W3 r' O3 B( W/ j, U+ _ - ADDR_93AD: LSR ;逻辑右移
2 Z3 U6 g! Y9 y5 z0 q - ADDR_93AE: LDA ADDR_93D2,Y ;读取横坐标数值
6 A5 |. ^ k& @' J! [ G - ADDR_93B1: BCC ADDR_93B5 ;C==0,有借位则跳过$2字节
4 F! U i6 j1 U1 s - PHA
- Q+ H4 f) K" i" J - TYA5 {3 V! N% B( ~$ B# d- y& V
- PHA
% C6 L& Z. c9 a* j% t# o - LDA #$D4' h9 ?* @! T x" P+ [8 z! d
- STA $0200,X
Z8 h5 g; a! [( h( A - PLA
& H% x1 d2 D$ j) s- ^ - TAY
]# }! a* h t' @ - PLA- E0 X# B( Z) e/ y' \, S
- ADDR_93B5: JSR WEAPON! Q. H- }/ z* O' a# _
- ADDR_93B8: DEC $0007 ;地址$C7递减
0 h( \$ R; R4 E C% Z- T9 b- D - ADDR_93BA: TXA ;X-->A
- B, b0 Z; ^" p( k4 f, q/ n9 q$ \' ` - ADDR_93BB: CLC ;清除进位标志. F* W1 i- T/ Y- ], g& C9 ~
- ADDR_93BC: ADC $0010 ;加上地址$10的值
* p1 r* m$ @% \# J( ]4 q% ~" s' r - ADDR_93BE: TAX ;A-->X0 v7 O k$ `) t3 _8 f% e
- ADDR_93BF: INY ;设置Y++
3 P* f( o0 y1 x( t/ c, I" \: e - ADDR_93C0: JMP ADDR_9399 ;跳转到ADDR_9399
/ w6 g2 n" L" r4 B, ?5 M& \/ j - ADDR_93C3: DEC $0000 ;地址$00递减
6 L2 R+ O7 G, |7 j! T/ Z& _ - ADDR_93C5: BPL ADDR_937A ;N==0,结果为正数则跳回$100-$B3=4D字节# L" k/ {& i$ }: ?
- ADDR_93C7: STX $0004 ;送入地址$04% F5 t& k3 O1 i' ~
- ADDR_93C9: RTS ;程序转回-----------------------------; M9 V0 p. O9 T' z* P
- 5 T, w5 {/ L" b% a0 n1 D
- .ORG $FB606 [% c* R" L, h5 {* x. x4 m) b
- ADDR_93CA:
) e- k0 y: z) z0 H0 R- J' c - .BYTE $0A,$0A,$0A,$0A,$0A,$0A,$0A,$0A ;生命图块号7 X! P( _$ W( O. L, a
- .BYTE $02,$04,$06,$08,$FE,$FE,$FE,$FE ;GAME OVER图块号
5 l( P3 J- P3 q' Q* | - ADDR_93D2:
7 |4 X2 e& R% {# n0 w @ - .BYTE $14,$1C,$28,$34,$40,$4C,$58,$64 ;生命图块坐标
# V2 i0 u: `; g+ ` - .BYTE $10,$1C,$28,$34,$40,$4C,$58,$64 ;GAME OVER图块坐标
' i( k9 q2 S1 k# \2 g; c% k0 }9 v2 ] - * b+ m0 d( y9 D, M. {: X4 }! Y
- 6 h4 h8 `, \; W. V
- .ORG $FB80
_4 L1 Y/ \# m- v5 X1 b- m - ; \7 A( C3 N% \, N$ ^& S
- WEAPON:: z( |5 I4 s0 [$ i5 `+ Z
- STA $0203,X ;送入横坐标地址
S% ?% M: _( u - PHP3 o+ u _! w# y0 f. W
- PHA
, [5 F0 D/ K) g0 B/ L" K - TYA, t; y6 l9 w( r9 N7 Y3 g% b
- PHA# U( D1 T$ H" ?, Z' w
- CPY #$00
, R9 }: w8 a& [1 S/ t$ R6 [ - BNE LB% t- c \( z$ l: `9 a" w
- JSR S_WRITE ;第一个精灵
' `4 m9 ?9 g3 F2 x) [+ Q4 n - LB:
# H' @. }' [% e0 W- X$ H8 [7 b - CPY #$01
+ B6 g3 p" l) B% f- H& m - BNE RE
( Z) ?5 K" Y6 \/ }5 C - JSR D_WRITE ;第二个精灵 y" E! J1 { `$ ]; p- l
- RE:
- _. E+ z4 z3 L2 m0 w. t4 b - PLA
1 ?/ ?' J- {( H! _3 k, V2 ^9 U1 d - TAY
5 H! B: ^& x8 {3 I* l4 v: J; v+ g - PLA) M! [' r+ F4 F" v7 z- u. y
- PLP9 G) {: H* {0 K4 R- ~+ X1 d
- RTS
1 A& a; b9 s! r: @8 v - 4 o0 o/ A1 e8 I) \: I7 t
- S_WRITE:$ e- }7 m7 \8 z
- PHA
9 R$ F$ g* T, h2 \# w' T2 m ~ - TYA
/ j: X* G% a+ M( U1 m' F, K - PHA
, [# r% a5 T" f: z: B! B - S_CMP:2 Q; u% A" J4 @6 x3 Y, c# I' K1 Q: M0 V
- LDA $00
3 m3 n# h$ q) W; L7 H - TAY
: U' T+ p5 h5 e) } - LDA $AA,Y ;读取武器值) f; l4 @3 }" U j5 f
- AND #$104 x1 p( _, i- f0 X$ o
- BNE S_WEAPON8 g; s5 f: x k! l
- M_WEAPON: ;普通状态
! |- {! l8 J' M! L, B L - LDA #$262 Q3 g( X" H* {( T) _+ t$ X
- STA $0201,X+ J$ q: R$ r/ b7 M( w2 K
- BNE RETURN# N& y2 x( \3 C* D$ E
- S_WEAPON: ;加速状态' g+ B, @, D Y" K
- LDA #$1C& T2 V( x6 S) u& c" X
- STA $0201,X
9 A$ C1 E2 X- K1 T4 D -
/ J7 T1 |0 L; O4 x2 m8 t -
* X- [& R9 N( ~8 r" g9 w/ K4 @ m+ k+ e - RETURN:+ d7 C, W: Q2 k$ Q" K$ y
- PLA2 h0 W: q8 r7 I/ O
- TAY( M4 ]" a' S) ]3 K p9 t3 u+ V
- PLA% I/ t' @6 ]- }' c0 s. J1 {
- RTS D6 q6 Z; o: e! k5 F
-
# L) z `5 O | - $ @) y; G0 f/ x# |6 H# S
- D_WRITE:! V1 x) a7 O$ j |
- PHA
4 u- v3 X' d0 _ h4 E1 Y3 R+ | - TYA# ?6 m+ q0 g6 J& ^+ C0 o2 D8 B3 y
- PHA* }3 G7 j- n6 @0 _
- WEAA:
$ f# K* o0 k' {: a% |; }8 Z" R - LDY $00! _6 ]( D+ E& r% N% G6 K
- LDA $AA,Y
5 z) l. X/ J; S - AND #$0F9 {- m# B5 e9 x ^4 a
- TAY' h: P) H3 ~ k; D, J, [0 K( [
- LDA DATA,Y
, a* G; ~0 r' L- f- b' B: V - STA $0201,X; k: J; x% J' H$ L$ v0 b
- + y8 X6 N& R5 \# h$ m
- PLA
4 `5 Q( R! b) h2 b - TAY
( L! ~" w! X: P1 ?8 C6 t+ [3 D - PLA$ S) \& z- |8 E& J" c
- RTS' X- z) {7 P4 h5 Y
- & B4 z3 J! `) ~0 q% j! O
- DATA: ;武器种类图块
5 g* |/ p2 t4 q6 w/ p/ Z - .BYTE $24,$26,$20,$1C,$22
复制代码 |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?立即注册
x
|