https://github.com/FrankBoesing/Teensy64
Features
- Supports Commodore Serial IEC Bus
- For ILI9341 SPI Display
- USB-Keyboards (wireless too)
- 31kHz reSID Audio emulation
- Audio Line-Out
- Compatible to 1541 and other drives + SD2IEC
- Simple drive emulation included (load "whatever.prg" or load "$" )
- Supports original joysticks
- very small
- Hotkeys (e.g. "LOAD "$":LIST)
About
Code:
10 PRINT "HELLO WORLD";
20 GOTO 10
In the beginning my goal was to make emulation good enough for "Boulder Dash" and other of my old favorite games. This goal has been achieved and I have the ambition to make some demos executable. "Teensy64" is compatible enough to play many games and other programs like the original. For the serial floppy interface the SID sound emulation has to be switched off during the accesses, because reSID requires a lot of computing time. Since the C64 operates this interface "in software" with the CPU and the signal lines have to be controlled more or less exactly in time, I couldn't find a way to keep the sound active even after many ideas and attempts. However, a 1541 floppy disk drive that had been bought extra second-hand was damaged after a short time. It was just too old. After some searching I found the "SD2IEC" project. It seems to be a good replacement and emulates the floppy drive wonderfully. SD2IEC can be connected to the interface of the board and works great. My plan is to port the SD2IEC software to Teensy 3.6 and integrate it into "Teensy64". I'm not sure if that's possible yet. There is also a way to work with the Teensy64 without an external drive. I patched the emulated ROM a little bit and misused the device ID 1. The following commands are available:
- Load "$" - loads the directory (display as known with the command "LIST")
- Load "whatever. prg" - Loads the program from the Teensy SD card.
- Save "whatever. prg" - Saves the program.
Other commands such as "open" are currently NOT supported for Device 1. Disk-Containers like "D64" are not supported by this simple patch.
Access is ALWAYS made to a subdirectory "/C64/", which must be present on the SD card.
Thanks to Bill Greiman for his SdFat library with long file names. The C64 was able to support file names of 16 characters length in the 80's when Microsoft only supported 8+3 characters.
There are many more TODOs I would like to tackle little by little. The emulated VIC does not yet support the BA signal, and the emulated 6150 processor does not yet know it; -) Therefore there are some inaccuracies in the processor cycles. For example, the VIC can pause the processor or allow write access only. The latter has not yet been implemented. There's still work to be done on the internal timing of the sprites - so "Democoder"tricks like sprite stretching don't work. Also "xFLI" and "DMA Delay" is not yet possible. All things that the developers of the C64 didn't foresee at that time but were discovered by "hackers". Furthermore, only the PAL mode works satisfactorily - but this is only because I haven't found an NTSC program yet!
Working "Demo VIC Tricks":
- Open Borders (top/bottom)
- FLD-Flexible Line Distance
This project is "Open Source" and everyone is invited to work on it.
(Old Version of board with only one joystick port soldered)
The board is exactly the size of the display.
Defragster, thank you very much for your help.
IEC Levelshifter:
This boards uses one transitor and three resistors as bi-directional levelshifter - per line. It is not very fast (about 1.2uS on falling edge) , but fast enough for the C64. It needs a bit more power (mA) than the single 1k-resistors which Commodore used in ther devices. I read somewhere, that, normally, you can attach 8 devices to the bus. With this board, I wouldn't use more than 5-6.
How to compile:
Teensy64 needs some special settings:
- F_CPU = 240MHz
- F_BUS = 120MHz
- AUDIO_BLOCK_SAMPLES=32
Included is a file named "defs.h" that will do all the hard work you - if you replace the platform.txt of Arduino (latest 1.39) with the one which is attached to this post. It will not influence your other sketches.
If you don't want to use this solution, please ask the forum for help
The following additional libraries are needed (copy them to your personal libraries folder)
- Teensy-reSid
- SdFat
Done.
Known issues:
-
use platform.txt from this thead: https://forum.pjrc.com/threads/3853..._CPU-USB-Keyboard-layout)?p=187712#post187712
(copy to Arduino/hardware/teensy/avr/)
Last edited: