Jump to content
IGNORED

Mode 1+16 with different 2 color palletes


Recommended Posts

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

 

  • Like 1
Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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....

Link to comment
Share on other sites

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

  • Like 1
Link to comment
Share on other sites

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 by MrFish
  • Like 3
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...