puae 2.3.0

This commit is contained in:
Mustafa 'GnoStiC' TUFAN 2010-09-20 15:26:14 +03:00
parent 45aab05fc2
commit 2d238d198d
11 changed files with 143 additions and 49 deletions

View File

@ -1234,7 +1234,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
TCHAR *tmpp;
TCHAR tmpbuf[CONFIG_BLEN];
if (memcmp (option, "input.", 6) == 0) {
if (_tcsncmp (option, "input.", 6) == 0) {
read_inputdevice_config (p, option, value);
return 1;
}
@ -1531,37 +1531,10 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
return 1;
}
if (_tcscmp (option, "gfx_filter_mode") == 0) {
p->gfx_filter_filtermode = 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++;
}
}
cfgfile_strval (option, value, "gfx_filter_mode", &p->gfx_filter_filtermode, filtermode2, 0);
return 1;
}
if (cfgfile_string (option, value, "gfx_filter_aspect_ratio", tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) {
int v1, v2;
TCHAR *s;
@ -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_FR, strcasecmp (value, "fr") == 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;
else
write_log ("Unknown keyboard language\n");
@ -1790,25 +1763,25 @@ static void decode_rom_ident (TCHAR *romfile, int maxlen, const TCHAR *ident, in
while (*p) {
TCHAR c = *p++;
int *pp1 = NULL, *pp2 = NULL;
if (_totupper(c) == 'V' && _istdigit(*p)) {
if (_totupper (c) == 'V' && _istdigit (*p)) {
pp1 = &ver;
pp2 = &rev;
} else if (_totupper(c) == 'R' && _istdigit(*p)) {
} else if (_totupper (c) == 'R' && _istdigit (*p)) {
pp1 = &subver;
pp2 = &subrev;
} else if (!_istdigit(c) && c != ' ') {
} else if (!_istdigit (c) && c != ' ') {
_tcsncpy (model, p - 1, (sizeof model) / sizeof (TCHAR) - 1);
p += _tcslen (model);
modelp = model;
}
if (pp1) {
*pp1 = _tstol(p);
*pp1 = _tstol (p);
while (*p != 0 && *p != '.' && *p != ' ')
p++;
if (*p == '.') {
p++;
if (pp2)
*pp2 = _tstol(p);
*pp2 = _tstol (p);
}
}
if (*p == 0 || *p == ';') {
@ -1932,7 +1905,7 @@ static void parse_addmem (struct uae_prefs *p, TCHAR *buf, int num)
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;
bool tmpbool, dummybool;

View File

@ -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

View File

@ -161,3 +161,23 @@ int getcapslockstate (void)
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;
}

View File

@ -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
*/

View File

@ -1746,7 +1746,7 @@ static void add_p96_mode (int width, int height, int emulate_chunky, int *count)
i = 0;
while (md1->DisplayModes[i].depth > 0)
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++;
return;
@ -2189,14 +2189,11 @@ struct inputdevice_functions inputdevicefunc_keyboard =
int getcapslockstate (void)
{
// TODO
// return capslockstate;
return 0;
return SDL_GetModState() & KMOD_CAPS;
}
void setcapslockstate (int state)
{
// TODO
// capslockstate = state;
//TODO:
}
@ -2265,3 +2262,19 @@ int WIN32GFX_IsPicassoScreen (void)
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;
}

View File

@ -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
*/

View File

@ -162,6 +162,11 @@ int inprec_open (TCHAR *fname, int record)
while (i-- > 0)
inprec_pu8 ();
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;
oldjoy[0] = oldjoy[1] = 0;
if (record < -1)
@ -175,6 +180,11 @@ int inprec_open (TCHAR *fname, int record)
inprec_ru8 (UAESUBREV);
inprec_ru32 (t);
inprec_ru32 (0); // extra header size
if (savestate_state == STATE_DORESTORE) {
inprec_rstart (INPREC_STATEFILE);
inprec_rstr (savestate_fname);
inprec_rend ();
}
} else {
return 0;
}
@ -1798,7 +1808,7 @@ int getbuttonstate (int joy, int button)
inprec_ru8 (v);
inprec_rend ();
} else if (input_recording < 0) {
while(inprec_pstart (INPREC_JOYBUTTON)) {
while (inprec_pstart (INPREC_JOYBUTTON)) {
uae_u8 j = inprec_pu8 ();
uae_u8 but = inprec_pu8 ();
uae_u8 vv = inprec_pu8 ();
@ -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 evt = na->eventid[j][sublevdir[state == 0 ? 1 : 0][k]];
int toggled;
/*
// if evt == caps and scan == caps: sync with native caps led
if (evt == INPUTEVENT_KEY_CAPS_LOCK) {
int v;
@ -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
continue;
}
*/
if (toggle) {
if (!state)
continue;

View File

@ -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 */
char *saved_path = strdup (optionsfile);
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
* directory - so that a GUI can save a new config file there */
strcpy (optionsfile, saved_path);

View File

@ -3163,6 +3163,15 @@ void m68k_go (int may_quit)
quit_program = 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
if (savestate_state == STATE_RESTORE)
restore_state (savestate_fname);
@ -3184,6 +3193,14 @@ void m68k_go (int may_quit)
}
savestate_restore_finish ();
#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 ();
if (currprefs.produce_sound == 0)
eventtab[ev_audio].active = 0;

View File

@ -3514,7 +3514,11 @@ static void copyall (uae_u8 *src, uae_u8 *dst)
static int flushpixels (void)
{
int i;
#ifdef JIT
uae_u8 *src = p96ram_start + natmem_offset;
#else
uae_u8 *src = p96ram_start;
#endif
int off = picasso96_state.XYOffset - gfxmem_start;
uae_u8 *src_start = src + (off & ~gwwpagemask);
uae_u8 *src_end = src + ((off + picasso96_state.BytesPerRow * picasso96_state.Height + gwwpagesize - 1) & ~gwwpagemask);