mirror of
https://github.com/isometimes/rpi4-osdev
synced 2024-11-22 10:10:45 +00:00
Added the font binaries into the Makefile - samples/wgt41.c still a work in progress
This commit is contained in:
parent
6f2d5352b1
commit
1d0e1717b3
6 changed files with 37 additions and 5 deletions
|
@ -35,11 +35,20 @@ bin/invaderspr.o: bin/invader.spr
|
||||||
bin/mousespr.o: bin/mouse.spr
|
bin/mousespr.o: bin/mouse.spr
|
||||||
$(LLVMPATH)/llvm-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@
|
$(LLVMPATH)/llvm-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@
|
||||||
|
|
||||||
|
bin/littlewfn.o: bin/little.wfn
|
||||||
|
$(LLVMPATH)/llvm-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@
|
||||||
|
|
||||||
|
bin/mediumwfn.o: bin/medium.wfn
|
||||||
|
$(LLVMPATH)/llvm-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@
|
||||||
|
|
||||||
|
bin/systemwfn.o: bin/system.wfn
|
||||||
|
$(LLVMPATH)/llvm-objcopy -I binary -O elf64-littleaarch64 -B aarch64 $< $@
|
||||||
|
|
||||||
%.o: %.c
|
%.o: %.c
|
||||||
$(LLVMPATH)/clang --target=aarch64-elf $(CLANGFLAGS) -c $< -o $@
|
$(LLVMPATH)/clang --target=aarch64-elf $(CLANGFLAGS) -c $< -o $@
|
||||||
|
|
||||||
kernel8.img: boot/boot.o $(OFILES) bin/BCM4345C0.o bin/wgt1pal.o bin/wgt1blk.o bin/wgt2blk.o bin/lettersspr.o bin/spacespr.o bin/invaderspr.o bin/mousespr.o bin/breakspr.o
|
kernel8.img: boot/boot.o $(OFILES) bin/BCM4345C0.o bin/wgt1pal.o bin/wgt1blk.o bin/wgt2blk.o bin/lettersspr.o bin/spacespr.o bin/invaderspr.o bin/mousespr.o bin/breakspr.o bin/littlewfn.o bin/mediumwfn.o bin/systemwfn.o
|
||||||
$(LLVMPATH)/ld.lld -m aarch64elf -nostdlib boot/boot.o $(OFILES) bin/BCM4345C0.o bin/wgt1pal.o bin/wgt1blk.o bin/wgt2blk.o bin/lettersspr.o bin/spacespr.o bin/invaderspr.o bin/mousespr.o bin/breakspr.o -T boot/link.ld -o kernel8.elf
|
$(LLVMPATH)/ld.lld -m aarch64elf -nostdlib boot/boot.o $(OFILES) bin/BCM4345C0.o bin/wgt1pal.o bin/wgt1blk.o bin/wgt2blk.o bin/lettersspr.o bin/spacespr.o bin/invaderspr.o bin/mousespr.o bin/breakspr.o bin/littlewfn.o bin/mediumwfn.o bin/systemwfn.o -T boot/link.ld -o kernel8.elf
|
||||||
$(LLVMPATH)/llvm-objcopy -O binary kernel8.elf kernel8.img
|
$(LLVMPATH)/llvm-objcopy -O binary kernel8.elf kernel8.img
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
BIN
part12-wgt/bin/little.wfn
Normal file
BIN
part12-wgt/bin/little.wfn
Normal file
Binary file not shown.
BIN
part12-wgt/bin/medium.wfn
Normal file
BIN
part12-wgt/bin/medium.wfn
Normal file
Binary file not shown.
BIN
part12-wgt/bin/system.wfn
Normal file
BIN
part12-wgt/bin/system.wfn
Normal file
Binary file not shown.
|
@ -59,13 +59,37 @@ void wgt41()
|
||||||
message[11] = '!';
|
message[11] = '!';
|
||||||
message[12] = '\0';
|
message[12] = '\0';
|
||||||
|
|
||||||
|
wgtfont little;
|
||||||
|
wgtfont medium;
|
||||||
|
|
||||||
|
extern unsigned char _binary_bin_little_wfn_start[];
|
||||||
|
little = &(_binary_bin_little_wfn_start[0]);
|
||||||
|
extern unsigned char _binary_bin_medium_wfn_start[];
|
||||||
|
medium = &(_binary_bin_medium_wfn_start[0]);
|
||||||
|
|
||||||
wtextcolor (vgapal[15]);
|
wtextcolor (vgapal[15]);
|
||||||
|
|
||||||
|
wgtprintf (0, 0, NULL, "%.15s", little);
|
||||||
|
wgtprintf (0, 8, NULL, "%.15s", medium);
|
||||||
|
wouttextxy (0, 50, medium, "Nice to see you");
|
||||||
|
wouttextxy (0, 100, little, "Goodbye cruel world!");
|
||||||
|
|
||||||
|
/*
|
||||||
wgtprintf (0, 0, NULL, "%s", message);
|
wgtprintf (0, 0, NULL, "%s", message);
|
||||||
wgtprintf (0, 8, NULL, "String width : %i pixels", wgettextwidth (message, NULL));
|
wgtprintf (0, 8, NULL, "String width : %i pixels", wgettextwidth (message, NULL));
|
||||||
wgtprintf (0, 16, NULL, "String height: %i pixels", wgettextheight (message, NULL));
|
wgtprintf (0, 16, NULL, "String height: %i pixels", wgettextheight (message, NULL));
|
||||||
|
|
||||||
|
wgtprintf (0, 50, medium, "%s", message);
|
||||||
|
wgtprintf (0, 66, NULL, "String width : %i pixels", wgettextwidth (message, medium));
|
||||||
|
wgtprintf (0, 74, NULL, "String height: %i pixels", wgettextheight (message, medium));
|
||||||
|
|
||||||
|
wgtprintf (0, 100, little, "%s", message);
|
||||||
|
wgtprintf (0, 116, NULL, "String width : %i pixels", wgettextwidth (message, little));
|
||||||
|
wgtprintf (0, 124, NULL, "String height: %i pixels", wgettextheight (message, little));
|
||||||
|
*/
|
||||||
|
|
||||||
getch ();
|
getch ();
|
||||||
|
free (message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
|
|
|
@ -431,10 +431,9 @@ wgtprintf (short x, short y, wgtfont font, const char *fmt, ...)
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
|
|
||||||
char *buffer = malloc(251); /* Buffer to build string into*/
|
char buffer[251]; /* Buffer to build string into*/
|
||||||
kvprintf(fmt, NULL, (void *)buffer, 10, ap);
|
kvprintf(fmt, NULL, (void *)buffer, 10, ap);
|
||||||
wouttextxy (x, y, font, buffer);
|
wouttextxy (x, y, font, buffer);
|
||||||
free(buffer);
|
|
||||||
|
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue