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

Amiga and C=128? #9

Open
ecstaticax opened this issue Jul 13, 2020 · 21 comments
Open

Amiga and C=128? #9

ecstaticax opened this issue Jul 13, 2020 · 21 comments
Labels
enhancement New feature or request

Comments

@ecstaticax
Copy link

your work is really great. Do you think you will add Amiga and 128?
Thanks

@Michael1260
Copy link

Michael1260 commented Jul 13, 2020 via email

@dillof dillof added the enhancement New feature or request label Jul 13, 2020
@dillof
Copy link
Member

dillof commented Jul 13, 2020

They are all within the scope of this project, and I've already thought about adding them.

However, adding a new computer is a lot of work:

  • import the emulator and get it to build
  • hook it up to the rest of the program
  • find a usable photo of the keyboard and implement the software and hardware keyboard mappings
  • draw icons for all supported variants and peripherals

Help on any of that (or any other part of the app, including documentation) would be most welcome. Currently, I'm the only one working on this project.

@ecstaticax
Copy link
Author

Hi, I presume it's a very time consuming work.
I can try to find a photo of the Amiga and 128 keyboards and try to adapt them. But I don't know if it will be good. If not, you will trash them.
What do I need to do about size and so on?
Regards.
Gianluca

@dillof
Copy link
Member

dillof commented Jul 13, 2020

You're looking for a photo that is straight from the top, ideally 3000-4000 pixels wide.

Also, you need permission to use the photo: either it's distributed under Creative Commons or similar (Wikipedia is a good source for this), it's your own photo, or you ask the photographer for permission to use it in an open source emulator.

Make sure the edges of the keyboard are straight and parallel to the edges of the image. I use Lightroom on iPad to straighten the image (with the Geometry tool), other programs should have similar tools.

Then you trim it so there is a border about half a key wide. If there are multiple blocks of keys, bring them closer together so the gap is also about half a key wide (e. .g the function keys on C64). Cut out the case, making the regions transparent. If there is writing on the case (e. g. ZX Spectrum), leave that there (best to make a flood color selection of the case color and cut that).

I have a German C128, if you want to start there, I can send you a photo.

@ecstaticax
Copy link
Author

Yes, send it to me and I will do my best. Regards

@dillof
Copy link
Member

dillof commented Jul 13, 2020

Here you go. I already straightened it. The gaps between the key blocks are small enough, you can leave them as they are.

C128

Also, could you please fill in the pixel measurements below:

  • rows expects 6 values:
    • top of digit row
    • bottom of digit row == top of qwerty row
    • bottom of query row == top of asdf row
    • ...
    • bottom of space bar
  • left / right are the edge of the main block
  • controlRight is the right edge of the control key

The rest should hopefully be self explanatory, if not feel free to ask.

For measurements at the edge of a key block, use the edge between the removed case and the remaining black background. For measurements between keys, use the middle between the top of the key caps.

    "C128 DE": Keyboard(c128WithImageName: "Commodore 128 DE Keyboard",
                        rows: [],
                        left: ,
                        right: ,
                        controlRight: ,
                        restoreLeft: ,
                        returnLeft: ,
                        leftShiftLeft: ,
                        leftShiftRight: ,
                        rightShiftLeft: ,
                        rightShiftRight: ,
                        spaceLeft: ,
                        spaceRight: ,
                        keypadLeft: ,
                        keypadRight: ,
                        keypad0Right: ,
                        functionRowTop: ,
                        functionRowBottom: ,
                        functionBlock1Right: ,
                        functionBlock2Left: ,
                        functionBlock2Right: ,
                        funcitonBlock3Right: ),

thanks,
db

@ecstaticax
Copy link
Author

Hi, I created the image, I have some problems to understand the pixel values. Is the image ok?
Regards.

c128

@dillof
Copy link
Member

dillof commented Jul 15, 2020

Please restore the vertical space between the top row of keys (dark grey) and the rest. Otherwise it looks great.

Here some examples of the values I mean, measured in your picture; hope this makes things clearer:

rows: [237, 414, ...]
left: 59,
right: 2739,
controlRight: 298,
...

@ecstaticax
Copy link
Author

Here it is:

C128de

` "C128 DE": Keyboard(c128WithImageName: "Commodore 128 DE Keyboard",
rows: [345,511,680,848,1014,1177],
left: 59,
right: 2739,
controlRight: 298,
restoreLeft: 2500,
returnLeft: 2420,
leftShiftLeft: 238,
leftShiftRight: 477,
rightShiftLeft: 2178,
rightShiftRight: 2404,
spaceLeft: 659,
spaceRight: 2159,
keypadLeft: 2841,
keypadRight: 3505,
keypad0Right: 3168,
functionRowTop: 113,
functionRowBottom: 272,
functionBlock1Right: 735,
functionBlock2Left: 1074,
functionBlock2Right: 1737,
functionBlock3Right: 2740),
functionBlock4Right: 3510),

`

