Jump to content
IGNORED

Question about array


Recommended Posts

Hello,

 

I have a few screens embedded in my code. Those are array's of bytes. I would like to switch between the array's on graphics 0 and not copy the data to screenram but point screenram to the begin of the array.

 

array1 ...

array2 ....

 

p:^înteger;

InitGraph(0); 

p:=@array1;

 

I did try dpoke(88,array1), dpoke(88,pointer(array1)) and dpoke(88,^array1) and dpoke(88,p) maybe its just syntax but whats the way to do this ?

Edited by TXG/MNX
Link to comment
Share on other sites

Location 88,89 is just the pointer to screen Ram that the OS refers to when doing character writes or pixel plots.

There's also the actual screen addresses fetched by Antic which are in the Display List and you'd need to change those also.

Typical Display List (560,561) will contain:

112 (3 times) 8 blank scanlines

66 LMS Antic Mode 2 (Gr.  0 )

low byte screen Ram

high byte screen Ram

2 (23 times)

65 (Jump and wait for VBlank)

low byte display list address

high byte display list address

 

You'd also need to ensure the screen memory doesn't cross a 4K boundary - without another LMS Antic will just wrap around and read from the current 4K block start.

Link to comment
Share on other sites

I am confused here when I read my array and poke that directly to screenmemory I dont have to change 560/561

 

var    sc : word absolute 88;  

 

for i:=0 to 959 do
      begin
        poke(sc+i,screendata[i]);
      end;

 

So this copies data from array to the current screenmemory. How is it impossible to point screenram to the start of an array ?            

Link to comment
Share on other sites

Posted (edited)
6 minutes ago, Rybags said:

560/561 points to the display list.

You need to change the display list itself to point to your own screen Ram.

In most cases display list + 4 will be what you need to change.

Hi,

 

Yes, ok now I get it man its been decades ago I coded ..... 

Now also figure out the right syntax to get the start memory address of the array...

Edited by TXG/MNX
Link to comment
Share on other sites

Note that your screen data should be aligned to memory pages. In particular, a 4K boundary should not be in the middle of a screen data. If so, you also need a special display list that points to the start of the second "half" past the boundary.

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