Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 8 of 8

Thread: Commodore 64 VIC Emulation on the Teensy

  1. #1

    Commodore 64 VIC Emulation on the Teensy

    New Thread started from a project proposal from the Commodore 64 on an Teensy 3.6 thread.

    After seeing the Commodore 64 emulator running on the Teensy 3.6, I thought it may also be interesting to port the VIC emulation code to see if a project which replaces the VIC chip in the C64 with a Teensy with VGA output would be possible.


    Frank B
    Hm, might be possible.. But it would -still- be an emulation. I wonder, if a FPGA wouldn't be better.
    The crystal input might be a bit problematic - on the other hand, it can be ignored, maybe ? The would mean, the c64-clock would be drivenby the teensy. We should take a look at the shematic - I'm not sure.
    Reading through the schematic this afternoon, it looks like address and data lines could be grabbed from the C64's expansion port. The actual VIC chip could remain in the circuit, resolving the timing issues, etc.

    Could your VIC-II code accept data from the data and address lines and act as an video output device?
    The R/W. BA. Dot Clock, and IRQ lines appear to be easily accessible as well. Also will your code run on the slower Teensy 3.5?

    Referenced from here: https://www.c64-wiki.com/wiki/Expansion_Port
    C64 schematic: http://www.zimmers.net/anonftp/pub/c...ev.A-right.gif

    Sadly, my experience with Teensy is beginner level, since most of my previous work has been with Propeller, and PIC. I'm not afraid to dig into this as I suspect it would be a great project.

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,469
    You'd have to remove the original VIC anyway, i think... or do you know a way to deactivate it ?
    The 3.5 would be better, yes, but I really don't know if it is fast enough. Needs testing...

    On the other hand, the VIC is the most important chip on the C64 Board - an emulation can never be as good as the original...
    It would be good to repair broken C64s - but i'd never replace a working VIC... you ??

    In the emulation, the VIC Code makes calls to the CPU, the VIC Code is "master" in the emulation. So it should be quite easy to remove all other code.

  3. #3
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,469
    @Paul or Robin: You might want to move this thread to an other subforum :-)

  4. #4
    Quote Originally Posted by Frank B View Post
    You'd have to remove the original VIC anyway, i think... or do you know a way to deactivate it ?
    The 3.5 would be better, yes, but I really don't know if it is fast enough. Needs testing...
    Would you really need to deactivate it if the emulated VIC is only mirroring what is actually happening by reading the address and data lines? Let the actual VIC handle the control of the 64's CPU, timing ect. Plugging the Teensy into the expansion port provides less physical modification to a historic machine.

    Can the VIC code become the slave to the data/address lines or am I missing something here that the emulated VIC needs to be in control of? I can't help but think that the emulated VIC would simply be and output device in this situation.

  5. #5
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,469
    Now I got it..
    Oh es, this would make some things even more easy.

    Edit:
    There are easy to use parts like this (?)
    https://www.youtube.com/watch?v=hU-Sz3fqyVU

  6. #6
    Quote Originally Posted by Frank B View Post
    Now I got it..
    Oh es, this would make some things even more easy.

    Edit:
    There are easy to use parts like this (?)
    https://www.youtube.com/watch?v=hU-Sz3fqyVU
    Yes, and they are all junk... (except for that $400 Framemeister unit from Japan)

    I'm shooting for crisp VGA video output direct from the 64. The CBM community has talked about a VGA interface for the last decade. Your VIC code running on the Teensy certainly looks like a working candidate.

    Guess it's time to break out my wallet, and purchase a couple of these boards and see what is possible here.

  7. #7
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    4,469
    Wait, all the GPIO can be a problem. Sorry I didn't think of that before. I guess I need some free time... or more sleep..
    GPIO that often will disturb the VGA output - please read the VGA thread about that problem. GPIO and DMA are on the same internal BUS in the ARM. And on top, the VGA output uses GPIO, too. So, I fear, this would result in very flickery output :-(
    There's a tricky way for the C64 emulation to get around this - but this would not work with your aproach.

    Edit: We have to wait if QIX finds a solution with external memory.
    Last edited by Frank B; 11-02-2017 at 11:11 PM.

  8. #8
    Read the entire thread.. Good read..

    Yes, it looks like I'm going to hold a bit and watch to see what QIX comes up with. It'll give me a chance to get up to speed on the Teensy...

Posting Permissions

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