appleiibot: optimize the bitmap drawing code

now only lose 1 byte at end instead of 6
This commit is contained in:
Vince Weaver 2020-10-20 09:26:17 -04:00
parent 8fb76846a0
commit b84725f72c
4 changed files with 18 additions and 4 deletions

View File

@ -9,7 +9,7 @@ appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS \
CIRCLES.BAS AUTUMN.BAS QKUMBA.BAS ASTEROID.BAS PERSON.BAS SHIP.BAS \ CIRCLES.BAS AUTUMN.BAS QKUMBA.BAS ASTEROID.BAS PERSON.BAS SHIP.BAS \
CONCERT.BAS NYAN.BAS RASTER.BAS RASTER2.BAS RASTER3.BAS LOTS.BAS LOAD \ CONCERT.BAS NYAN.BAS RASTER.BAS RASTER2.BAS RASTER3.BAS LOTS.BAS LOAD \
RASTER4.BAS RASTER5.BAS PUMPKIN.BAS PUMPKIN_SMALL.BAS LADY.BAS \ RASTER4.BAS RASTER5.BAS PUMPKIN.BAS PUMPKIN_SMALL.BAS LADY.BAS \
A2.BAS FOURAM.BAS A2.BAS FOURAM.BAS FLOPPY.BAS
cp empty.dsk appleiibot.dsk cp empty.dsk appleiibot.dsk
$(DOS33) -y appleiibot.dsk BSAVE -a 0x0300 LOAD $(DOS33) -y appleiibot.dsk BSAVE -a 0x0300 LOAD
$(DOS33) -y appleiibot.dsk SAVE A E2.BAS $(DOS33) -y appleiibot.dsk SAVE A E2.BAS
@ -34,6 +34,7 @@ appleiibot.dsk: E2.BAS FLAME.BAS FLAME2.BAS \
$(DOS33) -y appleiibot.dsk SAVE A LADY.BAS $(DOS33) -y appleiibot.dsk SAVE A LADY.BAS
$(DOS33) -y appleiibot.dsk SAVE A A2.BAS $(DOS33) -y appleiibot.dsk SAVE A A2.BAS
$(DOS33) -y appleiibot.dsk SAVE A FOURAM.BAS $(DOS33) -y appleiibot.dsk SAVE A FOURAM.BAS
$(DOS33) -y appleiibot.dsk SAVE A FLOPPY.BAS
### ###
@ -195,6 +196,11 @@ A2.BAS: a2.bas
FOURAM.BAS: fouram.bas FOURAM.BAS: fouram.bas
$(TOKENIZE) < fouram.bas > FOURAM.BAS $(TOKENIZE) < fouram.bas > FOURAM.BAS
####
FLOPPY.BAS: floppy.bas
$(TOKENIZE) < floppy.bas > FLOPPY.BAS
#### ####

4
appleiibot/floppy.bas Normal file
View File

@ -0,0 +1,4 @@
1REM_'> $^__XW?#__'\][C__!>W\Y_/&W:?\_SC=W/^?^1_]G_G_P=_Y_8><W?\/+, \/_S4&__S_T+C__\/]/P_/_3\_XYS_,X?@\\/K@/N$_CK"&OP_YO*B?^?^_*PA_'__;XX_#F9&$__1F9.X_?8F9&^_/8F9P_
2FORY=0TO159:Z=PEEK(2054+Y)-32:FORI=0TO5:NORMAL:Q%=Z/2:IFQ%*2-ZTHENINVERSE
3Z=Q%:IFY+I-164THEN?" ";
4NEXT I,Y:GETA

View File

@ -1,5 +1,3 @@
1REM_'> $^__XW?#__'\][C__!>W\Y_/&W:?\_SC=W/^?^1_]G_G_P=_Y_8><W?\/+, \/_S4&__S_T+C__\/]/P_/_3\_XYS_,X?@\\/K@/N$_CK"&OP_YO*B?^?^_*PA_'__;XX_#F9&$__1F9.X_?8F9&^_/8F9P_ 1REM_'> $^__XW?#__'\][C__!>W\Y_/&W:?\_SC=W/^?^1_]G_G_P=_Y_8><W?\/+, \/_S4&__S_T+C__\/]/P_/_3\_XYS_,X?@\\/K@/N$_CK"&OP_YO*B?^?^_*PA_'__;XX_#F9&$__1F9.X_?8F9&^_/8F9P_
2HOME:FORY=0TO158:Z=PEEK(2054+Y)-32:FORI=0TO5:NORMAL:Q=INT(Z/2):IFQ*2<>ZTHENINVERSE 2HOME:FORY=0TO158:Z=PEEK(2054+Y)-32:FORI=0TO5:NORMAL:Q=INT(Z/2):IFQ*2<>ZTHENINVERSE
3Z=Q:PRINT" ";:NEXT I,Y:GETA 3Z=Q:PRINT" ";:NEXT I,Y:GETA

View File

@ -159,6 +159,12 @@ static int find_token(void) {
/* don't tokenize if in quotes */ /* don't tokenize if in quotes */
if ((!in_quotes)&&(!in_rem)) { if ((!in_quotes)&&(!in_rem)) {
/* hack: handle ? as a BA PRINT token */
if (line_ptr[0]=='?') {
line_ptr++;
return 0xBA;
}
// fprintf(stderr,"%s",line_ptr); // fprintf(stderr,"%s",line_ptr);
for(i=0;i<NUM_TOKENS;i++) { for(i=0;i<NUM_TOKENS;i++) {
if (!strncmp(line_ptr,applesoft_tokens[i], if (!strncmp(line_ptr,applesoft_tokens[i],
@ -176,7 +182,7 @@ static int find_token(void) {
line_ptr+=strlen(applesoft_tokens[i]); line_ptr+=strlen(applesoft_tokens[i]);
/* REM is 0x32 */ /* REM is 0x32 (0xB2) */
if (i==0x32) in_rem=1; if (i==0x32) in_rem=1;
return 0x80+i; return 0x80+i;