- [FIX] Corrected key mapping
- [FIX] ULA ports reconnected after reset - [FIX] port check on IN() was crashing.
This commit is contained in:
2
z80.cpp
2
z80.cpp
@@ -821,7 +821,7 @@ namespace z80
|
|||||||
port = (rA<<8) | port;
|
port = (rA<<8) | port;
|
||||||
// don't touch flags
|
// don't touch flags
|
||||||
}
|
}
|
||||||
if (in_ports[port]) {
|
if (in_ports[port&0xff]) {
|
||||||
const uint8_t val = (uint8_t)in_ports[port&0xff](port);
|
const uint8_t val = (uint8_t)in_ports[port&0xff](port);
|
||||||
if (val != 0xff)
|
if (val != 0xff)
|
||||||
return val;
|
return val;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
#include "z80.h"
|
#include "z80.h"
|
||||||
#include "z80dis.h"
|
#include "z80dis.h"
|
||||||
|
#include "zx_ula.h"
|
||||||
namespace z80debug
|
namespace z80debug
|
||||||
{
|
{
|
||||||
#define CHR_W 6
|
#define CHR_W 6
|
||||||
@@ -356,7 +356,8 @@ namespace z80debug
|
|||||||
z80debug::cont();
|
z80debug::cont();
|
||||||
} else if (strcmp(cmd, "r")==0 || strcmp(cmd, "reset")==0) {
|
} else if (strcmp(cmd, "r")==0 || strcmp(cmd, "reset")==0) {
|
||||||
z80::reset(z80::getMem());
|
z80::reset(z80::getMem());
|
||||||
for (int i=0; i<65536; ++i) breakpoints[i]=0;
|
z80::connect_port(0xfe, zx_ula::port_in, zx_ula::port_out);
|
||||||
|
//for (int i=0; i<65536; ++i) breakpoints[i]=0;
|
||||||
z80debug::refresh();
|
z80debug::refresh();
|
||||||
} else if (strcmp(cmd, "b")==0 || strcmp(cmd, "break")==0) {
|
} else if (strcmp(cmd, "b")==0 || strcmp(cmd, "break")==0) {
|
||||||
getcmd();
|
getcmd();
|
||||||
|
|||||||
80
zx_ula.cpp
80
zx_ula.cpp
@@ -15,74 +15,74 @@ namespace zx_ula
|
|||||||
if (!(h_addr & ~0xfe))
|
if (!(h_addr & ~0xfe))
|
||||||
{
|
{
|
||||||
result &= ~(
|
result &= ~(
|
||||||
keys[SDL_SCANCODE_LSHIFT]*0xef +
|
keys[SDL_SCANCODE_LSHIFT]*0x01 +
|
||||||
keys[SDL_SCANCODE_Z]*0xf7 +
|
keys[SDL_SCANCODE_Z]*0x02 +
|
||||||
keys[SDL_SCANCODE_X]*0xfb +
|
keys[SDL_SCANCODE_X]*0x04 +
|
||||||
keys[SDL_SCANCODE_C]*0xfd +
|
keys[SDL_SCANCODE_C]*0x08 +
|
||||||
keys[SDL_SCANCODE_V]*0xfe );
|
keys[SDL_SCANCODE_V]*0x10 );
|
||||||
}
|
}
|
||||||
if (!(h_addr & ~0xfd))
|
if (!(h_addr & ~0xfd))
|
||||||
{
|
{
|
||||||
result &= ~(
|
result &= ~(
|
||||||
keys[SDL_SCANCODE_A]*0xef +
|
keys[SDL_SCANCODE_A]*0x01 +
|
||||||
keys[SDL_SCANCODE_S]*0xf7 +
|
keys[SDL_SCANCODE_S]*0x02 +
|
||||||
keys[SDL_SCANCODE_D]*0xfb +
|
keys[SDL_SCANCODE_D]*0x04 +
|
||||||
keys[SDL_SCANCODE_F]*0xfd +
|
keys[SDL_SCANCODE_F]*0x08 +
|
||||||
keys[SDL_SCANCODE_G]*0xfe );
|
keys[SDL_SCANCODE_G]*0x10 );
|
||||||
}
|
}
|
||||||
if (!(h_addr & ~0xfb))
|
if (!(h_addr & ~0xfb))
|
||||||
{
|
{
|
||||||
result &= ~(
|
result &= ~(
|
||||||
keys[SDL_SCANCODE_Q]*0xef +
|
keys[SDL_SCANCODE_Q]*0x01 +
|
||||||
keys[SDL_SCANCODE_W]*0xf7 +
|
keys[SDL_SCANCODE_W]*0x02 +
|
||||||
keys[SDL_SCANCODE_E]*0xfb +
|
keys[SDL_SCANCODE_E]*0x04 +
|
||||||
keys[SDL_SCANCODE_R]*0xfd +
|
keys[SDL_SCANCODE_R]*0x08 +
|
||||||
keys[SDL_SCANCODE_T]*0xfe );
|
keys[SDL_SCANCODE_T]*0x10 );
|
||||||
}
|
}
|
||||||
if (!(h_addr & ~0xf7))
|
if (!(h_addr & ~0xf7))
|
||||||
{
|
{
|
||||||
result &= ~(
|
result &= ~(
|
||||||
keys[SDL_SCANCODE_1]*0xef +
|
keys[SDL_SCANCODE_1]*0x01 +
|
||||||
keys[SDL_SCANCODE_2]*0xf7 +
|
keys[SDL_SCANCODE_2]*0x02 +
|
||||||
keys[SDL_SCANCODE_3]*0xfb +
|
keys[SDL_SCANCODE_3]*0x04 +
|
||||||
keys[SDL_SCANCODE_4]*0xfd +
|
keys[SDL_SCANCODE_4]*0x08 +
|
||||||
keys[SDL_SCANCODE_5]*0xfe );
|
keys[SDL_SCANCODE_5]*0x10 );
|
||||||
}
|
}
|
||||||
if (!(h_addr & ~0xef))
|
if (!(h_addr & ~0xef))
|
||||||
{
|
{
|
||||||
result &= ~(
|
result &= ~(
|
||||||
keys[SDL_SCANCODE_0]*0xef +
|
keys[SDL_SCANCODE_0]*0x01 +
|
||||||
keys[SDL_SCANCODE_9]*0xf7 +
|
keys[SDL_SCANCODE_9]*0x02 +
|
||||||
keys[SDL_SCANCODE_8]*0xfb +
|
keys[SDL_SCANCODE_8]*0x04 +
|
||||||
keys[SDL_SCANCODE_7]*0xfd +
|
keys[SDL_SCANCODE_7]*0x08 +
|
||||||
keys[SDL_SCANCODE_6]*0xfe );
|
keys[SDL_SCANCODE_6]*0x10 );
|
||||||
}
|
}
|
||||||
if (!(h_addr & ~0xdf))
|
if (!(h_addr & ~0xdf))
|
||||||
{
|
{
|
||||||
result &= ~(
|
result &= ~(
|
||||||
keys[SDL_SCANCODE_P]*0xef +
|
keys[SDL_SCANCODE_P]*0x01 +
|
||||||
keys[SDL_SCANCODE_O]*0xf7 +
|
keys[SDL_SCANCODE_O]*0x02 +
|
||||||
keys[SDL_SCANCODE_I]*0xfb +
|
keys[SDL_SCANCODE_I]*0x04 +
|
||||||
keys[SDL_SCANCODE_U]*0xfd +
|
keys[SDL_SCANCODE_U]*0x08 +
|
||||||
keys[SDL_SCANCODE_Y]*0xfe );
|
keys[SDL_SCANCODE_Y]*0x10 );
|
||||||
}
|
}
|
||||||
if (!(h_addr & ~0xbf))
|
if (!(h_addr & ~0xbf))
|
||||||
{
|
{
|
||||||
result &= ~(
|
result &= ~(
|
||||||
keys[SDL_SCANCODE_RETURN]*0xef +
|
keys[SDL_SCANCODE_RETURN]*0x01 +
|
||||||
keys[SDL_SCANCODE_L]*0xf7 +
|
keys[SDL_SCANCODE_L]*0x02 +
|
||||||
keys[SDL_SCANCODE_K]*0xfb +
|
keys[SDL_SCANCODE_K]*0x04 +
|
||||||
keys[SDL_SCANCODE_J]*0xfd +
|
keys[SDL_SCANCODE_J]*0x08 +
|
||||||
keys[SDL_SCANCODE_H]*0xfe );
|
keys[SDL_SCANCODE_H]*0x10 );
|
||||||
}
|
}
|
||||||
if (!(h_addr & ~0x7f))
|
if (!(h_addr & ~0x7f))
|
||||||
{
|
{
|
||||||
result &= ~(
|
result &= ~(
|
||||||
keys[SDL_SCANCODE_SPACE]*0xef +
|
keys[SDL_SCANCODE_SPACE]*0x01 +
|
||||||
keys[SDL_SCANCODE_RSHIFT]*0xf7 +
|
keys[SDL_SCANCODE_RSHIFT]*0x02 +
|
||||||
keys[SDL_SCANCODE_M]*0xfb +
|
keys[SDL_SCANCODE_M]*0x04 +
|
||||||
keys[SDL_SCANCODE_N]*0xfd +
|
keys[SDL_SCANCODE_N]*0x08 +
|
||||||
keys[SDL_SCANCODE_B]*0xfe );
|
keys[SDL_SCANCODE_B]*0x10 );
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user