mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-01-01 05:31:52 +00:00
basic: applebot: add star bounce
This commit is contained in:
parent
5b059ab037
commit
72215d5ec8
@ -22,7 +22,7 @@ appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS HELLO \
|
||||
OVAL.BAS OVAL_HGR.BAS MOVING.BAS THICK_SINE.BAS TURKEY.BAS \
|
||||
FLAME_HGR.BAS RECT.BAS SNOWY.BAS EDGAR.BAS OOPS4.BAS OOPS3.BAS \
|
||||
HORROR.BAS DIAMOND.BAS LEMM.BAS OOPS.BAS SPLIT.BAS PARTICLE.BAS \
|
||||
PARTICLE_HGR.BAS DIAMOND_SCROLL.BAS RANDOM_SCROLL.BAS
|
||||
PARTICLE_HGR.BAS DIAMOND_SCROLL.BAS RANDOM_SCROLL.BAS STAR_BOUNCE.BAS
|
||||
# cp $(EMPTY_DISK)/empty.dsk appleiibot.dsk
|
||||
cp empty.dsk appleiibot.dsk
|
||||
$(DOS33) -y appleiibot.dsk BSAVE -a 0x0300 LOAD
|
||||
@ -121,6 +121,7 @@ appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS HELLO \
|
||||
$(DOS33) -y appleiibot.dsk SAVE A PARTICLE_HGR.BAS
|
||||
$(DOS33) -y appleiibot.dsk SAVE A DIAMOND_SCROLL.BAS
|
||||
$(DOS33) -y appleiibot.dsk SAVE A RANDOM_SCROLL.BAS
|
||||
$(DOS33) -y appleiibot.dsk SAVE A STAR_BOUNCE.BAS
|
||||
|
||||
####
|
||||
|
||||
@ -682,6 +683,11 @@ DIAMOND_SCROLL.BAS: diamond_scroll.bas
|
||||
RANDOM_SCROLL.BAS: random_scroll.bas
|
||||
$(TOKENIZE) < random_scroll.bas > RANDOM_SCROLL.BAS
|
||||
|
||||
####
|
||||
|
||||
STAR_BOUNCE.BAS: star_bounce.bas
|
||||
$(TOKENIZE) < star_bounce.bas > STAR_BOUNCE.BAS
|
||||
|
||||
|
||||
####
|
||||
|
||||
|
@ -19,10 +19,13 @@
|
||||
#define END_AT_3F5 0
|
||||
#define BEGIN_AT_3F5 1
|
||||
|
||||
static int debug=0;
|
||||
|
||||
static int print_help(char *name) {
|
||||
|
||||
printf("\n");
|
||||
printf("Usage: %s [-e] [-h]\n",name);
|
||||
printf("Usage: %s [-d] [-e] [-h]\n",name);
|
||||
printf("\t-d : enables debug messages\n");
|
||||
printf("\t-e : ends program at 3F5 (useful for lo-res programs)\n");
|
||||
printf("\t default is to start program at 3F5\n");
|
||||
printf("\n");
|
||||
@ -35,14 +38,20 @@ int main(int argc, char **argv) {
|
||||
int mode=BEGIN_AT_3F5;
|
||||
int i = 0;
|
||||
int e = 0,filesize;
|
||||
int val,pv,final;
|
||||
int val;
|
||||
int pv,final;
|
||||
unsigned char in[1024];
|
||||
unsigned char enc[1024],enc2[1024];
|
||||
int third,enc_ptr=0;
|
||||
int filesize_digits;
|
||||
|
||||
/* FIXME: need to enumerate all arguments */
|
||||
/* should probably use getopt() instead */
|
||||
if (argc>1) {
|
||||
if (argv[1][0]=='-') {
|
||||
if (argv[1][1]=='d') {
|
||||
debug=1;
|
||||
}
|
||||
if (argv[1][1]=='e') {
|
||||
mode=END_AT_3F5;
|
||||
}
|
||||
@ -69,6 +78,8 @@ int main(int argc, char **argv) {
|
||||
val=val>>2;
|
||||
val=val+OFFSET;
|
||||
final=((val-OFFSET)<<2)+third-0x40;
|
||||
|
||||
if (debug) {
|
||||
fprintf(stderr,"%d: %x -> %x %x ==> %x\n",
|
||||
i,pv,val,third,final);
|
||||
if (pv!=final) fprintf(stderr,"error0: no match!\n");
|
||||
@ -81,6 +92,7 @@ int main(int argc, char **argv) {
|
||||
if (val=='\"') fprintf(stderr,"error0, additional quotation marks\n");
|
||||
// printf("%c",val); //(in[i + 0] >> 2) + OFFSET);
|
||||
//printf("%c",val); //(in[i + 0] >> 2) + OFFSET);
|
||||
}
|
||||
enc2[enc_ptr]=val;
|
||||
enc_ptr++;
|
||||
}
|
||||
@ -94,6 +106,7 @@ int main(int argc, char **argv) {
|
||||
val=val+OFFSET;
|
||||
final=((val-OFFSET)<<2)+(third>>2)-0x40;
|
||||
|
||||
if (debug) {
|
||||
fprintf(stderr,"%d: %x -> %x %x ==> %x\n",
|
||||
i+1,pv,val,third>>2,final);
|
||||
if (pv!=final) fprintf(stderr,"error1: no match!\n");
|
||||
@ -104,6 +117,7 @@ int main(int argc, char **argv) {
|
||||
if (val>0x7e) fprintf(stderr,"error1, too big! in=%x pv=%x e=%x val=%x\n",
|
||||
in[i+0],pv,third,val);
|
||||
// printf("%c",val); //(in[i + 1] >> 2) + OFFSET);
|
||||
}
|
||||
enc2[enc_ptr]=val;
|
||||
enc_ptr++;
|
||||
}
|
||||
@ -116,6 +130,8 @@ int main(int argc, char **argv) {
|
||||
val=val>>2;
|
||||
val=val+OFFSET;
|
||||
final=((val-OFFSET)<<2)+(third>>4)-0x40;
|
||||
|
||||
if (debug) {
|
||||
fprintf(stderr,"%d: %x -> %x %x ==> %x\n",
|
||||
i+2,pv,val,third>>4,final);
|
||||
if (pv!=final) fprintf(stderr,"error2: no match!\n");
|
||||
@ -126,6 +142,7 @@ int main(int argc, char **argv) {
|
||||
if (val>0x7e) fprintf(stderr,"error2 too big! in=%x pv=%x e=%x val=%x\n",
|
||||
in[i+0],pv,third,val);
|
||||
// printf("%c",val);//(in[i + 2] >> 2) + OFFSET);
|
||||
}
|
||||
enc2[enc_ptr]=val;
|
||||
enc_ptr++;
|
||||
}
|
||||
@ -149,6 +166,8 @@ int main(int argc, char **argv) {
|
||||
|
||||
if (mode==END_AT_3F5) {
|
||||
fprintf(stderr,"Ending at $3F5\n");
|
||||
fprintf(stderr,"You'll want to load your program at $%03X\n",
|
||||
0x3f5-filesize+3);
|
||||
printf("1FORI=0TO%d:POKE%d+I,4*PEEK(%d+I)-"
|
||||
"%d+(PEEK(%d+I/3)-%d)/4^(I-INT(I/3)*3):NEXT\n",
|
||||
filesize-1, // filesize for loop
|
||||
|
2
basic/appleiibot/star_bounce.bas
Normal file
2
basic/appleiibot/star_bounce.bas
Normal file
@ -0,0 +1,2 @@
|
||||
1FORI=0TO140:POKE875+I,4*PEEK(2125+I)-204+(PEEK(2266+I/3)-35)/4^(I-INT(I/3)*3):NEXT
|
||||
2&"/fo<HcJL54M4I:lI[N::g1nW2]L;]rJ:[4[3YGW<Ugci<]eoY:TFCEGM=.\bg2TBX4Q8LD8DdIPN;\D35E;T0X4Ui3EEW/\jU<MU7pa6iYPAm77ZZN]bH^D37V7.8rH@LU25156+357J3S+L)P80.*#L#4%^E4N8>@]5UW<M@VX%7,#50$I%7#OK^7O_
|
@ -17,7 +17,7 @@ star.dsk: $(DOS33) HELLO STAR STARS STARS_BOT
|
||||
$(DOS33) -y star.dsk SAVE A HELLO
|
||||
$(DOS33) -y star.dsk BSAVE -a 0xc00 STAR
|
||||
$(DOS33) -y star.dsk BSAVE -a 0xc00 STARS
|
||||
$(DOS33) -y star.dsk BSAVE -a 0xc00 STARS_BOT
|
||||
$(DOS33) -y star.dsk BSAVE -a 0x36B STARS_BOT
|
||||
|
||||
###
|
||||
|
||||
@ -44,7 +44,7 @@ stars.o: stars.s
|
||||
###
|
||||
|
||||
STARS_BOT: stars_bot.o
|
||||
ld65 -o STARS_BOT stars_bot.o -C $(LINKERSCRIPTS)/apple2_c00.inc
|
||||
ld65 -o STARS_BOT stars_bot.o -C $(LINKERSCRIPTS)/apple2_36b.inc
|
||||
|
||||
stars_bot.o: stars_bot.s
|
||||
ca65 -o stars_bot.o stars_bot.s -l stars_bot.lst
|
||||
|
Loading…
Reference in New Issue
Block a user