Jump to content

Photo

Display List Interrupts routine: problem

DLI Display list interrupts

10 replies to this topic

#1 Philsan OFFLINE  

Philsan

    River Patroller

  • 2,738 posts
  • New Orleans Saints Super Bowl XLIV Champions
  • Location:Switzerland

Posted Sun Feb 12, 2012 5:54 AM

I found this DLI ML routine that could suit my needs (e.g. more colors like my 2600 game L.E.M. or a beautiful sky).
http://www.atariarch..._Interrupts.php
(program 10 + program 12)

There is a problem.
As-is, cyclically artifacts appear (see yellow pixel on the right):
1.png
If I completely remove the bar draw part (type 126 GOTO 240 in the program), I get those moving artifacts:
2.png

To do tests, you can use the attached .atr and type ENTER "D:DLIST.LST".
Attached File  Filippo2012-TurboBasic.atr   130.02KB   76 downloads

#2 Rybags OFFLINE  

Rybags

    Quadrunner

  • 12,538 posts
  • Location:Australia

Posted Sun Feb 12, 2012 6:24 AM

It's a fairly inefficient DLI, you'd be better off just making your own from scratch.

#3 phaeron OFFLINE  

phaeron

    Stargunner

  • 1,137 posts
  • Location:USA

Posted Sun Feb 12, 2012 1:35 PM

The reason for the artifacts is that the DLI routine doesn't wait for WSYNC -- it just begins changing colors in the middle of the scan line. This puts you at the timing mercy of whatever code is running in mainline and what screen mode is in use. Adding WSYNC isn't enough, though, because there aren't enough cycles in horizontal blank with a standard width screen to cleanly switch all five color registers with the 77 cycles this routine takes. You'd need a streamlined routine with transposed color tables to do it in 24-28.

#4 Philsan OFFLINE  

Philsan

    River Patroller

  • Topic Starter
  • 2,738 posts
  • New Orleans Saints Super Bowl XLIV Champions
  • Location:Switzerland

Posted Sun Feb 12, 2012 2:28 PM

Thank you.
So in 1983 were published books (The Creative Atari) with programs far from perfection...

If it's not a time consuming task, it would be nice if someone would write a graphics 15 (or graphics 7) DLI ML routine to have more on-screen colors (f.e. 24 rows with different backgrounds / colors).

#5 Rybags OFFLINE  

Rybags

    Quadrunner

  • 12,538 posts
  • Location:Australia

Posted Mon Feb 13, 2012 12:19 AM

Attached File  dli1.zip   1.13KB   74 downloads

Here's a better one + sample Basic program.

Source included for the assembly routine (for AtAsm).

As is, the colour tables are:

$7000 Background
$7100 ColPF0
$7200 ColPF1
$7300 ColPF2

You can put as many DLIs as you need, you can't really have 2 DLIs adjacent because you'll get overrun. If you wanted something like that, then you need to do one DLI that continually changes the colours.

The Assembly routine sits @ $600 and has included a short USR routine that sets the DLI/VBlank vectors up.

#6 Philsan OFFLINE  

Philsan

    River Patroller

  • Topic Starter
  • 2,738 posts
  • New Orleans Saints Super Bowl XLIV Champions
  • Location:Switzerland

Posted Mon Feb 13, 2012 3:27 PM

Awesome, thank you very much!
1.png

I only a problem with the attached modified program ("DLI2.LST").
2.png

Attached Files



#7 Rybags OFFLINE  

Rybags

    Quadrunner

  • 12,538 posts
  • Location:Australia

Posted Mon Feb 13, 2012 6:40 PM

Without even looking at the program, I'd say you've inadvertantly changed the LMS address halfway down the screen.

#8 Philsan OFFLINE  

Philsan

    River Patroller

  • Topic Starter
  • 2,738 posts
  • New Orleans Saints Super Bowl XLIV Champions
  • Location:Switzerland

Posted Tue Feb 14, 2012 1:26 PM


10 GOSUB 1000

20 DL=PEEK(560)+PEEK(561)*256

30 FOR C=0 TO 2:COLOR C+1

40   FOR X=C*40 TO C*40+38 STEP 2

50	 PLOT X,0:DRAWTO X,191:NEXT X

60 NEXT C

70 POKE DL+20,174

80 POKE DL+40,174

90 POKE DL+60,174

91 POKE DL+80,174

92 POKE DL+100,174

93 POKE DL+120,174

94 POKE DL+140,174

95 POKE DL+160,174

100 TABBAK=7*4096:TABPF0=TABBAK+256:TABPF1=TABBAK+512:TABPF2=TABBAK+768

110 POKE TABBAK,2:POKE TABBAK+1,4:POKE TABBAK+2,6:POKE TABBAK+3,8:POKE TABBAK+4,10:POKE TABBAK+5,10

120 POKE TABPF0,34:POKE TABPF0+1,136:POKE TABPF1+2,248

130 POKE TABPF1,54:POKE TABPF1+1,PEEK(53770):POKE TABPF1+2,PEEK(53770)

140 POKE TABPF2,168:POKE TABPF2+1,PEEK(53770):POKE TABPF2+2,PEEK(53770)

500 Z=USR(1536)

999 GOTO 999

1000 TRAP 1020

1010 RESTORE 2000:FOR A=1536 TO 1791:READ D:POKE A,D:NEXT A

1020 GRAPHICS 15+16

1490 RETURN

2000 DATA 104,169,0,141,14,212,162,32

2010 DATA 160,6,142,0,2,140,1,2

2020 DATA 162,72,160,6,142,34,2,140

2030 DATA 35,2,169,64,141,14,212,96

2040 DATA 72,152,72,172,85,6,185,0

2050 DATA 112,141,10,212,141,26,208,185

2060 DATA 0,113,141,22,208,185,0,114

2070 DATA 141,23,208,185,0,115,141,24

2080 DATA 208,238,85,6,104,168,104,64

2090 DATA 169,0,141,85,6,169,192,141

2100 DATA 14,212,76,95,228,0,14,212

2110 DATA 76,95,228,3,0,-1



#9 phaeron OFFLINE  

phaeron

    Stargunner

  • 1,137 posts
  • Location:USA

Posted Tue Feb 14, 2012 11:17 PM

Yup, you nailed the LMS instruction at the 4K split. The instruction at DL+99 is the LMS and is three bytes long. Lines 92-95 need to use offsets 102, 122, 142, and 162.

#10 Rybags OFFLINE  

Rybags

    Quadrunner

  • 12,538 posts
  • Location:Australia

Posted Tue Feb 14, 2012 11:24 PM

An easy fix is to put the DList modifiers inside a loop, assuming you want constant steps between the DLIs.

Then have something like:

100 FOR A=DL+10 TO DL+190 STEP 8
110 I=PEEK(A) : IF I <> 14 AND I<>78 THEN A=A+1:GOTO 110
120 POKE A,142:NEXT A


#11 Philsan OFFLINE  

Philsan

    River Patroller

  • Topic Starter
  • 2,738 posts
  • New Orleans Saints Super Bowl XLIV Champions
  • Location:Switzerland

Posted Wed Feb 15, 2012 2:10 PM

Thank you Gary.

If I am not wrong I can safely use the original version of your DLI routine for graphics 7+16 and the modified one for graphics 15+16.

I attach a disk image with your two routines.

I like easy routines!

Attached Files

  • Attached File  DLI.atr   130.02KB   71 downloads






Also tagged with one or more of these keywords: DLI, Display list interrupts

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users