aboutsummaryrefslogtreecommitdiff
path: root/explosion.s.pm
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2016-02-01 02:28:49 -0500
committerB. Watson <yalhcru@gmail.com>2016-02-01 02:28:49 -0500
commitbb03d1a3a4eb97ff4e0b7ca4b642a47828cfd778 (patch)
treec0710cc908a437e08482566177815247af57ae14 /explosion.s.pm
parent08355d1aaa899aa973b7ae762abb48fbe07a5b7c (diff)
downloadtaipan-bb03d1a3a4eb97ff4e0b7ca4b642a47828cfd778.tar.gz
playing with PMG for explosions
Diffstat (limited to 'explosion.s.pm')
-rw-r--r--explosion.s.pm96
1 files changed, 96 insertions, 0 deletions
diff --git a/explosion.s.pm b/explosion.s.pm
new file mode 100644
index 0000000..81bc213
--- /dev/null
+++ b/explosion.s.pm
@@ -0,0 +1,96 @@
+; explosion seen when we're hit by enemy fire.
+; this draws something that looks a bit like TV static, only
+; it's a lot more regular and less random. it somewhat approximates
+; the apple version's explosion, but not all that closely.
+
+ .export _explosion
+ .include "atari.inc"
+ .importzp tmp1, tmp2
+ .import _jsleep
+
+static_loop_count = tmp1
+
+; extern void explosion(void);
+; {
+_explosion:
+
+ ldy #3 ; explosion_loop counter, counts 3 2 1
+
+; {
+@explosion_loop:
+ lda #$05 ; static_loop runs 3 times
+ sta static_loop_count
+
+; {
+@static_loop:
+ ldx #0 ; jsleep(2)
+ lda #$01
+ jsr _jsleep
+
+ ldx #2
+
+; {
+; {
+; let the top part of the screen display normally.
+; garbage begins to display on gr.0 line 8 (the one above the tops
+; of the top row of lorchas).
+@wait4scanline:
+ lda VCOUNT
+ cmp #(4+8)*4
+ bne @wait4scanline
+; }
+
+; {
+; store random stuff into the players/missiles
+@randpm:
+ sta WSYNC
+ lda RANDOM
+ sta GRAFP0
+ lda RANDOM
+ sta GRAFP1
+ lda RANDOM
+ sta GRAFP2
+ lda RANDOM
+ sta GRAFP3
+ lda RANDOM
+ sta GRAFM
+
+ lda VCOUNT
+ cmp #(4+23)*4
+ bne @randpm ; stop garbage 2 lines after the bottom row of lorchas
+; }
+
+ ; clear P/M for rest of frame
+ lda #0
+ sta GRAFP0
+ sta GRAFP1
+ sta GRAFP2
+ sta GRAFP3
+ sta GRAFM
+
+ lda RTCLOK+2
+; {
+; wait for start of next TV frame.
+@wait4frame:
+cmp RTCLOK+2
+ beq @wait4frame
+; }
+
+ dex
+ bne @wait4scanline
+; }
+
+ dec static_loop_count
+ bne @static_loop
+; }
+
+ ldx #0 ; jsleep(10)
+ lda #$0a
+ jsr _jsleep
+
+ dey
+ bne @explosion_loop ; we're done if Y==0
+; }
+
+ rts
+; }