C64 Emulation with Teensy 3.6

Status
Not open for further replies.
The Layout:
_wsb_684x343_Drean_Commodore_64_Retroport_22+$28Large$29.jpg


the " is shift + 2

more info in post #12
 
I have working sound ( headphones ) and graphics - BoulderDash Demo runs. NumLock cycles Joystick.
20170725_171720.jpg20170725_171912.jpg
I found Post #12 - will read.
 
Glad, that it works...
The picture on the right is the C64 on power-on - the screen-memory is filled with zeroes, the color-ram with random data. That's why you see all the "@" with random colors on power-on.

Your not working keyboard makes me a bit nervous... I did not expect any problems.. :-(
Does it have a USB-HUB built-in, or something like that ?

Headphones ? :) The audio connection is intended to be used as a line-out, for active speakers ... there is a 100uF cap which connects to a DAC pin, that's all.

Is the brightness of the display ok ?
 
Last edited:
Indeed Odd the keyboard isn't recognized. It is a new from box $18 Logitech MK360 Wireless Keyboard and Mouse Combo - with mouse not powered and a standard simple dongle pushed in place, that worked on my computer with no prompting/association (dedicated device - not Bluetooth). The Tablet keyboard seems simple - I didn't confirm it doesn't include a hub or extra ports. The wired keyboards I used are two Logitec units - they generally worked - but I had to repower at least once to get a working keyboard at the prompt.

Yes, headphones were handy and they worked - tonight I used ear buds and they worked - both at decent volume levels. I'll grab the intended powered speakers next time I'm out that way.
 
Last edited:
Ok, maybe there is an internal hub, because of the mouse. We should try Pauls keyboard-code standalone (without C64).
 
...
oh, i see, there was a an update 24 days ago. time to review my fork..
... But I suspect,the dongle will be the same ..

I'll try that - glad I made you look it up :)

Possible it will be the same - unless it saves a part ...

<edit>: I see I can turn on DEBUG prints . . .
 
Paul: I'm getting build errs { not defined DEC and NULL } on the above github USBHost_t36 code - I'm updating to 1.38b2 shortly - is that the issue?

"I:/arduino_1.8.3/hardware/teensy/../tools/arm/bin/arm-none-eabi-g++" -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -fno-exceptions -felide-constructors -std=gnu++11 -fno-rtti -mthumb -mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -D__MK66FX1M0__ -DTEENSYDUINO=137 -DARDUINO=20000 -DF_CPU=240000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-ID:/Users/Tim/Documents/GitHub/USBHost_t36/examples/Test" "-II:/arduino_1.8.3/hardware/teensy/avr/cores/teensy3" "-II:/arduino_1.8.3/hardware/teensy/avr/variants/" "-II:/arduino_1.8.3/hardware/teensy/avr/libraries/USBHost_t36" "C:/Users/Tim/AppData/Local/Arduino15/build/Test/sketch/Test.ino.cpp" -o "C:/Users/Tim/AppData/Local/Arduino15/build/Test/sketch/Test.ino.cpp.o"
In file included from D:/Users/Tim/Documents/GitHub/USBHost_t36/examples/Test/Test.ino:5:0:
I:/arduino_1.8.3/hardware/teensy/avr/libraries/USBHost_t36/USBHost_t36.h:301:54: error: 'DEC' was not declared in this scope
static void print(const char *s, int n, uint8_t b = DEC) {}
^
I:/arduino_1.8.3/hardware/teensy/avr/libraries/USBHost_t36/USBHost_t36.h:302:63: error: 'DEC' was not declared in this scope
static void print(const char *s, unsigned int n, uint8_t b = DEC) {}
^
I:/arduino_1.8.3/hardware/teensy/avr/libraries/USBHost_t36/USBHost_t36.h:303:55: error: 'DEC' was not declared in this scope
static void print(const char *s, long n, uint8_t b = DEC) {}
^
I:/arduino_1.8.3/hardware/teensy/avr/libraries/USBHost_t36/USBHost_t36.h:304:64: error: 'DEC' was not declared in this scope
static void print(const char *s, unsigned long n, uint8_t b = DEC) {}
^
I:/arduino_1.8.3/hardware/teensy/avr/libraries/USBHost_t36/USBHost_t36.h:305:56: error: 'DEC' was not declared in this scope
static void println(const char *s, int n, uint8_t b = DEC) {}
^
I:/arduino_1.8.3/hardware/teensy/avr/libraries/USBHost_t36/USBHost_t36.h:306:65: error: 'DEC' was not declared in this scope
static void println(const char *s, unsigned int n, uint8_t b = DEC) {}
^
I:/arduino_1.8.3/hardware/teensy/avr/libraries/USBHost_t36/USBHost_t36.h:307:57: error: 'DEC' was not declared in this scope
static void println(const char *s, long n, uint8_t b = DEC) {}
^
I:/arduino_1.8.3/hardware/teensy/avr/libraries/USBHost_t36/USBHost_t36.h:308:66: error: 'DEC' was not declared in this scope
static void println(const char *s, unsigned long n, uint8_t b = DEC) {}
^
I:/arduino_1.8.3/hardware/teensy/avr/libraries/USBHost_t36/USBHost_t36.h: In constructor 'USBDriver::USBDriver()':
I:/arduino_1.8.3/hardware/teensy/avr/libraries/USBHost_t36/USBHost_t36.h:330:21: error: 'NULL' was not declared in this scope
USBDriver() : next(NULL), device(NULL) {}
 
