Jump to content
IGNORED

FB : DLI + backgrounds colors


shaoth

Recommended Posts

For my adventure text game I use a DLI to get 2 zones.

1 for a picture and the other for the text.

Zone 2 is ANTIC Mode 2

And Zone 1 is ANTIC mode 7 for the tests.

I am not fixed yet with the graphic mode I will use.

My purpose is to test the comportement of my code according to the orders given by the user.

But I have a little problem with my DLI...

I would like to have a different background color for each zone : 0, 1 and 2. 

Up to now, the background color of Zone 2, ANTIC mode 2, overflows on zone 0.

Is there a way to stop it ?

 

 

outpost31.png

Link to comment
Share on other sites

The last colour change persists until changed again in the VBlank (end of screen).  But VBlank stage 2 which does most of the colours sometimes gets blocked (SIO, keypress etc).

 

You might want to put a DLI at the end of Zone 2.  If the colours wanted there are same as Zone 0 then fine, if not you might want an Immediate VBlank routine to ensure Zone 0 colours are stored.

  • Like 1
Link to comment
Share on other sites

Zone 2 is Antic Mode 2 and has a border colour (ie. Zone 0) whereas, Zone 1, depending on the mode you will use will have no distinct border, since the background colour register also changes the border.  To fix this, you can set up PMG and quadruple size a couple of missiles, you can set their colour to the required zone 0 border colour and use them at positions 40 + 200.  I believe you can even reuse the same missile as both borders using a simple DLI, as when called by the interrupt from Antic, the DLI could set the position of missile 0 to the right edge (200) and then pause for the hblank before setting the missile back to the left side of the screen ie. PHA; LDA #200; STA $D000; STA WSYNC, LDA #40; STA $D000; PLA; RTI;  It is interesting because a graphics mode such as antic E using missile borders can in fact display 5 colours like this, 6 if it is Antic Mode 4.

 

For the issue at the top at bottom, don't forget you can add DLIs (+128) to any entry in the display list, ie. even to the display list codes for blank lines eg. 112 + 128 = 240 so the change occurs on the next line.  These would simply set the background color to the colour in Zone 2.  I would do what Rybags says though and set the HW register in the Vblank.  However, at the beginning of your code for your screen initialisation, if you set both the hardware register and the shadow register (something I used to forget), then the OS Vblank will change the hardware register to the colour in the shadow register automatically, so it may not be strictly necessary for quickly getting something working.

 

 

Edited by TracMan
Edited typos/ OS vblank may work.
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...