mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-13 07:30:21 +00:00
Made a few mapping fixes, clarified where the default reset code lives, ensured the Oric and Vic clear their keys when the typer ends.
This commit is contained in:
parent
c21bef4283
commit
45b169f341
@ -46,21 +46,21 @@ uint16_t *Commodore::Vic20::Machine::sequence_for_character(Utility::Typer *type
|
||||
/* : */ KEYS(KeyColon), /* ; */ KEYS(KeySemicolon),
|
||||
/* < */ SHIFT(KeyComma), /* = */ KEYS(KeyEquals),
|
||||
/* > */ SHIFT(KeyFullStop), /* ? */ SHIFT(KeySlash),
|
||||
/* @ */ KEYS(KeyAt), /* A */ SHIFT(KeyA),
|
||||
/* B */ SHIFT(KeyB), /* C */ SHIFT(KeyC),
|
||||
/* D */ SHIFT(KeyD), /* E */ SHIFT(KeyE),
|
||||
/* F */ SHIFT(KeyF), /* G */ SHIFT(KeyG),
|
||||
/* H */ SHIFT(KeyH), /* I */ SHIFT(KeyI),
|
||||
/* J */ SHIFT(KeyJ), /* K */ SHIFT(KeyK),
|
||||
/* L */ SHIFT(KeyL), /* M */ SHIFT(KeyM),
|
||||
/* N */ SHIFT(KeyN), /* O */ SHIFT(KeyO),
|
||||
/* P */ SHIFT(KeyP), /* Q */ SHIFT(KeyQ),
|
||||
/* R */ SHIFT(KeyR), /* S */ SHIFT(KeyS),
|
||||
/* T */ SHIFT(KeyT), /* U */ SHIFT(KeyU),
|
||||
/* V */ SHIFT(KeyV), /* W */ SHIFT(KeyW),
|
||||
/* X */ SHIFT(KeyX), /* Y */ SHIFT(KeyY),
|
||||
/* Z */ SHIFT(KeyZ), /* [ */ SHIFT(KeyColon),
|
||||
/* \ */ X, /* ] */ SHIFT(KeyFullStop),
|
||||
/* @ */ KEYS(KeyAt), /* A */ KEYS(KeyA),
|
||||
/* B */ KEYS(KeyB), /* C */ KEYS(KeyC),
|
||||
/* D */ KEYS(KeyD), /* E */ KEYS(KeyE),
|
||||
/* F */ KEYS(KeyF), /* G */ KEYS(KeyG),
|
||||
/* H */ KEYS(KeyH), /* I */ KEYS(KeyI),
|
||||
/* J */ KEYS(KeyJ), /* K */ KEYS(KeyK),
|
||||
/* L */ KEYS(KeyL), /* M */ KEYS(KeyM),
|
||||
/* N */ KEYS(KeyN), /* O */ KEYS(KeyO),
|
||||
/* P */ KEYS(KeyP), /* Q */ KEYS(KeyQ),
|
||||
/* R */ KEYS(KeyR), /* S */ KEYS(KeyS),
|
||||
/* T */ KEYS(KeyT), /* U */ KEYS(KeyU),
|
||||
/* V */ KEYS(KeyV), /* W */ KEYS(KeyW),
|
||||
/* X */ KEYS(KeyX), /* Y */ KEYS(KeyY),
|
||||
/* Z */ KEYS(KeyZ), /* [ */ SHIFT(KeyColon),
|
||||
/* \ */ X, /* ] */ SHIFT(KeySemicolon),
|
||||
/* ^ */ X, /* _ */ X,
|
||||
/* ` */ X, /* a */ KEYS(KeyA),
|
||||
/* b */ KEYS(KeyB), /* c */ KEYS(KeyC),
|
||||
|
@ -162,7 +162,10 @@ unsigned int Machine::perform_bus_operation(CPU6502::BusOperation operation, uin
|
||||
if(_typer && operation == CPU6502::BusOperation::ReadOpcode && address == 0xEB1E)
|
||||
{
|
||||
if(!_typer->type_next_character())
|
||||
{
|
||||
clear_all_keys();
|
||||
_typer.reset();
|
||||
}
|
||||
}
|
||||
_tape.run_for_cycles(1);
|
||||
if(_c1540) _c1540->run_for_cycles(1);
|
||||
|
@ -64,7 +64,7 @@ enum Key: uint16_t {
|
||||
Key1 = key(0, 0x01), Key3 = key(0, 0x02), Key5 = key(0, 0x04), Key7 = key(0, 0x08),
|
||||
Key9 = key(0, 0x10), KeyPlus = key(0, 0x20), KeyGBP = key(0, 0x40), KeyDelete = key(0, 0x80),
|
||||
|
||||
TerminateSequence = 0, NotMapped = 0xffff
|
||||
TerminateSequence = 0xffff, NotMapped = 0xfffe
|
||||
};
|
||||
|
||||
enum JoystickInput {
|
||||
|
@ -15,7 +15,7 @@ int Electron::Machine::get_typer_delay()
|
||||
|
||||
int Electron::Machine::get_typer_frequency()
|
||||
{
|
||||
return 625*128; // accept a new character every frame
|
||||
return 625*128*2; // accept a new character every two frames
|
||||
}
|
||||
|
||||
uint16_t *Electron::Machine::sequence_for_character(Utility::Typer *typer, char character)
|
||||
|
@ -81,7 +81,11 @@ unsigned int Machine::perform_bus_operation(CPU6502::BusOperation operation, uin
|
||||
|
||||
if(_typer && operation == CPU6502::BusOperation::ReadOpcode && address == 0xF495)
|
||||
{
|
||||
if(!_typer->type_next_character()) _typer.reset();
|
||||
if(!_typer->type_next_character())
|
||||
{
|
||||
clear_all_keys();
|
||||
_typer.reset();
|
||||
}
|
||||
}
|
||||
|
||||
_via.run_for_cycles(1);
|
||||
|
@ -89,11 +89,6 @@ bool Typer::Delegate::typer_set_next_character(Utility::Typer *typer, char chara
|
||||
return false;
|
||||
}
|
||||
|
||||
void Typer::Delegate::typer_reset(Typer *typer)
|
||||
{
|
||||
clear_all_keys();
|
||||
}
|
||||
|
||||
uint16_t *Typer::Delegate::sequence_for_character(Typer *typer, char character)
|
||||
{
|
||||
return nullptr;
|
||||
|
@ -19,7 +19,7 @@ class Typer {
|
||||
class Delegate: public KeyboardMachine::Machine {
|
||||
public:
|
||||
virtual bool typer_set_next_character(Typer *typer, char character, int phase);
|
||||
virtual void typer_reset(Typer *typer);
|
||||
virtual void typer_reset(Typer *typer) = 0;
|
||||
|
||||
virtual uint16_t *sequence_for_character(Typer *typer, char character);
|
||||
|
||||
@ -52,6 +52,7 @@ class TypeRecipient: public Typer::Delegate {
|
||||
|
||||
void typer_reset(Typer *typer)
|
||||
{
|
||||
clear_all_keys();
|
||||
_typer.reset();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user