@dillof
Copy link
Member

dillof commented Jul 16, 2020

Thank you, this looks great.

@ecstaticax
Copy link
Author

If you want some other keyboards and have pictures, I can help!

@dillof
Copy link
Member

dillof commented Jul 23, 2020

Amiga 2000 DE Keyboard

Could you please take measurements for this keyboard?

Don't bother with the cursor keys, I'll compute them from the other measurements.

Thanks.

@dillof
Copy link
Member

dillof commented Jul 23, 2020

To avoid misunderstandings: this will need a different set of measurements than the C128 keyboard. Looking at what we measured for C128 should give you a good idea what we will need here. If you have any questions, feel free to ask. If you want to, you can contact me per email. My address is [email protected].

@ecstaticax
Copy link
Author

I am working on it now

@ecstaticax
Copy link
Author

ecstaticax commented Jul 27, 2020

“Amiga DE": Keyboard(AmigaWithImageName: "Commodore Amiga DE Keyboard", rows: [173,274,364,458,554,646], left: 36, right: 1475, controlRight: 150, returnLeft: 1350, leftShiftLeft: 47, leftShiftRight: 196, rightShiftLeft: 1218, rightShiftRight: 1470, spaceLeft: 338, spaceRight: 1163, leftAltLeft: 113, leftAltRight: 226, rightAltLeft: 1283, rightAltRight: 1405, keypadLeft: 1830, keypadRight: 2213, keypad0Right: 2019, functionRowTop: 34, functionRowBottom: 142, functionBlock1Right: 756, functionBlock2Left: 794, functionBlock2Right: 1380),

@dillof
Copy link
Member

dillof commented Jul 28, 2020

Great, thanks.

There are just a few measurements missing:
tildeRight
tabRight
returnUpperLeft
returnLowerLeft
cursorLeft (for the whole del/help/cursor block)
cursorRight
escapeRight
functionBlock1Left

Also, these two are unnecessary (Alt and Amiga keys have the same width):
leftAltRight, rightAltLeft

The next two steps are writing the actual init function and the key to symbol mapping. Would you be willing to tackle those as well?

The init function is in Emulator/Keyboard.swift. c128WithImageName is a good place to start, they have a similar layout. Key names are defined in Emulator/Key.swift; feel free to add new ones if none of the existing fits. CapsLock is the only toggle key.

This defines the hit zones of each key, grouped into rows (all keys with the same top and bottom edges), and within that into spans (adjacent keys of the same width). Double high keys are simply included in both rows.

The symbol mapping is in Emulator/KeyboardSymbols.swift. Again c128 should be a good starting point.

This maps keys from the Amiga keyboard to keys on the hardware keyboard connected to the iPad. If you're not sure which key to map to, just add a comment with the key name (so we see that it's not mapped yet).

@ecstaticax
Copy link
Author

ecstaticax commented Jul 28, 2020

“Amiga DE": Keyboard(AmigaWithImageName: "Commodore Amiga DE Keyboard", 
rows: [173,274,364,458,554,646], 
left: 36, 
right: 1475, 
controlRight: 150, 
leftShiftLeft: 47, 
leftShiftRight: 196, 
rightShiftLeft: 1218, 
rightShiftRight: 1470, 
spaceLeft: 338, 
spaceRight: 1163, 
leftAltLeft: 113, 
rightAltRight: 1405, 
keypadLeft: 1830, 
keypadRight: 2213, 
keypad0Right: 2019, 
functionRowTop: 34, 
functionRowBottom: 142, 
functionBlock1Left: 174,
functionBlock1Right: 756, 
functionBlock2Left: 794, 
functionBlock2Right: 1380,
tildeRight: 172,
tabRight: 223,
returnUpperLeft:1326,
returnLowerLeft:1355,
cursorLeft: 1508, 
cursorRight: 1794,
escapeRight: 140),

@ecstaticax
Copy link
Author

Let me know if I did the latest keys correctly, I also tried to modify Key.swift, but it's the first time I use github...
If it's ok I will tro to edit Keyboard.swift...

@dillof
Copy link
Member

dillof commented Jul 28, 2020

The following measurements are unnecessary:
leftShiftLeft (use left)
rightShiftRight (use right)
leftAltRight (use a span from leftAltLeft to spaceLeft with keys .AltLeft and .AmigaLeft)
rightAltleft

Otherwise they look great.

If you don't want to use git/GitHub, just download the raw version of the files and send me the edited versions (via email is probably best). Your changes should be easy enough for me to integrate.

@ecstaticax
Copy link
Author

I also cannot understand why I input with the "code" option on github, and they are not formatted :-(

@dillof
Copy link
Member

dillof commented Jul 28, 2020

For multi-line code, use triple backtick followed by the language used (swift in our case):

```swift
func foo() -> Bar {
    return Bar()
}
```

produces

func foo() -> Bar {
    return Bar()
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

3 participants