WIC64 development in C

There are 40 replies in this Thread which has previously been viewed 1,425 times. The latest Post (November 20, 2025 at 11:53 PM) was by SM7I.

  • Hi, I´m a software dev, mostly on the Sinclair scene, but done some minor contributions also on the Commodore scene.

    I have now aquired a nice WIC64 from Konstantin and I wish to start developing for it, but I´m having a hard time finding examples or actual guides for how to talk to the WIN64. The only information I find is in ASM and that´s slim at best.

    Does anyone have any information on how to code for WIC64 in C ? Examples or actual code perhaps ?

  • Please login to see this link. is known? It should contain the most relevant information (including some code examples).

    I am not aware of any WiC64 programs or code snippets in C. However, one of the other programmers who has developed software for the WiC64 may be able to help.

  • There is documentation in the Please login to see this link. on how to use the lib.

    Sure that's in assembler since that whats used most often for the C64, but you should be able to use the lib from your C-Project using inline asm, maybe you need wrapper calls for the macros, but that depends on how well your c-suite handles inline asm.

  • There is also a library for XC-Basic available.

    Please login to see this link.

    Video how to use:

    Please login to see this link.

  • There is documentation in the Please login to see this link. on how to use the lib.

    Sure that's in assembler since that whats used most often for the C64, but you should be able to use the lib from your C-Project using inline asm, maybe you need wrapper calls for the macros, but that depends on how well your c-suite handles inline asm.

    Yes, this is the code I´ve found, but not very well knowledgeable in 6502/6510 asm. Maybe there´s a chance anyone can make a useable C wrapper for the asm lib ?

  • While i'm capable in 6502 asm and also good enough in C to do some things for the C64, providing the magic glue to bring everything together is way out of my knowledge :biggrin:

  • While i'm capable in 6502 asm and also good enough in C to do some things for the C64, providing the magic glue to bring everything together is way out of my knowledge :biggrin:

    Matbe someone else has the knowledge and time to help out here ? I´d be eternally grateful :)

  • SM7I maybe you can have a look into the XC-Basic lib - Here you can see the logic of the communication between C64 and the module in BASIC Language - so it should be easy to understand how this works.

    Also the video I mentioned shows the handling of Vice in case of programming and testing WIC64 applications on a PC - it also shows how to start logging of communication between C64 and the Module...

    The video also shows how to handle the most used commands of the module

    maybe some interesting informations.

  • SM7I maybe you can have a look into the XC-Basic lib - Here you can see the logic of the communication between C64 and the module in BASIC Language - so it should be easy to understand how this works.

    Also the video I mentioned shows the handling of Vice in case of programming and testing WIC64 applications on a PC - it also shows how to start logging of communication between C64 and the Module...

    The video also shows how to handle the most used commands of the module

    maybe some interesting informations.

    Thanks you very much. Wathing your video as well now. The only problem for me would be to convert this into C code as I can´t use your library as is unfortunately.

  • I've never used C on the C64, but isn't the WiC64 interface mostly writing to or reading from the CIA register(s)? Do you have a setup with a C compiler for 6510?

    C64Studio: Please login to see this link. - Please login to see this link. --- C64Studio WIP: Please login to see this link. - Please login to see this link. --- Please login to see this link.

  • The XC library seems quite simple: Please login to see this link. - porting that to C should be straightforward

    Please login to see this link. - Please login to see this link.

  • I've never used C on the C64, but isn't the WiC64 interface mostly writing to or reading from the CIA register(s)? Do you have a setup with a C compiler for 6510?

    Yes, I have several cross compiler environments. CC65 is one of them. I do *alot* of C coding, but unfortunately ASM 6502/6510 is not one of my strongest sides :)

  • The XC library seems quite simple: Please login to see this link. - porting that to C should be straightforward

    I am going to give it a try, but calling it "straight forward" is kind of over exaggerating....

  • What parts exactly?

    E.g.,

    Code
         LDA $dd02
    	 ORA #$04
    	 STA $dd02
    	 LDA $dd00
    	 ORA #$04 
    	 STA $dd00
    	 LDA #$ff 
    	 STA $dd03
    	 lda $dd0d

    ...is really just...

    Code
    poke $dd02, peek($dd02) or 4
    poke $dd00, peek($dd00) or 4
    poke $dd03, 255
    a=peek($dd0d):rem clear cia flag

    Please login to see this link. - Please login to see this link.

    Edited once, last by 1570 (November 13, 2025 at 8:44 PM).

  • What parts exactly?

    E.g.,

    Code
         LDA $dd02
    	 ORA #$04
    	 STA $dd02
    	 LDA $dd00
    	 ORA #$04 
    	 STA $dd00
    	 LDA #$ff 
    	 STA $dd03
    	 lda $dd0d

    ...is really just...

    Code
    poke $dd02, peek($dd02) or 4
    poke $dd00, peek($dd00) or 4
    poke $dd03, 255
    a=peek($dd0d):rem clear cia flag

    Well, I´m quite puzzled as it does not seem so complicated, but for some reason it cannot get any response from the WIC64. First of all, are these addresses correct ?

    PRA = $dd00 ; Port A
    PRB = $dd01 ; Port B (data)
    DDRA = $dd02 ; Direction A
    DDRB = $dd03 ; Direction B
    ICR = $dd0d ; Interrupt control/status