mirror of
https://github.com/deater/dos33fsprogs.git
synced 2025-03-04 04:30:18 +00:00
gr: eye: update
This commit is contained in:
parent
66cdd48dbe
commit
337230115a
@ -5,12 +5,13 @@ TOKENIZE = ../../../utils/asoft_basic-utils/tokenize_asoft
|
||||
LINKERSCRIPTS = ../../../linker_scripts
|
||||
EMPTYDISK = ../../../empty_disk/empty.dsk
|
||||
|
||||
all: bitmap.dsk make_bitmap
|
||||
all: bitmap.dsk make_bitmap make_bitmap_small
|
||||
|
||||
bitmap.dsk: HELLO EYE EYE.BAS
|
||||
bitmap.dsk: HELLO EYE EYE.BAS EYE_NEW.BAS
|
||||
cp $(EMPTYDISK) bitmap.dsk
|
||||
$(DOS33) -y bitmap.dsk SAVE A HELLO
|
||||
$(DOS33) -y bitmap.dsk SAVE A EYE.BAS
|
||||
$(DOS33) -y bitmap.dsk SAVE A EYE_NEW.BAS
|
||||
$(DOS33) -y bitmap.dsk BSAVE -a 0xC00 EYE
|
||||
|
||||
###
|
||||
@ -25,6 +26,11 @@ EYE.BAS: eye.bas
|
||||
|
||||
###
|
||||
|
||||
EYE_NEW.BAS: eye_new.bas
|
||||
$(TOKENIZE) < eye_new.bas > EYE_NEW.BAS
|
||||
|
||||
###
|
||||
|
||||
EYE: eye.o
|
||||
ld65 -o EYE eye.o -C $(LINKERSCRIPTS)/apple2_c00.inc
|
||||
|
||||
@ -39,8 +45,16 @@ make_bitmap: make_bitmap.o
|
||||
make_bitmap.o: make_bitmap.c
|
||||
$(CC) $(CFLAGS) -c make_bitmap.c
|
||||
|
||||
###
|
||||
|
||||
make_bitmap_small: make_bitmap_small.o
|
||||
$(CC) -o make_bitmap_small make_bitmap_small.o $(LFLAGS)
|
||||
|
||||
make_bitmap_small.o: make_bitmap_small.c
|
||||
$(CC) $(CFLAGS) -c make_bitmap_small.c
|
||||
|
||||
|
||||
###
|
||||
|
||||
clean:
|
||||
rm -f *~ *.o *.lst HELLO EYE EYE.BAS make_bitmap
|
||||
rm -f *~ *.o *.lst HELLO EYE EYE.BAS EYE_NEW.BAS make_bitmap make_bitmap_small
|
||||
|
7
graphics/gr/bitmap/eye_new.bas
Normal file
7
graphics/gr/bitmap/eye_new.bas
Normal file
@ -0,0 +1,7 @@
|
||||
1GR
|
||||
2FORI=0TO7:A(I)=PEEK(2185+I)-35:NEXT
|
||||
3C=PEEK(2185+I)-35
|
||||
4FORX=XTOX+1:COLOR=A(C-INT(C/8)*8):PLOTX,I/8:C=C/8:NEXT:X=X*(X<15):I=I+1:IFI<135THEN3
|
||||
5END
|
||||
6".+#'2*/(#,#34,-%+$345555,3455555$455>655+5=>HO654=A5RG@M5V65]H?M5>955H?E8V655R@E7>955=>EO=A55V6HG=VAAA6GH8>VV>MGLO5>>5HO+0O55HO,#+,,,,,#
|
||||
|
80
graphics/gr/bitmap/make_bitmap_small.c
Normal file
80
graphics/gr/bitmap/make_bitmap_small.c
Normal file
@ -0,0 +1,80 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define OFFSET 32
|
||||
#define OFFSET2 35
|
||||
|
||||
//#define OFFSET 35
|
||||
|
||||
static int hex2int(int val) {
|
||||
|
||||
if ((val>='0') && (val<='9')) return val-'0';
|
||||
if ((val>='A') && (val<='F')) return (val-'A')+10;
|
||||
if ((val>='a') && (val<='f')) return (val-'a')+10;
|
||||
|
||||
printf("Unknown: %c %d\n",val,val);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int color_count=0;
|
||||
static int colors[16];
|
||||
|
||||
static int find_color(int which) {
|
||||
int i;
|
||||
|
||||
for(i=0;i<color_count;i++) {
|
||||
if (colors[i]==which) {
|
||||
// printf("Found %d at %d\n",which,i);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
/* not found */
|
||||
colors[color_count]=which;
|
||||
// printf("New %d at %d\n",which,color_count);
|
||||
color_count++;
|
||||
|
||||
return color_count-1;
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
|
||||
int i = 0;
|
||||
unsigned char in[1024];
|
||||
char string[256];
|
||||
char *result;
|
||||
int op=0;
|
||||
int color;
|
||||
|
||||
|
||||
memset(in,0,sizeof(in));
|
||||
|
||||
memset(colors,0,sizeof(colors));
|
||||
|
||||
while(1) {
|
||||
result=fgets(string,256,stdin);
|
||||
if (result==NULL) break;
|
||||
|
||||
for(i=0;i<strlen(string);i++) {
|
||||
if (string[i]=='$') {
|
||||
color=find_color(hex2int(string[i+1]));
|
||||
in[op]=color;
|
||||
op++;
|
||||
color=find_color(hex2int(string[i+2]));
|
||||
in[op]=color;
|
||||
op++;
|
||||
}
|
||||
}
|
||||
}
|
||||
printf("Raw Image was %d bytes, %d colors\n",op,color_count);
|
||||
|
||||
for(i=0;i<8;i++) printf("%c",colors[i]+35);
|
||||
|
||||
for(i=0;i<op;i+=2) printf("%c",((in[i]<<3)+in[i+1])+35);
|
||||
|
||||
printf("\n");
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user