Remove CP437 bitmap, i dont intend to use graphics mode for OS
This commit is contained in:
parent
df9f50c29a
commit
e217b70bb7
5
Makefile
5
Makefile
@ -35,11 +35,6 @@ utils/%: %.c
|
|||||||
mkdir -p utils
|
mkdir -p utils
|
||||||
$(CC) -o $@ $<
|
$(CC) -o $@ $<
|
||||||
|
|
||||||
cp437.bin: cp437.bmp utils/bmp2font
|
|
||||||
utils/bmp2font $< $@
|
|
||||||
|
|
||||||
vga11.com: cp437.bin
|
|
||||||
|
|
||||||
# COM programs
|
# COM programs
|
||||||
%.com: com/%.asm
|
%.com: com/%.asm
|
||||||
$(NASM) $(NASM_ARGS) -o $@ $<
|
$(NASM) $(NASM_ARGS) -o $@ $<
|
||||||
|
55
bmp2font.c
55
bmp2font.c
@ -1,55 +0,0 @@
|
|||||||
/* This script os meant to convert a 256x256 pixel bitmap into an bitmap of
|
|
||||||
* 8x8 pixel characters. When deciding upon the output format, i had the
|
|
||||||
* video output of scanlines in mind. So there are 8 sections for each row
|
|
||||||
* of pixels for a character cell, each secton containing the the pixel line
|
|
||||||
* data of all 256 character codes. If you align this blob to 256-bytes, you
|
|
||||||
* quickly fetch the data by pointing bx to the begin of the section for the
|
|
||||||
* pixel line you are currently drawing, then set bl to the character value
|
|
||||||
* you want to print and dereference [bx].
|
|
||||||
*/
|
|
||||||
|
|
||||||
#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…
Reference in New Issue
Block a user