Frank - I tried the updated USBHost_t36 code on the test sketch and it only gets this far with the Wireless Combo adapter {debug output on } - the device never comes up. I'll try later with the tablet keyboard.

<EDIT>: Same 'non' response from the tablet USB keyboard - no other USB ports exposed - but it fails to present anything but the below.

USB Host Testing
sizeof Device = 32
sizeof Pipe = 96
sizeof Transfer = 64
power up USBHS PHY
 
Last edited:
Paul - using the 'Add error recovery for async schedule errors & halted pipes ' Github linked code I see it working. Did you want to update the library.properties > version=0.1 - or is it a minor change?

I found a wireless keyboard that does work - a big old MSFT Mega function keyboard - radio receiver the size of a mouse with a 6 foot cord - but if I can hide it in the box at least it will work. I ordered the Keyboard only Logitech wireless - delivered Friday to see if it works. Also a pack of crimp spade females to wire the joystick and buttons to make that cleaner/easier to build/adjust.
 
Joystick-ports working.. emulation via keypad removed.
The end is near :D:D:D:D

I'll order a batch of new boards.. shouldn't take too long..
 
Joystick-ports working.. emulation via keypad removed.
The end is near :D:D:D:D

I'll order a batch of new boards.. shouldn't take too long..

Good News!

Got the new Logitech wireless keyboard only unit - typing this on it now from my computer - it doesn't work on the T_C64. The new keyboard has different shiny top face - but the back on both is the same and labelled K360. Win 10 had to do 'additional driver setup' according to the popup - just software not any sort of device ID. Put it back on T_C64 and it fails again.

With my keyboard came the connectors to wire joystick. So I'll have that working soon. Let me know about updated code.

In repowering the T_C64 to retry keyboard I saw it sit sometimes at "Initializing SD card...", comes up fast on reset next time. This showed up first time I booted T_C64 with the freshly formatted card with the C64 dir on it - I waited a long time before restarting it thinking maybe it was reformatting - which it was not.
 
Hm, I've tested two different wirelss keyboards w/o problems, but I think simple, wired, keyboards are better until Paul (or me) can work on the USB-HOST part.

"Initializing SD card..." - yes, i've noticed this, too. I don't know the reason - it's independed of the "c64" emulation as I saw it several times with other, simple sketches, too. I've mentioned this in this forum, but got no answer. Fortunately, it's rare.
Most of the time, the next reboot works.

Tim, you got mail (latest version).
 
My OLD MSFT keyboard has a defective "X" key - it doesn't work and spontaneously sends out X's when it wants to.

Good to know about the SD Init hang - hopefully it can be resolved.

Would be great to know of a wireless keyboard that works - or get one of my new ones to work - would make it much more portable and work off a battery pack.

Frank - I got email and replied.
 
SD:I suspect a power problem on start-up. I'll try to add a few delays before SD-INIT. The boards need a bit power.. it has the display connected (with a descent brightness ), the USB-HOST needs power, and the SD_Card can need a good amount of power, too.
I'll measure it

EDIT:
With my setup, 240 mA with running "DIG-DUG", SD+ sound + wireless usb + SD2IEC floppyemulator + second SD) @ 240MHz



The wireless keyboard I use is a Logitech K400 Plus (with useless touchpad) - but I can not recommend it - it is not very ergonomic.
The other one is a very old one... I can't find any product number or manufacturer.

All my wired keyboards work.
 
Last edited:
Tim.. could you try to use a powered usb-hub with your logitech keyboard ?
perhaps it is a powering-problem, too ?
 
