Can successfully run scripts/draw to gui without ROM
This commit is contained in:
parent
3f5f4fe7b9
commit
83ad2fc56e
|
@ -1,10 +1,14 @@
|
|||
emu.print("okay, but where does this one go?")
|
||||
local y = 6
|
||||
emu.print("Go Gators!")
|
||||
local y = 0
|
||||
|
||||
while(true) do
|
||||
gui.drawtext(0, y, "Hello World")
|
||||
y = y + 1
|
||||
soup("this is cool")
|
||||
emugator.yieldwithflag();
|
||||
|
||||
if(y < 256) then
|
||||
y = y + 1
|
||||
else
|
||||
y = 0
|
||||
end
|
||||
print(y)
|
||||
emugator.yieldwithflag(); -- call this if you want the script to run without emulation (game running)
|
||||
--emu.frameadvance()
|
||||
end
|
|
@ -965,18 +965,17 @@ doloopy:
|
|||
RedrawWindow(hAppWnd,0,0,RDW_ERASE|RDW_INVALIDATE);
|
||||
}
|
||||
else if (luaYieldFlag) {
|
||||
RedrawWindow(hAppWnd, 0, 0, RDW_ERASE | RDW_VALIDATE);
|
||||
|
||||
while (luaYieldFlag && !exiting) {
|
||||
UpdateFCEUWindow();
|
||||
FCEUI_ResetPalette();
|
||||
while (luaYieldFlag && !exiting && !GameInfo) {
|
||||
luaYieldFlag = false;
|
||||
UpdateFCEUWindow();
|
||||
UpdateRawInputAndHotkeys();
|
||||
|
||||
uint8* gfx = 0;
|
||||
FCEUI_AdvanceNoFrame(&gfx);
|
||||
FCEUD_BlitScreen(gfx);
|
||||
|
||||
Sleep(50);
|
||||
Sleep(25);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -1167,6 +1167,7 @@ bool ALoad(const char *nameo, char* innerFilename, bool silent)
|
|||
updateGameDependentMenus();
|
||||
updateGameDependentMenusDebugger();
|
||||
EmulationPaused = oldPaused;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2703,7 +2704,7 @@ void ByebyeWindow()
|
|||
DestroyWindow(hAppWnd);
|
||||
}
|
||||
|
||||
/// reates the main window.
|
||||
/// Creates the main window.
|
||||
/// @return Flag that indicates failure (0) or success (1)
|
||||
int CreateMainWindow()
|
||||
{
|
||||
|
|
10
src/fceu.cpp
10
src/fceu.cpp
|
@ -478,7 +478,7 @@ FCEUGI *FCEUI_LoadGameVirtual(const char *name, int OverwriteVidMode, bool silen
|
|||
if (fp->archiveFilename != "")
|
||||
GameInfo->archiveFilename = strdup(fp->archiveFilename.c_str());
|
||||
GameInfo->archiveCount = fp->archiveCount;
|
||||
|
||||
|
||||
GameInfo->soundchan = 0;
|
||||
GameInfo->soundrate = 0;
|
||||
GameInfo->name = 0;
|
||||
|
@ -487,7 +487,7 @@ FCEUGI *FCEUI_LoadGameVirtual(const char *name, int OverwriteVidMode, bool silen
|
|||
GameInfo->input[0] = GameInfo->input[1] = SI_UNSET;
|
||||
GameInfo->inputfc = SIFC_UNSET;
|
||||
GameInfo->cspecial = SIS_NONE;
|
||||
|
||||
|
||||
//try to load each different format
|
||||
bool FCEUXLoad(const char *name, FCEUFILE * fp);
|
||||
|
||||
|
@ -556,7 +556,7 @@ FCEUGI *FCEUI_LoadGameVirtual(const char *name, int OverwriteVidMode, bool silen
|
|||
}
|
||||
|
||||
if (GameInfo->type != GIT_NSF && !disableAutoLSCheats)
|
||||
FCEU_LoadGameCheats(0);
|
||||
//FCEU_LoadGameCheats(0);
|
||||
|
||||
if (AutoResumePlay)
|
||||
{
|
||||
|
@ -886,6 +886,10 @@ void FCEUI_AdvanceNoFrame(uint8** pXBuf) {
|
|||
*pXBuf = XBuf;
|
||||
}
|
||||
|
||||
void FCEUI_ResetPalette(void) {
|
||||
FCEU_ResetPalette();
|
||||
}
|
||||
|
||||
void FCEUI_CloseGame(void) {
|
||||
if (!FCEU_IsValidUI(FCEUI_CLOSEGAME))
|
||||
return;
|
||||
|
|
|
@ -151,8 +151,10 @@ void SetNESDeemph_OldHacky(uint8 d, int force);
|
|||
void DrawTextTrans(uint8 *dest, uint32 width, uint8 *textmsg, uint8 fgcolor);
|
||||
void FCEU_PutImage(void);
|
||||
|
||||
void FCEUI_AdvanceNoFrame(uint8** pXBuf); // - emugator
|
||||
void FCEU_ClearScreen(void); // -emugator
|
||||
// - emugator
|
||||
void FCEUI_AdvanceNoFrame(uint8** pXBuf);
|
||||
void FCEU_ClearScreen(void);
|
||||
void FCEUI_ResetPalette(void);
|
||||
|
||||
#ifdef FRAMESKIP
|
||||
void FCEU_PutImageDummy(void);
|
||||
|
|
|
@ -940,9 +940,9 @@ int iNESLoad(const char *name, FCEUFILE *fp, int OverwriteVidMode) {
|
|||
trainerpoo = NULL;
|
||||
ExtraNTARAM = NULL;
|
||||
return LOADER_HANDLED_ERROR;
|
||||
|
||||
|
||||
init_ok:
|
||||
|
||||
|
||||
GameInfo->mappernum = MapperNo;
|
||||
FCEU_LoadGameSave(&iNESCart);
|
||||
|
||||
|
|
|
@ -6469,7 +6469,6 @@ int FCEU_LoadLuaCode(const char *filename, const char *arg)
|
|||
|
||||
// register a few utility functions outside of libraries (in the global namespace)
|
||||
lua_register(L, "print", print);
|
||||
lua_register(L, "soup", print); //emugatordebug
|
||||
lua_register(L, "gethash", gethash),
|
||||
lua_register(L, "tostring", tostring);
|
||||
lua_register(L, "tobitstring", tobitstring);
|
||||
|
|
|
@ -71,6 +71,7 @@ static pal *default_palette[8]=
|
|||
static void CalculatePalette(void);
|
||||
static void ChoosePalette(void);
|
||||
static void WritePalette(void);
|
||||
static void UseDefaultPalette(void);
|
||||
|
||||
//points to the actually selected current palette
|
||||
pal *palo = NULL;
|
||||
|
@ -500,6 +501,11 @@ void FCEU_ResetPalette(void)
|
|||
ChoosePalette();
|
||||
WritePalette();
|
||||
}
|
||||
else if (luaYieldFlag) {
|
||||
UseDefaultPalette();
|
||||
WritePalette();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void ChoosePalette(void)
|
||||
|
@ -552,6 +558,12 @@ static void ChoosePalette(void)
|
|||
}
|
||||
}
|
||||
|
||||
static void UseDefaultPalette(void) {
|
||||
palo = default_palette[default_palette_selection];
|
||||
//need to calcualte a deemph on the fly.. sorry. maybe support otherwise later
|
||||
ApplyDeemphasisComplete(palo);
|
||||
}
|
||||
|
||||
void WritePalette(void)
|
||||
{
|
||||
int x;
|
||||
|
|
Loading…
Reference in New Issue