Dysphoria Posted November 12, 2023 Share Posted November 12, 2023 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? Quote Link to comment Share on other sites More sharing options...
dmsc Posted November 13, 2023 Share Posted November 13, 2023 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! 2 Quote Link to comment Share on other sites More sharing options...
Dysphoria Posted November 13, 2023 Author Share Posted November 13, 2023 Thank you @dmsc - this was exactly what I was looking for. I think it's odd that I cannot find any documentation that the "_graphics" function even exists. Quote Link to comment Share on other sites More sharing options...
baktra Posted November 13, 2023 Share Posted November 13, 2023 3 hours ago, Dysphoria said: Thank you @dmsc - this was exactly what I was looking for. I think it's odd that I cannot find any documentation that the "_graphics" function even exists. https://cc65.github.io/doc/atari.html#ss5.1 There it is. At least the function's existence is admitted by the docs. 1 Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted November 13, 2023 Share Posted November 13, 2023 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. 1 Quote Link to comment Share on other sites More sharing options...
baktra Posted November 13, 2023 Share Posted November 13, 2023 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. Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted November 13, 2023 Share Posted November 13, 2023 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. 1 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.