-
Notifications
You must be signed in to change notification settings - Fork 2k
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
apple2e: fix 80/40 and language switches, add additional UK and French Apple IIe/c variants #12756
base: master
Are you sure you want to change the base?
Conversation
- add UK variants of Apple IIe Platinum and Apple //c - use the same keyboard port descriptions as US since it is just the 3/# key that is different - remove 40/80 column switch from Apple //c+ (the switch is only on the Apple //c) - fix bug where Apple //c+ may crash when booting 5 1/4 disks due to uninitialized disk related variables - add 40/80 column switch to Franklin Ace 500 and Laser 128 series - move language/keyboard selection to its own configuration I/O port and use each nibble of the port byte to hold keyboard ROM and character ROM offsets - add QWERTY/DVORAK mod selection to US Apple //e models and Laser 128 series - add keyboard/language switch to UK, French and Spanish Apple IIe machines - add character set switch (enable/disable MouseText) to Franklin ACE - add keyboard/language switch to tk3000, spectred, and prav8c machines
Hi, As a french Apple II user, I'm interested in that!
Could I somehow help by dumping my french IIc char ROM? I fear this requires specific hardware?
|
Hi, Correct. Special hardware is required to dump either the keyboard or character ROMs since neither are CPU addressable on a real Apple IIe/IIc machines. Merging MAME's US and French keyboard ROMs (QWERTY-half of the US and either half of MAME's existing French ROM) would make the US keyboard layout functional for the French Apple IIe/IIc variants. I suspect the order is AZERTY first and then QWERTY. Regarding whether creating the ROM that MAME uses by merging the two is good, my opinion (but I am just a contributor) is that while it is not as good a real dump, it can be marked with a BAD_DUMP tag in MAME so that it is clear that it is not a real dump. Since using it would be an improvement in emulation accuracy without adding regression, it can be considered for submission for in a PR. For the filename, I assume that it is best to name it after the ROM that it trying to emulate as best as possible. After submitting the draft PR above, I found another yet another site that IDs the French keyboard ROM as "342-0326-A". I added a commit for this that changes the keyboard ROM for the existing apple2eefr with the suggestion you made (except reversing the order) and can confirm that the French/US keyboard switch now works correctly. |
Dumped two French Apple IIe keyboard ROMs, hope that helps. Model: A2S2064F
ROM: 342-0153-A, Copyright Apple 1983 |
A site I found that lists parts numbers refers to "341-0153" as the "Keyboard ROM French/USA" and the "342-0326-A" as "(Enhanced) Keyboard ROM French/USA". With "341-0153", the lock key below Shift is a 'Caps Lock' key and pressing Shift with Caps Lock down do not cancel each other out. Page 36 of Apple //e Guide de l'utilisateur (F030-0356-B) documents the behavior of a French Apple IIe being as per "341-0153". I created a new 'apple2efr' device in the last commit that uses "341-0153". The unenhanced 341-0163-a.e9 can be created from the enhanced 342-0274-a.e9 by replacing the MouseText characters with a second set of the uppercase letters: I tagged 342-0163-a.e9 as a BAD_DUMP. |
…e UK (ISO) keyboard instead of the US keyboard since the UK one is physically identical - do not use second character ROM section on US //e models in DVORAK mode - document Apple IIe keypad symbol changes
@colinleroy, after further inspection, it looks like the UK keyboard layout, 341-0150-A, is a better candidate than the US keyboard layout, 341-0132-D, to use as the basis of the missing US layout of Enhanced French keyboard layout 342-0326-A. UK and France share the same physical keyboard (ignoring the symbols on the keys), but the US one is different. This has a ripple effect that causes `~ and | keys to be swapped. My latest commit uses the first half of 341-0326-a.f12 and the first half of 341-0150-a.e12 to create the new 342-0326-a.f12. |
…(France, Spain, UK)
Seems like a better idea indeed :) |
I've been watching these changes and I appreciate them very much! Big thanks also @Altomare for the keyboard dump! European Apples are not well documented outside of the small bits of info about PAL timings in Sather's "Understanding the Apple IIe" so I don't even know what unique keyboard and video ROMs exist. I'll give a proper review when it's out of draft. |
src/mame/apple/apple2e.cpp
Outdated
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR(0xa3) PORT_CHAR('`') // UK pound (actually to the left of the return key on the QSDF row) | ||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_TILDE) PORT_CHAR('>') PORT_CHAR('<') // actually the key between left shift and W |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You’re supposed to use KEYCODE_BACKSLASH2
for this key.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My last commit adds KEYCODE_BACKSLASH2, but without removing KEYCODE_BACKSLASH for all ISO layouts (UK, FR, and ES). The reason I did not remove KEYCODE_BACKSLASH is that KEYCODE_BACKSLASH2 does not exist as a key on ANSI keyboards, and in the case of Apple IIe/IIc machines, the ISO keyboard has the same number of keys as the North American keyboard - unlike PCs where the ISO keyboard has one extra key. On the Apple IIe/IIc, it is just two keys get swapped in physical position and in how they get encoded in the ROM. Please advise if having both backslashes mapped is correct.
Regarding taking this PR out of draft mode, the main thing I have not done yet is create a new keyboard layout for the UK variant of the Platinum Apple IIe. For that, I wanted to discuss a long-term design for the International Apple computers.
- My original thought was that they could all share the same PORT_CODE/PORT_CHAR defined layout as the US variant. However, `~ and | encodings are swapped between North American and ISO layouts make that design impossible.
- A similar design to the above would be to have 2 US layouts (ISO US layout for UK, France, Italy, Germany, Sweden, Spain and North American US layout for US, Canada, and Latin American machines)
- Would MAME users expect to see the ''Input Assignments (this system)" to show the localized keyboard, or is having the US layout shown an option - given that the real Apple IIe/IIc machines have selection switches to pick either of the two layouts? This would impact which of the two Apple IIe/c keyboard layouts will work when the keyboard mode is set to 'natural'. Currently, the localized one works in 'natural' mode, but the US one will work instead if the above change is made.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, KEYCODE_BACKSLASH
is present on ISO keyboards.
Using this image for reference:
KEYCODE_BACKSLASH
is for the key immediately to the left of return on the home row, with the £ pound sign on it.KEYCODE_BACKSLASH2
is for the key immediately to the right of the left shift key on the bottom row, with angle brackets on it.
The key corresponding to KEYCODE_BACKSLASH2
on ISO keyboards simply doesn’t exist on ANSI or JIS keyboards. Users need to reassign it manually. Assigning KEYCODE_BACKSLASH2
and KEYCODE_BACKSLASH
to that key by default will not do what people expect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My original thought was that they could all share the same PORT_CODE/PORT_CHAR defined layout as the US variant. However, `~ and | encodings are swapped between North American and ISO layouts make that design impossible.
And that’s a bad idea, and not how we do things in MAME. But remember PORT_MODIFY
is a thing so you can reduce duplication if the matrix is mostly the same.
Would MAME users expect to see the ''Input Assignments (this system)" to show the localized keyboard, or is having the US layout shown an option - given that the real Apple IIe/IIc machines have selection switches to pick either of the two layouts? This would impact which of the two Apple IIe/c keyboard layouts will work when the keyboard mode is set to 'natural'. Currently, the localized one works in 'natural' mode, but the US one will work instead if the above change is made.
No, always showing the US layout is not what users would expect. For systems with plug-in keyboards, we provide options for language variants known to exist, even if they only differ in key cap labels, e.g. see these files:
- Mac Plus keyboards (US, France, Japan – only key caps differ)
- Original Mac keyboards (US, UK, France, Italy, Japan – ANSI and ISO use different scan codes as well as different physical layout)
- Sun Type 3/4/5 keyboards (Type 5 had ANSI, ISO and JIS physical layouts – US, UK, Sweden and Japan variants confirmed)
- Amiga keyboards (numerous language variants)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I have modified the genuine Apple //e keyboard definitions to all base upon a single layout and then use PORT_MODIFY to make the minimally required alterations. With this, future expansion for additional localized layouts will not complicate things too much.
Note though that unlike the Amiga where a US keyboard can be unplugged and French keyboard plugged in, with the Apple //e, there is just a physical switch to toggle between US and localize keyboards 'live'. Whether we pick the US or localized layout, for the PORT_CHAR, the other one will technically be missing. Would the emulated Apple //e keyboard have to become a 'slot' device to correctly implement both language layouts at 'Input Assignments' menu? If it is better just to just support 1 at the UI (and natural keyboard level), then the localized one is better.
I will look at the KEYCODE_BACKSLASH2 again for my next commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’s possible to use PORT_CONDITION
to flip the key inputs when you change the state of the switch. Practicality depends on the number of keys that need to have their labels switched when the layout switches.
The Swiss Amiga keyboard needs to do this because a few keys switch function between French and German modes (shift states reversed): https://github.com/mamedev/mame/blob/mame0269/src/devices/bus/amiga/keyboard/matrix.cpp#L663
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. PORT_CONDITION works if I put the condition after each PORT_BIT and create a revert PORT_BIT with the opposite condition (e.g. ISO US keyboard entries for each localized keyboard). I agree that it is only practical if there are not too many keys, but I think there may be quite a bit in the long term if more layouts are added. I tried applying PORT_CONDITION to a 'PORT_MODIFY' line (in case it could be used to disable the entire port-modification when the condition was false, but that did not work). For this PR, I am keeping the existing design where only the localized keyboard works in natural keyboard mode.
Regarding the Apple's ISO keyboard layouts, I tried the changes with a physical ISO PC keyboard just now, and I agree, the KEYCODE_BACKSLASH2 is needed for the <>| key and the KEYCODE_BACKSLASH is needed for the `~£ key as you suggested. My most recent commit makes that change. The current version of MAME (i.e. 270) has KEYCODE_TILDE for the <>| key. I have not removed KEYCODE_TILDE as a mapping to that key since KEYCODE_TILDE would otherwise not be mapped to anything and I therefore expect that it be the key that those without a physical KEYCODE_BACKSLASH2 key would manually map the <>| to. If the correct keys are working for someone using a physical ISO keyboard, is it OK if an extra works by default too? If not, I will remove the KEYCODE_TILDE mapping.
…nal default key - correct descriptions and port characters of some French and Spanish keyboard layout keys - document the ISO keyboard matrix - document known languages, keyboard and character generator ROMs, adding references
@rb6502, my latest commit adds lists of variants I have read about in various Apple documents as well as a list of references. ROM numbers are not well documented for international models. There are many unofficial lists I found on the Internet, but none appear to be complete. |
…ercase comes after lower case for the natural keyboard mode to work correctly) - base Apple //e Platinum and international Apple //e model keyboards on the original US Apple //e keyboard to minimise copy/paste - add French Apple //c and Apple IIe Platinum machines
…he correct location on a modern ISO keyboard
@cuavas Are you OK with the layout and port usage here now? |
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') PORT_CHAR('q') | ||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('W') PORT_CHAR('w') | ||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('E') PORT_CHAR('e') | ||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('R') PORT_CHAR('r') | ||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') PORT_CHAR('y') | ||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('T') PORT_CHAR('t') | ||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('U') PORT_CHAR('u') | ||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('I') PORT_CHAR('i') | ||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('O') PORT_CHAR('o') | ||
PORT_BIT(0x002, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') | ||
PORT_BIT(0x004, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') | ||
PORT_BIT(0x008, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') | ||
PORT_BIT(0x010, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') | ||
PORT_BIT(0x020, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') | ||
PORT_BIT(0x040, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') | ||
PORT_BIT(0x080, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') | ||
PORT_BIT(0x100, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') | ||
PORT_BIT(0x200, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are the PORT_CHAR
swapped here? Don’t unshifted keys produce uppercase by default? Or am I remembering wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Apple IIe/IIc machines, unshifted keys produce lowercase letters by default. However, many Apple IIe/IIc users would keep the caps lock button pressed to run older Apple II/II+ era applications or to type DOS 3.3 commands.
I’m OK with the default assignments. It might be useful to add a The one thing that’s concerning me a little is that this swaps the order of the lowercase and uppercase |
I could not find any cases in apple2e.cpp where there was an LSHIFT without an RSHIFT. This seems to work OK for me with MAME 0.271. I did just notice that 3 cases of RSHIFT are missing the PORT_CHAR(UCHAR_SHIFT_1). I added these just now.
I have never used this feature myself. For sure the letter case in strings will be reversed and will be broken. For commands, it depends on the platform. ProDOS supports lowercase commands, but DOS 3.3 commands must be in uppercase. Filenames are case insensitive. Older applications and games will likely only work with uppercase. |
added European Apple IIe/IIc variants:
80/40 column switch fixes:
keyboard/language switch implementation changes:
fixed bug where Apple IIc+ may crash when booting 5 1/4" disks due to uninitialized disk related variables
embedded more notes about keyboard, keypad, and regional variants in the apple2e.cpp file