From bb03d1a3a4eb97ff4e0b7ca4b642a47828cfd778 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Mon, 1 Feb 2016 02:28:49 -0500 Subject: playing with PMG for explosions --- explosion.s.pm | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 explosion.s.pm (limited to 'explosion.s.pm') 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 +; } -- cgit v1.2.3