8bit-Dude Posted October 3, 2017 Share Posted October 3, 2017 Hey guyz, I have programmed an online racing game for C64 using CC65, and now trying to port it to Atari 8bit. After reviewing the various GFX modes, I selected CIN. But I am looking for some advice on CC65 integration. Here is what I have done so far: (1) Used Atari Interlaced Studio to generate CIN data of a map, and exported as assembly code. (2) Simplified the ASM file, replaced the main loop with "jsr $2001", compiled it with MADS, and located it between $6010 - $A21A (RUN $A194). (3) Compiled an hello world prog with CC65, and located it $2E00-$3031 (RUN $2001). (4) Used merge-xex to combine the 2 progs, with default run location $A194. When I test in Altirra, the ASM code does the CIN setup, and move to the CC65 prog as expected.However, things get tricky from here: (1) Doing simple loops to modify the CIN memory seem to work (for instance blacking out half the lines). (2) But functions like sleep() or cgetc() do not seem to work at all. I have attached my files for reference: The prog shows the map, blacks out half the lines, then waits for a key press... but never detects it. Commenting line 27, the prog carries on to the next part...?!? I must be doing something stupid, but I can't figure out what.Converting the ASM code to CC65 assembly would probably be best, but CC65 does not support many of the MADS macros...Is there an easy way to transcode from MADS to CC65? CIN-CC65.zip Quote Link to comment Share on other sites More sharing options...
8bit-Dude Posted October 3, 2017 Author Share Posted October 3, 2017 Update: I modified the ASM code and declared procedures to Start/Stop the CIN graphics (MADS says they are located at $A194 and $A1D6. After merging the MADS and CC65 binaries, I run the CC65 prog direcly and use __asm__("jsr $a194") and __asm__("jsr $a1d6") to call the CIN procs. It works just about the same as before: I can do some loops, but cgetc() does not respond... (see attached code). CIN-CC65-v2.zip Quote Link to comment Share on other sites More sharing options...
8bit-Dude Posted October 3, 2017 Author Share Posted October 3, 2017 I have done some more reading, and I am starting to understand. CC65 sets up some interrupts for the Keyboard and Timer. Does anyone know how I can keep the CC65 interrupts running whilst setting up the CIN interrupt? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.