Jump to content
IGNORED

changing a color register on thesame scanline


Thelen

Recommended Posts

I was doing some little experiments on the atari 8 bit, but it just won't work..

 

Is it possible to change a color register multiple times on the same scanline ? I was thinking it should be possible. let's say change the background color 10 times on the same scanline :

 

sta wsync

ldx #0

loop stx colbk

inx

cpx #10

bne loop

 

and I run this from in a DLI

 

is this possinle ? and how ?

 

Thanks,

 

Thelen

Link to comment
Share on other sites

What are your results? Do you see any change at all?

 

Are you setting the shadow register? You can't set the shadow register in a DLI. You must set the register directly. The shadows get moved during VBLANK (if you didn't override it :D). So if you set the shadow you won't see the change.

Link to comment
Share on other sites

yes i'm using the hardware register, COLBK $D01A, but i get no color variation on the same scanline, only at the scanlines underneath.....

 

Thelen

 

Hmmm...I wonder if it's a timing issue. ANTIC takes up some cycles from the CPU. What graphics mode are you using? I think I remember seeing this too. I was exerimenting with changing colors and the display list in the middle of a scanline. I later found that changing the display list wasn't possible :sad:

 

Now I remember...look at Atari Graphics and Arcade Game Design-Chapter 6. They have an example of doing this.

Link to comment
Share on other sites

Thanks, but that's not what i'm looking for, that example changes the screencolor only once. I want to change the color register a few times on the same scanline, so that on one scanline the background has multiple colors

 

 

Thelen

 

It should give some background on timing issues, though. I think this is where I read about ANTIC stealing some of the CPU cycles. It may have been De Re Atari, I can't remember.

Link to comment
Share on other sites

hmmm... maybe you don't see the changes????? what kind of gfx mode are you in? imagine a gr.0 screen than you don't see the changes as you are probably "behind" the text screen area...

 

dli pha

sta wsync

lda #$0f

sta wsync

sta $d01a

nop

nop

nop

nop

nop

nop

lda #$00

sta $d01a

nop

nop

nop

nop

nop

nop

nop

lda #$0f

sta $d01a

pla

rti

 

should give you at least something to see... i must admit that i havent tested the code...

 

hve

Link to comment
Share on other sites

Thanks man( I didn't have time to test it before) it works, but the color changed only 1 time on the scanline.....i want at leat three :D

 

and I am using XASM, and it says to me : WARNING professional loader needed, what does that mean ?

 

Thanks,

 

Thelen

Link to comment
Share on other sites

thelen,

 

you can put as much color changes in one line as you have cpu cycles left which means as much cpu power... the rasterbeam of the monitor is running from left two right so you have just this time and you have to consider that all commands need execution time themself....

 

while loading the accumulator the rasterbeam is moving but you haven't written any value to the color register ergo you can not see anything...

 

so if you want to change severl times the color try this:

 

lda #color1

sta wsync ; sync

sta $d018

lda #color2

sta $d018

lda #color3

sta $d018

lda #color4

sta $d018

...

pla

rti

 

be creative...what makes me wonder is for what do you need this routine??? maybe there is a quicker and easier way to do it... ;)

 

re: professional loader...

 

the xasm tool XBOOT generates an ATR image with your EXE file and includes automaticly an boot-loader so you can easily test it with an emulator.

 

in standard mode a "normal" loader is included and the atari operating system (OS) is not switched off... therefore all VBL and rom routines work...

 

for "real" hardcore demo coding or game coding it's good to switch off the OS/ROM completly as you have more zeropage variables etc left and more RAM. an example:

 

the color registers like 708,709,710,712 are mapped by the OS into the GTIA registers $d016, ... $d01a.

 

why is XASM suggestion you the professional loader? i guess your program is positioned & assembled into an area which is normaly used by the OS. so it would be better to use the /P flag to put the "professional" loader & the XASM kernel routines with minimum OS routines...

 

check your ORG statement...

 

XASM filename

XBOOT /p filename

 

hve

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