mirror of
https://github.com/TomHarte/CLK.git
synced 2025-10-31 20:16:07 +00:00
Compare commits
4 Commits
2018-03-03
...
2018-03-04
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dfcc502a88 | ||
|
|
1c6faaae88 | ||
|
|
35c8a0dd8c | ||
|
|
38feedaf6a |
@@ -460,12 +460,35 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
// deliberate fallthrough...
|
// deliberate fallthrough...
|
||||||
case SDL_KEYUP: {
|
case SDL_KEYUP: {
|
||||||
KeyboardMachine::Machine *keyboard_machine = machine->keyboard_machine();
|
const bool is_pressed = event.type == SDL_KEYDOWN;
|
||||||
if(!keyboard_machine) break;
|
|
||||||
|
|
||||||
Inputs::Keyboard::Key key = Inputs::Keyboard::Key::Space;
|
KeyboardMachine::Machine *const keyboard_machine = machine->keyboard_machine();
|
||||||
if(!KeyboardKeyForSDLScancode(event.key.keysym.scancode, key)) break;
|
if(keyboard_machine) {
|
||||||
keyboard_machine->get_keyboard().set_key_pressed(key, event.type == SDL_KEYDOWN);
|
Inputs::Keyboard::Key key = Inputs::Keyboard::Key::Space;
|
||||||
|
if(!KeyboardKeyForSDLScancode(event.key.keysym.scancode, key)) break;
|
||||||
|
keyboard_machine->get_keyboard().set_key_pressed(key, is_pressed);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
JoystickMachine::Machine *const joystick_machine = machine->joystick_machine();
|
||||||
|
if(joystick_machine) {
|
||||||
|
std::vector<std::unique_ptr<Inputs::Joystick>> &joysticks = joystick_machine->get_joysticks();
|
||||||
|
if(!joysticks.empty()) {
|
||||||
|
switch(event.key.keysym.scancode) {
|
||||||
|
case SDL_SCANCODE_LEFT: joysticks[0]->set_digital_input(Inputs::Joystick::DigitalInput::Left, is_pressed); break;
|
||||||
|
case SDL_SCANCODE_RIGHT: joysticks[0]->set_digital_input(Inputs::Joystick::DigitalInput::Right, is_pressed); break;
|
||||||
|
case SDL_SCANCODE_UP: joysticks[0]->set_digital_input(Inputs::Joystick::DigitalInput::Up, is_pressed); break;
|
||||||
|
case SDL_SCANCODE_DOWN: joysticks[0]->set_digital_input(Inputs::Joystick::DigitalInput::Down, is_pressed); break;
|
||||||
|
case SDL_SCANCODE_SPACE: joysticks[0]->set_digital_input(Inputs::Joystick::DigitalInput::Fire, is_pressed); break;
|
||||||
|
case SDL_SCANCODE_A: joysticks[0]->set_digital_input(Inputs::Joystick::DigitalInput(Inputs::Joystick::DigitalInput::Fire, 0), is_pressed); break;
|
||||||
|
case SDL_SCANCODE_S: joysticks[0]->set_digital_input(Inputs::Joystick::DigitalInput(Inputs::Joystick::DigitalInput::Fire, 1), is_pressed); break;
|
||||||
|
default: {
|
||||||
|
const char *key_name = SDL_GetKeyName(event.key.keysym.sym);
|
||||||
|
joysticks[0]->set_digital_input(Inputs::Joystick::DigitalInput(key_name[0]), is_pressed);
|
||||||
|
} break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
default: break;
|
default: break;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ It currently contains emulations of the:
|
|||||||
* Acorn Electron;
|
* Acorn Electron;
|
||||||
* Amstrad CPC;
|
* Amstrad CPC;
|
||||||
* Atari 2600;
|
* Atari 2600;
|
||||||
|
* ColecoVision;
|
||||||
* Commodore Vic-20 (and Commodore 1540/1);
|
* Commodore Vic-20 (and Commodore 1540/1);
|
||||||
* MSX 1;
|
* MSX 1;
|
||||||
* Oric 1/Atmos; and
|
* Oric 1/Atmos; and
|
||||||
@@ -43,6 +44,7 @@ If your machine has a 4k monitor and a 96Khz audio output? Then you'll get a 4k
|
|||||||
|||
|
|||
|
||||||
|||
|
|||
|
||||||
|||
|
|||
|
||||||
|
|||
|
||||||
|
|
||||||
| 1:1 Pixel Copying | Correct Aspect Ratio, Filtered |
|
| 1:1 Pixel Copying | Correct Aspect Ratio, Filtered |
|
||||||
|---|---|
|
|---|---|
|
||||||
@@ -65,7 +67,7 @@ Cycle-accurate emulation for the supported target machines is fairly trite; this
|
|||||||
|
|
||||||
Self-ratings:
|
Self-ratings:
|
||||||
* the Electron, Oric and Vic-20 are pretty much perfect;
|
* the Electron, Oric and Vic-20 are pretty much perfect;
|
||||||
* the ZX80, ZX81 and MSX 1 are very strong;
|
* the ZX80, ZX81, ColecoVision and MSX 1 are very strong;
|
||||||
* the Amstrad CPC has known accuracy deficiencies in its 8272 and 6845;
|
* the Amstrad CPC has known accuracy deficiencies in its 8272 and 6845;
|
||||||
* the Atari 2600 has some known accuracy deficiencies in its TIA;
|
* the Atari 2600 has some known accuracy deficiencies in its TIA;
|
||||||
* the C-1540(/1) is locked in reading mode and doesn't yet support writing.
|
* the C-1540(/1) is locked in reading mode and doesn't yet support writing.
|
||||||
|
|||||||
BIN
READMEImages/CompositePresentsDonkeyKong.png
Normal file
BIN
READMEImages/CompositePresentsDonkeyKong.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
BIN
READMEImages/NaivePresentsDonkeyKong.png
Normal file
BIN
READMEImages/NaivePresentsDonkeyKong.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 311 B |
Reference in New Issue
Block a user