mirror of
https://github.com/retro100/dosbox-wii.git
synced 2025-01-12 18:29:07 +01:00
DosBox_Wii_R1 Wiimpathy https://gbatemp.net/threads/wiiflow-lite.422685/page-76#post-8580238
This commit is contained in:
parent
c9fc90cc15
commit
02a83be576
4
Makefile
4
Makefile
@ -15,7 +15,7 @@ include $(DEVKITPPC)/wii_rules
|
||||
# SOURCES is a list of directories containing source code
|
||||
# INCLUDES is a list of directories containing extra header files
|
||||
#---------------------------------------------------------------------------------
|
||||
TARGET := $(notdir $(CURDIR))
|
||||
TARGET := boot
|
||||
BUILD := build
|
||||
SOURCES := src src/cpu src/debug src/dos src/fpu src/gui \
|
||||
src/hardware src/hardware/serialport src/ints src/libs \
|
||||
@ -105,7 +105,7 @@ export OUTPUT := $(CURDIR)/$(TARGET)
|
||||
#---------------------------------------------------------------------------------
|
||||
$(BUILD):
|
||||
@[ -d $@ ] || mkdir -p $@
|
||||
@make --no-print-directory -C $(BUILD) -f $(CURDIR)/Makefile
|
||||
@make --no-print-directory -j4 -C $(BUILD) -f $(CURDIR)/Makefile
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
clean:
|
||||
|
11
README_R1.txt
Normal file
11
README_R1.txt
Normal file
@ -0,0 +1,11 @@
|
||||
/* DOSBox Wii Version 1.7 R1 (wiimpathy) */
|
||||
|
||||
R1 - April 1, 2016
|
||||
------------------
|
||||
|
||||
* GameCube pad support in-game : add joystick=fcs in Dosbox .conf file.
|
||||
* Navigate menu with GC pad, open it with Start+Z.
|
||||
* Mapper button to remap keyboard/controllers(same as CTRL-F1).
|
||||
* New top menu buttons, from left to right: cycles, frameskip, scaler.
|
||||
Push + or - to increase/decrease cycles/frameskip. Push the tv button to change the filter.
|
||||
* Conf file saved automatically when exiting if values have been modified("config -wc").
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2002-2011 The DOSBox Team
|
||||
* Copyright (C) 2002-2015 The DOSBox Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -30,10 +30,9 @@ void MAPPER_AddHandler(MAPPER_Handler * handler,MapKeys key,Bitu mods,char const
|
||||
void MAPPER_Init(void);
|
||||
void MAPPER_StartUp(Section * sec);
|
||||
void MAPPER_Run(bool pressed);
|
||||
void MAPPER_RunInternal();
|
||||
extern void MAPPER_RunInternal();
|
||||
void MAPPER_LosingFocus(void);
|
||||
|
||||
|
||||
#define MMOD1 0x1
|
||||
#define MMOD2 0x2
|
||||
|
||||
|
@ -83,7 +83,7 @@ public:
|
||||
void WriteOut(const char * format,...); /* Write to standard output */
|
||||
void WriteOut_NoParsing(const char * format); /* Write to standard output, no parsing */
|
||||
void ChangeToLongCmd();
|
||||
|
||||
void writez();
|
||||
};
|
||||
|
||||
typedef void (PROGRAMS_Main)(Program * * make);
|
||||
|
@ -82,3 +82,4 @@ void GFX_CaptureMouse(void);
|
||||
extern bool mouselocked; //true if mouse is confined to window
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -37,6 +37,10 @@
|
||||
|
||||
Bitu DEBUG_EnableDebugger(void);
|
||||
extern void GFX_SetTitle(Bit32s cycles ,Bits frameskip,bool paused);
|
||||
#ifdef HW_RVL
|
||||
extern void CPU_CycleDecrease(bool pressed);
|
||||
extern void CPU_CycleIncrease(bool pressed);
|
||||
#endif
|
||||
|
||||
#if 1
|
||||
#undef LOG
|
||||
@ -2101,8 +2105,11 @@ void CPU_ENTER(bool use32,Bitu bytes,Bitu level) {
|
||||
sp_index-=bytes;
|
||||
reg_esp=(reg_esp&cpu.stack.notmask)|((sp_index)&cpu.stack.mask);
|
||||
}
|
||||
|
||||
#ifdef HW_RVL
|
||||
void CPU_CycleIncrease(bool pressed) {
|
||||
#else
|
||||
static void CPU_CycleIncrease(bool pressed) {
|
||||
#endif
|
||||
if (!pressed) return;
|
||||
if (CPU_CycleAutoAdjust) {
|
||||
CPU_CyclePercUsed+=5;
|
||||
@ -2126,8 +2133,11 @@ static void CPU_CycleIncrease(bool pressed) {
|
||||
GFX_SetTitle(CPU_CycleMax,-1,false);
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef HW_RVL
|
||||
void CPU_CycleDecrease(bool pressed) {
|
||||
#else
|
||||
static void CPU_CycleDecrease(bool pressed) {
|
||||
#endif
|
||||
if (!pressed) return;
|
||||
if (CPU_CycleAutoAdjust) {
|
||||
CPU_CyclePercUsed-=5;
|
||||
|
@ -36,8 +36,13 @@
|
||||
Render_t render;
|
||||
ScalerLineHandler_t RENDER_DrawLine;
|
||||
|
||||
#ifdef HW_RVL
|
||||
extern void IncreaseFrameSkip(bool pressed);
|
||||
extern void DecreaseFrameSkip(bool pressed);
|
||||
extern void ChangeScaler(bool pressed);
|
||||
static void RENDER_CallBack( GFX_CallBackFunctions_t function );
|
||||
|
||||
char filterTxt[15];
|
||||
#endif
|
||||
static void Check_Palette(void) {
|
||||
/* Clean up any previous changed palette data */
|
||||
if (render.pal.changed) {
|
||||
@ -281,14 +286,26 @@ static void RENDER_Reset( void ) {
|
||||
gfx_scalew = 1;
|
||||
gfx_scaleh = 1;
|
||||
}
|
||||
#ifdef HW_RVL
|
||||
if (render.scale.size == 3)
|
||||
render.scale.size=1;
|
||||
#endif
|
||||
|
||||
if ((dblh && dblw) || (render.scale.forced && !dblh && !dblw)) {
|
||||
/* Initialize always working defaults */
|
||||
if (render.scale.size == 2)
|
||||
simpleBlock = &ScaleNormal2x;
|
||||
#if !defined(HW_RVL)
|
||||
else if (render.scale.size == 3)
|
||||
simpleBlock = &ScaleNormal3x;
|
||||
|
||||
else
|
||||
simpleBlock = &ScaleNormal1x;
|
||||
#else
|
||||
else if (render.scale.size < 2)
|
||||
simpleBlock = &ScaleNormal1x;
|
||||
#endif
|
||||
|
||||
/* Maybe override them */
|
||||
#if RENDER_USE_ADVANCED_SCALERS>0
|
||||
switch (render.scale.op) {
|
||||
@ -296,20 +313,26 @@ static void RENDER_Reset( void ) {
|
||||
case scalerOpAdvInterp:
|
||||
if (render.scale.size == 2)
|
||||
complexBlock = &ScaleAdvInterp2x;
|
||||
#if !defined(HW_RVL)
|
||||
else if (render.scale.size == 3)
|
||||
complexBlock = &ScaleAdvInterp3x;
|
||||
#endif
|
||||
break;
|
||||
case scalerOpAdvMame:
|
||||
if (render.scale.size == 2)
|
||||
complexBlock = &ScaleAdvMame2x;
|
||||
#if !defined(HW_RVL)
|
||||
else if (render.scale.size == 3)
|
||||
complexBlock = &ScaleAdvMame3x;
|
||||
#endif
|
||||
break;
|
||||
case scalerOpHQ:
|
||||
if (render.scale.size == 2)
|
||||
complexBlock = &ScaleHQ2x;
|
||||
#if !defined(HW_RVL)
|
||||
else if (render.scale.size == 3)
|
||||
complexBlock = &ScaleHQ3x;
|
||||
#endif
|
||||
break;
|
||||
case scalerOpSuperSaI:
|
||||
if (render.scale.size == 2)
|
||||
@ -327,20 +350,26 @@ static void RENDER_Reset( void ) {
|
||||
case scalerOpTV:
|
||||
if (render.scale.size == 2)
|
||||
simpleBlock = &ScaleTV2x;
|
||||
#if !defined(HW_RVL)
|
||||
else if (render.scale.size == 3)
|
||||
simpleBlock = &ScaleTV3x;
|
||||
#endif
|
||||
break;
|
||||
case scalerOpRGB:
|
||||
if (render.scale.size == 2)
|
||||
simpleBlock = &ScaleRGB2x;
|
||||
#if !defined(HW_RVL)
|
||||
else if (render.scale.size == 3)
|
||||
simpleBlock = &ScaleRGB3x;
|
||||
#endif
|
||||
break;
|
||||
case scalerOpScan:
|
||||
if (render.scale.size == 2)
|
||||
simpleBlock = &ScaleScan2x;
|
||||
#if !defined(HW_RVL)
|
||||
else if (render.scale.size == 3)
|
||||
simpleBlock = &ScaleScan3x;
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -367,11 +396,17 @@ forcenormal:
|
||||
gfx_flags = complexBlock->gfxFlags;
|
||||
xscale = complexBlock->xscale;
|
||||
yscale = complexBlock->yscale;
|
||||
#ifdef HW_RVL
|
||||
sprintf(filterTxt, complexBlock->name);
|
||||
#endif
|
||||
// LOG_MSG("Scaler:%s",complexBlock->name);
|
||||
} else {
|
||||
gfx_flags = simpleBlock->gfxFlags;
|
||||
xscale = simpleBlock->xscale;
|
||||
yscale = simpleBlock->yscale;
|
||||
#ifdef HW_RVL
|
||||
sprintf(filterTxt, simpleBlock->name);
|
||||
#endif
|
||||
// LOG_MSG("Scaler:%s",simpleBlock->name);
|
||||
}
|
||||
switch (render.src.bpp) {
|
||||
@ -535,23 +570,31 @@ void RENDER_SetSize(Bitu width,Bitu height,Bitu bpp,float fps,double ratio,bool
|
||||
}
|
||||
|
||||
extern void GFX_SetTitle(Bit32s cycles, Bits frameskip,bool paused);
|
||||
#ifdef HW_RVL
|
||||
void IncreaseFrameSkip(bool pressed) {
|
||||
#else
|
||||
static void IncreaseFrameSkip(bool pressed) {
|
||||
#endif
|
||||
if (!pressed)
|
||||
return;
|
||||
if (render.frameskip.max<10) render.frameskip.max++;
|
||||
LOG_MSG("Frame Skip at %d",render.frameskip.max);
|
||||
GFX_SetTitle(-1,render.frameskip.max,false);
|
||||
}
|
||||
|
||||
#ifdef HW_RVL
|
||||
void DecreaseFrameSkip(bool pressed) {
|
||||
#else
|
||||
static void DecreaseFrameSkip(bool pressed) {
|
||||
#endif
|
||||
if (!pressed)
|
||||
return;
|
||||
if (render.frameskip.max>0) render.frameskip.max--;
|
||||
LOG_MSG("Frame Skip at %d",render.frameskip.max);
|
||||
GFX_SetTitle(-1,render.frameskip.max,false);
|
||||
}
|
||||
/* Disabled as I don't want to waste a keybind for that. Might be used in the future (Qbix)
|
||||
static void ChangeScaler(bool pressed) {
|
||||
//Disabled as I don't want to waste a keybind for that. Might be used in the future (Qbix)
|
||||
//static void ChangeScaler(bool pressed) {
|
||||
void ChangeScaler(bool pressed) {
|
||||
if (!pressed)
|
||||
return;
|
||||
render.scale.op = (scalerOperation)((int)render.scale.op+1);
|
||||
@ -561,7 +604,7 @@ static void ChangeScaler(bool pressed) {
|
||||
render.scale.size = 1;
|
||||
}
|
||||
RENDER_CallBack( GFX_CallBackReset );
|
||||
} */
|
||||
}
|
||||
|
||||
void RENDER_Init(Section * sec) {
|
||||
Section_prop * section=static_cast<Section_prop *>(sec);
|
||||
|
@ -392,7 +392,6 @@ static SDLKey sdlkey_map[MAX_SCANCODES]={SDLK_UNKNOWN,SDLK_ESCAPE,
|
||||
|
||||
#undef Z
|
||||
|
||||
|
||||
SDLKey MapSDLCode(Bitu skey) {
|
||||
if (usescancodes) {
|
||||
if (skey<MAX_SCANCODES) return sdlkey_map[skey];
|
||||
@ -450,7 +449,6 @@ Bitu GetKeyCode(SDL_keysym keysym) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class CKeyBind;
|
||||
class CKeyBindGroup;
|
||||
|
||||
@ -527,7 +525,6 @@ static struct {
|
||||
bool hat_pressed[16];
|
||||
} virtual_joysticks[2];
|
||||
|
||||
|
||||
class CJAxisBind;
|
||||
class CJButtonBind;
|
||||
class CJHatBind;
|
||||
@ -636,6 +633,7 @@ public:
|
||||
JOYSTICK_Enable(emustick,true);
|
||||
|
||||
sdl_joystick=SDL_JoystickOpen(_stick);
|
||||
|
||||
if (sdl_joystick==NULL) {
|
||||
button_wrap=emulated_buttons;
|
||||
return;
|
||||
@ -710,7 +708,6 @@ public:
|
||||
SDL_JoyAxisEvent * jaxis = NULL;
|
||||
SDL_JoyButtonEvent * jbutton = NULL;
|
||||
Bitu but = 0;
|
||||
|
||||
switch(event->type) {
|
||||
case SDL_JOYAXISMOTION:
|
||||
jaxis = &event->jaxis;
|
||||
@ -1531,7 +1528,6 @@ protected:
|
||||
Bitu stick,hat,dir;
|
||||
};
|
||||
|
||||
|
||||
class CModEvent : public CTriggeredEvent {
|
||||
public:
|
||||
CModEvent(char const * const _entry,Bitu _wmod) : CTriggeredEvent(_entry) {
|
||||
@ -1617,13 +1613,11 @@ static struct {
|
||||
CCheckButton * mod1,* mod2,* mod3,* hold;
|
||||
} bind_but;
|
||||
|
||||
|
||||
static void change_action_text(const char* text,Bit8u col) {
|
||||
bind_but.action->Change(text,"");
|
||||
bind_but.action->SetColor(col);
|
||||
}
|
||||
|
||||
|
||||
static void SetActiveBind(CBind * _bind) {
|
||||
mapper.abind=_bind;
|
||||
if (_bind) {
|
||||
@ -1931,9 +1925,7 @@ static void CreateLayout(void) {
|
||||
new CTextButton(PX(XO+4),PY(YO-1),3*BW,20,"Disabled");
|
||||
new CTextButton(PX(XO+8),PY(YO-1),3*BW,20,"Disabled");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* The modifier buttons */
|
||||
AddModButton(PX(0),PY(14),50,20,"Mod1",1);
|
||||
AddModButton(PX(2),PY(14),50,20,"Mod2",2);
|
||||
@ -2206,7 +2198,11 @@ static void InitializeJoysticks(void) {
|
||||
SDL_JoystickClose(tmp_stick1);
|
||||
}
|
||||
bool second_usable=false;
|
||||
#ifdef HW_RVL
|
||||
SDL_Joystick* tmp_stick2=SDL_JoystickOpen(4);
|
||||
#else
|
||||
SDL_Joystick* tmp_stick2=SDL_JoystickOpen(1);
|
||||
#endif
|
||||
if (tmp_stick2) {
|
||||
if ((SDL_JoystickNumAxes(tmp_stick2)>1) || (SDL_JoystickNumButtons(tmp_stick2)>0)) {
|
||||
second_usable=true;
|
||||
@ -2268,8 +2264,13 @@ static void CreateBindGroups(void) {
|
||||
new CStickBindGroup(joyno,joyno+1U,true);
|
||||
break;
|
||||
case JOY_FCS:
|
||||
#ifdef HW_RVL
|
||||
mapper.sticks.stick[mapper.sticks.num_groups++]=new CFCSBindGroup(0,joyno);
|
||||
mapper.sticks.stick[mapper.sticks.num_groups++]=new CFCSBindGroup(4,joyno+1U);
|
||||
#else
|
||||
mapper.sticks.stick[mapper.sticks.num_groups++]=new CFCSBindGroup(joyno,joyno);
|
||||
new CStickBindGroup(joyno+1U,joyno+1U,true);
|
||||
#endif
|
||||
break;
|
||||
case JOY_CH:
|
||||
mapper.sticks.stick[mapper.sticks.num_groups++]=new CCHBindGroup(joyno,joyno);
|
||||
@ -2278,11 +2279,22 @@ static void CreateBindGroups(void) {
|
||||
case JOY_2AXIS:
|
||||
default:
|
||||
mapper.sticks.stick[mapper.sticks.num_groups++]=new CStickBindGroup(joyno,joyno);
|
||||
#ifdef HW_RVL
|
||||
mapper.sticks.stick[mapper.sticks.num_groups++]=new CStickBindGroup(4,joyno);
|
||||
if((joyno+1U) < mapper.sticks.num) {
|
||||
mapper.sticks.stick[mapper.sticks.num_groups++]=new CStickBindGroup(1,joyno+1U);
|
||||
mapper.sticks.stick[mapper.sticks.num_groups++]=new CStickBindGroup(5,joyno+1U);
|
||||
} else {
|
||||
new CStickBindGroup(1,joyno+1U,true);
|
||||
new CStickBindGroup(5,joyno+1U,true);
|
||||
}
|
||||
#else
|
||||
if((joyno+1U) < mapper.sticks.num) {
|
||||
mapper.sticks.stick[mapper.sticks.num_groups++]=new CStickBindGroup(joyno+1U,joyno+1U);
|
||||
} else {
|
||||
new CStickBindGroup(joyno+1U,joyno+1U,true);
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2380,6 +2392,7 @@ void MAPPER_Init(void) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Somehow including them at the top conflicts with something in setup.h
|
||||
#ifdef C_X11_XKB
|
||||
#include "SDL_syswm.h"
|
||||
|
@ -134,6 +134,16 @@ struct private_hwdata {
|
||||
#include <os2.h>
|
||||
#endif
|
||||
|
||||
#ifdef HW_RVL
|
||||
#include "mapper.h"
|
||||
extern int option;
|
||||
extern bool savecfg;
|
||||
int CyclesDisplay;
|
||||
int FrameskipDisplay;
|
||||
extern char filterTxt[15];
|
||||
void ChangeScaler(bool pressed);
|
||||
#endif
|
||||
|
||||
enum SCREEN_TYPES {
|
||||
SCREEN_SURFACE,
|
||||
SCREEN_SURFACE_DDRAW,
|
||||
@ -150,7 +160,6 @@ enum PRIORITY_LEVELS {
|
||||
PRIORITY_LEVEL_HIGHEST
|
||||
};
|
||||
|
||||
|
||||
struct SDL_Block {
|
||||
bool inited;
|
||||
bool active; //If this isn't set don't draw
|
||||
@ -246,6 +255,9 @@ void GFX_SetTitle(Bit32s cycles,Bits frameskip,bool paused){
|
||||
sprintf(title,"DOSBox %s, CPU speed: %8d cycles, Frameskip %2d, Program: %8s",VERSION,internal_cycles,internal_frameskip,RunningProgram);
|
||||
}
|
||||
|
||||
CyclesDisplay=internal_cycles;
|
||||
FrameskipDisplay=internal_frameskip;
|
||||
|
||||
if(paused) strcat(title," PAUSED");
|
||||
SDL_WM_SetCaption(title,VERSION);
|
||||
}
|
||||
@ -578,6 +590,7 @@ dosurface:
|
||||
if (sdl.blit.surface) {
|
||||
SDL_FreeSurface(sdl.blit.surface);
|
||||
sdl.blit.surface=0;
|
||||
|
||||
}
|
||||
LOG_MSG("Failed to create ddraw surface, back to normal surface.");
|
||||
goto dosurface;
|
||||
@ -848,6 +861,7 @@ bool GFX_StartUpdate(Bit8u * & pixels,Bitu & pitch) {
|
||||
pitch=sdl.blit.surface->pitch;
|
||||
sdl.updating=true;
|
||||
return true;
|
||||
|
||||
#endif
|
||||
case SCREEN_OVERLAY:
|
||||
if (SDL_LockYUVOverlay(sdl.overlay)) return false;
|
||||
@ -1346,6 +1360,7 @@ static void GUI_StartUp(Section * sec) {
|
||||
}
|
||||
|
||||
if (use_fadeout) {
|
||||
|
||||
SDL_FillRect(sdl.surface, NULL, SDL_MapRGB(sdl.surface->format, 0, 0, 0));
|
||||
SDL_Flip(sdl.surface);
|
||||
}
|
||||
@ -1438,15 +1453,63 @@ bool GFX_IsFullscreen(void) {
|
||||
return sdl.desktop.fullscreen;
|
||||
}
|
||||
|
||||
#ifdef HW_RVL
|
||||
void HandleCfg(void) {
|
||||
Section *sec = NULL;
|
||||
char ScalerTxt[20];
|
||||
char CyclesTxt[15];
|
||||
char frameskipTxt[15];
|
||||
|
||||
sec = control->GetSection("render");
|
||||
|
||||
for(int i = 0; filterTxt[i]; i++) {
|
||||
filterTxt[i] = tolower(filterTxt[i]);
|
||||
}
|
||||
|
||||
sprintf(ScalerTxt, "scaler=%s", filterTxt);
|
||||
sec->HandleInputline(std::string(ScalerTxt));
|
||||
sprintf(frameskipTxt, "frameskip=%d", FrameskipDisplay);
|
||||
sec->HandleInputline(std::string(frameskipTxt));
|
||||
|
||||
sec = control->GetSection("cpu");
|
||||
sprintf(CyclesTxt, "cycles=%d", CyclesDisplay);
|
||||
sec->HandleInputline(std::string(CyclesTxt));
|
||||
|
||||
// Values have changed, save dosbox .cfg when exiting
|
||||
savecfg=true;
|
||||
option=0;
|
||||
}
|
||||
#endif
|
||||
|
||||
void GFX_Events() {
|
||||
#ifdef HW_RVL
|
||||
// check for home button
|
||||
u32 btns;
|
||||
u16 btns_gc;
|
||||
for(int i=0; i<4; i++)
|
||||
{
|
||||
btns = WPAD_ButtonsHeld(i);
|
||||
if((btns & WPAD_BUTTON_HOME) || (btns & WPAD_CLASSIC_BUTTON_HOME))
|
||||
btns_gc = PAD_ButtonsHeld(i);
|
||||
if((btns & WPAD_BUTTON_HOME) || (btns & WPAD_CLASSIC_BUTTON_HOME) || ((btns_gc & PAD_BUTTON_START) && (btns_gc & PAD_TRIGGER_Z)) )
|
||||
WiiMenu ();
|
||||
|
||||
// Call the Mapper
|
||||
if(option == 1)
|
||||
{
|
||||
MAPPER_RunInternal();
|
||||
option=0;
|
||||
}
|
||||
// Change cycles and frameskip
|
||||
else if(option==2)
|
||||
{
|
||||
HandleCfg();
|
||||
}
|
||||
// Change the scaler
|
||||
else if(option==3)
|
||||
{
|
||||
ChangeScaler(true);
|
||||
HandleCfg();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -2057,7 +2120,6 @@ int main(int argc, char* argv[]) {
|
||||
GFX_SwitchFullScreen();
|
||||
}
|
||||
}
|
||||
|
||||
/* Init the keyMapper */
|
||||
MAPPER_Init();
|
||||
if (control->cmdline->FindExist("-startmapper")) MAPPER_RunInternal();
|
||||
@ -2071,6 +2133,7 @@ int main(int argc, char* argv[]) {
|
||||
} catch (char * error) {
|
||||
#if defined (WIN32)
|
||||
sticky_keys(true);
|
||||
|
||||
#endif
|
||||
GFX_ShowMsg("Exit to error: %s",error);
|
||||
fflush(NULL);
|
||||
@ -2108,6 +2171,7 @@ int main(int argc, char* argv[]) {
|
||||
WiiFinished();
|
||||
#endif
|
||||
SDL_Quit();//Let's hope sdl will quit as well when it catches an exception
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -32,6 +32,10 @@
|
||||
#include "control.h"
|
||||
#include "shell.h"
|
||||
|
||||
#ifdef HW_RVL
|
||||
extern void SaveConfig(bool pressed);
|
||||
#endif
|
||||
|
||||
Bitu call_program;
|
||||
|
||||
/* This registers a file on the virtual drive and creates the correct structure for it*/
|
||||
@ -67,8 +71,6 @@ void PROGRAMS_MakeFile(char const * const name,PROGRAMS_Main * main) {
|
||||
VFILE_Register(name,comdata,size);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static Bitu PROGRAMS_Handler(void) {
|
||||
/* This sets up everything for a program start up call */
|
||||
Bitu size=sizeof(Bit8u);
|
||||
@ -250,6 +252,9 @@ void restart_program(std::vector<std::string> & parameters);
|
||||
class CONFIG : public Program {
|
||||
public:
|
||||
void Run(void);
|
||||
#ifdef HW_RVL
|
||||
void Write();
|
||||
#endif
|
||||
private:
|
||||
void restart(const char* useconfig);
|
||||
|
||||
@ -276,6 +281,8 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
void CONFIG::Run(void) {
|
||||
static const char* const params[] = {
|
||||
"-r", "-wcp", "-wcd", "-wc", "-writeconf", "-l", "-rmconf",
|
||||
@ -749,6 +756,19 @@ static void CONFIG_ProgramStart(Program * * make) {
|
||||
*make=new CONFIG;
|
||||
}
|
||||
|
||||
#ifdef HW_RVL
|
||||
void CONFIG::Write(void) {
|
||||
writeconf(control->configfiles[0], false);
|
||||
}
|
||||
|
||||
void SaveConfig(bool pressed) {
|
||||
if (!pressed)
|
||||
return;
|
||||
|
||||
CONFIG config;
|
||||
config.Write();
|
||||
}
|
||||
#endif
|
||||
|
||||
void PROGRAMS_Init(Section* /*sec*/) {
|
||||
/* Setup a special callback to start virtual programs */
|
||||
|
@ -103,4 +103,10 @@ extern const u32 player3_point_png_size;
|
||||
extern const u8 player4_point_png[];
|
||||
extern const u32 player4_point_png_size;
|
||||
|
||||
extern const u8 tv_png[];
|
||||
extern const u32 tv_png_size;
|
||||
|
||||
extern const u8 tv_over_png[];
|
||||
extern const u32 tv_over_png_size;
|
||||
|
||||
#endif
|
||||
|
BIN
src/platform/wii/images/tv.png
Normal file
BIN
src/platform/wii/images/tv.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 995 B |
BIN
src/platform/wii/images/tv_over.png
Normal file
BIN
src/platform/wii/images/tv_over.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 965 B |
@ -109,3 +109,4 @@ bool MenuRequested()
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -19,12 +19,17 @@
|
||||
#include "libwiigui/gui.h"
|
||||
#include "wiihardware.h"
|
||||
|
||||
#include "cpu.h"
|
||||
|
||||
#define THREAD_SLEEP 100
|
||||
#define APPVERSION "1.7"
|
||||
|
||||
static GuiImageData * pointer[4];
|
||||
static GuiWindow * mainWindow = NULL;
|
||||
static GuiButton * logoBtn = NULL;
|
||||
static GuiText * cycleText = NULL;
|
||||
static GuiText * fskipText = NULL;
|
||||
static GuiText * filterBtnTxt = NULL;
|
||||
|
||||
static lwp_t guithread = LWP_THREAD_NULL;
|
||||
static lwp_t creditsthread = LWP_THREAD_NULL;
|
||||
@ -32,6 +37,23 @@ static bool guiHalt = true;
|
||||
static bool ExitRequested = false;
|
||||
static bool creditsOpen = false;
|
||||
|
||||
int option=0;
|
||||
bool savecfg=false;
|
||||
extern int CyclesDisplay;
|
||||
extern int FrameskipDisplay;
|
||||
extern Bit32s CPU_CycleUp;
|
||||
extern Bit32s CPU_CycleDown;
|
||||
extern char filterTxt[15];
|
||||
int cyclez;
|
||||
int fskip;
|
||||
|
||||
void SaveConfig(bool pressed);
|
||||
void CPU_CycleDecrease(bool pressed);
|
||||
void CPU_CycleIncrease(bool pressed);
|
||||
void IncreaseFrameSkip(bool pressed);
|
||||
void DecreaseFrameSkip(bool pressed);
|
||||
void ChangeScaler(bool pressed);
|
||||
|
||||
/****************************************************************************
|
||||
* UpdateGUI
|
||||
*
|
||||
@ -79,6 +101,11 @@ static void * UpdateGUI (void *arg)
|
||||
ShutoffRumble();
|
||||
VIDEO_SetBlack(TRUE);
|
||||
VIDEO_Flush();
|
||||
|
||||
// Save dosbox .cfg file
|
||||
if(savecfg)
|
||||
SaveConfig(true);
|
||||
|
||||
throw(0);
|
||||
}
|
||||
usleep(THREAD_SLEEP);
|
||||
@ -304,13 +331,107 @@ static void DisplayCredits(void * ptr)
|
||||
LWP_CreateThread (&creditsthread, WindowCredits, NULL, NULL, 0, 60);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* CpuCycleUpdate
|
||||
*
|
||||
* Increase or decrease CPU cycles.
|
||||
***************************************************************************/
|
||||
static void CpuCycleUpdate(void * ptr, bool increase)
|
||||
{
|
||||
GuiButton * b = (GuiButton *)ptr;
|
||||
if(b->GetState() == STATE_CLICKED)
|
||||
{
|
||||
char cycleTxt[10];
|
||||
|
||||
if(increase)
|
||||
{
|
||||
if (CPU_CycleUp < 100)
|
||||
{
|
||||
cyclez = (Bit32s)(CyclesDisplay * (1 + (float)CPU_CycleUp / 100.0));
|
||||
}
|
||||
else
|
||||
{
|
||||
cyclez = (Bit32s)(CyclesDisplay + CPU_CycleUp);
|
||||
}
|
||||
|
||||
sprintf(cycleTxt, "%d",cyclez);
|
||||
cycleText->SetText(cycleTxt);
|
||||
CPU_CycleIncrease(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (CPU_CycleDown < 100)
|
||||
{
|
||||
cyclez = (Bit32s)(CyclesDisplay / (1 + (float)CPU_CycleDown / 100.0));
|
||||
}
|
||||
else
|
||||
{
|
||||
cyclez = (Bit32s)(CyclesDisplay - CPU_CycleDown);
|
||||
}
|
||||
|
||||
sprintf(cycleTxt, "%d",cyclez);
|
||||
cycleText->SetText(cycleTxt);
|
||||
CPU_CycleDecrease(true);
|
||||
}
|
||||
CyclesDisplay=cyclez;
|
||||
b->ResetState();
|
||||
option=2;
|
||||
}
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* RenderFskipUpdate
|
||||
*
|
||||
* Increase or decrease frameskip.
|
||||
***************************************************************************/
|
||||
static void RenderFskipUpdate(void * ptr, bool increase)
|
||||
{
|
||||
GuiButton * b = (GuiButton *)ptr;
|
||||
if(b->GetState() == STATE_CLICKED)
|
||||
{
|
||||
char fskipTxt[10];
|
||||
|
||||
if(fskip < 0)
|
||||
fskip=0;
|
||||
|
||||
if(increase)
|
||||
{
|
||||
fskip=FrameskipDisplay;
|
||||
fskip++;
|
||||
sprintf(fskipTxt, "%d",fskip);
|
||||
fskipText->SetText(fskipTxt);
|
||||
IncreaseFrameSkip(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
fskip=FrameskipDisplay;
|
||||
fskip--;
|
||||
if(fskip < 0)
|
||||
fskip=0;
|
||||
sprintf(fskipTxt, "%d",fskip);
|
||||
fskipText->SetText(fskipTxt);
|
||||
DecreaseFrameSkip(true);
|
||||
}
|
||||
|
||||
FrameskipDisplay=fskip;
|
||||
b->ResetState();
|
||||
option=2;
|
||||
}
|
||||
}
|
||||
|
||||
static void CpuCycleDecrease(void * ptr) { CpuCycleUpdate(ptr, false); }
|
||||
static void CpuCycleIncrease(void * ptr) { CpuCycleUpdate(ptr, true); }
|
||||
|
||||
static void RenderFskipDecrease(void * ptr) { RenderFskipUpdate(ptr, false); }
|
||||
static void RenderFskipIncrease(void * ptr) { RenderFskipUpdate(ptr, true); }
|
||||
|
||||
/****************************************************************************
|
||||
* HomeMenu
|
||||
***************************************************************************/
|
||||
void HomeMenu ()
|
||||
{
|
||||
ResetVideo_Menu();
|
||||
|
||||
|
||||
pointer[0] = new GuiImageData(player1_point_png);
|
||||
pointer[1] = new GuiImageData(player2_point_png);
|
||||
pointer[2] = new GuiImageData(player3_point_png);
|
||||
@ -366,12 +487,110 @@ void HomeMenu ()
|
||||
logoBtn->SetTrigger(&trigA);
|
||||
logoBtn->SetUpdateCallback(DisplayCredits);
|
||||
|
||||
char CyclesTxt[15];
|
||||
char FskipTxt[15];
|
||||
sprintf(CyclesTxt, "%d", CyclesDisplay);
|
||||
sprintf(FskipTxt, "%d", FrameskipDisplay);
|
||||
|
||||
cycleText = new GuiText(NULL, 20, (GXColor){255, 255, 255, 255});
|
||||
cycleText->SetText(CyclesTxt);
|
||||
cycleText->SetPosition(-215, -180);
|
||||
|
||||
fskipText = new GuiText(NULL, 20, (GXColor){255, 255, 255, 255});
|
||||
fskipText->SetText(FskipTxt);
|
||||
fskipText->SetPosition(-45, -180);
|
||||
|
||||
GuiText cycleDecBtnTxt("-", 24, (GXColor){0, 0, 0, 255});
|
||||
GuiImageData cycleDec(keyboard_key_png);
|
||||
GuiImage cycleDecImg(&cycleDec);
|
||||
GuiImageData cycleDecOver(keyboard_key_over_png);
|
||||
GuiImage cycleDecOverImg(&cycleDecOver);
|
||||
GuiButton cycleDecBtn(cycleDec.GetWidth(), cycleDec.GetHeight());
|
||||
cycleDecBtn.SetImage(&cycleDecImg);
|
||||
cycleDecBtn.SetImageOver(&cycleDecOverImg);
|
||||
cycleDecBtn.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
cycleDecBtn.SetPosition(-270, -180);
|
||||
cycleDecBtn.SetLabel(&cycleDecBtnTxt);
|
||||
cycleDecBtn.SetTrigger(&trigA);
|
||||
cycleDecBtn.SetUpdateCallback(CpuCycleDecrease);
|
||||
|
||||
GuiText cycleIncBtnTxt("+", 24, (GXColor){0, 0, 0, 255});
|
||||
GuiImageData cycleInc(keyboard_key_png);
|
||||
GuiImage cycleIncImg(&cycleInc);
|
||||
GuiImageData cycleIncOver(keyboard_key_over_png);
|
||||
GuiImage cycleIncOverImg(&cycleIncOver);
|
||||
GuiButton cycleIncBtn(cycleInc.GetWidth(), cycleInc.GetHeight());
|
||||
cycleIncBtn.SetImage(&cycleIncImg);
|
||||
cycleIncBtn.SetImageOver(&cycleIncOverImg);
|
||||
cycleIncBtn.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
cycleIncBtn.SetPosition(-160, -180);
|
||||
cycleIncBtn.SetLabel(&cycleIncBtnTxt);
|
||||
cycleIncBtn.SetTrigger(&trigA);
|
||||
cycleIncBtn.SetUpdateCallback(CpuCycleIncrease);
|
||||
|
||||
GuiText fskipDecBtnTxt("-", 24, (GXColor){0, 0, 0, 255});
|
||||
GuiImageData fskipDec(keyboard_key_png);
|
||||
GuiImage fskipDecImg(&fskipDec);
|
||||
GuiImageData fskipDecOver(keyboard_key_over_png);
|
||||
GuiImage fskipDecOverImg(&fskipDecOver);
|
||||
GuiButton fskipDecBtn(fskipDec.GetWidth(), fskipDec.GetHeight());
|
||||
fskipDecBtn.SetImage(&fskipDecImg);
|
||||
fskipDecBtn.SetImageOver(&fskipDecOverImg);
|
||||
fskipDecBtn.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
fskipDecBtn.SetPosition(-80, -180);
|
||||
fskipDecBtn.SetLabel(&fskipDecBtnTxt);
|
||||
fskipDecBtn.SetTrigger(&trigA);
|
||||
fskipDecBtn.SetUpdateCallback(RenderFskipDecrease);
|
||||
|
||||
GuiText fskipIncBtnTxt("+", 24, (GXColor){0, 0, 0, 255});
|
||||
GuiImageData fskipInc(keyboard_key_png);
|
||||
GuiImage fskipIncImg(&fskipInc);
|
||||
GuiImageData fskipIncOver(keyboard_key_over_png);
|
||||
GuiImage fskipIncOverImg(&fskipIncOver);
|
||||
GuiButton fskipIncBtn(fskipInc.GetWidth(), fskipInc.GetHeight());
|
||||
fskipIncBtn.SetImage(&fskipIncImg);
|
||||
fskipIncBtn.SetImageOver(&fskipIncOverImg);
|
||||
fskipIncBtn.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
fskipIncBtn.SetPosition(0, -180);
|
||||
fskipIncBtn.SetLabel(&fskipIncBtnTxt);
|
||||
fskipIncBtn.SetTrigger(&trigA);
|
||||
fskipIncBtn.SetUpdateCallback(RenderFskipIncrease);
|
||||
|
||||
filterBtnTxt = new GuiText(NULL, 20, (GXColor){255, 255, 255, 255});
|
||||
filterBtnTxt->SetText(filterTxt);
|
||||
filterBtnTxt->SetAlignment(ALIGN_CENTRE, ALIGN_BOTTOM);
|
||||
GuiImageData filter(tv_png);
|
||||
GuiImage filterImg(&filter);
|
||||
GuiImageData filterOver(tv_over_png);
|
||||
GuiImage filterOverImg(&filterOver);
|
||||
GuiButton filterBtn(filter.GetWidth(), filter.GetHeight());
|
||||
filterBtn.SetImage(&filterImg);
|
||||
filterBtn.SetImageOver(&filterOverImg);
|
||||
filterBtn.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
|
||||
filterBtn.SetPosition(80, -180);
|
||||
filterBtn.SetLabel(filterBtnTxt);
|
||||
filterBtn.SetTrigger(&trigA);
|
||||
|
||||
GuiText remapBtnTxt("Mapper", 24, (GXColor){0, 0, 0, 255});
|
||||
GuiImage remapBtnImg(&btnLargeOutline);
|
||||
GuiImage remapBtnImgOver(&btnLargeOutlineOver);
|
||||
GuiButton remapBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
|
||||
remapBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
remapBtn.SetPosition(125, 250);
|
||||
remapBtn.SetLabel(&remapBtnTxt);
|
||||
remapBtn.SetImage(&remapBtnImg);
|
||||
remapBtn.SetImageOver(&remapBtnImgOver);
|
||||
remapBtn.SetSoundOver(&btnSoundOver);
|
||||
remapBtn.SetSoundClick(&btnSoundClick);
|
||||
remapBtn.SetTrigger(&trigA);
|
||||
remapBtn.SetEffectGrow();
|
||||
|
||||
GuiText exitBtnTxt("Exit", 24, (GXColor){0, 0, 0, 255});
|
||||
GuiImage exitBtnImg(&btnLargeOutline);
|
||||
GuiImage exitBtnImgOver(&btnLargeOutlineOver);
|
||||
GuiButton exitBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
|
||||
exitBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
exitBtn.SetPosition(-125, 120);
|
||||
exitBtn.SetPosition(-125, 110);
|
||||
exitBtn.SetLabel(&exitBtnTxt);
|
||||
exitBtn.SetImage(&exitBtnImg);
|
||||
exitBtn.SetImageOver(&exitBtnImgOver);
|
||||
@ -385,7 +604,7 @@ void HomeMenu ()
|
||||
GuiImage keyboardBtnImgOver(&btnLargeOutlineOver);
|
||||
GuiButton keyboardBtn(btnLargeOutline.GetWidth(), btnLargeOutline.GetHeight());
|
||||
keyboardBtn.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
|
||||
keyboardBtn.SetPosition(125, 120);
|
||||
keyboardBtn.SetPosition(125, 110);
|
||||
keyboardBtn.SetLabel(&keyboardBtnTxt);
|
||||
keyboardBtn.SetImage(&keyboardBtnImg);
|
||||
keyboardBtn.SetImageOver(&keyboardBtnImgOver);
|
||||
@ -463,6 +682,14 @@ void HomeMenu ()
|
||||
w.Append(logoBtn);
|
||||
w.Append(&closeBtn);
|
||||
w.Append(&exitBtn);
|
||||
w.Append(&remapBtn);
|
||||
w.Append(cycleText);
|
||||
w.Append(fskipText);
|
||||
w.Append(&cycleDecBtn);
|
||||
w.Append(&cycleIncBtn);
|
||||
w.Append(&fskipDecBtn);
|
||||
w.Append(&fskipIncBtn);
|
||||
w.Append(&filterBtn);
|
||||
w.Append(&keyboardBtn);
|
||||
|
||||
mainWindow->Append(&screenImg);
|
||||
@ -554,6 +781,19 @@ void HomeMenu ()
|
||||
if(dosboxCommand[0] != 0)
|
||||
break;
|
||||
}
|
||||
else if(remapBtn.GetState() == STATE_CLICKED)
|
||||
{
|
||||
remapBtn.ResetState();
|
||||
option=1;
|
||||
break;
|
||||
}
|
||||
else if(filterBtn.GetState() == STATE_CLICKED)
|
||||
{
|
||||
filterBtn.ResetState();
|
||||
option=3;
|
||||
filterBtnTxt->SetText(filterTxt);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ShutoffRumble();
|
||||
@ -580,6 +820,8 @@ void HomeMenu ()
|
||||
delete pointer[1];
|
||||
delete pointer[2];
|
||||
delete pointer[3];
|
||||
delete(cycleText);
|
||||
delete(fskipText);
|
||||
|
||||
mainWindow = NULL;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user