I just got a teensy, so I don't really know it's full capabilities. But with some ingenuity, maybe a "mid 80's era GUI" with run-alike applications might work. But Amiga OS on the Teensy? yeeah, that might be a stretch. How is the Teensy at multitasking? The Amiga was also one of the first to have a "gpu", they had those graphics & I/O co-processors. There was a lot going on inside those things. The Amiga was really a late 90's era computer in the 80's.
But I'm a huge Amiga fan from back in the day. I'll talk it up always.

But don't let peoples discouragement stop you. I will applaud attempts to emulate Amiga on Teensy. That would be cool. Maybe if you had multiple teensys emulating each of the custom chips? But that starts to sound like one heck of a project. easier to just fake a run-alike, not even a full emulator. I'd just like to see something looks like Amiga Workbench, or any OS from back then.

Great job on c-64! Sounds like Teensy is more than capable for that.
But anything 68000 based on a teensy 3.5/3.6 would be cool, due to the teensy 3.5/3.6 being approx the same size as the original Motorola 68000. Looking a teensy it just reminds me of the classic chip.
Maybe not an Amiga, but possibly a Mac Classic is possible?
 
@pete1061 - Probably any pre pentium era 'CPU' could be done if you add enough the supporting hardware for things like sound and graphics, but takes a bit of the purity away if your hardware emulator is bigger, more expensive, consumes more power and is less reliable than the original. The magic here is that Frank somehow managed to fit all the hardware emulation functions into the Teensy CPU as software and still have enough clock cycles to emulate the CPU itself (even if the display controller is technically helping push pixels).

If you head into the Amiga you will probably find a Teensy 3.6 can run the OS fine to a terminal, but you will either need to dig deep into DMA or add some slave CPUs to actually get graphics/sound/drive emulation working. Emulation is a fascinating topic but don't forget the little things like how your floppy drive will work when you move from a pure software emulation into a hardware.
 
Well I have a working Alpha board with wired Joystick and updated code to play Boulder Dash - Great work Frank!

So many crimped ends - and solder to a flippable header pair on 9 pin Dsub as this board got an PCB inverted pinout - new board in the works.

20170730_003150.jpg
 
Well I have a working Alpha board with wired Joystick and updated code to play Boulder Dash - Great work Frank!

So many crimped ends - and solder to a flippable header pair on 9 pin Dsub as this board got an PCB inverted pinout - new board in the works.

View attachment 11120

Tim, thank you for testing!
Pete1061, the main problem ist not the CPU emulation (but I had a hard time to make the emulation 99.x% react like a real 6510). The custom chips VIC (VideoController), SID (Sound) and both CIAs are more difficult to emulate. The hardest part is to make the timing the same as the original. Or at least compatible enough...

The AMIGA has some of these custom chips, too. There is "Paula" with 4 sound channels, "Denise" for graphics/sprites, "Agnus" with 25 DMA Channels, the "Blitter" and a co-processor ("Copper").
Then, even the first model, the AMIGA 500 had 512KB RAM (is that true?) - much more than the T3.6 has.

Paul announced a Teensy with 600MHz and 512KB RAM - IF there will be a way to add more RAM, then, maybe, there is a little chance to emulate an AMIGA 500 without additional chips but RAM.

Edit:
A little update to the C64:
I'll order new boards tomorrow. It is possible to use add SD2IEC boards as floppydisk. During IEC access , the sound is turned off.
SD2IEC or real floppydrives are the preferred storage.

Currently, i'm trying to add a *very simple* floppyemulation with device-number 9, so it will be possible to do basic load/save to the Teensy 3.6 SD-Card.

Later - and only if there is enough interest from others - I can try to add "SD2IEC" floppyemulation to the 3.6 itself. The Teensy C64 will be Open Source, so, theoretically, others can help with this...
 
Last edited:
No, the floppy-connector is the round black "DIN" connector on the right, next to the transitors.

attachment.php



I've removed the "user-port" (JP2) - it was rarely used, and intended for "Makers" (LOL, that word wasn't used 30 years ago..).
 
Last edited:
Okay, I misunderstood it was the ROUND connector that was being removed. So if I ordered an SD2IEC floppy emulator board they seemed to just have solder pads - it would be easier to just solder wires right to the pinholes under the DIN connector? It would cause re-routing but you could put a second set of holes in a row to duplicate the DIN connections and a female header could be soldered instead - that would be easier to mount an SD2IEC floppy board?
DIN_HEADER.jpg
<simulation - I just pulled down 7 pins on the bottom and added red lines showing the connection : this would also work with a LONG pin female header if the long legs were bent carefully to reach the existing holes>
 
Status
Not open for further replies.
Back
Top