Skip to content

Commit e31317b

Browse files
committed
tiavolume, getfade, setfade, snes+vox fix
1 parent f6a2117 commit e31317b

18 files changed

Lines changed: 209 additions & 0 deletions

includes/std_routines.asm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,10 @@ exitmusictracker
10391039
sfxvolumeentrypt
10401040
ifconst TIAVOLUME
10411041
lda tiavolume
1042+
asl
1043+
asl
1044+
asl
1045+
asl
10421046
sta fourbitfadevalueint
10431047
endif ; TIAVOLUME
10441048
lda (inttemp5),y

keywords.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@ void keywords(char **cstatement)
363363
sinedata(statement);
364364
else if (!strncmp(statement[1], "pokechar\0", 8))
365365
pokechar(statement);
366+
else if (!strncmp(statement[1], "setfade\0", 7))
367+
setfade(statement);
366368
else if ((!strncmp(statement[1], "on\0", 3)) && (!strncmp(statement[3], "go\0", 2)))
367369
ongoto(statement); // on ... goto or on ... gosub
368370
else if (!strncmp(statement[1], "const\0", 6))

samples/colorfade/Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export PROJECT=colorfade
2+
export PROJECTDIR=`pwd`
3+
export COMPILER=7800basic.sh
4+
5+
main: ${PROJECT}.bas.bin
6+
7+
${PROJECT}.bas.bin: ${PROJECT}.bas
8+
${COMPILER} ${PROJECT}.bas -O
9+
10+
clean:
11+
/bin/rm -fr ${PROJECT}.bas.bin ${PROJECT}.bas.asm ${PROJECT}.bas.a78 ${PROJECT}.bas.list.txt ${PROJECT}.bas.symbol.txt 7800.asm 7800gfx.asm includes.7800 7800basic_variable_redefs.h a78info.cfg cfg
12+
13+
run:
14+
a7800 a7800 -cart ${PROJECT}.bas.a78

samples/colorfade/colorfade.bas

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
2+
rem ** color fade demo
3+
4+
set doublewide on
5+
set tv ntsc
6+
7+
dim xpos=a
8+
dim ypos=b
9+
dim frame=c
10+
dim herodir=d
11+
dim moving=e
12+
dim heroframe=f
13+
dim fadevalue=g
14+
15+
displaymode 160A
16+
17+
xpos=40
18+
19+
incgraphic gfx/tileset_blanks.png 160A 3 0 1 2
20+
incgraphic gfx/tileset_rocks.png
21+
incgraphic gfx/scoredigits_8_wide.png
22+
incgraphic gfx/alphabet_8_wide.png 160A 0 2 1 3
23+
24+
incgraphic gfx/herodown1.png
25+
incgraphic gfx/herodown2.png
26+
incgraphic gfx/heroleft1.png
27+
incgraphic gfx/heroleft2.png
28+
incgraphic gfx/heroup1.png
29+
incgraphic gfx/heroup2.png
30+
incgraphic gfx/heroright1.png
31+
incgraphic gfx/heroright2.png
32+
33+
P0C1=heroright2_color1
34+
P0C2=heroright2_color2
35+
P0C3=heroright2_color3
36+
37+
rem ** activate the graphics area with our tiles...
38+
characterset tileset_blanks
39+
40+
clearscreen
41+
42+
rem ** put the background down and save the screen before the main loop.
43+
rem ** this way we don't setup the background over and over again.
44+
45+
plotmap screen1map 1 0 0 20 12
46+
plotchars demotext 2 64 3 4
47+
savescreen
48+
49+
drawscreen
50+
51+
frame=0
52+
53+
mainloop
54+
55+
rem ** fade in and out...
56+
if frame<15 then fadevalue=fadevalue+1
57+
if frame>127 && frame<143 then fadevalue=fadevalue-1
58+
59+
rem ** set the global fade value...
60+
setfade fadevalue
61+
62+
rem ** fetch the fade values appropriate for our colors.
63+
rem ** note the "black" argument, which zeroes the hue nibble
64+
rem ** when the luminance nibble is zero.
65+
66+
P1C1=getfade($12,black)
67+
P1C2=getfade($F6,black)
68+
P1C3=getfade($FC,black)
69+
70+
P2C1=getfade($62,black)
71+
P2C2=getfade($86,black)
72+
P2C3=getfade($AC,black)
73+
74+
rem ** we skip the "black" argument for the hero. you'll see him
75+
rem ** in the dark, since a hue with 0 luminance still gets displayed...
76+
P0C1=getfade(heroright2_color1)
77+
P0C2=getfade(heroright2_color2)
78+
P0C3=getfade(heroright2_color3)
79+
80+
frame=frame+1
81+
82+
BACKGRND=$00
83+
if joy0fire1 then BACKGRND=$38
84+
if joy0fire0 then BACKGRND=$a8
85+
86+
rem ** move our hero in only the cardinal directions...
87+
moving=moving+1
88+
if joy0down then ypos=ypos+1:herodir=0:goto doneherowalk
89+
if joy0up then ypos=ypos-1:herodir=2:goto doneherowalk
90+
if joy0left then xpos=xpos-1:herodir=1:goto doneherowalk
91+
if joy0right then xpos=xpos+1:herodir=3:goto doneherowalk
92+
moving=moving-1 : rem we didn't move
93+
doneherowalk
94+
95+
restorescreen
96+
97+
rem ** calculate which animation frame to display, based on direction and
98+
rem ** the walking counter...
99+
100+
heroframe=(herodir*2)+((moving/16)&1)
101+
plotsprite herodown1 0 xpos ypos heroframe
102+
103+
plotvalue scoredigits_8_wide 2 score0 6 56 11
104+
plotvalue scoredigits_8_wide 2 score1 6 56 10
105+
106+
drawscreen
107+
108+
goto mainloop
109+
110+
alphadata demotext alphabet_8_wide
111+
'demo'
112+
end
113+
114+
alphachars ' abcdefghijklmnopqrstuvwxyz'
115+
116+
alphadata screen1map tileset_blanks
117+
'hifgfg fgfghi'
118+
'hi hi'
119+
'hi hi'
120+
'fg fg'
121+
' '
122+
' '
123+
' '
124+
' '
125+
'hi hi'
126+
'hi hi'
127+
'hi dehi'
128+
'fgfgfg fgfgfg'
129+
end
349 Bytes
Loading
215 Bytes
Loading
213 Bytes
Loading
231 Bytes
Loading
227 Bytes
Loading
232 Bytes
Loading

0 commit comments

Comments
 (0)