letzter Beitrag von kim_jorgensen am
Kung Fu Flash Cartridge
- kim_jorgensen
- Unerledigt
-
-
I'm running freezer cartridge images (Action Replay V6, Super Snapshot V5, etc.) on KFF to inspect some programs, but freezer button does not work after executing a PRG file from SD card. I can't reach the freezer cartridge's startup screen by pressing the reset button too. Is there a way to do that?
Sorry, but there is no way to load a PRG from KFF while emulating a cartridge. You'll need to load the program from a disk drive or tape.
-
there is no way to load a PRG from KFF while emulating a cartridge
Could it be like this?
- stop emulating the CRT
- load the PRG from SD card
- start emulating the CRT from its turned off state (EXROM and GAME high)
- execute PRG
-
Could it be like this?
- stop emulating the CRT
- load the PRG from SD card
- start emulating the CRT from its turned off state (EXROM and GAME high)
- execute PRG
Unfortunately it is not as simple. If you want a general and stable solution you cannot simply stop emulating the CRT while the C64 is running as the program may try to access the cartridge and crash.
What you want is to pause the execution, load the PRG to memory, restore the system state and then resume execution. There is this document that explains how this is implemented in Ultimate 1541, however this method cannot be used by KFF as the DMA line is not connected.
I guess you could develop a custom KFF freezer that somehow could be integrated with all the supported cartridge types, but that would be a big task.
-
What you want is to pause the execution, load the PRG to memory, restore the system state and then resume execution.
I couldn't express what I was thinking, I guess. Let me write it like this:
1- load the PRG using built-in launcher as usual
2- start emulating the CRT (for example AR6)
3- execute PRG
Notes for step 2
--------------------
CRT's ROM must be turned off. In order to do this, start the CRT emulation using EXROM=1 and GAME=1 values. EXROM value is at offset $18, GAME value is at offset $19 of the CRT file.
-
OK, I think I understand now. You are not suggesting a general solution for loading a PRG while emulating a cartridge, but specific solution to be able to freeze an already loaded PRG.
It is important to understand that loading of PRG file is currently done by emulating an EasyFlash cartridge where the C64 communicates with the KFF via the EF3 USB registers. The disk drive emulation is an extension to that where kernal vectors are overridden so that e.g. a LOAD will trigger custom code in the EF3 cartridge ROM.
I'm not saying what you a suggesting is impossible but it will not work with the disk drive emulation and would require changes to the PRG loader.
Feel free to create a feature request for this on GitHub, if you think this is an important feature.
-
This is what I came up with for the PCB rev. 2 based on input from bigby and Metallic:
Besides moving the USB connector closer to the cartridge case edge, the pads was also made longer. Hopefully this would make it a bit easier to install the USB connector.
The gerbers can be found here but has not been tested yet. I'll let you know once I have received and tested them.
Have you received already the rev. 2 PCBs? And had you time to test them?
-
A new firmware version has just been released that should address some of the menu lockups and disk emulation errors at startup. Let me know if this fixes anything or causes other problems.
-
A new firmware version has just been released that should address some of the menu lockups and disk emulation errors at startup. Let me know if this fixes anything or causes other problems.
Great, the "device not present" error no longer occurs on my C64 with a PLA replacement. Thank you.
-
Have you received already the rev. 2 PCBs? And had you time to test them?
Yes, I have received them but not had the time to assemble them yet. I'll keep you updated.
At least the dimensions seems to be correct (left: TFW8b case, rigth: 3D printed case)
-
I felt lucky and ordered a small batch myself a while ago. They are currently somewhere in limbo between China and Germany. When I finally get my PCBs, I will try to update the STLs for the case to support the USB connector.
-
A new firmware version has just been released that should address some of the menu lockups and disk emulation errors at startup. Let me know if this fixes anything or causes other problems.
The crash when pressing the DEL key several times is gone. It works good.
-
All problems have disappeared with 1.09, great work!!
-
I've prepared a video for gaming and cross development using the USB connection of KFF.
[Externes Medium: https://youtu.be/2IuOAAEOOeM] -
I've prepared a video for gaming and cross development using the USB connection of KFF.
Great. I did something similar for a small game I was developing but also had a small piece of code in the game that checked for commands on the USB port. That way I could upload a new version without having to reset the C64 each time. It was developed for EasyFlash 3 but it also works with Kung Fu Flash.
Code- ;------------------------------------------------------------------------------
- ; Check if a EasyFlash3 command is received on USB (for debug)
- ;------------------------------------------------------------------------------
- .if debug_build == 1
- ef3usb_check bit USB_STATUS ;Byte received?
- bmi rx_byte
- rts
- rx_byte ldx rx_index
- lda txt_efstart_prg,x
- cmp USB_DATA ;Check received byte
- bne reset_rx_index
- inx
- cpx #12 ;End of command string?
- bne store_rx_index
- ldx #0 ;Got command - send "wait"
- tx_byte lda txt_wait,x
- - bit USB_STATUS ;Wait on TX OK
- bvc -
- sta USB_DATA
- inx
- cpx #5
- bne tx_byte
- jmp ef_soft_reset ;Reset and let EF3 handle the command
- reset_rx_index ldx #0
- store_rx_index stx rx_index
- rts
- .enc "none"
- txt_efstart_prg .text "efstart:prg",0
- txt_wait .text "wait",0
- rx_index .byte $00
- USB_STATUS = $de09
- USB_DATA = $de0a
- ;------------------------------------------------------------------------------
- ; Soft reset
- ;------------------------------------------------------------------------------
- ef_soft_reset lda #$00 ;Disable raster interrupt
- sta $d01a
- ldx #(reset_code_end - reset_code)
- copy_code lda reset_code,x
- sta $0200,x
- dex
- bpl copy_code
- jmp $0200
- reset_code ;Installed at $0200
- lda #$37 ;Enable Kernal
- sta $01
- lda #$85 ;Easyflash in Ultimax mode
- sta EF_CONTROL
- jmp ($fffc) ;Soft reset
- reset_code_end
- EF_CONTROL = $de02
- .fi
Just call ef3usb_check in you main loop and it should work.
The file is uploaded with the ef3usb "s" command, both in the KFF Launcher and when the game is running. -
Rev. 2 of the PCB has been successfully tested. Dikdom did also provide SMT Assembly files for JLCPCB if you would like to avoid soldering most of the parts.
(here is my crappy soldering)
-
That good to hear, thanks for letting us know! I've ordered a batch of rev.2 PCBs more than 5 weeks ago and I'm still waiting for them to be delivered, unfortunately. (To be delivered by bike courier as someone suspected in another thread...)
-
That good to hear, thanks for letting us know! I've ordered a batch of rev.2 PCBs more than 5 weeks ago and I'm still waiting for them to be delivered, unfortunately. (To be delivered by bike courier as someone suspected in another thread...)
What delivery method did you choose?
I always choose EuroPacket it only takes 2 weeks to arrive.
-
What delivery method did you choose?
I always choose EuroPacket it only takes 2 weeks to arrive.
Well, when I order from JLCPCB these days, I choose EuroPacket, too. And I can confirm that it works fine. But I ordered these PCBs from PCBway where EuroPacket is not an option. At the time, the only affordable option there was China Post.
-
At the time, the only affordable option there was China Post.
It took two months. They were traveling by train for some time. I could see that in tracking ...