1
0
mirror of https://gitlab.os-k.eu/os-k-team/kvisc.git synced 2023-08-25 14:05:46 +02:00
This commit is contained in:
julianb0 2019-07-08 17:46:10 +02:00
parent 972ea65016
commit 8ba9f2dd69
No known key found for this signature in database
GPG Key ID: DDF8325C95299A62
3 changed files with 34 additions and 33 deletions

View File

@ -57,7 +57,7 @@ void exec_instr(ctx_t *ctx,
ulong r1 = 0, r2 = 0, r3 = 0;
// Global instruction counter
ctx->ninstrs++;
fc0++;
// Current frame instruction counter
fc2++; // since last frame change
@ -135,7 +135,10 @@ do_rep:
if (rcx == 0)
return;
ctx->ninstrs++;
// Should we really count REP's in instruction count?
fc0++;
fc1++;
fc2++;
#if 0
// Show that we're REP'ing

View File

@ -126,16 +126,6 @@ void console_handle_input(ctx_t *ctx, SDL_Keycode key)
QKEY(BACKSLASH, '\\', '|', 0, 0, 0);
QKEY(PERIOD, '.', '>', 0, 0, 0);
QKEY(SLASH, '/', '?', 0, 0, 0);
QKEY(1, '1', '!', 0, 0, 0);
QKEY(2, '2', '@', 0, 0, 0);
QKEY(3, '3', '#', 0, 0, 0);
QKEY(4, '4', '$', 0, 0, 0);
QKEY(5, '5', '%', 0, 0, 0);
QKEY(6, '6', '^', 0, 0, 0);
QKEY(7, '7', '&', 0, 0, 0);
QKEY(8, '8', '*', 0, 0, 0);
QKEY(9, '9', '(', 0, 0, 0);
QKEY(0, '0', ')', 0, 0, 0);
QKEY(LEFTBRACKET, '[', '{', 0, 0, 0);
QKEY(RIGHTBRACKET, ']', '}', 0, 0, 0);
QKEY(BACKQUOTE, '`', '~', 0, 0, 0);
@ -149,14 +139,34 @@ void console_handle_input(ctx_t *ctx, SDL_Keycode key)
QKEY(SEMICOLON, ';', ':', 0, 0, 0);
QKEY(EQUALS, '=', '+', 0, 0, 0);
QKEY(MINUS, '-', '_', 0, 0, 0);
QKEY(1, '1', '!', 0, 0, 0);
QKEY(2, '2', '@', 0, 0, 0);
QKEY(3, '3', '#', 0, 0, 0);
QKEY(4, '4', '$', 0, 0, 0);
QKEY(5, '5', '%', 0, 0, 0);
QKEY(6, '6', '^', 0, 0, 0);
QKEY(7, '7', '&', 0, 0, 0);
QKEY(8, '8', '*', 0, 0, 0);
QKEY(9, '9', '(', 0, 0, 0);
QKEY(0, '0', ')', 0, 0, 0);
#else
QKEY(QUOTE, '\'', '4', '{', 0, 0);
QKEY(COMMA, ',', '?', 0, 0, 0);
QKEY(SEMICOLON, ';', '.', 0, 0, 0);
QKEY(EQUALS, '=', '+', '}', 0, 0);
QKEY(MINUS, '-', '6', '|', 0, 0);
QKEY(COMMA, ',', '?', 0, 0, 0);
QKEY(SEMICOLON, ';', '.', 0, 0, 0);
QKEY(EQUALS, '=', '+', '}', 0, 0);
QKEY(MINUS, '-', '6', '|', 0, 0);
QKEY(1, '&', '1', 0, 0, 0);
QKEY(2, 0, '2', '~', 0, 0);
QKEY(3, '"', '3', '#', 0, 0);
QKEY(4, '\'','4', '{', 0, 0);
QKEY(5, '(', '5', '[', 0, 0);
QKEY(6, '-', '6', '|', 0, 0);
QKEY(7, 0, '7', '`', 0, 0);
QKEY(8, '_', '8', '\\', 0, 0);
QKEY(9, 0, '9', '^', 0, 0);
QKEY(0, 0, '0', '@', 0, 0);
#endif

View File

@ -128,17 +128,17 @@ ulong readmem(ctx_t *ctx, ulong addr, uint len)
switch (len) {
case 1:
val = readmem8(ctx, real, addr);
val = SIGN_EXTEND(val, 0xFF);
val = (ulong)(long)(char)(val & 0xFF);
break;
case 2:
val = readmem16(ctx, real, addr);
val = SIGN_EXTEND(val, 0xFFFF);
val = (ulong)(long)(short)(val & 0xFFFF);
break;
case 4:
val = readmem32(ctx, real, addr);
val = SIGN_EXTEND(val, 0xFFFFFFFFUL);
val = (ulong)(long)(int)(val & 0xFFFFFFFF);
break;
case 8:
@ -169,7 +169,7 @@ void writemem(ctx_t *ctx, ulong val, ulong addr, uint len)
//----------------------------------------------------------------------------//
//
// The following functions zero-extend rather than sign-extend
// The following function zero-extend rather than sign-extend
//
ulong readmemzx(ctx_t *ctx, ulong addr, uint len)
@ -187,17 +187,5 @@ ulong readmemzx(ctx_t *ctx, ulong addr, uint len)
}
}
void writememzx(ctx_t *ctx, ulong val, ulong addr, uint len)
{
GETREAL();
CHK_RANGE();
switch (len) {
case 1: writemem8(ctx, val, real, addr); break;
case 2: writemem16(ctx, val, real, addr); break;
case 4: writemem32(ctx, val, real, addr); break;
case 8: writemem64(ctx, val, real, addr); break;
default: logerr("writememzx() bad length %d!\n", len); abort();
}
}
//----------------------------------------------------------------------------//