Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SRAM: AZERTY keyboard not recognized, QWERTY only #235

Open
legluondunet opened this issue May 16, 2023 · 5 comments
Open

SRAM: AZERTY keyboard not recognized, QWERTY only #235

legluondunet opened this issue May 16, 2023 · 5 comments

Comments

@legluondunet
Copy link

Hello,
when I play SRAM 1 with Caprice32, my keyboard is in QWERTY, I can not use an AZERTY keyboard.

  • when I start Caprice32 without launching a game: keyboard is AZERTY
  • when I play SRAM1: keyboard is QWERTY
  • when I press F9 to use virtual keyboard, it shows me an AZERTY keyboard, but when I press A, the game show a Q...
  • when I play another game: AZERTY keyboard is ok

I can reproduce this issue with Caprice32 compiled from git (today's code) or with RETROARCH Caprice32 core (today's code).

Thank you for your help.

my config:
OS: Manjaro 22.1.1 Talos
Kernel: x86_64 Linux 6.3.0-1-MANJARO
Proc: AMD Ryzen 9 5900HX
GPU: AMD AMD Radeon RX 6600M
Drivers: Mesa 23.01
32 Go RAM

@ColinPitrat
Copy link
Owner

Interesting. I'd be curious to know how it behaves on a real Amstrad CPC. Though it would be surprising if it doesn't work...

Changing the PC keyboard layout (e.g. 'keymap_uk_linux.map') doesn't fix the issue. Changing the CPC language does fix it.

It seems to me that the game may be written in a peculiar way. Instead of using the BIOS routines to access the keyboard, it may be doing the translation to a char itself (level 2 in https://www.cpcwiki.eu/imgs/3/3e/S968se03.pdf) ignoring the type of keyboard used.

Or maybe it does take into account the type of keyboard use but determines it based on some difference between keyboards that I don't emulate. The only thing that changes between keyboards in Caprice is that a different charmap and key map table are used.

@ColinPitrat
Copy link
Owner

I need to dig whether this works or not:
https://www.cpcwiki.eu/forum/programming/how-know-the-keyboard-layout-(cpctelera)/

The basic routine at the end seems to work but I need to test the assembly one too.

@legluondunet legluondunet changed the title SRAM: QWERTY, impossibe to play with an AZERTY keyboard SRAM: AZERTY keyboard not recognized, QWERTY only May 17, 2023
@legluondunet
Copy link
Author

legluondunet commented May 17, 2023

I forgot to precise I use AZERTY keyboard cause I'm french, so during my tests I set Caprice32 to french and set Keyboard layout to keymap_fr_linux.map, that changed nothing. After launching SRAM 1, I choose F for France language.

@ColinPitrat
Copy link
Owner

Tried the asm routine from cpcwiki.eu, it works as expected too: https://github.com/ColinPitrat/CPCMisc/tree/main/assembly/004_keyboard

@ColinPitrat
Copy link
Owner

ColinPitrat commented May 17, 2023

Note that as it works fine with a UK keyboard, a workaround could be to have a special shortcut for this game, something like:

cap32 -O system.keyboard=0 -a 'run"sram' Sram_Side_A.dsk

Other tips:

You can press F9 (toggle limit speed) to accelerate the animation & load times.

Even better, to avoid having to switch the disk each time, once you've loaded Side B you can save a snapshot (F1 - Load/Save - File type = Snapshot). This allows to have a shortcut that will drop you directly from the start of the game.

You can also use the snapshot as a way to save the game. Shift+F3 is a shortcut to take a snapshot (named from the date & time). Shift+F4 restores the latest snapshot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants