POKEing Rasters help!

STOS-related stuff in here please

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

User avatar
exxos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

POKEing Rasters help!

Postby exxos » Tue Sep 21, 2004 12:16 pm

HI all,

I know how to poke the pallette addresses to change the raster colour, though I can't work out how to sync them. ive tried using WAIT VBL and the like but the raster code don't do anything, they work but the rasters are rolling all the time, need something to say when to draw them and when to wait, anyone got any ideas on how this is done ??

I've tried the trap commands for vertical sync and no luck with them either :(

HELP!
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
Shazz
Atari Super Hero
Atari Super Hero
Posts: 575
Joined: Wed Aug 27, 2003 9:27 am
Location: Crétin des Alpes dauphinoises

Postby Shazz » Tue Sep 21, 2004 12:20 pm

Try to sync on the Horizontal sync than the rvertical... it shoud help :D

Just change the palette (the background to start) at each HBL interrupt...
...8bits are enough...

User avatar
Mug UK
Administrator
Administrator
Posts: 11379
Joined: Thu Apr 29, 2004 7:16 pm
Location: Stockport (UK)
Contact:

Postby Mug UK » Tue Sep 21, 2004 1:24 pm

You doing it from STOS or from a HBL queue in a STOS extension?

Or you doing it from assembly? If assembly, I got plenty of source code I can send you.

Otherwise, you are best writing the code outside of STOS and then calling it.
My main site: http://www.mug-uk.co.uk - slowly digging up the bits from my past (and re-working a few): Atari ST, Sega 8-bit (game hacks) and NDS (Music ripping guide).

I develop a free Word (for Windows) add-in that's available for Word 2007 upwards. It's a fix-it toolbox that will allow power Word users to fix document errors. You can find it at: http://www.mikestoolbox.co.uk

User avatar
exxos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Postby exxos » Tue Sep 21, 2004 2:05 pm

well I'm poking direct from STOS, I have some code I can call (assmbely) but I dont know how that works.

My knowledge of assm is limited, but if you have any simple code then I should be able to follow it.

I used devpak a long itme ago, only got as far as printing stuff to the screen and printer( was easy with trap calls) but I never needed to use it for anything imparticular until now.

I did ask about de-compiling code in another post, the code only does 2 rasters, im looking to change all 15, easy to poke them in STOS but not so great for timeing ;-)

thanks for any help u can give!
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
tobe
Atari God
Atari God
Posts: 1459
Joined: Sat Jan 24, 2004 10:06 am
Location: Lyon, France
Contact:

Postby tobe » Tue Sep 21, 2004 3:01 pm

You need to synchronize your code with the electron beam. I only know how to achieve it with GFA.

Code: Select all

  REPEAT
    b|=BYTE{&HFF8209}
  UNTIL b|
  VOID SHL(13,-b|)


maybe you can try this with STOS.

the full sequence is :
- vblwait
- synchro
- draw rasters

the palette is located at $FF8240, there's 16 registers of one word (2 bytes) size.
Each register is coded $xxxxxrrrxgggxbbb on ST(F) (512 colors) and xxxxrrrrggggbbbb on STE (4096 colors).
On STE the fourth bit of each color composant is the low byte, to keep ST(F) compatibility.

For example, on STE, a gradient from black to white would give :

Code: Select all

- $0000
- $0888
- $0111
- $0999
- $0222
- $0AAA
- $0333
- $0BBB
- $0444
- $0CCC
- $0555
- $0DDD
- $0666
- $0EEE
- $0777
- $0FFF

On ST(F):

Code: Select all

- $0000
- $0111
- $0222
- $0333
- $0444
- $0555
- $0666
- $0777
step 1: introduce bug, step 2: fix bug, step 3: goto step 1.

User avatar
Mug UK
Administrator
Administrator
Posts: 11379
Joined: Thu Apr 29, 2004 7:16 pm
Location: Stockport (UK)
Contact:

Postby Mug UK » Tue Sep 21, 2004 3:50 pm

You should be able to do that in STOS with the DOKE commands (was that the command for a Word-size Poke? Been so long now).

Simple loop to check the counter as per the GFA above - and no need to go into Supervisor mode as you're already in it with STOS (could be wrong on this, but never was a STOS-head much).
My main site: http://www.mug-uk.co.uk - slowly digging up the bits from my past (and re-working a few): Atari ST, Sega 8-bit (game hacks) and NDS (Music ripping guide).

I develop a free Word (for Windows) add-in that's available for Word 2007 upwards. It's a fix-it toolbox that will allow power Word users to fix document errors. You can find it at: http://www.mikestoolbox.co.uk

User avatar
exxos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Postby exxos » Tue Sep 21, 2004 4:55 pm

im using in STOS

doke $FF8240,$XXX

where XXX is the colout value. which is palette colour 0, FF8242 for colour 1 etc, if I use about 10 lines of colors then this works fine, but as I said there nothing to sync it to anything.

I do have some assembly code which does sync, though this goes back to my post on de-compiling it to see how its done.

I suppose to write a small chunk of assm would do the trick, normally the data is held in a chunk of ram (set from within STOS) then then you CALL the assm code in STOS, maybe uding areg(0) to pass the location of the colour data to the assm code. This can be done, though I am not good with assm, so I dont know how it can run this code and then carry on running the STOS code at the same time. I think the assm code uses a interuppt so it don't hang the STOS code while the rasters are running..
hope that made sence :)
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
exxos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Postby exxos » Tue Sep 21, 2004 9:44 pm

$FF8209 does a nice job!

Rasters have stopped rolling but are jerky now, getting better though! might work better compiled, but st least its a start!!
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
exxos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Postby exxos » Tue Sep 21, 2004 10:10 pm

Ah, goes compleatly mad when compiled :-\
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

