ColinPitrat / caprice32

An emulator of the Amstrad CPC 8bit home computer range.
GNU General Public License v2.0
147 stars 32 forks source link

Faulty spanish keyboard #227

Open Noobsaibot73 opened 2 years ago

Noobsaibot73 commented 2 years ago

Hello, I'm experiencing a trouble when running this emulator, if you select the spanish CPC and choose ES_Linux or es ES_Windows keyboard, the "ñ" key is not working at all, and no way to get the "|" sign in order to change from disk to tape. On the other hand, if I select a CPC 464 rom, change memory to 64 kb, select spanish version of the CPC, spanish keyboard, change load from disk to tape, select a tape to load, and perform a cat, I get the "Drive A: disc missing" message (seems that changes are saved, but not applied). No way to get working the spanish version of the CPC keyboard, and no matter if you choose a CPC 464 rom, you are always using disks, even if you change load to tape.

ColinPitrat commented 2 years ago

I'll look into the keyboard issue. Note that you can use the virtual keyboard for typing unaccessible characters (shift+F1).

I'm not sure I understand your last problem.

What do you mean by selecting 464 ROM? Do you mean switching the model to 464 in the menu or configuration file?

How do you change load from disk to tape? Normally it's done through "|tape" command but as you can't type a pipe...

Noobsaibot73 commented 2 years ago

Hello again,

Yes, if I switch from the cpc 6128 to the cpc 464 (which doesn't use disks as it was marketed with tape unit, as you know), you need to change from disk to tape. I can't do it in Caprice32 4.6.0, but if I use Caprice32 3.6.4 version, which has a working spanish keyboard, I realised that there is the same problem. The CPC 464 ROM, is working with disks instead to do it (natively) with tapes, so, if I want to load a tape, I have to change from disk to tape with that command (|tape). That's what is driving me crazy, as the original CPC 464 doesn't need to change from disk to tape in order to load a tape. Another way to see the problem, is switching to cpc 464 in the config menu, and type run" you will get an error menu, if you do this with a real CPC 464, the cpc will try to load a tape (its default unit). So, why do you have to change from disk to tape if the real CPC 464 doesn't come with a disk unit and you don't need to do it?

Thank you very much in advance. Best regards.

El dom, 9 oct 2022 a las 9:18, Colin Pitrat @.***>) escribió:

I'll look into the keyboard issue. Note that you can use the virtual keyboard for typing unaccessible characters (shift+F1).

I'm not sure I understand your last problem.

What do you mean by selecting 464 ROM? Do you mean switching the model to 464 in the menu or configuration file?

How do you change load from disk to tape? Normally it's done through "|tape" command but as you can't type a pipe...

— Reply to this email directly, view it on GitHub https://github.com/ColinPitrat/caprice32/issues/227#issuecomment-1272475426, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT6WHTAX2MDYCQYE7UZABUTWCJWTXANCNFSM6AAAAAARAFSHNY . You are receiving this because you authored the thread.Message ID: @.***>

ColinPitrat commented 2 years ago

Indeed, that is a regression! Thanks for catching it, I'll have a look.

ColinPitrat commented 2 years ago

Keeping this issue for the keyboard issue and opening #228 for the ROM issue.

ColinPitrat commented 2 years ago

I managed to open a separate bug and use the wrong one in the commit :-)

ColinPitrat commented 2 years ago

Coming back to the keyboard, it's always quite hard for me to test and fix because I'm only under linux and I got reports that windows was sending different keycodes than linux in SDL (hence the split of linux & windows keymap files).

Switching my layout to spanish under linux and setting spanish keyboard and keymap_es_linux.map I have no issue typing ñ and Ñ (using the key below P) and | (using AltGr + 1).

With keymap_es_win.map the ñ and Ñ don't work anymore (expected as I'm not under windows) but | still works with the same key combination.

One thing you can try is creating your own copy of keymap_es_win.map (or linux) under resources/ and edit it to see if you can get it to work as you want.

