Here's a patch for the function snes9x.setrenderplanes(bool,bool,bool,bool,bool).
It uses the same syntax as fceu.setrenderplanes, but it supports 4 background layers, so it needs 5 parameters. All of them must be present. for example,
snes9x.setrenderplanes(true,false,true,false,false) would say "enable sprites, enable bg2, disable all others"
Index: lua-engine.cpp
===================================================================
--- lua-engine.cpp (revision 21)
+++ lua-engine.cpp (working copy)
@@ -2896,6 +2896,33 @@
return 4;
}
+
+// gui.setrenderplanes{5 booleans}
+//
+
+#ifndef luaL_checkbool
+#define luaL_checkbool(L, i) (lua_isboolean(L,i) ? lua_toboolean(L,i) : luaL_checkint(L,i))
+#endif
+
+static int snes9x_setrenderplanes(lua_State *L) {
+ bool sprites, bg1, bg2, bg3, bg4;
+ bg1 = luaL_checkbool(L,2);
+ bg2 = luaL_checkbool(L,3);
+ bg3 = luaL_checkbool(L,4);
+ bg4 = luaL_checkbool(L,5);
+ sprites = luaL_checkbool(L,1);
+
+ int l1, l2, l3, l4, l5;
+ l1 = (bg1 ? 0 : 1);
+ l2 = (bg2 ? 0 : 2);
+ l3 = (bg3 ? 0 : 4);
+ l4 = (bg4 ? 0 : 8);
+ l5 = (sprites ? 0 : 16);
+ Settings.BG_Forced = l1 | l2 | l3 | l4 | l5;
+
+ return 0;
+}
+
// gui.gdscreenshot()
//
// Returns a screen shot as a string in gd's v1 file format.
@@ -4175,6 +4202,7 @@
{"registerexit", snes9x_registerexit},
{"message", snes9x_message},
{"print", print}, // sure, why not
+ {"setrenderplanes", snes9x_setrenderplanes}, //NEW FUNCTION: snes9x.setrenderplanes()!
{NULL,NULL}
};