2023-11-22 14:39:27 -08:00
|
|
|
#include <mammoth/util/debug.h>
|
|
|
|
#include <mammoth/util/init.h>
|
2023-11-21 19:14:02 -08:00
|
|
|
#include <victoriafalls/victoriafalls.yunq.client.h>
|
2023-11-15 16:41:51 -08:00
|
|
|
#include <yellowstone/yellowstone.yunq.client.h>
|
2023-11-09 12:55:44 -08:00
|
|
|
|
2023-11-21 19:32:31 -08:00
|
|
|
#include "framebuffer/console.h"
|
2023-11-15 19:20:52 -08:00
|
|
|
#include "framebuffer/framebuffer.h"
|
2023-11-21 19:14:02 -08:00
|
|
|
#include "framebuffer/psf.h"
|
2023-11-15 19:20:52 -08:00
|
|
|
|
2023-11-09 12:55:44 -08:00
|
|
|
uint64_t main(uint64_t init_port) {
|
|
|
|
ParseInitPort(init_port);
|
|
|
|
|
|
|
|
dbgln("Teton Starting");
|
2023-11-15 16:41:51 -08:00
|
|
|
|
2023-11-09 12:55:44 -08:00
|
|
|
// 1. Set up framebuffer.
|
2023-11-15 16:41:51 -08:00
|
|
|
YellowstoneClient client(gInitEndpointCap);
|
|
|
|
|
|
|
|
FramebufferInfo framebuffer;
|
|
|
|
RET_ERR(client.GetFramebufferInfo({}, framebuffer));
|
2023-11-15 19:20:52 -08:00
|
|
|
dbgln("FB addr {x}, bpp {}, width {} , height {}, pitch {}",
|
|
|
|
framebuffer.address_phys(), framebuffer.bpp(), framebuffer.width(),
|
|
|
|
framebuffer.height(), framebuffer.pitch());
|
|
|
|
|
|
|
|
Framebuffer fbuf(framebuffer);
|
|
|
|
|
2023-11-09 12:55:44 -08:00
|
|
|
// 2. Parse a font file.
|
|
|
|
|
2023-11-22 16:42:42 -08:00
|
|
|
Psf psf("/default8x16.psfu");
|
2023-11-21 19:14:02 -08:00
|
|
|
psf.DumpHeader();
|
|
|
|
|
2023-11-21 19:32:31 -08:00
|
|
|
Console console(fbuf, psf);
|
2023-11-22 08:56:26 -08:00
|
|
|
console.WriteString("Hello World!\n");
|
|
|
|
for (uint8_t i = 0x20; i < 0x7E; i++) {
|
|
|
|
console.WriteChar(i);
|
|
|
|
}
|
2023-11-21 19:14:02 -08:00
|
|
|
|
2023-11-09 12:55:44 -08:00
|
|
|
// 3. Write a line to the screen.
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|