mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2025-03-01 09:15:37 +01:00
commit
cdf21a9f32
26
gx/config.c
26
gx/config.c
@ -162,6 +162,8 @@ void config_default(void)
|
||||
#ifdef HW_RVL
|
||||
config.trap = 0;
|
||||
config.gamma = VI_GM_1_0 / 10.0;
|
||||
#else
|
||||
config.v_prog = 1;
|
||||
#endif
|
||||
|
||||
/* NTSC filter options */
|
||||
@ -183,25 +185,31 @@ void config_default(void)
|
||||
/* menu options */
|
||||
config.autoload = 0;
|
||||
config.autocheat = 0;
|
||||
#ifdef HW_RVL
|
||||
config.s_auto = 1;
|
||||
config.autosleep = 1;
|
||||
#else
|
||||
config.s_auto = 0;
|
||||
config.v_prog = 1;
|
||||
#endif
|
||||
config.s_default = 1;
|
||||
config.s_device = 0;
|
||||
config.bg_overlay = 0;
|
||||
config.screen_w = 658;
|
||||
config.bgm_volume = 100.0;
|
||||
config.sfx_volume = 100.0;
|
||||
#ifdef HW_RVL
|
||||
config.autosleep = 1;
|
||||
config.calx = 0;
|
||||
config.caly = 0;
|
||||
#endif
|
||||
|
||||
/* default ROM directories */
|
||||
#ifdef HW_RVL
|
||||
char dir[16];
|
||||
getcwd(dir, 16);
|
||||
config.l_device = strstr(dir, "sd") ? TYPE_SD : TYPE_USB;
|
||||
DIR *dir = opendir("sd:/");
|
||||
if (dir)
|
||||
{
|
||||
config.l_device = TYPE_SD;
|
||||
closedir(dir);
|
||||
}
|
||||
else
|
||||
{
|
||||
config.l_device = TYPE_USB;
|
||||
}
|
||||
sprintf (config.lastdir[0][TYPE_SD], "sd:%s/roms/", DEFAULT_PATH);
|
||||
sprintf (config.lastdir[1][TYPE_SD], "sd:%s/roms/", DEFAULT_PATH);
|
||||
sprintf (config.lastdir[2][TYPE_SD], "sd:%s/roms/", DEFAULT_PATH);
|
||||
|
@ -98,6 +98,8 @@ typedef struct
|
||||
#ifdef HW_RVL
|
||||
uint32 wpad_keymap[4*3][MAX_KEYS];
|
||||
uint8 autosleep;
|
||||
int32 calx;
|
||||
int32 caly;
|
||||
#endif
|
||||
uint8 autoload;
|
||||
uint8 autocheat;
|
||||
|
@ -401,7 +401,7 @@ static gui_item items_video[16] =
|
||||
|
||||
/* Menu options */
|
||||
#ifdef HW_RVL
|
||||
static gui_item items_prefs[12] =
|
||||
static gui_item items_prefs[13] =
|
||||
#else
|
||||
static gui_item items_prefs[11] =
|
||||
#endif
|
||||
@ -419,6 +419,7 @@ static gui_item items_prefs[11] =
|
||||
{NULL,NULL,"Show FPS: OFF", "Enable/disable FPS counter", 56,132,276,48},
|
||||
#ifdef HW_RVL
|
||||
{NULL,NULL,"Wiimote Timeout: OFF","Enable/disable Wii remote automatic shutodwn", 56,132,276,48},
|
||||
{NULL,NULL,"Wiimote Calibration: AUTO","Calibrate Wii remote pointer", 56,132,276,48},
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -698,8 +699,10 @@ static void prefmenu ()
|
||||
sprintf (items[9].text, "Show CD Leds: %s", config.cd_leds ? "ON":"OFF");
|
||||
sprintf (items[10].text, "Show FPS: %s", config.fps ? "ON":"OFF");
|
||||
#ifdef HW_RVL
|
||||
sprintf (items[11].text, "Wiimote Timeout: %s", config.autosleep ? "5min":"30min");
|
||||
m->max_items = 12;
|
||||
sprintf (items[11].text, "Wiimote Timeout: %s", config.autosleep ? "5 MIN":"30 MIN");
|
||||
sprintf (items[12].text, "Wiimote Calibration: %s", ((config.calx * config.caly) != 0) ? "MANUAL":"AUTO");
|
||||
sprintf (items[12].comment, "%s", ((config.calx * config.caly) != 0) ? "Reset default Wii remote pointer calibration":"Calibrate Wii remote pointer");
|
||||
m->max_items = 13;
|
||||
#else
|
||||
m->max_items = 11;
|
||||
#endif
|
||||
@ -803,6 +806,27 @@ static void prefmenu ()
|
||||
sprintf (items[11].text, "Wiimote Timeout: %s", config.autosleep ? "5min":"30min");
|
||||
WPAD_SetIdleTimeout(config.autosleep ? 300 : 1800);
|
||||
break;
|
||||
|
||||
case 12: /*** Wii remote pointer calibration ***/
|
||||
if ((config.calx * config.caly) == 0)
|
||||
{
|
||||
if (GUI_WaitConfirm("Pointer Calibration","Aim center of TV screen"))
|
||||
{
|
||||
sprintf (items[12].text, "Wiimote Calibration: MANUAL");
|
||||
sprintf (items[12].comment, "Reset default Wii remote pointer calibration");
|
||||
config.calx = 320 - m_input.ir.x;
|
||||
config.caly = 240 - m_input.ir.y;
|
||||
m_input.ir.x = 320;
|
||||
m_input.ir.y = 240;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sprintf (items[12].text, "Wiimote Calibration: AUTO");
|
||||
sprintf (items[12].comment, "Calibrate Wii remote pointer");
|
||||
config.calx = config.caly = 0;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
case -1:
|
||||
|
@ -381,10 +381,10 @@ static void pad_update(s8 chan, u8 i)
|
||||
input.analog[0][1] -= y / ANALOG_SENSITIVITY;
|
||||
|
||||
/* Limits */
|
||||
if (input.analog[0][0] < 0x17c) input.analog[0][0] = 0x17c;
|
||||
else if (input.analog[0][0] > 0x3c) input.analog[0][0] = 0x3c;
|
||||
if (input.analog[0][0] > 0x17c) input.analog[0][0] = 0x17c;
|
||||
else if (input.analog[0][0] < 0x3c) input.analog[0][0] = 0x3c;
|
||||
if (input.analog[0][1] < 0x1fc) input.analog[0][1] = 0x1fc;
|
||||
else if (input.analog[0][1] > 0x3f3) input.analog[0][1] = 0x3f3;
|
||||
else if (input.analog[0][1] > 0x2f7) input.analog[0][1] = 0x2f7;
|
||||
|
||||
/* PEN button */
|
||||
if (p & pad_keymap[KEY_BUTTONA]) input.pad[0] |= INPUT_PICO_RED;
|
||||
@ -858,8 +858,8 @@ static void wpad_update(s8 chan, u8 i, u32 exp)
|
||||
if (ir.valid)
|
||||
{
|
||||
/* screen position */
|
||||
input.analog[i][0] = (ir.x * bitmap.viewport.w) / 640;
|
||||
input.analog[i][1] = (ir.y * bitmap.viewport.h) / 480;
|
||||
input.analog[i][0] = ((ir.x + config.calx) * bitmap.viewport.w) / 640;
|
||||
input.analog[i][1] = ((ir.y + config.caly) * bitmap.viewport.h) / 480;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -956,10 +956,10 @@ static void wpad_update(s8 chan, u8 i, u32 exp)
|
||||
input.analog[0][1] -= y / ANALOG_SENSITIVITY;
|
||||
|
||||
/* Limits */
|
||||
if (input.analog[0][0] < 0x17c) input.analog[0][0] = 0x17c;
|
||||
else if (input.analog[0][0] > 0x3c) input.analog[0][0] = 0x3c;
|
||||
if (input.analog[0][0] > 0x17c) input.analog[0][0] = 0x17c;
|
||||
else if (input.analog[0][0] < 0x3c) input.analog[0][0] = 0x3c;
|
||||
if (input.analog[0][1] < 0x1fc) input.analog[0][1] = 0x1fc;
|
||||
else if (input.analog[0][1] > 0x3f3) input.analog[0][1] = 0x3f3;
|
||||
else if (input.analog[0][1] > 0x2f7) input.analog[0][1] = 0x2f7;
|
||||
|
||||
/* Wiimote IR */
|
||||
if (exp != WPAD_EXP_CLASSIC)
|
||||
@ -968,8 +968,8 @@ static void wpad_update(s8 chan, u8 i, u32 exp)
|
||||
WPAD_IR(chan, &ir);
|
||||
if (ir.valid)
|
||||
{
|
||||
input.analog[0][0] = 0x3c + (ir.x * (0x17c - 0x3c + 1)) / 640;
|
||||
input.analog[0][1] = 0x1fc + (ir.y * (0x3f3 - 0x1fc + 1)) / 480;
|
||||
input.analog[0][0] = 0x3c + ((ir.x + config.calx) * (0x17c - 0x3c + 1)) / 640;
|
||||
input.analog[0][1] = 0x1fc + ((ir.y + config.caly) * (0x2f7 - 0x1fc + 1)) / 480;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1004,8 +1004,8 @@ static void wpad_update(s8 chan, u8 i, u32 exp)
|
||||
WPAD_IR(chan, &ir);
|
||||
if (ir.valid)
|
||||
{
|
||||
input.analog[0][0] = (ir.x * 250) / 640;
|
||||
input.analog[0][1] = (ir.y * 250) / 480;
|
||||
input.analog[0][0] = ((ir.x + config.calx) * 250) / 640;
|
||||
input.analog[0][1] = ((ir.y + config.caly) * 250) / 480;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1582,6 +1582,10 @@ void gx_input_UpdateMenu(void)
|
||||
else if (pw & (WPAD_BUTTON_DOWN|WPAD_CLASSIC_BUTTON_DOWN)) pp |= PAD_BUTTON_DOWN;
|
||||
else if (pw & (WPAD_BUTTON_LEFT|WPAD_CLASSIC_BUTTON_LEFT)) pp |= PAD_BUTTON_LEFT;
|
||||
else if (pw & (WPAD_BUTTON_RIGHT|WPAD_CLASSIC_BUTTON_RIGHT)) pp |= PAD_BUTTON_RIGHT;
|
||||
|
||||
/* Wiimote pointer user calibration */
|
||||
m_input.ir.x += config.calx;
|
||||
m_input.ir.y += config.caly;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -222,7 +222,7 @@ void osd_input_update(void)
|
||||
case DEVICE_MOUSE:
|
||||
{
|
||||
input.analog[i][0] = input_state_cb(player, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_X);
|
||||
input.analog[i][1] = input_state_cb(player, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_Y);
|
||||
input.analog[i][1] = -input_state_cb(player, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_Y);
|
||||
|
||||
if (input.analog[i][0] < -255)
|
||||
input.analog[i][0] = -255;
|
||||
@ -248,17 +248,8 @@ void osd_input_update(void)
|
||||
|
||||
case DEVICE_LIGHTGUN:
|
||||
{
|
||||
input.analog[i][0] += (input_state_cb(player, RETRO_DEVICE_LIGHTGUN, 0, RETRO_DEVICE_ID_LIGHTGUN_X) / 2);
|
||||
input.analog[i][1] += (input_state_cb(player, RETRO_DEVICE_LIGHTGUN, 0, RETRO_DEVICE_ID_LIGHTGUN_Y) / 2);
|
||||
|
||||
if (input.analog[i][0] < 0)
|
||||
input.analog[i][0] = 0;
|
||||
else if (input.analog[i][0] > bitmap.viewport.w)
|
||||
input.analog[i][0] = bitmap.viewport.w;
|
||||
if (input.analog[i][1] < 0)
|
||||
input.analog[i][1] = 0;
|
||||
else if (input.analog[i][1] > bitmap.viewport.h)
|
||||
input.analog[i][1] = bitmap.viewport.h;
|
||||
input.analog[i][0] = ((input_state_cb(player, RETRO_DEVICE_POINTER, 0, RETRO_DEVICE_ID_POINTER_X) + 0x7fff) * bitmap.viewport.w) / 0xfffe;
|
||||
input.analog[i][1] = ((input_state_cb(player, RETRO_DEVICE_POINTER, 0, RETRO_DEVICE_ID_POINTER_Y) + 0x7fff) * bitmap.viewport.h) / 0xfffe;
|
||||
|
||||
if (input_state_cb(player, RETRO_DEVICE_LIGHTGUN, 0, RETRO_DEVICE_ID_LIGHTGUN_TRIGGER))
|
||||
temp |= INPUT_A;
|
||||
@ -275,7 +266,7 @@ void osd_input_update(void)
|
||||
|
||||
case DEVICE_PADDLE:
|
||||
{
|
||||
input.analog[i][0] = (input_state_cb(player, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_X) + 0x8000) >> 8;
|
||||
input.analog[i][0] = (input_state_cb(player, RETRO_DEVICE_ANALOG, 0, RETRO_DEVICE_ID_ANALOG_X) + 0x8000) >> 8;
|
||||
|
||||
if (input_state_cb(player, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B))
|
||||
temp |= INPUT_BUTTON1;
|
||||
@ -288,8 +279,8 @@ void osd_input_update(void)
|
||||
|
||||
case DEVICE_SPORTSPAD:
|
||||
{
|
||||
input.analog[i][0] = (input_state_cb(player, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_X) + 0x8000) >> 8;
|
||||
input.analog[i][1] = (input_state_cb(player, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_Y) + 0x8000) >> 8;
|
||||
input.analog[i][0] = (input_state_cb(player, RETRO_DEVICE_ANALOG, 0, RETRO_DEVICE_ID_ANALOG_X) + 0x8000) >> 8;
|
||||
input.analog[i][1] = (input_state_cb(player, RETRO_DEVICE_ANALOG, 0, RETRO_DEVICE_ID_ANALOG_Y) + 0x8000) >> 8;
|
||||
|
||||
if (input_state_cb(player, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B))
|
||||
temp |= INPUT_BUTTON1;
|
||||
@ -304,17 +295,8 @@ void osd_input_update(void)
|
||||
|
||||
case DEVICE_PICO:
|
||||
{
|
||||
input.analog[i][0] + input_state_cb(player, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_X);
|
||||
input.analog[i][1] += input_state_cb(player, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_Y);
|
||||
|
||||
if (input.analog[0][0] < 0x17c)
|
||||
input.analog[0][0] = 0x17c;
|
||||
else if (input.analog[0][0] > 0x3c)
|
||||
input.analog[0][0] = 0x3c;
|
||||
if (input.analog[0][1] < 0x1fc)
|
||||
input.analog[0][1] = 0x1fc;
|
||||
else if (input.analog[0][1] > 0x3f3)
|
||||
input.analog[0][1] = 0x3f3;
|
||||
input.analog[i][0] = 0x03c + ((input_state_cb(player, RETRO_DEVICE_POINTER, 0, RETRO_DEVICE_ID_POINTER_X) + 0x7fff) * (0x17c-0x03c)) / 0xfffe;
|
||||
input.analog[i][1] = 0x1fc + ((input_state_cb(player, RETRO_DEVICE_POINTER, 0, RETRO_DEVICE_ID_POINTER_Y) + 0x7fff) * (0x2f7-0x1fc)) / 0xfffe;
|
||||
|
||||
if (input_state_cb(player, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_LEFT))
|
||||
temp |= INPUT_PICO_PEN;
|
||||
@ -339,8 +321,8 @@ void osd_input_update(void)
|
||||
|
||||
case DEVICE_TEREBI:
|
||||
{
|
||||
input.analog[i][0] + input_state_cb(player, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_X);
|
||||
input.analog[i][1] += input_state_cb(player, RETRO_DEVICE_MOUSE, 0, RETRO_DEVICE_ID_MOUSE_Y);
|
||||
input.analog[i][0] = ((input_state_cb(player, RETRO_DEVICE_POINTER, 0, RETRO_DEVICE_ID_POINTER_X) + 0x7fff) * 250) / 0xfffe;
|
||||
input.analog[i][1] = ((input_state_cb(player, RETRO_DEVICE_POINTER, 0, RETRO_DEVICE_ID_POINTER_Y) + 0x7fff) * 250) / 0xfffe;
|
||||
|
||||
if (input.analog[0][0] < 0)
|
||||
input.analog[0][0] = 0;
|
||||
@ -362,8 +344,18 @@ void osd_input_update(void)
|
||||
|
||||
case DEVICE_XE_1AP:
|
||||
{
|
||||
input.analog[i][0] = (input_state_cb(player, RETRO_DEVICE_ANALOG, 0, RETRO_DEVICE_ID_ANALOG_X) + 0x8000) >> 8;
|
||||
input.analog[i][1] = (input_state_cb(player, RETRO_DEVICE_ANALOG, 0, RETRO_DEVICE_ID_ANALOG_Y) + 0x8000) >> 8;
|
||||
int rx = input.analog[i][0] = input_state_cb(player, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_X);
|
||||
int ry = input.analog[i][1] = input_state_cb(player, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_Y);
|
||||
if (abs(rx) > abs(ry))
|
||||
{
|
||||
input.analog[i+1][0] = (rx + 0x8000) >> 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
input.analog[i+1][0] = (0x7fff - ry) >> 8;
|
||||
}
|
||||
input.analog[i][0] = (input_state_cb(player, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_X) + 0x8000) >> 8;
|
||||
input.analog[i][1] = (input_state_cb(player, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_Y) + 0x8000) >> 8;
|
||||
|
||||
if (input_state_cb(player, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_R))
|
||||
temp |= INPUT_XE_A;
|
||||
|
@ -55,7 +55,7 @@ OBJECTS += $(OBJDIR)/input.o \
|
||||
$(OBJDIR)/lightgun.o \
|
||||
$(OBJDIR)/mouse.o \
|
||||
$(OBJDIR)/activator.o \
|
||||
$(OBJDIR)/xe_a1p.o \
|
||||
$(OBJDIR)/xe_1ap.o \
|
||||
$(OBJDIR)/teamplayer.o \
|
||||
$(OBJDIR)/paddle.o \
|
||||
$(OBJDIR)/sportspad.o \
|
Loading…
x
Reference in New Issue
Block a user