Hallo Besucher, der Thread wurde 72k mal aufgerufen und enthält 317 Antworten

letzter Beitrag von Peto74 am

Unicart64 - The FPGA based cartridge for Commodore 64

  • Hi,


    I have identified the place where it is hanging on (red screen). Oh, how good it is I have added color identification/diagnostic :D .
    I have also theory how to improve it, but it is about timing - number of waiting cycles when the C64 and FPGA is powered on and the SD controller is initialized.
    When FPGA is loading firmware it takes for a while. The C64 power on sequence takes a while as well. And it seems to be there are differencies in this timing between C64 boards.
    I believe that I have to wait longer time in my starting code - boot Ultimax cartridge.
    Unfortunately,
    1) I have no such C64 machine to test it.
    2) The code is part of FPGA firmware.
    If you need to change it, you need reflash FPGA firmware, you will need USB Blaster Rev.C programmer + Altera Quartus Studio installed on your PC.
    What to do ? I can only check the theory in reverse way, I will set lower number of cycles and my expectation will be I will end in red screen as well.
    I strongly believe I will solve this problem. Only confirmation will take a time.


    Thanks all, perfect inputs and good night.

  • Oh, thats good and bad news.


    Is it possible to update FPGA firmware with Raspberry Pi?


    We have done this for the CPLD on the Ultimate64 board already...
    Like here: Ultimate64 CPLD Update für Boards bis Seriennummer #540 mit einem RASPI 2/3


    Thanks for your effort!

  • Hi,
    No imagine ... I only know it is Altera stuff. Quartus studio generates for me the following:


    .SOF - I think this is JTAG connector debugging format, directly to running FPGA (I don't have connector on the board, not supported)


    .POF - this is "AS interface protocol", this is used for my board, supported in my board. This file is flashed to Serial Flash, not directly to FPGA. If you are able read this format/understand it and you are able to send it to Serial Flash + some signals are set to block FPGA during flashing it could be possible.


    But, I think the programmer USB Blaster Rev.C is widenly available for 3-5 $ + free shipping, everywhere on internet shops :) .
    Quartus Studio is free ...


    Only waiting is around 1 month. Unfortunately I have only 1 piece and I need it. This could be investment for the future firmware flashing, not bad to have it.

  • Meantime ...,
    I send you my examples of Cartridge Starters - small programs to start cartridges directly from SD card inside SDCMDUC.


    You can load it to your SD card and if you need just start your selected type of cartridge from ROM/RAM.
    This is dedicated to my memory map, but most of it will work for you.
    TEST-STARTERS.zip



    Example:
    Start SDCMDUC somehow ...
    1) Uploading CRT to RAM: Navigate .CRT file, press "Return", select "RAM", wait and "Return".
    2) Starting CRT: Navigate starter program e.g. "START-RAM-AR.PRG", press Return. The AR should start automatically.



    code details ...


    CONST cUC64_IO2RAM_PAGE = $DE05 ; map page IO2RAM register
    CONST cUC64_IO2RAM_BANK = $DE06 ; map bank IO2RAM register
    CONST cUC64_IO2RAM_SLOT = $DE07 ; map slot IO2RAM register



    CONST cUC64_CRT_BANK = $DEFD ; map bank CRT register
    CONST cUC64_CRT_SLOT = $DEFE ; map slot CRT register
    CONST cUC64_CRT_START = $DEFF ; start CRT register
    ...
    LDA #$00
    STA cUC64_IO2RAM_PAGE
    LDA #$00
    STA cUC64_IO2RAM_BANK
    LDA #$00
    STA cUC64_IO2RAM_SLOT



    LDA #$00 ; always bank 0, bank is defined in CRT header ...
    STA cUC64_CRT_BANK
    LDA #$09 ; Slot-9 ( Flash ROM slots: 0..7, SRAM 8..15, only slot 9 is used by SDCMDUC in case of RAM)
    STA cUC64_CRT_SLOT
    LDA #$09 ; this is code for AR
    STA cUC64_CRT_START ; resets hardware , board is now AR



    --> RESET/BOOT

  • Some limits for SDCMDUC 2.4:


    - Directory will display max. 255 items (dirs+files).
    - No sorting. Hint: If you will copy files, delete all files in directory and copy all of them on PC. Then, the files will be sorted like on PC.
    - There is FAT32 long filename support, but only max. 255 chars / file (original is 260 ...).
    - The current directory is loaded to C64 RAM. The buffer for all filenames in directory is max. 24 kB (theoretically 64kB) placed $A000-$FFFF.


    Hint: I support 3 screens/views. Press "S" to rotate all screen views.


    If you exceed limits, no error will come, just your file list will be not complete !
    Happy browsing :D .

  • Yes, it works.
    How do i flash / start Kernal e.g. JiffyDOS_C64.bin?

  • Kernal .bin file convert to .CRT file (I have used HexEdit only ... ) and flash it or upload it to SRAM.
    Then, create your starter program, similar to my one.


    OK, my stuff is flashed in Slot-4.
    My ROM starters are dedicated for slot-4 only.
    SLOT-4 BANK-00 KERNAL-0
    SLOT-4 BANK-01 KERNAL-1
    SLOT-4 BANK-02 KERNAL-2
    SLOT-4 BANK-03 KERNAL-3
    SLOT-4 BANK-04 KERNAL-4
    SLOT-4 BANK-05 KERNAL-5
    SLOT-4 BANK-06 KERNAL-6
    SLOT-4 BANK-07 KERNAL-7


    I have collected that and created one bigger .CRT, I was too lazy to do it by one ...
    kernals.crt


    Try starter for KERNAL-4 or 5 for JiffyDos, I don't remember.


    You can create .crt for 1 bin file only and load it to SRAM to Bank-0 as well.
    Then use my START-RAM-KERNAL.PRG.
    JIFFYDOS.crt

  • Hint to start EasyFlash image after power up of C64.


    Here is example of very short bootfile, which redirects running to EasyFlash image in slot-0.
    Just try to flash your EF image into Slot-0 and replace my SDCMDUC bootfile by this EF bootfile.
    start-files-reset-ef.zip


    Simply you can create what you want.
    The detailed info for developers I plan to publish soon.


    Enjoy !

  • ok, thanks!


    i tried to flash / start JiffyDos to / from Slot 4. That worked, but after loading commander with JiffyDOS kernal it shows HW: ERROR and SD-CARD: ERROR and commander is empty (no files).

  • I have done some more tests with my two C64, mainly flashing cartridges, here are my results:


    Used kernals: kernals.crt and jiffydos.crt from post #70



    1. Assy 250407, Vic ?


    This one did not boot reliable with the cartridge, sometimes red screen, sometimes black screen, sometime normal prompt without run/stop.
    If i get the normal prompt i can load the sdcmduc via disk, it shows the firmware number and ok.


    Tests:
    1.1. Writing kernals.crt in flash memory did not work: hardware error (prompt with loading sdcmduc via disk)
    1.2. Writing jiffydos.crt to sram: not tested


    due to test failure switching to:



    2. Assy 250469, Vic 8565R2


    This one boot and works with programs from sd-card, much less problems with reliability...


    Tests:
    2.1. Writing jiffydos.crt to sram works, booting via starter START-RAM-KERNAL.PRG works, too
    2.2. Writing kernals.crt in flash memory works, booting via starter did not work: C64 crashes on every slot



    switching with the cartridge and flashed kernals.crt back to


    1. Assy 250407, Vic ?


    1.3. booting to prompt, loading sdcmduc via disk and then booting kernal via starter did work:
    no crashes, tests on slot-0 (original kernal) and slot-4 (jiffy)




    Any news yet?

  • Thank you borstie for your tests !
    It is valuable for me very much, more symptoms bigger chance to improve it.


    Tests:
    1.1. Writing kernals.crt in flash memory did not work: hardware error (prompt with loading sdcmduc via disk)

    Hmm, it sounds like this is clock/timing general issue. This ASSY 250407 has different timing, probably.
    I should think about what to do ...


    Writing kernals.crt in flash memory works, booting via starter did not work: C64 crashes on every slot

    This is on 250469 ... it should work. How did you test it ?
    Try flash the kernals.crt into Slot-4, please. And try my ROM KERNAL starters 0-7.
    It should be working.
    Please, let me know.

  • I send you my experimental FPGA firmware:
    UC64_2019-02-04-red-screen-problem.zip
    It will give me the answer if I have solved "red screen" / booting problem.
    Yes or No. To be or not to be ! :D
    Please, once you will be able to flash it ... send me the answer.


    I have also updated the user guide.
    2019-02-04-Unicart64-user-guide.pdf
    added: FPGA firmware programming using USB Blaster Rev. C


    I have also updated the FPGA hardware guide for you.
    2019-02-06-Unicart64-hw-guide.pdf
    Now, everyone should be able to create his own FPGA firmware. :thumbsup:


    And finally. I have started with the Firmware documentation.
    2019-02-06-Unicart64-fpga-fw-guide.pdf
    Now, everyone should be able to create his own software for FPGA firmware UC64190124.
    ... will be updated in the future.

  • Thanks for updated documentation and guides :)


    I have just did some more quick tests:


    1. Assy 250469, Vic 8565R2
    I have removed my Superkernal 36 in 1, used in this machine, and now no crashes anymore... hooray... :ChPeace
    Seams there are some compability problems with it... :(



    Then I flashed the experimental firmware from post #79 in the fpga.


    Test on the same assy (350469):
    1.1. First red screen, then switching to green screen, then it showed sdcmduc.
    1.2. Starting a kernal with a starter program: ok.



    Switching to


    2. Assy 250407, Vic ?


    Same behaviour as before:
    This one did not boot reliable with the cartridge, sometimes red screen, sometimes black screen, sometime normal prompt without run/stop.
    2.1. If i get the normal prompt i can load the sdcmduc via disk, it shows the firmware number and ok.
    2.2. Starting a kernal with tha starter program: ok.



    Hmm, i think i saw a mint green color screen with no prompt once, am i right or was my vga-box fooling me?
    sometimes it shows "Falschfarben"... :D