Commit 0a2dd98f authored by GnoStiC's avatar GnoStiC

puae 2.3.2

parent a2b6937f
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
static unsigned int ciaaicr, ciaaimask, ciabicr, ciabimask; static unsigned int ciaaicr, ciaaimask, ciabicr, ciabimask;
static unsigned int ciaacra, ciaacrb, ciabcra, ciabcrb; static unsigned int ciaacra, ciaacrb, ciabcra, ciabcrb;
static unsigned int ciaastarta, ciaastartb, ciabstarta, ciabstartb; static unsigned int ciaastarta, ciaastartb, ciabstarta, ciabstartb;
static unsigned int ciaaicr_reg, ciaaicr_old, ciabicr_reg, ciabicr_old; static unsigned int ciaaicr_reg, ciabicr_reg;
/* Values of the CIA timers. */ /* Values of the CIA timers. */
static unsigned long ciaata, ciaatb, ciabta, ciabtb; static unsigned long ciaata, ciaatb, ciabta, ciabtb;
...@@ -110,7 +110,7 @@ static void ICRA(uae_u32 data) ...@@ -110,7 +110,7 @@ static void ICRA(uae_u32 data)
{ {
if (ciaaimask & ciaaicr) { if (ciaaimask & ciaaicr) {
ciaaicr |= 0x80; ciaaicr |= 0x80;
INTREQ_0 (data); INTREQ_0 (0x8000 | data);
} }
ciaaicr_reg |= ciaaicr; ciaaicr_reg |= ciaaicr;
} }
...@@ -118,30 +118,28 @@ static void ICRB(uae_u32 data) ...@@ -118,30 +118,28 @@ static void ICRB(uae_u32 data)
{ {
if (ciabimask & ciabicr) { if (ciabimask & ciabicr) {
ciabicr |= 0x80; ciabicr |= 0x80;
INTREQ_0 (data); INTREQ_0 (0x8000 | data);
} }
ciabicr_reg |= ciabicr; ciabicr_reg |= ciabicr;
} }
static void RethinkICRA (void) static void RethinkICRA (void)
{ {
if (ciaaicr != ciaaicr_old) { if (ciaaicr) {
ciaaicr_old = ciaaicr;
if (currprefs.cpu_cycle_exact) if (currprefs.cpu_cycle_exact)
event2_newevent_xx (-1, 2 * CYCLE_UNIT + CYCLE_UNIT / 2, 0x8008, ICRA); event2_newevent_xx (-1, 2 * CYCLE_UNIT + CYCLE_UNIT / 2, 0x0008, ICRA);
else else
ICRA (0x8008); ICRA (0x0008);
} }
} }
static void RethinkICRB (void) static void RethinkICRB (void)
{ {
if (ciabicr != ciabicr_old) { if (ciabicr) {
ciabicr_old = ciabicr;
if (currprefs.cpu_cycle_exact) if (currprefs.cpu_cycle_exact)
event2_newevent_xx (-1, 2 * CYCLE_UNIT + CYCLE_UNIT / 2, 0xA000, ICRB); event2_newevent_xx (-1, 2 * CYCLE_UNIT + CYCLE_UNIT / 2, 0x2000, ICRB);
else else
ICRB (0xA000); ICRB (0x2000);
} }
} }
...@@ -660,8 +658,10 @@ void CIA_hsync_posthandler (bool dotod) ...@@ -660,8 +658,10 @@ void CIA_hsync_posthandler (bool dotod)
RethinkICRA (); RethinkICRA ();
sleepyhead = 0; sleepyhead = 0;
} else if (!(++sleepyhead & 15)) { } else if (!(++sleepyhead & 15)) {
if (ciaasdr_unread == 3) if (ciaasdr_unread == 3) {
ciaaicr |= 8; ciaaicr |= 8;
RethinkICRA ();
}
if (ciaasdr_unread < 3) if (ciaasdr_unread < 3)
ciaasdr_unread = 0; /* give up on this key event after unread for a long time */ ciaasdr_unread = 0; /* give up on this key event after unread for a long time */
} }
......
...@@ -131,8 +131,8 @@ static const TCHAR help[] = { ...@@ -131,8 +131,8 @@ static const TCHAR help[] = {
" Cl List currently found trainer addresses\n" " Cl List currently found trainer addresses\n"
" D[idxzs <[max diff]>] Deep trainer. i=new value must be larger, d=smaller,\n" " D[idxzs <[max diff]>] Deep trainer. i=new value must be larger, d=smaller,\n"
" x = must be same, z = must be different, s = restart.\n" " x = must be same, z = must be different, s = restart.\n"
" W <address> <value> Write into Amiga memory\n" " W <address> <value[.x]> Write into Amiga memory\n"
" w <num> <address> <length> <R/W/I/F/C> [<value>] (read/write/opcode/freeze/mustchange)\n" " w <num> <address> <length> <R/W/I/F/C> [<value[.x]>] (read/write/opcode/freeze/mustchange)\n"
" Add/remove memory watchpoints\n" " Add/remove memory watchpoints\n"
" wd [<0-1>] Enable illegal access logger. 1 = enable break.\n" " wd [<0-1>] Enable illegal access logger. 1 = enable break.\n"
" S <file> <addr> <n> Save a block of Amiga memory\n" " S <file> <addr> <n> Save a block of Amiga memory\n"
...@@ -1784,6 +1784,8 @@ static int memwatch_func (uaecptr addr, int rwi, int size, uae_u32 *valp) ...@@ -1784,6 +1784,8 @@ static int memwatch_func (uaecptr addr, int rwi, int size, uae_u32 *valp)
continue; continue;
if (!(rwi & rwi2)) if (!(rwi & rwi2))
continue; continue;
if (addr == 0x100)
write_log("*\n");
if (addr >= addr2 && addr < addr3) if (addr >= addr2 && addr < addr3)
brk = 1; brk = 1;
if (!brk && size == 2 && (addr + 1 >= addr2 && addr + 1 < addr3)) if (!brk && size == 2 && (addr + 1 >= addr2 && addr + 1 < addr3))
...@@ -1848,16 +1850,29 @@ static int memwatch_func (uaecptr addr, int rwi, int size, uae_u32 *valp) ...@@ -1848,16 +1850,29 @@ static int memwatch_func (uaecptr addr, int rwi, int size, uae_u32 *valp)
} }
if (m->frozen) { if (m->frozen) {
if (m->val_enabled) { if (m->val_enabled) {
int shift = addr - m->addr; int shift = (addr + size - 1) - (m->addr + m->val_size - 1);
int max = 0; uae_u32 sval;
if (m->val_size == 2) { uae_u32 mask;
max = 1;
shift = 1 - ((addr - m->addr) & 1); if (m->val_size == 4)
} else if (m->val_size == 4) { mask = 0xffffffff;
max = 3; else if (m->val_size == 2)
shift = 3 - ((addr - m->addr) & 3); mask = 0x0000ffff;
} else
*valp = m->val >> ((max - shift) * 8); mask = 0x000000ff;
sval = m->val;
if (shift < 0) {
shift = -8 * shift;
sval >>= shift;
mask >>= shift;
} else {
shift = 8 * shift;
sval <<= shift;
mask <<= shift;
}
*valp = (sval & mask) | ((*valp) & ~mask);
write_log ("%p %p %08x %08x %d\n", addr, m->addr, *valp, mask, shift);
return 1; return 1;
} }
return 0; return 0;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
* Amiga keycodes * Amiga keycodes
* *
* Copyright 2004 Richard Drummond * Copyright 2004 Richard Drummond
* 2010-2011 Mustafa Tufan
* *
* Based on previous SDL keymapping * Based on previous SDL keymapping
* Copyright 2001 Bernd Lachner (EMail: dev@lachner-net.de) * Copyright 2001 Bernd Lachner (EMail: dev@lachner-net.de)
...@@ -17,9 +18,9 @@ ...@@ -17,9 +18,9 @@
#include "inputdevice.h" #include "inputdevice.h"
#include "keyboard.h" #include "keyboard.h"
#include "hotkeys.h" #include "hotkeys.h"
#include "../keymap/keymap.h"
#include "sdlgfx.h" #include "sdlgfx.h"
#include <SDL.h> #include <SDL.h>
/* /*
...@@ -361,114 +362,132 @@ static int decode_tr (int keysym) ...@@ -361,114 +362,132 @@ static int decode_tr (int keysym)
int sdlk2dik (int keysym) { int sdlk2dik (int keysym) {
switch (keysym) { switch (keysym) {
case SDLK_ESCAPE: return 0x01; case SDLK_ESCAPE: return DIK_ESCAPE;
case SDLK_1: return 0x02;
case SDLK_2: return 0x03;
case SDLK_3: return 0x04;
case SDLK_4: return 0x05;
case SDLK_5: return 0x06;
case SDLK_6: return 0x07;
case SDLK_7: return 0x08;
case SDLK_8: return 0x09;
case SDLK_9: return 0x0a;
case SDLK_0: return 0x0b;
case SDLK_BACKSPACE:return 0x0e;
// //
case SDLK_TAB: return 0x0f; case SDLK_1: return DIK_1;
case SDLK_q: return 0x10; case SDLK_2: return DIK_2;
case SDLK_w: return 0x11; case SDLK_3: return DIK_3;
case SDLK_e: return 0x12; case SDLK_4: return DIK_4;
case SDLK_r: return 0x13; case SDLK_5: return DIK_5;
case SDLK_t: return 0x14; case SDLK_6: return DIK_6;
case SDLK_y: return 0x15; case SDLK_7: return DIK_7;
case SDLK_u: return 0x16; case SDLK_8: return DIK_8;
case SDLK_i: return 0x17; case SDLK_9: return DIK_9;
case SDLK_o: return 0x18; case SDLK_0: return DIK_0;
case SDLK_p: return 0x19; case SDLK_MINUS: return DIK_MINUS; //?*
case SDLK_EQUALS: return DIK_EQUALS; //-_
case SDLK_RETURN: return 0x1c; case SDLK_BACKSPACE: return DIK_BACK;
case SDLK_LCTRL: return 0x1d;
// //
case SDLK_a: return 0x1e; case SDLK_TAB: return DIK_TAB;
case SDLK_s: return 0x1f; case SDLK_q: return DIK_Q;
case SDLK_d: return 0x20; case SDLK_w: return DIK_W;
case SDLK_f: return 0x21; case SDLK_e: return DIK_E;
case SDLK_g: return 0x22; case SDLK_r: return DIK_R;
case SDLK_h: return 0x23; case SDLK_t: return DIK_T;
case SDLK_j: return 0x24; case SDLK_y: return DIK_Y;
case SDLK_k: return 0x25; case SDLK_u: return DIK_U;
case SDLK_l: return 0x26; case SDLK_i: return DIK_I;
case SDLK_o: return DIK_O;
case SDLK_LSHIFT: return 0x2a; case SDLK_p: return DIK_P;
case SDLK_LEFTBRACKET: return DIK_LBRACKET; //tr kbd g
case SDLK_RIGHTBRACKET: return DIK_RBRACKET; //tr kbd u
case SDLK_RETURN: return DIK_RETURN;
case SDLK_LCTRL: return DIK_LCONTROL;
// //
case SDLK_a: return DIK_A;
case SDLK_z: return 0x2c; case SDLK_s: return DIK_S;
case SDLK_x: return 0x2d; case SDLK_d: return DIK_D;
case SDLK_c: return 0x2e; case SDLK_f: return DIK_F;
case SDLK_v: return 0x2f; case SDLK_g: return DIK_G;
case SDLK_b: return 0x30; case SDLK_h: return DIK_H;
case SDLK_n: return 0x31; case SDLK_j: return DIK_J;
case SDLK_m: return 0x32; case SDLK_k: return DIK_K;
case SDLK_l: return DIK_L;
case SDLK_RSHIFT: return 0x36;
case SDLK_SPACE: return 0x39; case SDLK_SEMICOLON: return DIK_SEMICOLON; //tr kbd s
case SDLK_QUOTE: return DIK_APOSTROPHE; //tr kbd i
// case SDLK_ return DIK_GRAVE; //tr kdb ;,
case SDLK_F1: return 0x3b; case SDLK_LSHIFT: return DIK_LSHIFT;
case SDLK_F2: return 0x3c; //
case SDLK_F3: return 0x3d; case SDLK_z: return DIK_Z;
case SDLK_F4: return 0x3e; case SDLK_x: return DIK_X;
case SDLK_F5: return 0x3f; case SDLK_c: return DIK_C;
case SDLK_F6: return 0x40; case SDLK_v: return DIK_V;
case SDLK_F7: return 0x41; case SDLK_b: return DIK_B;
case SDLK_F8: return 0x42; case SDLK_n: return DIK_N;
case SDLK_F9: return 0x43; case SDLK_m: return DIK_M;
case SDLK_F10: return 0x44;
case SDLK_COMMA: return DIK_COMMA; //tr kbd o
case SDLK_PERIOD: return DIK_PERIOD; //tr kbd c
case SDLK_SLASH: return DIK_SLASH; //tr kbd .
case SDLK_RSHIFT: return DIK_RSHIFT;
case SDLK_SPACE: return DIK_SPACE;
// //
case SDLK_KP7: return 0x47; case SDLK_F1: return DIK_F1;
case SDLK_KP8: return 0x48; case SDLK_F2: return DIK_F2;
case SDLK_KP9: return 0x49; case SDLK_F3: return DIK_F3;
case SDLK_KP_MINUS: return 0x4a; case SDLK_F4: return DIK_F4;
case SDLK_KP4: return 0x4b; case SDLK_F5: return DIK_F5;
case SDLK_KP5: return 0x4c; case SDLK_F6: return DIK_F6;
case SDLK_KP6: return 0x4d; case SDLK_F7: return DIK_F7;
case SDLK_KP_PLUS: return 0x4e; case SDLK_F8: return DIK_F8;
case SDLK_KP1: return 0x4f; case SDLK_F9: return DIK_F9;
case SDLK_KP2: return 0x50; case SDLK_F10: return DIK_F10;
case SDLK_KP3: return 0x51; case SDLK_F11: return DIK_F11;
case SDLK_KP0: return 0x52; case SDLK_F12: return DIK_F12;
case SDLK_KP_PERIOD:return 0x53; case SDLK_F13: return DIK_F13;
case SDLK_KP_ENTER: return 0x9c; case SDLK_F14: return DIK_F14;
case SDLK_F15: return DIK_F15;
case SDLK_KP_DIVIDE: return 0xB5; case SDLK_NUMLOCK: return DIK_NUMLOCK;
case SDLK_KP_MULTIPLY: return 0x37; // case SDLK_CAPSLOCK: return DIK_CAPSLOCK;
case SDLK_CAPSLOCK: return DIK_CAPITAL;
case SDLK_DELETE: return 0xd3; case SDLK_SCROLLOCK: return DIK_SCROLL;
case SDLK_RCTRL: return 0x9d; //
case SDLK_LALT: return 0x38; case SDLK_KP7: return DIK_NUMPAD7;
case SDLK_RALT: return 0xB8; case SDLK_KP8: return DIK_NUMPAD8;
/* case SDLK_RMETA: return AK_RAMI; case SDLK_KP9: return DIK_NUMPAD9;
case SDLK_LMETA: return AK_LAMI;*/ case SDLK_KP_MINUS: return DIK_SUBTRACT;
case SDLK_KP4: return DIK_NUMPAD4;
case SDLK_INSERT: return 0xd2; case SDLK_KP5: return DIK_NUMPAD5;
case SDLK_HOME: return 0xc7; case SDLK_KP6: return DIK_NUMPAD6;
case SDLK_END: return 0xcf; case SDLK_KP_PLUS: return DIK_ADD;
case SDLK_CAPSLOCK: return 0x3a; case SDLK_KP1: return DIK_NUMPAD1;
case SDLK_KP2: return DIK_NUMPAD2;
case SDLK_UP: return 0xc8; case SDLK_KP3: return DIK_NUMPAD3;
case SDLK_PAGEUP: return 0xc9; case SDLK_KP0: return DIK_NUMPAD0;
case SDLK_LEFT: return 0xcb; case SDLK_KP_PERIOD: return DIK_DECIMAL;
case SDLK_RIGHT: return 0xcd; case SDLK_KP_ENTER: return DIK_NUMPADENTER;
case SDLK_DOWN: return 0xd0; case SDLK_KP_DIVIDE: return DIK_DIVIDE;
case SDLK_PAGEDOWN: return 0xd1; case SDLK_KP_MULTIPLY: return DIK_MULTIPLY;
case SDLK_KP_EQUALS: return DIK_NUMPADEQUALS;
case SDLK_DELETE: return DIK_DELETE;
case SDLK_RCTRL: return DIK_RCONTROL;
case SDLK_LALT: return DIK_LMENU;
case SDLK_RALT: return DIK_RMENU;
case SDLK_INSERT: return DIK_INSERT;
case SDLK_HOME: return DIK_HOME;
case SDLK_END: return DIK_END;
case SDLK_UP: return DIK_UP;
case SDLK_PAGEUP: return DIK_PRIOR;
case SDLK_LEFT: return DIK_LEFT;
case SDLK_RIGHT: return DIK_RIGHT;
case SDLK_DOWN: return DIK_DOWN;
case SDLK_PAGEDOWN: return DIK_NEXT;
/* case SDLK_RSUPER: return AK_RAMI; /* case SDLK_RSUPER: return AK_RAMI;
case SDLK_LSUPER: return AK_LAMI;*/ case SDLK_LSUPER: return AK_LAMI;*/
case SDLK_PAUSE: return 0xc5; case SDLK_PAUSE: return DIK_PAUSE;
case SDLK_SCROLLOCK: return 0x46;
// case SDLK_PRINT: return AKS_SCREENSHOT_FILE; // case SDLK_PRINT: return AKS_SCREENSHOT_FILE;
//here
case SDLK_LMETA: return DIK_LWIN; //mac LCMD
case SDLK_RMETA: return DIK_RWIN; //mac RCMD
// case SDLK_WORLD_0: return 0; //e"
default: return -1; default: return -1;
} }
} }
......
...@@ -1665,7 +1665,7 @@ static uae_u32 hardfile_do_io (struct hardfiledata *hfd, struct hardfileprivdata ...@@ -1665,7 +1665,7 @@ static uae_u32 hardfile_do_io (struct hardfiledata *hfd, struct hardfileprivdata
outofbounds (cmd, offset64, len, hfd->virtsize); outofbounds (cmd, offset64, len, hfd->virtsize);
goto bad_len; goto bad_len;
} }
put_long (request + 32, (uae_u32)cmd_write (hfd, dataptr, offset64, len)); actual = (uae_u32)cmd_write (hfd, dataptr, offset64, len);
} }
break; break;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* Support for platform-independent key-mapping * Support for platform-independent key-mapping
* *
* Copyright 2004 Richard Drummond * Copyright 2004 Richard Drummond
* 2010-2011 Mustafa Tufan
*/ */
#include "sysconfig.h" #include "sysconfig.h"
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
* Support for platform-independent key-mapping * Support for platform-independent key-mapping
* *
* Copyright 2004 Richard Drummond * Copyright 2004 Richard Drummond
* 2010-2011 Mustafa Tufan
*/ */
......
...@@ -929,15 +929,18 @@ void debugger_change (int mode) ...@@ -929,15 +929,18 @@ void debugger_change (int mode)
// regsetint (NULL, "DebuggerType", debugger_type); // regsetint (NULL, "DebuggerType", debugger_type);
openconsole (); openconsole ();
} }
// unicode // unicode
char *ua (const TCHAR *s) char *ua (const TCHAR *s)
{ {
return s; return s;
} }
char *uutf8 (const char *s) char *uutf8 (const char *s)
{ {
return s; return s;
} }
char *utf8u (const char *s) char *utf8u (const char *s)
{ {
return s; return s;
...@@ -1062,7 +1065,7 @@ void my_kbd_handler (int keyboard, int scancode, int newstate) ...@@ -1062,7 +1065,7 @@ void my_kbd_handler (int keyboard, int scancode, int newstate)
scancode = scancode_new; scancode = scancode_new;
#endif #endif
// write_log ("kbd1 = %d, scancode = %d (0x%02x), state = %d\n", keyboard, scancode, scancode, newstate); write_log ("kbd= %d, sc_new= %d, scancode= %d (0x%02x), state= %d\n", keyboard, scancode_new, scancode, scancode, newstate);
if (newstate == 0 && code == 0) { if (newstate == 0 && code == 0) {
switch (scancode) switch (scancode)
......
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