Finish ppu, and mbc1 mapping

This commit is contained in:
2025-02-01 19:05:25 -07:00
parent 2603916972
commit 89a99b160d
17 changed files with 779 additions and 18 deletions

View File

@ -3,6 +3,9 @@
#include <string.h>
#include <ppu_sm.h>
void pipeline_fifo_reset();
void pipeline_process();
static ppu_context ctx;
ppu_context *ppu_get_context() {
@ -14,6 +17,17 @@ void ppu_init() {
ctx.line_ticks = 0;
ctx.video_buffer = malloc(YRES * XRES * sizeof(u32));
ctx.pfc.line_x = 0;
ctx.pfc.pushed_x = 0;
ctx.pfc.fetch_x = 0;
ctx.pfc.pixel_fifo.size = 0;
ctx.pfc.pixel_fifo.head = ctx.pfc.pixel_fifo.tail = NULL;
ctx.pfc.cur_fetch_state = FS_TILE;
ctx.line_sprites = 0;
ctx.fetched_entry_count = 0;
ctx.window_line = 0;
lcd_init();
LCDS_MODE_SET(MODE_OAM);