* Super NES and Super Nintendo Entertainment System are trademarks of
* Nintendo Co., Limited and its subsidiary companies.
*/
+
+#include <stdarg.h>
+
#include "snes9x.h"
#include "memmap.h"
void S9xStartScreenRefresh ()
{
- if (GFX.InfoStringTimeout > 0 && --GFX.InfoStringTimeout == 0)
- GFX.InfoString = NULL;
+ if (GFX.InfoStringTimeout > 0 && --GFX.InfoStringTimeout == 0) {
+ free(GFX.InfoString);
+ GFX.InfoString = NULL;
+ }
if (IPPU.RenderThisFrame)
{
}
}
-void S9xSetInfoString (const char *string)
+void S9xSetInfoString (const char * fmt, ...)
{
- GFX.InfoString = string;
- GFX.InfoStringTimeout = 120;
+ va_list ap;
+ va_start(ap, fmt);
+
+ if (vasprintf(&GFX.InfoString, fmt, ap) > 0) {
+ GFX.InfoStringTimeout = 120;
+ } else {
+ GFX.InfoString = 0;
+ GFX.InfoStringTimeout = 0;
+ }
+
+ va_end(ap);
}
INLINE void SelectTileRenderer (bool8_32 normal)
Count = 8 - Offset;
if (Count > Width)
Count = Width;
- s -= (Offset>>1);
+ if (s) // XXX: Workaround for underflow (Secret of MANA)
+ s -= (Offset>>1);
Tile = READ_2BYTES (t);
GFX.Z1 = GFX.Z2 = depths [(Tile & 0x2000) >> 13];
}
return (FALSE);
}
+
#endif
+