Fabrizio Caruso Posted February 19, 2019 Share Posted February 19, 2019 HI everyone!I am not an experienced Atari developer. I would like to know if I can have a simple display list for a screen in Mode 1+16 with two different color palettes (one on the top 2 lines and one on the rest).Can I avoid interrupts for this? I don't need mid-line palette switches. I just need the same video mode times but two different color palettes (for the 4 foreground colors).I would like to do this in standard Atari BASIC first and then in C (CC65) afterwards. Fabrizio 1 Quote Link to comment Share on other sites More sharing options...
+Stephen Posted February 19, 2019 Share Posted February 19, 2019 No way to do this without a simple DLI to change the 4 registers. Quote Link to comment Share on other sites More sharing options...
+Philsan Posted February 19, 2019 Share Posted February 19, 2019 Perhaps what written here could be useful (however graphics modes 7 and 15). http://atariage.com/forums/topic/194020-display-list-interrupts-routine-problem/ EDIT OP doesn't want DLI so linked topic isn't useful for him. Quote Link to comment Share on other sites More sharing options...
Irgendwer Posted February 19, 2019 Share Posted February 19, 2019 Can I avoid interrupts for this? I don't need mid-line palette switches. ... I would like to do this in standard Atari BASIC first and then in C (CC65) afterwards. There is no way to do this in Atari Basic - for cc65 it depends: You could organize your main-loop in a way that the change of the Antic VCOUNT register at the line of interest is noticed and change the color registers then, just in a similar way like here: http://atariage.com/forums/topic/261463-c-or-assembler-for-game-development/?view=findpost&p=3690336 or here: http://atariage.com/forums/topic/191488-player-editor/?view=findpost&p=3864173 but timing is of course a bit critical when doing other tasks... Quote Link to comment Share on other sites More sharing options...
popmilo Posted February 19, 2019 Share Posted February 19, 2019 HI everyone! I am not an experienced Atari developer. I would like to know if I can have a simple display list for a screen in Mode 1+16 with two different color palettes (one on the top 2 lines and one on the rest). Can I avoid interrupts for this? I don't need mid-line palette switches. I just need the same video mode times but two different color palettes (for the 4 foreground colors). I would like to do this in standard Atari BASIC first and then in C (CC65) afterwards. Fabrizio Ehmmm... Which one is "mode 16" ? If you meant mode 15 (4 color bitmap), it uses COLBK and PF0,PF1,PF2 color registers. Mode 0 uses PF1 and PF2. (Note - PF2 provides color, and only luminance of PF1 is used for bits '1'. Bits '0' have color and luminance of PF2. Crazy I know ) So.... Even if you can live with PF1 in top having same luma as PF1 in bottom part (it can have different hue) you would still need to change PF2 at exact time when raster hits that division line. Imho - if you can - Use same color for PF2, make good combo for PF1 and choose freely COLBK and PF0. Only thing left then is to put those mode codes into display list. If you want dli (or loop till vcount reaches certain value), it can be done in CC65 like Irgendwer said. Don't know about basic.... Quote Link to comment Share on other sites More sharing options...
emkay Posted February 19, 2019 Share Posted February 19, 2019 Mode 16 ? He wrote 1+16 which means Graphics mode 1 without the text window. It's antic mode 6. Quote Link to comment Share on other sites More sharing options...
Heaven/TQA Posted February 19, 2019 Share Posted February 19, 2019 No way without DLI 1 Quote Link to comment Share on other sites More sharing options...
sanny Posted February 19, 2019 Share Posted February 19, 2019 No way without DLI Yes, but should be rather simple. Just install a DLI handler which changes the color registers. VBI will take care that in the next frame the colors will be restored for the lines before the DLI position. 1 Quote Link to comment Share on other sites More sharing options...
tschak909 Posted February 19, 2019 Share Posted February 19, 2019 DLI's are very simple (they _HAVE_ to be, you don't have the cycles to do much), and are arguably the most powerful feature of the platform, and allow you to do raster interrupts easily. All you need to do, is write a little routine that changes the registers you need to change (use the direct write-only registers, not the shadow values stored by the OS), and end it with an RTI, set the vector to point to your routine, and turn on the DLI NMI to the NMIEN ($D40E) register, typically by writing $C0. -Thom 1 Quote Link to comment Share on other sites More sharing options...
+MrFish Posted February 20, 2019 Share Posted February 20, 2019 (edited) DLI's are very simple (they _HAVE_ to be, you don't have the cycles to do much), and are arguably the most powerful feature of the platform, and allow you to do raster interrupts easily. All you need to do, is write a little routine that changes the registers you need to change (use the direct write-only registers, not the shadow values stored by the OS), and end it with an RTI, set the vector to point to your routine, and turn on the DLI NMI to the NMIEN ($D40E) register, typically by writing $C0. They are quite easy, once understood. For a beginner, you need not write your own routine though; you can borrow some simple magazine examples and replace small portions as needed for your own use. This one from Antic Magazine gives a nice introduction and 3 usable BASIC program examples to get you started. The first 2 programs don't modify the display list; program 1 changes a single color; program 2 changes 3 colors and the screen width. Either of these programs can be easily modified to change whatever registers (or other memory locations) you'd like with whatever values you'd like. The 3rd program also gets into changing the display list itself (and drawing some example image). The web page pointed to below with the article and programs includes programs 1 & 2, but not program 3 for some reason. Program 3 can be copied from the actual magazine scans (from Atarimania or elsewhere) if you're interested. Another thing to keep in mind, is that you don't need to understand everything about what's going on with such programs, but rather at least enough to change the necessary values to get the desired behavior. If you can't understand what's needed, someone here can help. Antic: Start Interrupting Edited February 20, 2019 by MrFish 3 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.