From 27e926bd58302d8b5e6198cacd84aa524f8ec6a6 Mon Sep 17 00:00:00 2001 From: Guy Perfect Date: Wed, 25 Dec 2024 13:48:39 -0600 Subject: [PATCH] Fix byte writes to VIP cells, objects and worlds --- core/vip.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/vip.c b/core/vip.c index 74b9bb2..cabbd4e 100644 --- a/core/vip.c +++ b/core/vip.c @@ -234,7 +234,7 @@ static void vipWriteCell(VB *sim, uint32_t offset, int type, int32_t value) { case VB_S8: case VB_U8: value = offset & 1 ? - value << 8 | sim->vip.ram[0x20000 | offset] : + value << 8 | sim->vip.ram[0x20001 ^ offset] : value | (int32_t) sim->vip.ram[0x20001 | offset] << 8 ; break; @@ -284,7 +284,7 @@ static void vipWriteObject(VB *sim, uint32_t offset, int type, int32_t value) { case VB_S8: case VB_U8: value = offset & 1 ? - value << 8 | sim->vip.ram[0x3E000 | offset] : + value << 8 | sim->vip.ram[0x3E001 ^ offset] : value | (int32_t) sim->vip.ram[0x3E001 | offset] << 8 ; break; @@ -326,7 +326,7 @@ static void vipWriteWorld(VB *sim, uint32_t offset, int type, int32_t value) { case VB_S8: case VB_U8: value = offset & 1 ? - value << 8 | sim->vip.ram[0x3D800 | offset] : + value << 8 | sim->vip.ram[0x3D801 ^ offset] : value | (int32_t) sim->vip.ram[0x3D801 | offset] << 8 ; break;