Jump to content
IGNORED

fastbasic DLI colors


Recommended Posts

When I run this test, the first top two lines of gr.0 is the normal background, it seems the first line starts at 6 - dpeek(560)+6, 130..  when I try line 5, nothing is displayed not even the print statement. What am I not understanding?  Thanks. Running the .atr version 4.5 and altirra 3.90 XL/XE mode

 

DATA COLORS() BYTE = $FF

DLI SET D2 = COLORS INTO $D01A,
DLI         = $00 WSYNC INTO $D018,
DLI         = $BA WSYNC INTO $D018,
DLI         = $BB WSYNC INTO $D018,
DLI         = $BC WSYNC INTO $D018,
DLI         = $BD WSYNC INTO $D018,
DLI         = $BE WSYNC INTO $D018,
DLI         = $BF WSYNC INTO $D018
 

' SETUPS SCREEN
GRAPHICS 0
' ADDS DLI AT THREE LINES:
POKE DPEEK(560) + 6, 130

' ACTIVATE DLI
DLI D2

 

'WAIT KEY

GET K

DLI

..

 

 

Link to comment
Share on other sites

 

45 minutes ago, eflake said:

when I try line 5, nothing is displayed not even the print statement.

Display List, first 6 bytes are

 

$70    8 Blank Lines

$70    8 Blank lines

$70    8 Blank line

$42    LMS Mode 2

$40    Low byte of screen address

$BC    High Byte of screen address

$02

etc.

.

so when you poke into line 5 you are changing the high byte of the screen address

if you wanted the DLI on the first line you need to POKE PEEK(560)+3,$C2

$C2=mode 2 line+LMS+DLI

 

The print statement is going the the screen @560/561 but the display list is now showing some other area of memory, thats why you don't see anything

Edited by TGB1718
Link to comment
Share on other sites

Hi!

Quote

When I run this test, the first top two lines of gr.0 is the normal background, it seems the first line starts at 6 - dpeek(560)+6, 130..  when I try line 5, nothing is displayed not even the print statement. What am I not understanding?  Thanks. Running the .atr version 4.5 and altirra 3.90 XL/XE mode

You need to understand how Display-Lists work.

 

The DLI fires in the next line of the display-list where it is maked. So, to have a DLI in line two, you need to mark line 1. But line 1 is special, it is a LMS (load-memory-scan-counter) operation so it takes 3 bytes instead of one, and has a value of 64 more than the standard. This means that you need to use POKE DPEEK(560) + 3, 130+64

 

There are a lot of o online resources that explain display-lists in the Atari.

 

Have Fun!

 

 

Edited by dmsc
fixed example
Link to comment
Share on other sites

27 minutes ago, dmsc said:

This means that you need to use POKE DPEEK(560) + 6, 130+64

no, that location is the 7th line of the display list, the first display line instruction starts at byte 4 

if you poke $C2 into byte 7, it will need an address following it as I have shown in my explanation $C2=mode 2 line+LMS+DLI

 

Link to comment
Share on other sites

Hi!

33 minutes ago, TGB1718 said:

no, that location is the 7th line of the display list, the first display line instruction starts at byte 4 

if you poke $C2 into byte 7, it will need an address following it as I have shown in my explanation $C2=mode 2 line+LMS+DLI

 

You are right, of course, a copy-paste problem :) 

 

it was: POKE DPEEK(560) + 3, 130+64

 

Have Fun!

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