Skip to content

Commit 0626039

Browse files
committed
WIP Flame effect. Bump date in docs.
1 parent 57ebf31 commit 0626039

File tree

3 files changed

+79
-3
lines changed

3 files changed

+79
-3
lines changed

CHANGES.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,16 @@ Firefighting game for the Atari 8-bit
44
Bill Kendrick <[email protected]>
55
http://www.newbreedsoftware.com/firefighter/
66

7-
0.1-beta-9 (2023-09-26):
7+
0.1-beta-9 (2023-10-17):
88
* Gameplay:
99
* Slowed the game down some.
1010
* Nicer music scale when tallying bonus points.
1111
* Levels:
1212
* Four more levels
1313
* Title:
1414
* Level creator credits
15+
* Misc:
16+
* WIP [deactivated] splash screen flame effect
1517

1618
0.1-beta-8 (2023-09-26):
1719
* Misc:

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ A twin-stick firefighting action game for the Atari 8-bit.
2929
>
3030
> Level 7 by Edward
3131
32-
Developed 2023-08-13 - 2023-09-26
32+
Developed 2023-08-13 - 2023-10-17
3333

3434
------------------------------------------------------------------------
3535

src/splash.c

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Bill Kendrick <[email protected]>
66
http://www.newbreedsoftware.com/firefighter/
77
8-
2023-09-19 - 2023-09-19
8+
2023-09-19 - 2023-10-17
99
*/
1010

1111
#include <atari.h>
@@ -20,9 +20,31 @@ extern unsigned char scr_mem[];
2020
unsigned char * dlist = scr_mem;
2121
unsigned char * scr_mem_pt1 = (scr_mem + 0x150);
2222
unsigned char * scr_mem_pt2 = (scr_mem + 0x1000);
23+
unsigned char * scr_mem_row[191];
24+
unsigned char * scr_mem_row_src1, * scr_mem_row_src2, * scr_mem_row_dest;
2325

2426
void eat_input(void);
2527

28+
//#define FIRE_OUTRO
29+
30+
#ifdef FIRE_OUTRO
31+
unsigned char fade[61] = {
32+
0,0,0,1,1,1,1,1,2,2,2,2,2,3,3,3,3,3,4,4,4,4,4,5,5,5,5,5,6,6,6,6,6,7,7,7,7,7,8,8,
33+
8,8,8,9,9,9,9,9,10,10,10,10,10,11,11,11,11,11,12,12,12
34+
};
35+
36+
unsigned char fade_shift4[61] = {
37+
0,0,0,16,16,16,16,16,32,32,32,32,32,48,48,48,48,48,64,64,64,64,64,80,80,80,80,80,
38+
96,96,96,96,96,112,112,112,112,112,128,128,128,128,128,144,144,144,144,144,160,
39+
160,160,160,160,176,176,176,176,176,192,192,192
40+
};
41+
#pragma bss-name (push,"ZEROPAGE")
42+
unsigned char x, y, i;
43+
unsigned char c, c1, c2, c3, c4;
44+
unsigned int new_c;
45+
#pragma bss-name (pop)
46+
#endif
47+
2648

2749
/* Main loop! */
2850
void main(void) {
@@ -73,6 +95,58 @@ void main(void) {
7395
eat_input();
7496
do {
7597
} while (OS.strig0 == 1 && OS.strig1 == 1 && OS.ch == 255 && GTIA_READ.consol == 7);
98+
99+
100+
/* Fire effect; very slow in straight C, at the moment */
101+
102+
#ifdef FIRE_OUTRO
103+
for (y = 0; y < 191; y++) {
104+
scr_mem_row[y] = scr_mem_pt1 + (y * 40);
105+
}
106+
107+
/*
108+
xx T1 T2 xx
109+
S1 S2 S3 S4
110+
xx S5 S6 xx
111+
112+
T1 = S1, S2, S3, S5
113+
T2 = S2, S3, S4, S6
114+
*/
115+
116+
for (i = 0; i < 8; i++) {
117+
for (y = 0; y < 191; y++) {
118+
scr_mem_row_dest = scr_mem_row[y];
119+
scr_mem_row_src1 = scr_mem_row[y + 1];
120+
scr_mem_row_src2 = scr_mem_row[y + 2];
121+
122+
for (x = 0; x < 40; x++) {
123+
c1 = PEEK(scr_mem_row_src1 + x);
124+
#define s1 ((c1 & 0xF0) >> 4)
125+
#define s2 ((c1 & 0x0F))
126+
127+
c2 = PEEK(scr_mem_row_src1 + x + 1);
128+
#define s3 ((c2 & 0xF0) >> 4)
129+
#define s4 ((c2 & 0x0F))
130+
131+
c3 = PEEK(scr_mem_row_src2 + x);
132+
#define s5 ((c3 & 0x0F))
133+
134+
c4 = PEEK(scr_mem_row_src2 + x + 1);
135+
#define s6 ((c4 & 0xF0) >> 4)
136+
137+
new_c = fade[(s1 + s2 + s3 + s5)];
138+
c = PEEK(scr_mem_row_dest + x) & 0xF0;
139+
POKE(scr_mem_row_dest + x, c | new_c);
140+
141+
new_c = fade_shift4[(s2 + s3 + s4 + s6)];
142+
c = PEEK(scr_mem_row_dest + x + 1) & 0x0F;
143+
POKE(scr_mem_row_dest + x + 1, c | new_c);
144+
}
145+
}
146+
}
147+
#endif
148+
149+
76150
eat_input();
77151

78152
/* Blank the screen (and unset GRAPHICS 9 ANTIC mode), and exit */

0 commit comments

Comments
 (0)