Forum Rule: Always post complete source code & details to reproduce any issue!
Page 2 of 7 FirstFirst 1 2 3 4 ... LastLast
Results 26 to 50 of 160

Thread: Commodore C64 Emulation on a Teensy 3.6 Microcontroller

  1. #26
    Moderator Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,347
    Hi,
    I don't know.. it really should work without problems. Have you tried to remove the normal SD library ? At least this should work.

    For comparison, my output is:
    Code:
    Bibliothek Teensy64_new im Ordner: C:\Users\Frank\Documents\Arduino\libraries\Teensy64_new (legacy) wird verwendet
    Bibliothek SdFat-master in Version 1.0.3 im Ordner: C:\Users\Frank\Documents\Arduino\libraries\SdFat-master  wird verwendet
    Bibliothek SPI in Version 1.0 im Ordner: C:\Arduino\hardware\teensy\avr\libraries\SPI  wird verwendet
    Bibliothek Audio in Version 1.3 im Ordner: C:\Arduino\hardware\teensy\avr\libraries\Audio  wird verwendet
    Bibliothek SerialFlash in Version 0.5 im Ordner: C:\Arduino\hardware\teensy\avr\libraries\SerialFlash  wird verwendet
    Bibliothek reSID im Ordner: C:\Users\Frank\Documents\Arduino\libraries\reSID (legacy) wird verwendet
    No mention of SD

    Seems that I have to fork the Audio-lib and add it to the emu-code to get rid of the includes of sd.h

  2. #27
    Moderator Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,347
    ron2way: I've decided to make my own audio-library for the emu. It will only have a copy of the needed audio-dac, without references to SerialFlash, Wire, or SD.
    Please wait a few days - I want to add some other things before I start with that. I hope that I can do it next weekend.
    I addition, it will completely remove other teensyduino-core things that slow down the emu unnecessarily.

    Then, i've noticed that fastloaders do not work with IEC. That's the next important thing on my list.. I hope I can solve that...

  3. #28
    Moderator Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,347
    Latest update to version 08 is on GitHub now:

    + VGA (work in progress)
    + PS/2 Keyboards (optional)
    + Remove teensy Audio-Library - just copied the output_dac.* files from the official lib
    - removed "SD.h" from lib, there shouldn't be any conflicts anymore.
    + minor impovements

    Please take a look at settings.h to configure.

  4. #29
    Moderator Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,347
    I have a fastloader (jiffydos-like) partially working - that means the timing must be close to OK.


    LOL... is anybody interested in this and this project ? I'm talking with myself...
    Maybe it's better to stop and spend time more meaningfully?

  5. #30
    Junior Member
    Join Date
    Apr 2017
    Posts
    6

    Compiling Solved!

    At last a successful compile after downloading your changes. Compiled on a linux64 but had to use a win7 machine to load the hex file to the teensy.

  6. #31
    Moderator Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,347
    Update:

    - "Bruce Lee" works now. Challenge finished. Sorry guys
    - Fastloader "Jiffydos" works

    I want to make it a bit nicer, update follows today. My workaround to make fastloaders work - which need a very exact timing was to disable the screenrendering during loading.

    @ron2way: great !
    Last edited by Frank B; 10-08-2017 at 01:04 PM.

  7. #32
    Moderator Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,347
    Anybody interested in a VGA Version ?
    My preliminary board looks like this:


    Click image for larger version. 

