puae 2.3.0

parent 45aab05f
...@@ -1234,7 +1234,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) ...@@ -1234,7 +1234,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
TCHAR *tmpp; TCHAR *tmpp;
TCHAR tmpbuf[CONFIG_BLEN]; TCHAR tmpbuf[CONFIG_BLEN];
if (memcmp (option, "input.", 6) == 0) { if (_tcsncmp (option, "input.", 6) == 0) {
read_inputdevice_config (p, option, value); read_inputdevice_config (p, option, value);
return 1; return 1;
} }
...@@ -1531,37 +1531,10 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) ...@@ -1531,37 +1531,10 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
return 1; return 1;
} }
if (_tcscmp (option, "gfx_filter_mode") == 0) { if (_tcscmp (option, "gfx_filter_mode") == 0) {
p->gfx_filter_filtermode = 0; cfgfile_strval (option, value, "gfx_filter_mode", &p->gfx_filter_filtermode, filtermode2, 0);
if (p->gfx_filter > 0) {
struct uae_filter *uf;
int i = 0;
while(uaefilters[i].name) {
uf = &uaefilters[i];
if (uf->type == p->gfx_filter) {
if (!uf->x[0]) {
int mt[4], j;
i = 0;
if (uf->x[1])
mt[i++] = 1;
if (uf->x[2])
mt[i++] = 2;
if (uf->x[3])
mt[i++] = 3;
if (uf->x[4])
mt[i++] = 4;
cfgfile_strval (option, value, "gfx_filter_mode", &i, filtermode2, 0);
for (j = 0; j < i; j++) {
if (mt[j] == i)
p->gfx_filter_filtermode = j;
}
}
break;
}
i++;
}
}
return 1; return 1;
} }
if (cfgfile_string (option, value, "gfx_filter_aspect_ratio", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) { if (cfgfile_string (option, value, "gfx_filter_aspect_ratio", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) {
int v1, v2; int v1, v2;
TCHAR *s; TCHAR *s;
...@@ -1709,8 +1682,8 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value) ...@@ -1709,8 +1682,8 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
|| (l = KBD_LANG_US, strcasecmp (value, "us") == 0) || (l = KBD_LANG_US, strcasecmp (value, "us") == 0)
|| (l = KBD_LANG_FR, strcasecmp (value, "fr") == 0) || (l = KBD_LANG_FR, strcasecmp (value, "fr") == 0)
|| (l = KBD_LANG_IT, strcasecmp (value, "it") == 0) || (l = KBD_LANG_IT, strcasecmp (value, "it") == 0)
|| (l = KBD_LANG_TR, strcasecmp (value, "tr") == 0) || (l = KBD_LANG_ES, strcasecmp (value, "es") == 0)
|| (l = KBD_LANG_ES, strcasecmp (value, "es") == 0)) || (l = KBD_LANG_TR, strcasecmp (value, "tr") == 0))
p->keyboard_lang = l; p->keyboard_lang = l;
else else
write_log ("Unknown keyboard language\n"); write_log ("Unknown keyboard language\n");
...@@ -1790,25 +1763,25 @@ static void decode_rom_ident (TCHAR *romfile, int maxlen, const TCHAR *ident, in ...@@ -1790,25 +1763,25 @@ static void decode_rom_ident (TCHAR *romfile, int maxlen, const TCHAR *ident, in
while (*p) { while (*p) {
TCHAR c = *p++; TCHAR c = *p++;
int *pp1 = NULL, *pp2 = NULL; int *pp1 = NULL, *pp2 = NULL;
if (_totupper(c) == 'V' && _istdigit(*p)) { if (_totupper (c) == 'V' && _istdigit (*p)) {
pp1 = &ver; pp1 = &ver;
pp2 = &rev; pp2 = &rev;
} else if (_totupper(c) == 'R' && _istdigit(*p)) { } else if (_totupper (c) == 'R' && _istdigit (*p)) {
pp1 = &subver; pp1 = &subver;
pp2 = &subrev; pp2 = &subrev;
} else if (!_istdigit(c) && c != ' ') { } else if (!_istdigit (c) && c != ' ') {
_tcsncpy (model, p - 1, (sizeof model) / sizeof (TCHAR) - 1); _tcsncpy (model, p - 1, (sizeof model) / sizeof (TCHAR) - 1);
p += _tcslen (model); p += _tcslen (model);
modelp = model; modelp = model;
} }
if (pp1) { if (pp1) {
*pp1 = _tstol(p); *pp1 = _tstol (p);
while (*p != 0 && *p != '.' && *p != ' ') while (*p != 0 && *p != '.' && *p != ' ')
p++; p++;
if (*p == '.') { if (*p == '.') {
p++; p++;
if (pp2) if (pp2)
*pp2 = _tstol(p); *pp2 = _tstol (p);
} }
} }
if (*p == 0 || *p == ';') { if (*p == 0 || *p == ';') {
...@@ -1932,7 +1905,7 @@ static void parse_addmem (struct uae_prefs *p, TCHAR *buf, int num) ...@@ -1932,7 +1905,7 @@ static void parse_addmem (struct uae_prefs *p, TCHAR *buf, int num)
p->custom_memory_sizes[num] = size; p->custom_memory_sizes[num] = size;
} }
static int cfgfile_parse_hardware (struct uae_prefs *p, TCHAR *option, TCHAR *value) static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCHAR *value)
{ {
int tmpval, dummyint, i; int tmpval, dummyint, i;
bool tmpbool, dummybool; bool tmpbool, dummybool;
......
...@@ -2538,6 +2538,25 @@ void setcapslockstate (int state) ...@@ -2538,6 +2538,25 @@ void setcapslockstate (int state)
{ {
} }
int target_checkcapslock (int scancode, int *state)
{
if (scancode != DIK_CAPITAL && scancode != DIK_NUMLOCK && scancode != DIK_SCROLL)
return 0;
if (*state == 0)
return -1;
/*
if (scancode == DIK_CAPITAL)
*state = SDL_GetModState() & KMOD_CAPS;
if (scancode == DIK_NUMLOCK)
*state = SDL_GetModState() & KMOD_NUM;
if (scancode == DIK_SCROLL)
*state = host_scrolllockstate;
return 1;
*/
return 0;
}
/**************************************************************************** /****************************************************************************
* *
* Handle gfx specific cfgfile options * Handle gfx specific cfgfile options
......
...@@ -161,3 +161,23 @@ int getcapslockstate (void) ...@@ -161,3 +161,23 @@ int getcapslockstate (void)
void setcapslockstate (int state) void setcapslockstate (int state)
{ {
} }
int target_checkcapslock (int scancode, int *state)
{
if (scancode != DIK_CAPITAL && scancode != DIK_NUMLOCK && scancode != DIK_SCROLL)
return 0;
if (*state == 0)
return -1;
/*
if (scancode == DIK_CAPITAL)
*state = SDL_GetModState() & KMOD_CAPS;
if (scancode == DIK_NUMLOCK)
*state = SDL_GetModState() & KMOD_NUM;
if (scancode == DIK_SCROLL)
*state = host_scrolllockstate;
return 1;
*/
return 0;
}
...@@ -870,6 +870,25 @@ void setcapslockstate (int state) ...@@ -870,6 +870,25 @@ void setcapslockstate (int state)
{ {
} }
int target_checkcapslock (int scancode, int *state)
{
if (scancode != DIK_CAPITAL && scancode != DIK_NUMLOCK && scancode != DIK_SCROLL)
return 0;
if (*state == 0)
return -1;
/*
if (scancode == DIK_CAPITAL)
*state = SDL_GetModState() & KMOD_CAPS;
if (scancode == DIK_NUMLOCK)
*state = SDL_GetModState() & KMOD_NUM;
if (scancode == DIK_SCROLL)
*state = host_scrolllockstate;
return 1;
*/
return 0;
}
/* /*
* Default inputdevice config for mouse * Default inputdevice config for mouse
*/ */
......
...@@ -1746,7 +1746,7 @@ static void add_p96_mode (int width, int height, int emulate_chunky, int *count) ...@@ -1746,7 +1746,7 @@ static void add_p96_mode (int width, int height, int emulate_chunky, int *count)
i = 0; i = 0;
while (md1->DisplayModes[i].depth > 0) while (md1->DisplayModes[i].depth > 0)
i++; i++;
write_log ("'%s', %d display modes (%s)\n", md1->name, i, md1->disabled ? "disabled" : "enabled"); //write_log ("'%s', %d display modes (%s)\n", md1->name, i, md1->disabled ? "disabled" : "enabled");
md1++; md1++;
return; return;
...@@ -2189,14 +2189,11 @@ struct inputdevice_functions inputdevicefunc_keyboard = ...@@ -2189,14 +2189,11 @@ struct inputdevice_functions inputdevicefunc_keyboard =
int getcapslockstate (void) int getcapslockstate (void)
{ {
// TODO return SDL_GetModState() & KMOD_CAPS;
// return capslockstate;
return 0;
} }
void setcapslockstate (int state) void setcapslockstate (int state)
{ {
// TODO //TODO:
// capslockstate = state;
} }
...@@ -2265,3 +2262,19 @@ int WIN32GFX_IsPicassoScreen (void) ...@@ -2265,3 +2262,19 @@ int WIN32GFX_IsPicassoScreen (void)
return screen_is_picasso; return screen_is_picasso;
} }
int target_checkcapslock (int scancode, int *state)
{
if (scancode != DIK_CAPITAL && scancode != DIK_NUMLOCK && scancode != DIK_SCROLL)
return 0;
if (*state == 0)
return -1;
if (scancode == DIK_CAPITAL)
*state = SDL_GetModState() & KMOD_CAPS;
if (scancode == DIK_NUMLOCK)
*state = SDL_GetModState() & KMOD_NUM;
// if (scancode == DIK_SCROLL)
// *state = host_scrolllockstate;
return 1;
}
...@@ -1770,6 +1770,25 @@ void setcapslockstate (int state) ...@@ -1770,6 +1770,25 @@ void setcapslockstate (int state)
{ {
} }
int target_checkcapslock (int scancode, int *state)
{
if (scancode != DIK_CAPITAL && scancode != DIK_NUMLOCK && scancode != DIK_SCROLL)
return 0;
if (*state == 0)
return -1;
/*
if (scancode == DIK_CAPITAL)
*state = SDL_GetModState() & KMOD_CAPS;
if (scancode == DIK_NUMLOCK)
*state = SDL_GetModState() & KMOD_NUM;
if (scancode == DIK_SCROLL)
*state = host_scrolllockstate;
return 1;
*/
return 0;
}
/* /*
* Handle gfx cfgfile options * Handle gfx cfgfile options
*/ */
......
...@@ -162,6 +162,11 @@ int inprec_open (TCHAR *fname, int record) ...@@ -162,6 +162,11 @@ int inprec_open (TCHAR *fname, int record)
while (i-- > 0) while (i-- > 0)
inprec_pu8 (); inprec_pu8 ();
inprec_p = inprec_plastptr; inprec_p = inprec_plastptr;
if (inprec_pstart (INPREC_STATEFILE)) {
inprec_pstr (savestate_fname);
savestate_state = STATE_RESTORE;
inprec_pend ();
}
oldbuttons[0] = oldbuttons[1] = oldbuttons[2] = oldbuttons[3] = 0; oldbuttons[0] = oldbuttons[1] = oldbuttons[2] = oldbuttons[3] = 0;
oldjoy[0] = oldjoy[1] = 0; oldjoy[0] = oldjoy[1] = 0;
if (record < -1) if (record < -1)
...@@ -175,6 +180,11 @@ int inprec_open (TCHAR *fname, int record) ...@@ -175,6 +180,11 @@ int inprec_open (TCHAR *fname, int record)
inprec_ru8 (UAESUBREV); inprec_ru8 (UAESUBREV);
inprec_ru32 (t); inprec_ru32 (t);
inprec_ru32 (0); // extra header size inprec_ru32 (0); // extra header size
if (savestate_state == STATE_DORESTORE) {
inprec_rstart (INPREC_STATEFILE);
inprec_rstr (savestate_fname);
inprec_rend ();
}
} else { } else {
return 0; return 0;
} }
...@@ -1798,7 +1808,7 @@ int getbuttonstate (int joy, int button) ...@@ -1798,7 +1808,7 @@ int getbuttonstate (int joy, int button)
inprec_ru8 (v); inprec_ru8 (v);
inprec_rend (); inprec_rend ();
} else if (input_recording < 0) { } else if (input_recording < 0) {
while(inprec_pstart (INPREC_JOYBUTTON)) { while (inprec_pstart (INPREC_JOYBUTTON)) {
uae_u8 j = inprec_pu8 (); uae_u8 j = inprec_pu8 ();
uae_u8 but = inprec_pu8 (); uae_u8 but = inprec_pu8 ();
uae_u8 vv = inprec_pu8 (); uae_u8 vv = inprec_pu8 ();
...@@ -4747,7 +4757,7 @@ static int inputdevice_translatekeycode_2 (int keyboard, int scancode, int state ...@@ -4747,7 +4757,7 @@ static int inputdevice_translatekeycode_2 (int keyboard, int scancode, int state
int toggle = (na->flags[j][sublevdir[state == 0 ? 1 : 0][k]] & ID_FLAG_TOGGLE) ? 1 : 0; int toggle = (na->flags[j][sublevdir[state == 0 ? 1 : 0][k]] & ID_FLAG_TOGGLE) ? 1 : 0;
int evt = na->eventid[j][sublevdir[state == 0 ? 1 : 0][k]]; int evt = na->eventid[j][sublevdir[state == 0 ? 1 : 0][k]];
int toggled; int toggled;
/*
// if evt == caps and scan == caps: sync with native caps led // if evt == caps and scan == caps: sync with native caps led
if (evt == INPUTEVENT_KEY_CAPS_LOCK) { if (evt == INPUTEVENT_KEY_CAPS_LOCK) {
int v; int v;
...@@ -4762,7 +4772,7 @@ static int inputdevice_translatekeycode_2 (int keyboard, int scancode, int state ...@@ -4762,7 +4772,7 @@ static int inputdevice_translatekeycode_2 (int keyboard, int scancode, int state
// it was caps lock resync, ignore, not mapped to caps // it was caps lock resync, ignore, not mapped to caps
continue; continue;
} }
*/
if (toggle) { if (toggle) {
if (!state) if (!state)
continue; continue;
......
...@@ -627,7 +627,7 @@ static void parse_cmdline_and_init_file (int argc, TCHAR **argv) ...@@ -627,7 +627,7 @@ static void parse_cmdline_and_init_file (int argc, TCHAR **argv)
/* sam: if not found in $HOME then look in current directory */ /* sam: if not found in $HOME then look in current directory */
char *saved_path = strdup (optionsfile); char *saved_path = strdup (optionsfile);
strcpy (optionsfile, OPTIONSFILENAME); strcpy (optionsfile, OPTIONSFILENAME);
if (! target_cfgfile_load (&currprefs, optionsfile, 0) ) { if (!target_cfgfile_load (&currprefs, optionsfile, 0) ) {
/* If not in current dir either, change path back to home /* If not in current dir either, change path back to home
* directory - so that a GUI can save a new config file there */ * directory - so that a GUI can save a new config file there */
strcpy (optionsfile, saved_path); strcpy (optionsfile, saved_path);
......
...@@ -3163,6 +3163,15 @@ void m68k_go (int may_quit) ...@@ -3163,6 +3163,15 @@ void m68k_go (int may_quit)
quit_program = 0; quit_program = 0;
hardboot = 0; hardboot = 0;
#ifdef INPREC
if (currprefs.inprecfile[0] && currprefs.inprecmode < 0) {
inprec_open (currprefs.inprecfile, currprefs.inprecmode);
changed_prefs.inprecmode = currprefs.inprecmode = 0;
changed_prefs.inprecfile[0] = currprefs.inprecfile[0] = 0;
}
#endif
#ifdef SAVESTATE #ifdef SAVESTATE
if (savestate_state == STATE_RESTORE) if (savestate_state == STATE_RESTORE)
restore_state (savestate_fname); restore_state (savestate_fname);
...@@ -3184,6 +3193,14 @@ void m68k_go (int may_quit) ...@@ -3184,6 +3193,14 @@ void m68k_go (int may_quit)
} }
savestate_restore_finish (); savestate_restore_finish ();
#endif #endif
#ifdef INPREC
if (currprefs.inprecfile[0] && currprefs.inprecmode > 0) {
inprec_open (currprefs.inprecfile, currprefs.inprecmode);
changed_prefs.inprecmode = currprefs.inprecmode = 0;
changed_prefs.inprecfile[0] = currprefs.inprecfile[0] = 0;
}
#endif
fill_prefetch_slow (); fill_prefetch_slow ();
if (currprefs.produce_sound == 0) if (currprefs.produce_sound == 0)
eventtab[ev_audio].active = 0; eventtab[ev_audio].active = 0;
......
...@@ -118,7 +118,7 @@ void preinit_shm (void) ...@@ -118,7 +118,7 @@ void preinit_shm (void)
//xaind //xaind
int mib[2]; int mib[2];
size_t len; size_t len;
mib[0] = CTL_HW; mib[0] = CTL_HW;
mib[1] = HW_MEMSIZE; /* gives a 64 bit int */ mib[1] = HW_MEMSIZE; /* gives a 64 bit int */
len = sizeof(totalphys64); len = sizeof(totalphys64);
......
...@@ -3514,7 +3514,11 @@ static void copyall (uae_u8 *src, uae_u8 *dst) ...@@ -3514,7 +3514,11 @@ static void copyall (uae_u8 *src, uae_u8 *dst)
static int flushpixels (void) static int flushpixels (void)
{ {
int i; int i;
#ifdef JIT
uae_u8 *src = p96ram_start + natmem_offset; uae_u8 *src = p96ram_start + natmem_offset;
#else
uae_u8 *src = p96ram_start;
#endif
int off = picasso96_state.XYOffset - gfxmem_start; int off = picasso96_state.XYOffset - gfxmem_start;
uae_u8 *src_start = src + (off & ~gwwpagemask); uae_u8 *src_start = src + (off & ~gwwpagemask);
uae_u8 *src_end = src + ((off + picasso96_state.BytesPerRow * picasso96_state.Height + gwwpagesize - 1) & ~gwwpagemask); uae_u8 *src_end = src + ((off + picasso96_state.BytesPerRow * picasso96_state.Height + gwwpagesize - 1) & ~gwwpagemask);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment