beginning ppu

This commit is contained in:
2025-02-01 00:48:49 -07:00
parent 5206c3871e
commit f4cbfd09c8
25 changed files with 683 additions and 43 deletions

View File

@ -1,4 +1,8 @@
#include <io.h>
#include <timer.h>
#include <cpu.h>
#include <dma.h>
#include <lcd.h>
static char serial_data[2];
@ -11,6 +15,18 @@ u8 io_read(u16 address){
return serial_data[1];
}
if(BETWEEN(address, 0xFF04, 0xFF07)){
return timer_read(address);
}
if(BETWEEN(address, 0xFF40, 0xFF4B)){
return lcd_read(address);
}
if(address == 0xFF0F) {
return cpu_get_int_flags();
}
printf("UNSUPPORTED io_read(%04X)\n", address);
return 0;
}
@ -27,6 +43,21 @@ void io_write(u16 address, u8 value){
return;
}
if(BETWEEN(address, 0xFF04, 0xFF07)){
timer_write(address, value);
return;
}
if(address == 0xFF0F) {
cpu_set_int_flags(value);
return;
}
if(BETWEEN(address, 0xFF40, 0xFF4B)){
lcd_write(address, value);
return;
}
printf("UNSUPPORTED io_write(%04X)\n", address);
}