To help you with this, you should be able to run ./cap32 -v in a terminal. Then when you press keys, you'll see lines like:

VERBOSE src/cap32.cpp:2780 - Keyboard: pressed: M - keycode: SDLK_m (109) - scancode: SDL_SCANCODE_SEMICOLON (51)

You're interested into what the output is when you try to input ñ, Ñ and |.

Personally, with a spanish layout, I have:

For ñ:

VERBOSE src/cap32.cpp:2780 - Keyboard: pressed: ñ - keycode:  (241) - scancode: SDL_SCANCODE_SEMICOLON (51)

For Ñ (in two steps: one line when pressing shift, the other when pressing the letter):

VERBOSE src/cap32.cpp:2780 - Keyboard: pressed: Left Shift - keycode: SDLK_LSHIFT (1073742049) - scancode: SDL_SCANCODE_LSHIFT (225)
VERBOSE src/cap32.cpp:2780 - Keyboard: pressed: ñ - keycode:  (241) - scancode: SDL_SCANCODE_SEMICOLON (51)

For | (in two steps too):

VERBOSE src/cap32.cpp:2780 - Keyboard: pressed: Right Alt - keycode: SDLK_RALT (1073742054) - scancode: SDL_SCANCODE_RALT (230)
VERBOSE src/cap32.cpp:2780 - Keyboard: pressed: 1 - keycode: SDLK_1 (49) - scancode: SDL_SCANCODE_1 (30)
Noobsaibot73 commented 2 years ago

Hi again,

Yes, removing Amsdos from slot 7, CPC 464 ROM is working with no problem. Thanks.

Going to check the keyboard...

El dom, 9 oct 2022 a las 13:36, Colin Pitrat @.***>) escribió:

The solution in 61f6cb0 https://github.com/ColinPitrat/caprice32/commit/61f6cb0ecdef8008ee1aba4d93927d65ba8f77de consists in:

  • introducing a DEFAULT keyword for Rom 7 which allows to specify that we want the default ROM
  • if using 464, DEFAULT means no ROM, if using 664 or 6128 it means amsdos.rom
  • if a user overrides DEFAULT with a particular value (for example amsdos.rom) then the override is kept across model changes

I think it's unlikely a user would override the ROM 7 and be hurt by that later.

— Reply to this email directly, view it on GitHub https://github.com/ColinPitrat/caprice32/issues/227#issuecomment-1272522564, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT6WHTHY3XMRYBZWHPQX24LWCKU5TANCNFSM6AAAAAARAFSHNY . You are receiving this because you authored the thread.Message ID: @.***>

Noobsaibot73 commented 2 years ago

Removing cap32.cfg and creating a new one results in getting back the "ñ" key and the asterisk "*" but only using the spanish linux keyboard, no way to get back the "|" sign. Going to check keyboards on the 3.6.4 version.

El dom, 9 oct 2022 a las 18:09, Francisco Martín (< @.***>) escribió:

Hi again,

Yes, removing Amsdos from slot 7, CPC 464 ROM is working with no problem. Thanks.

Going to check the keyboard...

El dom, 9 oct 2022 a las 13:36, Colin Pitrat @.***>) escribió:

The solution in 61f6cb0 https://github.com/ColinPitrat/caprice32/commit/61f6cb0ecdef8008ee1aba4d93927d65ba8f77de consists in:

  • introducing a DEFAULT keyword for Rom 7 which allows to specify that we want the default ROM
  • if using 464, DEFAULT means no ROM, if using 664 or 6128 it means amsdos.rom
  • if a user overrides DEFAULT with a particular value (for example amsdos.rom) then the override is kept across model changes

I think it's unlikely a user would override the ROM 7 and be hurt by that later.

— Reply to this email directly, view it on GitHub https://github.com/ColinPitrat/caprice32/issues/227#issuecomment-1272522564, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT6WHTHY3XMRYBZWHPQX24LWCKU5TANCNFSM6AAAAAARAFSHNY . You are receiving this because you authored the thread.Message ID: @.***>