bpadinha
Captain Atari
Captain Atari
Posts: 184
Joined: Sun Jun 23, 2002 9:49 pm

Postby bpadinha » Wed Sep 22, 2004 12:00 am

There's a small nice example program for rasters in STOS (+asm) by someone called Falcon (not to be mistaken with the Atari machine! :-)) in ICTARI #2 (http://www.funet.fi/pub/atari/mag/ictari/ictari02.zip).

bp

User avatar
exxos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Postby exxos » Wed Sep 22, 2004 7:39 am

thanks for that, never thought to look in there, I never understoon the maths behind those wavy type things, though it only seems to be for one colour, like most of them :( I have 1 which will do 2 colours but never seen anything more, im sure there must be one somewhere which will do more!
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
tobe
Atari God
Atari God
Posts: 1459
Joined: Sat Jan 24, 2004 10:06 am
Location: Lyon, France
Contact:

Postby tobe » Wed Sep 22, 2004 8:34 am

exxos wrote:Ah, goes compleatly mad when compiled :-\

Yes, obviously, instructions timings are shorter when compiled :D

You should try the instruction i mention after the loop watching for $FF8209, (13 << -b), but don't ask me why 13, really i don't know 8O
The goal is to wait a variable amount of cycles based on the video counter, the higher is the counter, the shorter it waits. This way, your code is synchronized with the beam at pixel precision, and is stable between frames.
step 1: introduce bug, step 2: fix bug, step 3: goto step 1.

User avatar
exxos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Postby exxos » Wed Sep 22, 2004 9:04 am

The counter never hits 13, seems to be even numbers only, ive been using all kinda of numbers, all give odd results so far, will keep trying though!
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
exxos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Postby exxos » Wed Sep 22, 2004 9:13 am

32,64,96,128,160 (did try anymore)

those lock on in STOS, still a slight jerks but they are in sync. compiled I get some results at the same numbers, but mostely white screen with a random flash of colour if your lucky. It should be more stable when compiled but proved wrong again :(
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
unseenmenace
Atari God
Atari God
Posts: 1961
Joined: Tue Sep 21, 2004 9:33 pm
Location: Margate, Kent, UK
Contact:

Postby unseenmenace » Fri Sep 24, 2004 12:04 pm

There is a great Stos extension by Top Notch Software with a simple to use command that produces perfectly stable rasters whether interpreted or compiled. I think it was the Misty extension that had the raster and palsplit commands, but they also did the Missing Link extension which included loads of commands, such as a much better sprite system, to help with games programming. I'm not sure where you can download it from but if you can't find it let me know as I should have it on floppy still.
UNSEEN MENACE
Several STFM's, 4MB STE, 2MB TT with 1.2GB Hard Drive and 14MB Falcon with 540MB Hard Drive,
Lynx 2 and Jaguar with JagCD
Member of GamebaseST and AtariLegend team
Check out my website at http://unseenmenace.110mb.com

User avatar
exxos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Postby exxos » Fri Sep 24, 2004 1:22 pm

You are correct, Missing Link does have a raster command, BUT, from what I can figure it will only work on 1 colour at a time! I've tried to program 2 , but when you call the command gain it looses the first one.

Perhaps someone out there can help us out with some asm code ? If any clever chaps have some spare time, I can pass any colour values into AREG and DREG (which is how the code is normally called), From what I can tell form exsisting asm code, the colours are programmed into a interuppt, so even when the program ends, the asm code is still working in the background, I assume this is what people mean by VBL que or alike, is this can be done with all 15 colours and not just the one then this would be great! will include whoever can sort it in the demo credits when it gets done ;-)

STOS itself can switch the registers, ive only done upto 4 colours to try this, and it works, but like I said its unstable, so some asm code should be no problem ? anyone help us out here ???
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
unseenmenace
Atari God
Atari God
Posts: 1961
Joined: Tue Sep 21, 2004 9:33 pm
Location: Margate, Kent, UK
Contact:

Postby unseenmenace » Fri Sep 24, 2004 2:49 pm

That's where the palsplit command comes in. If I recall you give it the address of a colour palette and a line to change at and it changes the whole palette between one scanline and the next. I will have to dig my Falcon out and see what commands are in what extensions.
UNSEEN MENACE
Several STFM's, 4MB STE, 2MB TT with 1.2GB Hard Drive and 14MB Falcon with 540MB Hard Drive,
Lynx 2 and Jaguar with JagCD
Member of GamebaseST and AtariLegend team
Check out my website at http://unseenmenace.110mb.com

User avatar
exxos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4933
Joined: Fri Mar 28, 2003 8:36 pm
Location: England
Contact:

Postby exxos » Fri Sep 24, 2004 3:46 pm

cheers, I will have a look into that!

If you can code in STOS, do you care to join are STOS MEGA DEMO project ??
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
unseenmenace
Atari God
Atari God
Posts: 1961
Joined: Tue Sep 21, 2004 9:33 pm
Location: Margate, Kent, UK
Contact:

Postby unseenmenace » Sat Sep 25, 2004 7:54 am

I abandoned STOS when I decided it wasn't fast enough for what I wanted to do so I started teaching myself Assembler. I still have all my STOS disks though including loads of extensions and loads of proggies I've written over the years. I shall have a look through what I've got and see if there's anything that might be worthy of attention.
UNSEEN MENACE
Several STFM's, 4MB STE, 2MB TT with 1.2GB Hard Drive and 14MB Falcon with 540MB Hard Drive,
Lynx 2 and Jaguar with JagCD
Member of GamebaseST and AtariLegend team
Check out my website at http://unseenmenace.110mb.com


Social Media

     

Return to “STOS”

Who is online

Users browsing this forum: No registered users and 3 guests