Name:	2017-10-10 22.27.25.jpg 
Views:	56 
Size:	83.9 KB 
ID:	11745
    Because the demand is very small, I ask before continuing and will only finalize the final board if there is demand for the VGA version.
    Edit: It has a easy to solder SMD IC ("SOIC") for 3V<->5V conversion on the backside. The board can be used for other projects, too. Perhaps the 5V bidirectional pins are useful ?
    Last edited by Frank B; 10-11-2017 at 11:40 PM.

  8. #33
    Junior Member
    Join Date
    Apr 2017
    Posts
    6
    I will purchase one.

  9. #34
    Junior Member
    Join Date
    Oct 2017
    Posts
    1
    I am also interested, any options to pre-order at this time? Please let me know if I can pre-order.

  10. #35
    I'm interested in a vga version too..

  11. #36
    Moderator Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,347
    Ok..:-)

    I'm almost through with testing the preliminary board - so far, everything works (with additional diode as protection). 20x Fastloading with Jiffydos + SD2IEC seems to work, too (but a bit more testing is required).
    ( I don't know any other emulator that can do this with real hardware.. are there any ? I'd like to know..)
    Screen-refresh + Sound is disabled during IEC access (would be a little too much work for teensy..)

    Just played one of my old fav games, "Bruce Lee" on this board + 22'' display.

    TBD:
    - fix board, order... takes some time :-(
    - add code for correct right- and left borders on VGA

    I'm going to order a cheap VGA->TV converter too, for testing.
    Last edited by Frank B; 10-12-2017 at 10:39 PM.

  12. #37
    Moderator Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,347
    For Jiffydos: You need the Jiffydos kernal eprom-file for the C64. Convert it with a tool like "bin2h.exe" to a c-header file, take the output and insert into "roms.cpp" as "const unsigned char rom_kernal[8192]="
    You might want to leave the original as is and use "#ifdef" to switch between both versions.

    Later, I'll add a menusystem to the emulator which can select the desired ROMs and other things.

  13. #38
    Moderator KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    3,139
    Thought I would mention I assembled one over the last couple of days.

    Click image for larger version. 

Name:	Frank_Board_1.jpg 
Views:	36 
Size:	125.2 KB 
ID:	11806Click image for larger version. 

Name:	Frank_Board_2.jpg 
Views:	32 
Size:	125.5 KB 
ID:	11807

    As I am the Tinkering type, I made a few minor mods to the assembly. In particular I used long breakout pins on the Teensy, such that it makes it easier to jumper pins on the Teensy to other stuff like breadboard as well as nice place to hook up Logic Analyzer. In the past I purchased some from Adafruit and some from sparkfun (https://www.sparkfun.com/products/12693)

    I also used some standoffs, such that it can sit on ground without having the Teensy hit...

    So far the only thing I have tested out is the USB Host code and verified i could talk to a Keyboard...

    Next up figure out how to install the Commodore 64 code to try it out. It is unfortunate that we got rid of my Wife's C64 and all of the games a long long long time ago. Likewise I no longer have my Amiga.

    I should mention that the board is easy to assemble. With my boards I have to constantly look at the schematic and board layout to find which parts go where...
    As you maybe can see the differences in this picture:
    Click image for larger version. 

Name:	Frank_and_Well_Board.jpg 
Views:	47 
Size:	29.9 KB 
ID:	11808

    Also maybe try out some of my other ili9341_t3n library code to see if it works OK on this board... Should once I track down which PINS connect.

  14. #39
    Kurt: Check this out for pin connects :: github.com/FrankBoesing/Teensy64 /T64_PinMapUse.txt
    { Frank - it doesn't look like I found a #define or anything for the DAC pin used }

    On assembly - Yes Frank has done some good work! The Version like this with ILI9341 is currently available and AFAIK will still be supported - but it is a good general purpose display and USB board. The VGA board may be coming along and offer the same setup - with VGA video option ( and other minor interface part changes ).

  15. #40
    Moderator KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    3,139
    Thanks Defragster - I verified my display test program works Next up try to install the C64 stuff... But might be awhile - power out, running on generator

  16. #41
    Quote Originally Posted by KurtE View Post
    Thanks Defragster - I verified my display test program works Next up try to install the C64 stuff... But might be awhile - power out, running on generator
    Awesome you got Display working - now you can post USB_HOST status/debug on local screen as you work. I went through Frank's code and pulled those pins out to that file knowing without them the board would seem 'single use'. Frank went over it and made some edits so it should be right and helpful for all pins wired.

    Yes Kurt, we are having a windy day aren't we - our lights have only flickered so far. Dropped once yesterday and I swapped my UPS that had about 0% reserve just hibernated on any dip ( or when my laser printer fired up the fuser ) - as I type new UPS kept machine up across a dip that dropped 2nd display and other stuff.

    C64 stuff was good an easy when I did it. Just need a lib or two and I got it working. Have not recompiled recently with newest IDE/TD but there are README notes on Github that should get you there - post any issues.

  17. #42
    Junior Member
    Join Date
    Oct 2017
    Posts
    2
    Quote Originally Posted by Frank B View Post
    Anybody interested in a VGA Version ?
    My preliminary board looks like this:


    Click image for larger version. 

Name:	2017-10-10 22.27.25.jpg 
Views:	56 
Size:	83.9 KB 
ID:	11745
    Because the demand is very small, I ask before continuing and will only finalize the final board if there is demand for the VGA version.
    Edit: It has a easy to solder SMD IC ("SOIC") for 3V<->5V conversion on the backside. The board can be used for other projects, too. Perhaps the 5V bidirectional pins are useful ?
    I would definitely buy one as well

  18. #43
    Senior Member
    Join Date
    Oct 2014
    Posts
    113
    I might have some of the games already in a file format, I can check for the C-64 if you like.

  19. #44
    Moderator Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,347
    Quote Originally Posted by Wayne View Post
    I might have some of the games already in a file format, I can check for the C-64 if you like.
    Easiest, and fasted to use is single-file software - PRG files. They load in less than a second from the Teensy-SD slot.
    They are available on the internet. Some time ago I saw a big archive with hundrets of them..

    I think, most PAL 80's and 90's games should work. The younger the games are are the more likely they use "dirty tricks" which may not be emulated at the moment..
    NTSC is totally untested.

  20. #45
    Moderator Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,347
    I have a rock-stable VGA now, at least on my display. I think, I was right with this post. However, for this test, I had to disable some important things
    Reasons for pixel-flickering are: - GPIO-Access, DAC, USB. I am hoping that I can solve this with synchronizing the GPIO and DAC accesses with the VGA hsync-signal.
    USB (Host) is not that easy - It helps a lot to disable the async transfers completely (after enumeration) - but there is still a little flickering. I tried to sync this is with VGA-vsync, and to enable the periodic transfers "outside" the screen only - but this resulted in too slow reaction to key-presses. Maybe hsync is better...

    Anyway, the flickering is not too annoying, and I can't see it from 1.5 Meter distance.

  21. #46
    Moderator KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    3,139
    I am hoping to try out a few C64 games, but I don't have any C64 joysticks... I found a few up on Ebay for about $200 8)

    So thought I might build my own for now... Looked at some sites and it look like the connections to the 9 pin connector looks pretty straight forward, so I thought I would buy some simple joystick parts.

    I saw Defragster purchased some stuff from Sparkfun... Should have purchased some of the same stuff. Actually Amazon has the joystick a bit cheaper. But I purchased a different one that also came with some buttons (8)... I probably should have looked a little more carefully as I think the size of it is a little out of scale :lol:

    Click image for larger version. 

Name:	Joystick.jpg 
Views:	22 
Size:	115.7 KB 
ID:	11902

    May need to build a pretty big heavy box for it!

  22. #47
    Junior Member
    Join Date
    Dec 2016
    Posts
    3
    The stick I got for my Aiie box is not bad. About the right size for me, seems pretty solid but feels a bit cheap.

    Click image for larger version. 

Name:	apple.JPG 
Views:	30 
Size:	132.6 KB 
ID:	11904

    I bought it here: http://www.ebay.com.au/itm/AC-240V-5...item2caccfd4fb

  23. #48
    Moderator Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,347
    @Kurt: I bought an old digital ATARI Joystick for 5€ in the bay.. One of the next things I'll add is a "swap joystickports" function via keyboard.
    All the c64 software uses the ports more or less randomly. It's a bit annoying to always plug the joystick into another socket. That's why I had two then.

    @prickle: Nice !!


    Last updates:
    - Please update the reSID library - there was a little change to make it more exact.
    - VGA: GPIO and DAC is now sychronized to VGA - flicker almost completely gone.
    - VIC: Added a better emulation for graphic modes 1 and 3 in "idle" state - all other modes in "idle" are still ""TODO". Only very few programs use it, so not a big issue.

    Please report issues on Github! Thank you!

  24. #49
    Junior Member
    Join Date
    Oct 2017
    Posts
    2
    Quote Originally Posted by KurtE View Post
    I am hoping to try out a few C64 games, but I don't have any C64 joysticks... I found a few up on Ebay for about $200 8)

    So thought I might build my own for now... Looked at some sites and it look like the connections to the 9 pin connector looks pretty straight forward, so I thought I would buy some simple joystick parts.

    I saw Defragster purchased some stuff from Sparkfun... Should have purchased some of the same stuff. Actually Amazon has the joystick a bit cheaper. But I purchased a different one that also came with some buttons (8)... I probably should have looked a little more carefully as I think the size of it is a little out of scale :lol:

    Click image for larger version. 

Name:	Joystick.jpg 
Views:	22 
Size:	115.7 KB 
ID:	11902

    May need to build a pretty big heavy box for it!
    You can buy them online, i am not sure whether they sell outside eu, but you can ask Thomas :
    https://shop.pixelwizard.eu/commodor...-pro-retro?c=6

  25. #50
    Moderator Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,347
    I've managed to record some music - I hope this gives you an impression of the SID emulation. Not 100% perfect, but not too bad, I think
    https://github.com/FrankBoesing/Teen...0The%20Run.mp3

    There are several C64 programs to create such music.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •