Topic: C64 core talk

There is a lot of interest in getting a C64 core up and running.
I've started to set up and the directory structure and top level based on the Amiga stuff.

/MikeJ

Re: C64 core talk

I'm a C64 and Amiga guy, so for me this would be a killer combo. big_smile Still I would suggest finishing the Amiga core first.

Re: C64 core talk

I'm only planning on doing bits of the SID at the moment wink

Re: C64 core talk

That's the most important part of the C64. smile

5 (edited by WoS 2014-03-03 23:59:50)

Re: C64 core talk

With the C64 I'll do a step-by step development of a new core, starting from the loader design. I'll document the changes and the next steps I am going to do.

The idea is to provide a real-life tutorial on a real core, which can be mapped to individual projects later on. Thus, I'll keep the SVN version numbers to allow you to retrieve these steps in case you want to check the changes by yourself.

Step 1:
Just checked in a cleaned-up and little more documented version of the replay loader as starting point for the C64 core (or any other core wink ).

It compiles and simulates, but have it only briefly tested on a board (and still works - as it is not really different to the loader - my intention was to provide an up-to date, simplified version of the toplevel with a simple core implemented as "demo").

--> You may want to remember SVN version 401 of the c64 directory to get this initial version. 


Next step is to set up a "naked" C64 block with some VIC-II like video out (will see what I can find, but probably will set up the VIC-II from scratch to have it proper set up for the Replay clocking framework), video converter and update the PLL scheme required.

/WoS

6 (edited by WoS 2014-03-04 00:05:26)

Re: C64 core talk

Checked in step 2:

Made a (very) minimal VIC-II setup, connected it to the video converter and and replaced the video generator of the loader design. Furthermore calculated the required PLL settings and updated the INI file accordingly.

When this core is started, a picture shows up as green field with blue border (very simple 3bit RGB for now). HD/SD mode switching via OSD works as well. This setup is already quite sufficient to test further implementation steps of the VIC-II block.

I have not yet moved the VIC-II on a proper level in the design, it is still directly on the "Replay_Core" level. As I intend to focus on the VIC-II for now until it does something "more useful", this is no big problem and avoids some work not urgently needed for now (and it keeps the setup lean). As soon as the 6510 comes into play, I'll set up the correct "C64 level".

--> SVN version 414 of the c64 directory will allow to retrieve this setup again.

Next step will be to add some video RAM and character ROM memory (via DRAM controller) and implement a VIC-II text mode. By uploading screen contents via ARM further tests can be done, still without having a processor in the core.

/WoS

Re: C64 core talk

Cool, I'm following this with great interest.

Re: C64 core talk

This is great Wolfgang.

Regarding pll calcs. As I understand it the idea is to have a different output video clock from core video clock. The videoconverter constraints being:
I) vsync freq must match _exactly_.
ii) hsync freq must be close to 1:1 or 1:2 (scan doubled).
iii) Pixel clock need not match at all

Is that correct. Sorry if you explained this in the code - away from svn:)

Re: C64 core talk

foft wrote:

I) vsync freq must match _exactly_.
ii) hsync freq must be close to 1:1 or 1:2 (scan doubled).
iii) Pixel clock need not match at all

Yes, but not in terms of absolute timing, just in terms of clock ticks of the video signal syncs and video data in relation to each other. The absolute timing is given by the pixel clock, which seems it can be easily off by some percent... 

So Mike came up with the idea to "overlay" any video signal on top of a "perfect" HDMI signal timing (in terms of the different clock counts) from his Replay video generator. Thats what the converter does (later we want to add a full generic framebuffer using the DRAM).

To fit it to the core video, both clocks (of the core and the HDMI pixel clock) are modified in a way that they both come exactly to the same frame rate (=vsync). Of course by that the original frame rate is a little off, as the HDMI framerate is. I made the Android app where you select a 50Hz or 60Hz mode, the system clock of the core and the x/y resolution. It then gives all possibilities of PLL settings as close as possible to the original frame rate. Mike also provided the math for it I just tweaked it a little...

/WoS

Re: C64 core talk

wolfgang wrote:

When this core is started, a picture shows up as green field with blue border

It's beautiful! I wouldn't mind a CPU within this one, but hey, it has nice colors. big_smile I added a build.sh.

11

Re: C64 core talk

Step 3 done:

Implemented a basic address scheme for text mode access with VIC-II.
Added more registers for colours and a colour-mapping scheme for RGB out.
Initially connected the VIC-II to the dram controller, which allows reading a text RAM and the character ROM.
INI file loads the character ROM and an experimental text screen.

The new version can show up some text mode screen using a fixed colour set (which still needs some tweaking, though).

SVN version 423 of the c64 core directory reflects this state

Next step is setting up the VIC-II registers (which are still pre-initialised signals yet) and do some more testing. Some settings (like yscroll, start of screen memory) are not yet correct (has to do with my badline setup which is "too simple" yet) and I need more analysis on this setup in general.

Maybe I'll already go for some CPU/kernel/basic connection already if everything works out fine.

Post's attachments

VIC-II_first.png
VIC-II_first.png 260.45 kb, 5 downloads since 2014-03-06 

You don't have the permssions to download the attachments of this post.
/WoS

Re: C64 core talk

Awesome!

Guess it's early to talk about yet, but I ask anyway. Will you be able to use a fastloader like Action Replay, The Final Cartridge or Retro Replay?

13

Re: C64 core talk

As we are going quite close with the implementation to the "real" setup, it could work. But I don't know yet how well this stuff is documented to implement it correctly. At least I am about to buy jiffy dos for the 1541 and the vic-20 (it is not so expensive as binary only - but will start it only if l have time left to do also debugging if needed), so I can do first tests how fastloader will work in general with this setup, as it will still take a little to use it on the c64.  wink

BTW, just for the meeting minutes :-)
- The code is - as you can see - developed "from scratch" to have a new version w/o problems to be used for Replay
- I am using only the vic-ii.txt description on zimmers.net plus a "real" (PAL-type) C64 for analysis (and maybe google as well)
- I have the VICE sources/binary just in case to analyse some code later on (to get register values, ... in an "easy way")
- I am not at all using Peters FPGA-64 code, as it is copyrighted (and partly a little bit too complicated, for my taste)

/WoS

Re: C64 core talk

JiffyDOS is not really needed if we have support for a proper fast loader cartridge. Everything is very well documented.

The thing with fast loader cartridges is not only they have a ROM with tools, but also extra hardware like buffer memory. Guess they could be implemented within the Replay as well as the computer.

15

Re: C64 core talk

There is no fast loader cartridge for the VIC-20 I am aware of, except jiffy. So I can only use this for testing the 1541 with a fast loader together with a working computer while continuing with the C64 - which is far away from working with any cartridge.

If the cartridge is more than ROM, as mentioned it depends on its documentation if and how fast it will be in...

/WoS

Re: C64 core talk

Awesome progress! WolfG for pres!

Re: C64 core talk

It won't be a true reimplementation unless Arcadia64 takes over 20 minutes to load.  tongue

18

Re: C64 core talk

Step 4:

Introducing C64 core level, hooking up CPU + VIC + ROMs + Colour-RAM + DRAM to allow initial boot.
No registers yet to be set by the CPU, furthermore memory map is fully hardcoded yet.
ROMs set up as FPGA BRAMs, to ensure CPU is running fine before going for a full DRAM setup.

So the core can successfully run the RAM test, but of course it freezes at the boot screen, as it does not have any CIAs etc. to operate properly (e.g. no timer for cursor blink, no keyboard I/O etc.).

This setup can be found as SVN version 426 of the c64 directory.

Next is hooking up CIAs, keyboard and the 1541 core to have something to run simple examples on the core. So the next step can be seen as base to start with the important part of the C64, the SID  big_smile

Post's attachments

c64_1st_boot.png
c64_1st_boot.png 176.22 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.
/WoS

Re: C64 core talk

Absolutely fabulous! Great work Mr! big_smile

20 (edited by Vanfanel 2014-03-09 16:32:16)

Re: C64 core talk

Wow, so simple yet beautiful! C64 is starting to live in the FPGA ARCADE! Great!!

Re: C64 core talk

smile

22

Re: C64 core talk

Nearly done with the first shot of the core. CIA hooked in, cursor blinks and reacts on the keyboard. I also can load PRG files via the OSD. Of course no memory mapping or other VIC-II modes than the basic text mode, but it's an start!

Tried to use the VIC-20 keyboard, but this does not really fit (took me a while to figure out how to type LIST and RUN wink).
So need to update the keymapper for it, then I'll connect the 1541 before checking it in and reporting here again. But this might take a while, not sure if I can work on it this weekend...

Post's attachments

c64_running_minimal.png
c64_running_minimal.png 258.01 kb, 3 downloads since 2014-03-13 

You don't have the permssions to download the attachments of this post.
/WoS

Re: C64 core talk

Just a quick reminder, stickers are available to put on your keyboard so that you know where to find those wonderful symbols:

White keyboard stickers:
http://www.ebay.com/itm/COMMODORE-64-KE … 43a0c13076

Black keyboard stickers:
http://www.ebay.com/itm/COMMODORE-64-KE … 35ab3df230

Re: C64 core talk

Have you tried them yourself? If so, a word about the quality? I was thinking about ordering custom laser etched caps, but this is a radically cheaper solution.

Re: C64 core talk

I haven't appled them to a keyboard yet, but I have a set each of the black and white ones.  They look fine.  I was actually thinking of cutting the symbols off and applying them to the front of the keys rather than just sticking the whole thing over the top of the key.  It would be more work, but it would look more like a "real" C64 keyboard.