Jump to content
IGNORED

Problems with CIN graphics in CC65


8bit-Dude

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...