256 Byte Boundary

STOS-related stuff in here please

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
mrdalliard
Atari nerd
Atari nerd
Posts: 45
Joined: Tue May 01, 2012 8:29 pm
Location: UK
Contact:

256 Byte Boundary

Postby mrdalliard » Sat Feb 06, 2016 10:56 pm

Hi, just a quick question.

I'm trying to set "logic" to be a particular address. I know the address is on a 256 byte boundary (as per what it says in the manual). However, when I try and set it I get error 43, which is "bad screen address". This doesn't make sense as the address is divisible by 256 with no remainders. Anyone else had this problem?

Thanks,

M.
--
520 STFM.

seedy1812
Atari User
Atari User
Posts: 33
Joined: Tue May 18, 2010 2:04 pm

Re: 256 Byte Boundary

Postby seedy1812 » Sat Feb 06, 2016 11:14 pm

Which function are you calling. If its _setscreen ( trap#14 number 5 ) that does not return back an error code

User avatar
Mikefulton
Captain Atari
Captain Atari
Posts: 169
Joined: Sun Nov 29, 2015 10:27 am

Re: 256 Byte Boundary

Postby Mikefulton » Sun Feb 07, 2016 1:37 am

mrdalliard wrote:Hi, just a quick question.

I'm trying to set "logic" to be a particular address. I know the address is on a 256 byte boundary (as per what it says in the manual). However, when I try and set it I get error 43, which is "bad screen address". This doesn't make sense as the address is divisible by 256 with no remainders. Anyone else had this problem?

Thanks,

M.


1) How are you trying to set it? If using XBIOS SetScreen() function, note that it is a VOID function that doesn't return a value.

2) Where you getting "error 43" and how are you interpreting that as "bad screen address". All regular system error codes are negative, so that sounds like it's coming from STOS.

User avatar
mrdalliard
Atari nerd
Atari nerd
Posts: 45
Joined: Tue May 01, 2012 8:29 pm
Location: UK
Contact:

Re: 256 Byte Boundary

Postby mrdalliard » Sun Feb 07, 2016 9:41 am

Mikefulton wrote:1) How are you trying to set it? If using XBIOS SetScreen() function, note that it is a VOID function that doesn't return a value.

2) Where you getting "error 43" and how are you interpreting that as "bad screen address". All regular system error codes are negative, so that sounds like it's coming from STOS.


I'm setting it in STOS with a "logic = start(memory bank number)+X" line. The memory bank is defined as a 64K work bank and both its address and "X" offset combined are divisible by 256.

The error code is coming from within interpreted STOS. Because the screen is black at this point (I've not finished processing what I need to do on the logical screen to screen swap), the only way I get to find out about errors when program execution stops is by using ERRN and ERRL.

Thanks,

M.
--
520 STFM.

Moulinaie
Atari maniac
Atari maniac
Posts: 89
Joined: Wed Feb 01, 2012 9:34 pm

Re: 256 Byte Boundary

Postby Moulinaie » Sun Feb 07, 2016 10:15 am

Hi,

If you are using STOS, I imagine that it is on a ST/E.
So the screen uses 32k.
Are you sure that start+X+32k fits all in memory? Maybe it's not the starting address that is a problem, but indirectly the end address that bypasses the top of RAM.

Guillaume.

User avatar
mrdalliard
Atari nerd
Atari nerd
Posts: 45
Joined: Tue May 01, 2012 8:29 pm
Location: UK
Contact:

Re: 256 Byte Boundary

Postby mrdalliard » Wed Feb 10, 2016 5:36 pm

Moulinaie wrote:Hi,

If you are using STOS, I imagine that it is on a ST/E.
So the screen uses 32k.
Are you sure that start+X+32k fits all in memory? Maybe it's not the starting address that is a problem, but indirectly the end address that bypasses the top of RAM.

Guillaume.


Hi - definitely an STFM, using 2.6 of STOS and 2.7 of compiler.

It's weird, because I've got another program doing basically the same thing without issue. It seems that when the 64K memory bank is reserved, it's not reserving it properly. I know a screen uses 32K, but I'm doing some full-screen scrolling and it works so much better when you change the logical screen address to a position in the bank, instead of using the scroll command (which is slow as hell).

If the end is bypassing the top of RAM, surely that's a bug in STOS for allowing this to happen?

Thanks,

m.
--
520 STFM.

EstTeeEfEm
Captain Atari
Captain Atari
Posts: 299
Joined: Mon May 04, 2015 9:02 pm

Re: 256 Byte Boundary

Postby EstTeeEfEm » Sat Mar 05, 2016 2:42 pm

There are two scenarios here.
1) create two different screen banks and jump between the two or
B) The trick I use ;) - Copy from
copy start(bank_a)+32 to start(bank_a)+64 into Start(Bank b)
logic=bank b

