TXG/MNX Posted April 25 Share Posted April 25 (edited) 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 April 25 by TXG/MNX Quote Link to comment https://forums.atariage.com/topic/365511-question-about-array/ Share on other sites More sharing options...
Rybags Posted April 25 Share Posted April 25 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. Quote Link to comment https://forums.atariage.com/topic/365511-question-about-array/#findComment-5455334 Share on other sites More sharing options...
TXG/MNX Posted April 25 Author Share Posted April 25 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 ? Quote Link to comment https://forums.atariage.com/topic/365511-question-about-array/#findComment-5455337 Share on other sites More sharing options...
Rybags Posted April 25 Share Posted April 25 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. Quote Link to comment https://forums.atariage.com/topic/365511-question-about-array/#findComment-5455339 Share on other sites More sharing options...
TXG/MNX Posted April 25 Author Share Posted April 25 (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 April 25 by TXG/MNX Quote Link to comment https://forums.atariage.com/topic/365511-question-about-array/#findComment-5455341 Share on other sites More sharing options...
vitoco Posted April 25 Share Posted April 25 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. Quote Link to comment https://forums.atariage.com/topic/365511-question-about-array/#findComment-5455350 Share on other sites More sharing options...
TXG/MNX Posted April 25 Author Share Posted April 25 Ok got the memory location of array in mad pascal aswell screendata:=array...... var address:=integer; address:=(word(@screendata)); writeln(address) // decimal output write(IntToHex(address, 4)); // hex output Quote Link to comment https://forums.atariage.com/topic/365511-question-about-array/#findComment-5455448 Share on other sites More sharing options...
tebe Posted April 28 Share Posted April 28 (edited) https://bocianu.gitlab.io/bathub/ Edited April 28 by tebe Quote Link to comment https://forums.atariage.com/topic/365511-question-about-array/#findComment-5457083 Share on other sites More sharing options...
Recommended Posts
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.