M cmd/hdmg/main.ha => cmd/hdmg/main.ha +5 -0
@@ 35,6 35,11 @@ export fn main() void = {
const render = sdl2::SDL_CreateRenderer(win, -1, SDL_RendererFlags::NONE)!;
defer sdl2::SDL_DestroyRenderer(render);
+ sdl2::SDL_SetRenderDrawColor(render,
+ (dmg::LCD_COLORS[0] >> 24): u8,
+ (dmg::LCD_COLORS[0] >> 16): u8,
+ (dmg::LCD_COLORS[0] >> 8): u8,
+ (dmg::LCD_COLORS[0] >> 0): u8)!;
let state = state {
quit = false,
M dmg/dmg.ha => dmg/dmg.ha +3 -0
@@ 1,6 1,9 @@
use dmg::cart;
use sm83;
+// Clock rate in Hz of the DMG CPU.
+export def CLOCK_HZ: size = 4194304;
+
export type dmg = struct {
cart: *cart::cart,
cpu: sm83::sm83,
A dmg/ppu.ha => dmg/ppu.ha +9 -0
@@ 0,0 1,9 @@
+use pixbuf;
+
+// The recommended colors for the PPU LCD, RGBA.
+export const LCD_COLORS: [4]u32 = [
+ 0x0F380FFF,
+ 0x306230FF,
+ 0x8BAC0FFF,
+ 0x9BBC0FFF,
+];