mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-09-13 12:56:30 +00:00
fireworks: closer to a spark
This commit is contained in:
parent
b1d8098bee
commit
6f78ca810b
129
fireworks/fw.s
129
fireworks/fw.s
@ -25,23 +25,6 @@ X_OLD = $FD
|
|||||||
X_OLDER = $FE
|
X_OLDER = $FE
|
||||||
TEMPY = $FF
|
TEMPY = $FF
|
||||||
|
|
||||||
;signed char o,i;
|
|
||||||
|
|
||||||
;void routine_370(void) {
|
|
||||||
|
|
||||||
; hplot(xpos+o,ypos_h+o); // NE
|
|
||||||
; hplot(xpos-o,ypos_h-o); // SW
|
|
||||||
|
|
||||||
; hplot(xpos+o,ypos_h-o); // SE
|
|
||||||
; hplot(xpos-o,ypos_h+o); // NW
|
|
||||||
|
|
||||||
; hplot(xpos,ypos_h+(o*1.5)); // N
|
|
||||||
; hplot(xpos+(o*1.5),ypos_h); // E
|
|
||||||
|
|
||||||
; hplot(xpos,ypos_h-(o*1.5)); // S
|
|
||||||
; hplot(xpos-(o*1.5),ypos_h); // W
|
|
||||||
|
|
||||||
;}
|
|
||||||
|
|
||||||
|
|
||||||
draw_fireworks:
|
draw_fireworks:
|
||||||
@ -296,35 +279,85 @@ done_with_loop:
|
|||||||
;==================================
|
;==================================
|
||||||
draw_explosion:
|
draw_explosion:
|
||||||
|
|
||||||
|
jsr random16
|
||||||
|
lda SEEDL
|
||||||
|
and #$f
|
||||||
|
sec
|
||||||
|
sbc #8
|
||||||
|
adc X_OLD
|
||||||
|
sta XPOS_L ; xpos=x_old+(random()%16)-8; x +/- 8
|
||||||
|
; FIXME: XPOS can overlow
|
||||||
|
|
||||||
|
jsr random16
|
||||||
|
lda SEEDL
|
||||||
|
and #$f
|
||||||
|
sec
|
||||||
|
sbc #8
|
||||||
|
adc Y_OLD
|
||||||
|
sta YPOS_H ; ypos_h=y_old+(random()%16)-8; // y +/- 8
|
||||||
|
|
||||||
|
; draw white (with fringes)
|
||||||
|
|
||||||
|
lda COLOR_GROUP
|
||||||
|
clc
|
||||||
|
adc #$3
|
||||||
|
tax
|
||||||
|
lda COLORTBL,X ; get color from table
|
||||||
|
sta HGR_COLOR
|
||||||
|
|
||||||
; xpos=x_old;
|
|
||||||
; xpos+=(random()%20)-10; // x +/- 10
|
|
||||||
;
|
|
||||||
; ypos_h=y_old;
|
|
||||||
; ypos_h+=(random()%20)-10; // y +/- 10
|
|
||||||
;
|
|
||||||
; hcolor_equals(color_group+3); // draw white (with fringes)
|
|
||||||
;
|
|
||||||
; hplot(xpos,ypos_h); // draw at center of explosion
|
; hplot(xpos,ypos_h); // draw at center of explosion
|
||||||
;
|
|
||||||
; /* Spread the explosion */
|
; HPLOT X,Y: X= (y,x), Y=a
|
||||||
; for(i=1;i<=9;i++) {
|
|
||||||
; /* Draw spreading dots in white */
|
ldx XPOS_L
|
||||||
|
lda YPOS_H
|
||||||
|
ldy #0
|
||||||
|
jsr HPLOT0 ; hplot(x_old,y_old);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
; Spread the explosion
|
||||||
|
|
||||||
|
ldy #1
|
||||||
|
sty TEMPY ; save Y
|
||||||
|
|
||||||
|
explosion_loop:
|
||||||
|
ldy TEMPY
|
||||||
|
|
||||||
|
;================================
|
||||||
|
; Draw spreading dots in white
|
||||||
|
|
||||||
|
cpy #9
|
||||||
|
bcc explosion_erase
|
||||||
|
|
||||||
; if (i<9) {
|
; if (i<9) {
|
||||||
; o=i;
|
; o=i;
|
||||||
; hcolor_equals(color_group+3);
|
; hcolor_equals(color_group+3);
|
||||||
; routine_370();
|
; routine_370();
|
||||||
; }
|
; }
|
||||||
; /* erase old */
|
explosion_erase:
|
||||||
; o=i-1;
|
;======================
|
||||||
; hcolor_equals(color_group);
|
; erase old
|
||||||
; routine_370();
|
|
||||||
;
|
; erase with proper color black (0 or 4)
|
||||||
; grsim_update();
|
|
||||||
; ch=grsim_input();
|
ldx COLOR_GROUP
|
||||||
; if (ch=='q') break;
|
lda COLORTBL,X ; get color from table
|
||||||
; usleep(50000);
|
sta HGR_COLOR
|
||||||
; }
|
|
||||||
|
; o=i-1;
|
||||||
|
|
||||||
|
jsr explosion
|
||||||
|
|
||||||
|
done_with_explosion:
|
||||||
|
|
||||||
|
lda #$c0
|
||||||
|
jsr WAIT
|
||||||
|
|
||||||
|
inc TEMPY
|
||||||
|
lda TEMPY
|
||||||
|
cmp #9
|
||||||
|
bne explosion_loop
|
||||||
|
|
||||||
;==================================
|
;==================================
|
||||||
; randomly draw more explosions
|
; randomly draw more explosions
|
||||||
@ -342,6 +375,24 @@ done_fireworks:
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
explosion:
|
||||||
|
|
||||||
|
; hplot(xpos+o,ypos_h+o); // NE
|
||||||
|
; hplot(xpos-o,ypos_h-o); // SW
|
||||||
|
|
||||||
|
; hplot(xpos+o,ypos_h-o); // SE
|
||||||
|
; hplot(xpos-o,ypos_h+o); // NW
|
||||||
|
|
||||||
|
; hplot(xpos,ypos_h+(o*1.5)); // N
|
||||||
|
; hplot(xpos+(o*1.5),ypos_h); // E
|
||||||
|
|
||||||
|
; hplot(xpos,ypos_h-(o*1.5)); // S
|
||||||
|
; hplot(xpos-(o*1.5),ypos_h); // W
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;=============================
|
;=============================
|
||||||
; Draw the stars
|
; Draw the stars
|
||||||
;=============================
|
;=============================
|
||||||
|
Loading…
Reference in New Issue
Block a user