Jump to content
IGNORED

Custom display list: help needed


Philsan

Recommended Posts

I want to write a basic game with this custom display list:

2 rows of graphics mode 1 at the top

remaining lines of graphics mode 7+16

 

This program, adapted from Compute's First Book of Atari, works but I don't know if all the values are correct, in particular variable A (I don't want an overscanned screen).

10 GRAPHICS 7+16

11 A=90

20 BEGIN=PEEK(560)+PEEK(561)*256+4

25 POKE BEGIN-1,70

26 POKE BEGIN+2,6

50 POKE BEGIN+A,65:POKE BEGIN+A+1,PEEK(560):POKE BEGIN+A+2,PEEK(561)

60 SETCOLOR 4,0,0:REM BACKGROUND

70 POKE 87,1:POSITION 0,0:PRINT #6;"SCORE:2350 HIGH:9700";

75 POKE 87,1:POSITION 0,1:PRINT #6;"SCORE:2350 HIGH:9700";

100 POKE 87,7:COLOR 1:PLOT 0,1:DRAWTO 159,1:DRAWTO 159,87:DRAWTO 0,87:DRAWTO 0,1

110 GOTO 110

 

And if I want this custom display list

graphics mode 7+16 with one top and one bottom row of graphics mode 1

what I have to do?

 

Thanks

Edited by Philsan
Link to comment
Share on other sites

You'd probably be best off opening a standard GR. 7 screen with text window.

 

Then, you can just use the memory area allocated to it for your GR. 1 text.

 

With the text window though, POS. won't work. The POS. statement relates to the graphics window.

 

To position the cursor in text windows, you have to POKE the relevant OS variables.

 

I'll write something up a bit later - busy with other stuff now.

Link to comment
Share on other sites

Try this:

 

10 GRAPHICS 7:L=PEEK(560)-12:IF L<0 THEN L=0
20 D=L+PEEK(561)*256:POKE 560,L
30 POKE D,112:POKE D+1,16*3:REM TOTAL OF 12 BLANK LINES TOP OF SCREEN
40 POKE D+2,70
50 POKE D+3,PEEK(660):POKE D+4,PEEK(661):REM TEXT WINDOW
60 POKE D+5,6
70 POKE D+6,77
80 POKE D+7,PEEK(88):POKE D+8,PEEK(89)
90 FOR A=0 TO 94:POKE D+A+9,13:NEXT A
100 POKE D+A+9,65
110 POKE D+A+10,PEEK(560)
120 POKE D+A+11,PEEK(561)

 

It cheats a bit with the Display List - I had a problem because it was crossing a 1K boundary, so I shifted it back a bit.

 

To add an extra couple of lines of text at the bottom, you could just put another LMS for Antic mode 6 in, and add 40 to the operand to get it to continue in the text window's assigned RAM.

 

The memory addresses relevant to the text window (decimal):

 

656 - TXTROW Row position of text cursor (0-3)

657,658 TXTCOL Column position of text cursor (usually 0-39)

660,661 TXTMSC Start address of text window memory

Edited by Rybags
Link to comment
Share on other sites

Can you add 3 basic lines to print something in the screen's upper and bottom row and to draw a rectangle that frames the graphics 7 screen?

Hi,

 

Do you mean the three blank lines in upper area of the screen? Of course you can change it. Replace blank line commands with LMS pointing to Gr.0 screen (Antic mode 2), set display area to be shown on the screen (next two operands), and remain two blank lines replaced with Antic mode 2 instructions. For example:

 

66 0 6 2 2 instead of existing three 128 blank line instructions.

 

In this example 0 6 is PAGE 6 area.

Link to comment
Share on other sites

Page 6 is a valuable resource and shouldn't be wasted on graphics data.

 

OK. Some code (getting sloppy looking now) which has 12 blank scanlines, 192 GR. 7 lines, and 1 GR. 0 line at the bottom of screen. Draws box + cross as well:

 

10 GRAPHICS 7:L=PEEK(560)-16:IF L<0 THEN L=0
20 D=L+PEEK(561)*256:POKE 560,L
30 POKE D+1,16*3:REM TOTAL OF 12 BLANK LINES TOP OF SCREEN
40 POKE D+2,70
50 POKE D+3,PEEK(660):POKE D+4,PEEK(661):REM TEXT WINDOW
60 POKE D+5,6
70 POKE D+6,77
80 POKE D+7,PEEK(88):POKE D+8,PEEK(89)
90 FOR A=0 TO 94:POKE D+A+9,13:NEXT A
100 T2=PEEK(660)+PEEK(661)*256+40
110 H=INT(T2/256):L=T2-H*256
120 POKE D+A+9,66:POKE D+A+10,L:POKE D+A+11,H
140 POKE D+A+12,65
150 POKE D+A+13,PEEK(560)
160 POKE D+A+14,PEEK(561)
200 COLOR 1:PLOT 0,0:DRAWTO 159,0:DRAWTO 159,95:DRAWTO 0,95:DRAWTO 0,0
210 COLOR 2:PLOT 1,1:DRAWTO 158,94:PLOT 1,94:DRAWTO 158,1
220 POKE 657,1:POKE 656,0:? "PLR 1: 00";
998 GOTO 998

 

Try pressing Break once it's drawn, you'll see how the text window is used to provide the text lines (although only half the text window memory is used).

Link to comment
Share on other sites

Excuse me but I'm not a good programmer so I need, if possibile, simple answers!

 

The first question was if my program, that displays 2 top rows in graphics 1 and the remaining rows in graphics 7+16 is correct; it works well but I'm not sure if it is perfect.

 

The second question was if someone can modify my program or write another one that displays 1 top row in graphics 1, the remaining rows in graphics 7+16 and 1 bottom row again in graphics 1.

In this second case I also need the print and the draw commands to know how to print and draw in the 3 different areas of the screen.

 

Thanks for the patience.

Link to comment
Share on other sites

Change the "66" in line 120 to a "70".

 

The memory used by both text regions is contiguous.

 

Imagine a normal text window

 

1 --- line 1 --- 40

1 --- line 2 --- 40

1 --- line 3 --- 40

1 --- line 4 --- 40

 

In the one I've done, the two lines up the top of screen use characters 1-20 and 21-40 of a normal line 1 from a text window.

The text line at the bottom of screen corresponds to line 2 of a normal text window.

Link to comment
Share on other sites

I've just typed your program.

I need only one top row of graphics 1 not two.

I don't like the blue 4 rows characters window that appears for a while.

In the bottom row there are some moving characters and I don't know how to print there.

Why your program is so long compared to mine (from Compute!)? Perhaps a stupid question...

Edited by Philsan
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...