shithub: zelda3

Download patch

ref: 18c351f101ddcd572360dc21be029ba3e62d45d0
parent: 3072b8ae0cfe442010a65666eef5b2af3e2ecdd7
author: Snesrev <[email protected]>
date: Wed Oct 19 12:02:34 EDT 2022

Fix so bomb gets drawn in widescreen (Fixes #159)

--- a/ancilla.c
+++ b/ancilla.c
@@ -346,7 +346,7 @@
 
 static void Ancilla_SetOam(OamEnt *oam, uint16 x, uint16 y, uint8 charnum, uint8 flags, uint8 big) {
   uint8 yval = 0xf0;
-  int xt = enhanced_features0 ? 0x40 : 0;
+  int xt = enhanced_features0 & kFeatures0_ExtendScreen64 ? 0x40 : 0;
   if ((uint16)(x + xt) < 256 + xt * 2 && y < 256) {
     big |= (x >> 8) & 1;
     oam->x = x;
@@ -362,7 +362,8 @@
 static void Ancilla_SetOam_Safe(OamEnt *oam, uint16 x, uint16 y, uint8 charnum, uint8 flags, uint8 big) {
   uint8 yval = 0xf0;
   oam->x = x;
-  if ((uint16)(x + 0x80) < 0x180) {
+  int xt = enhanced_features0 & kFeatures0_ExtendScreen64 ? 0x48 : 0;
+  if ((uint16)(x + 0x80) < (0x180 + xt)) {
     big |= (x >> 8) & 1;
     if ((uint16)(y + 0x10) < 0x100)
       yval = y;