change PI DMA to use 16 bit fetches (275ba735de)

This commit is contained in:
CasualPokePlayer 2022-02-12 02:33:41 -08:00
parent 682111f377
commit f48f9dba9f
2 changed files with 6 additions and 2 deletions

Binary file not shown.

View File

@ -27,8 +27,12 @@ auto PI::dmaWrite() -> void {
if (length.bit(0)) length += 1;
i32 rom_len = (cur_len + 1) & ~1;
for (u32 i = 0; i < rom_len; i++)
mem[i] = bus.read<Byte>(io.pbusAddress++);
for (u32 i = 0; i < rom_len; i += 2) {
u16 data = bus.read<Half>(io.pbusAddress);
mem[i + 0] = data >> 8;
mem[i + 1] = data & 0xFF;
io.pbusAddress += 2;
}
if (first_block) {
if (cur_len == block_len-1) cur_len++;