I used a similar program to create the UDG data for MINIPAINT, even though I did the design in MS Paint as *.bmp, and then a conversion in IrfanView to *.pgm, so my image library (see 'image.c' and 'image.h'
here) could process the bitmap:
The grey/white checkerboard pattern shows the 8x8 character bounding boxes. Then this C program converts it into EQUB directives for the inline assembler of HI BASIC:
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include "image.h"
int main(int argc, char *argv[])
{
IMAGE *image=image_load("status");
FILE *stream=fopen("result.txt","w");
int byte[8],x,x2,y,y2;
for(y=0; y<4; y++)
for(x=0; x<14; x++)
{
for(y2=0; y2<8; y2++)
{
byte[y2]=0;
for(x2=0; x2<8; x2++) byte[y2]=2*byte[y2]+(b_pixel(image,x*8+x2,y*8+y2)<128);
}
fprintf(stream," EQUB %3d:EQUB %3d:EQUB %3d:EQUB %3d:EQUB %3d:EQUB %3d:EQUB %3d:EQUB %3d\n",
byte[0], byte[1], byte[2], byte[3], byte[4], byte[5], byte[6], byte[7]);
}
exit(EXIT_SUCCESS);
}
It would have been a much hairier task to design this in a normal character editor, let alone squared paper.
Anyway, this thread should go into 'Emulation and Cross-Development'. Could one of the mods please move it to there?