I hope this kind of makes sense...
Also, if the bank contains palette data are you jumping 34 bytes for this?

If you're using multiple pictures might I suggest using the filebank system in The Missing Link?
Then its simply a call to the correct file WITHIN the filebank... check the docs out. Its a pain and takes some working out but once you've cracked it you can create huge files with 600k of files within and simply get file (a) or get file(b)

Oh, and as a last note... if its feasible, build your scroller into 16x16 sprites, and use the mapping system in The Missing Link - The "BLACK" demo uses this technique

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: 256 Byte Boundary

Postby exxos » Sun Mar 06, 2016 10:52 am

"bad screen address" is normally as the memory bank hasn't been reserved as screen.

reserve as screen 10
logic=start(10)

I have done a scroller based on a 64K screen but its been some 20 years..

I think you would reserve a work bank (or data bank) and load in pi1 images, so first image loaded at zero start, the second image loaded at 32k start. Then you should be able to just change the logic screen to somewhere in that data bank and it should work ( I think )

I'm pretty sure at some point I did a 4 screen sized image (640x400) and scrolled around the ram locations to created a moving background. Though it might have been a extension in the missing link extension or similar.
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator

User avatar
mrdalliard
Atari nerd
Atari nerd
Posts: 45
Joined: Tue May 01, 2012 8:29 pm
Location: UK
Contact:

Re: 256 Byte Boundary

Postby mrdalliard » Fri Mar 11, 2016 12:57 pm

exxos wrote:"bad screen address" is normally as the memory bank hasn't been reserved as screen.

reserve as screen 10
logic=start(10)

I have done a scroller based on a 64K screen but its been some 20 years..

I think you would reserve a work bank (or data bank) and load in pi1 images, so first image loaded at zero start, the second image loaded at 32k start. Then you should be able to just change the logic screen to somewhere in that data bank and it should work ( I think )

I'm pretty sure at some point I did a 4 screen sized image (640x400) and scrolled around the ram locations to created a moving background. Though it might have been a extension in the missing link extension or similar.


This is exactly what I'm doing, funnily enough - reserving a 64K bank as work and changing the logic address. I'm using a tesselated image, so that the scrolling looks seamless. Well, it would if my screen address was right. :)

M.
--
520 STFM.

User avatar
exxos
Hardware Guru
Hardware Guru
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Re: 256 Byte Boundary

Postby exxos » Fri Mar 11, 2016 1:13 pm

mrdalliard wrote:This is exactly what I'm doing, funnily enough - reserving a 64K bank as work and changing the logic address. I'm using a tesselated image, so that the scrolling looks seamless. Well, it would if my screen address was right. :)
M.


If you post a example routine with the images and whatever, I can take a look..

A alternative is to use something like SKOPY, and just copy-paste the images on the back screen and do it that way.

Also, as EstTeeEfEm suggested, normally scrolling backgrounds are done with something "mapping" related. You may find it better to go down that route as its designed for scrolling worlds.
4MB STFM 1.44 FD- VELOCE+ 020 STE - Falcon 030 CT60 - Atari 2600 - Atari 7800 - Gigafile - SD Floppy Emulator - PeST - various clutter

http://www.exxoshost.co.uk/atari/ All my hardware guides - mods - games - STOS
http://www.exxoshost.co.uk/atari/last/storenew/ - All my hardware mods for sale - Please help support by making a purchase.
http://ataristeven.exxoshost.co.uk/Steem.htm Latest Steem Emulator


Social Media

     

Return to “STOS”

Who is online

Users browsing this forum: No registered users and 1 guest