Jump to content
IGNORED

Modified Display Lists in CC65 and SpartaDOS with TD-Line


Recommended Posts

Hello - I am writing a program which runs under SpartaDOS, that creates a custom display list, and then reverts to the previous display list when exiting to DOS. However, when I have the time/date line active it doesn't want to revert to the previous display list correctly. I would believe that issuing a Graphics 0 command like in BASIC or Action! would correct the issue and restore the default display list, which would then be overridden by the TD-Line routines. The issue is that there is no Graphics 0 command in CC65. I can set SDLSTL to 0x9C20, but I don't think that's a universal location for the Graphics 0 display list, certainly not in the 800 which has Cartridge B from 0x8000 to 0x9FFF. Is there a universal location to find the Graphics 0 display list that isn't SDLSTL? Is there a way to perform a Graphics 0 command in CC65?

Link to comment
Share on other sites

Hi!

3 hours ago, Dysphoria said:

Hello - I am writing a program which runs under SpartaDOS, that creates a custom display list, and then reverts to the previous display list when exiting to DOS. However, when I have the time/date line active it doesn't want to revert to the previous display list correctly. I would believe that issuing a Graphics 0 command like in BASIC or Action! would correct the issue and restore the default display list, which would then be overridden by the TD-Line routines. The issue is that there is no Graphics 0 command in CC65.

 

CC65 does have a "_graphics" function. This is a complete example of using a DL and then returning to graphics 0:

 

#include <atari.h>
#include <conio.h>
#include <atari_screen_charmap.h>
static char scr[] =
  "               HELLO WORLD                    press any key...                  ";
#include <atari_atascii_charmap.h>

static void dl = {
        DL_BLK8, DL_BLK8, DL_BLK8, DL_BLK8, // 32 blank lines
        DL_LMS(DL_CHR40x8x1), &scr,         // LMS ANTIC mode 2
        DL_CHR40x8x1,                       // 1 extra line ANTIC mode 2
        DL_JVB, &dl                         // JVB
};

int main(void)
{
    static unsigned char i = 120;
    OS.sdlst = &dl;
    cgetc();

    _graphics(0);

    cputs("Press any key to exit.");
    cgetc();

    return 0;
}

 

Compile with:

cl65 -Osir -tatari  -Wl -D__RESERVED_MEMORY__=0x1  -o dlsample.xex dlsample.c

 

The "__RESERVED_MEMORY__" is needed in Atari mode because the OS will fail to set the graphics mode unless there is at least one free byte.

 

Have Fun!

  • Like 2
Link to comment
Share on other sites

I think it's hard to find due to the cc65 documentation which doesn't have any links to the platform specific stuff

on it's main page if you search for cc65 user guide.

 

However if you Google for "cc65 index page", it takes you to a link to the documentation where you will find

a link to Atari specific routines.

  • Like 1
Link to comment
Share on other sites

55 minutes ago, TGB1718 said:

I think it's hard to find due to the cc65 documentation which doesn't have any links to the platform specific stuff

on it's main page if you search for cc65 user guide.

 

However if you Google for "cc65 index page", it takes you to a link to the documentation where you will find

a link to Atari specific routines.

I would beg to differ. It is three steps:

 

1. Navigate to the cc65 home page

2. Click the Documentation Link

3. Navigate to the Platform-specific information section and pick your platform.

 

The "CC65 Users's guide" describes just the cc65 tool, not the whole cc65 toolikt. And I take it the platform-specific information is valid for the whole toolkit (compiler, linker, assembler), not just the cc65 tool.

 

Link to comment
Share on other sites

It does depend, if you goggle for "cc65 user guide" or "cc65 user manual", it takes you here https://cc65.github.io/doc/cc65.html

there is no link to "Documentation"

 

However if you search for cc65 Documentation it takes you here https://cc65.github.io/doc/ which is much more useful.

 

So it does really depend on what you search for.

  • Thanks 1
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...