Throw out previous x86 stuff
This commit is contained in:
parent
18e9221bf6
commit
807db4a592
25 changed files with 0 additions and 2504 deletions
45
HOST/bmp2font.c
Normal file
45
HOST/bmp2font.c
Normal file
|
@ -0,0 +1,45 @@
|
|||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/mman.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
|
||||
FILE* in;
|
||||
FILE* out;
|
||||
void *addr;
|
||||
|
||||
void copyline(int c) {
|
||||
uint8_t *ptr = addr + 0x82 + (128/8)*(127 - c);
|
||||
int i;
|
||||
for (i=0; i<16; i++) {
|
||||
fputc(*ptr++, out);
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
struct stat sbuf;
|
||||
|
||||
in = fopen(argv[1], "r+");
|
||||
out = fopen(argv[2], "w");
|
||||
|
||||
fstat(fileno(in), &sbuf);
|
||||
|
||||
if (sbuf.st_size != 2178) {
|
||||
printf("File must be a 128x128 pixel 1 bit monochrome bmp\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
addr = mmap(NULL, sbuf.st_size, PROT_READ | PROT_WRITE, MAP_SHARED, fileno(in), 0);
|
||||
|
||||
int i, j;
|
||||
for(j=0; j<8; j++) {
|
||||
for(i=0; i<16; i++) {
|
||||
copyline(j+i*8);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue