I have targeted the following M5 Stack models with my C64/C128/Vic-20/Apple 1 emulator:
(Even though I have targeted other boards, I had only implemented touch on the CoreS3)
The primary reason for targeting these boards was the common 2" 320x240 display perfect for most C64 emulation, and the availability of a wristband that works with Core2 and CoreS3 (it works with the Fire if and only if you never need to charge the battery - not aware of a universe where that works out long term).
[aside... Originally I had supported the M5 Core Basic, but without PSRAM, it was difficult to support the different computer models that currently load into that memory. So M5 Core BASIC was dropped after its initial development.]
The Basic and Fire have three UI hardware buttons. The Core2 has three virtual touchscreen buttons (touchscreen expands farther down from the LCD screen to allow for capacitive touch button points, and the M5 library abstracts them similar to physical buttons, so your code doesn't even have to know the difference). The CoreS3 has no UI buttons, but I've manually implemented virtual touch screen buttons at the bottom of the screen. From left to right the buttons are known to M5 as A, B, and C.
So button support for Basic, Fire, and Core2 was straightforward.
- press Button A: Cursor UP
- press Button B: RETURN
- press Button C: Cursor Down
- hold Button A: toggle computer model (C64, C128, Vic-20, Apple 1, repeats)
- hold Button B: LOAD"*",8 / RUN for Commodore, snapshot system for Apple 1
- hold Button C: STOP

No comments:
Post a Comment