STOS STE vertical shooter: I need help please

STOS-related stuff in here please

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

Post Reply
mOa
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 147
Joined: Sun May 12, 2002 11:53 pm

STOS STE vertical shooter: I need help please

Post by mOa »

Hello fellow stossers
I'm trying to code a vertical shooter in stos using Ste capabilities ( blitter, hard scroll, dma)
I'm terrible at coding, drawing but really like to understand the logic of a game
So here's the problem: my scrolling doesn't work ( illegal function call)
I use Asa Burrows Ste ext + blitter ext

my code so far is a loop of 2 screens (bank 6) and joystick control of a ship
(bank 5) is bg+ship picture

I think there's a boundarie issue + swap screen issue for the ship

Thank you for your help

Code: Select all

10 mode 0 : key off : mouseoff : click off : auto back off : update off : synchro off : curs off 
20 get palette (5)
21 reserve as work 6,64000
22 copy start(5),start(5)+32000 to start(6)
23 copy start(5),start(5)+32000 to start(6)+32000
24 hard screen size 320,200,0 : hard screen offset 0,0
25 X=hard physic(start(6))
26 hard inter on 
30 logic=back : XP=0 : YP=0
40 repeat 
50 for Y=0 to 199
60 hard screen offset 0,Y
70 blit copy start(5),192,0,216,31,logic,XP,YP,7
71 if blit busy=1 then 71
80 if jup and YP>0 then dec YP
90 if jdown and YP<168 then inc YP
100 if jleft and XP>0 then dec XP
110 if jright and XP<168 then inc XP
120 doke $FF8240,7 : doke $FF8240,0
130 screen swap : wait vbl 
140 next Y
150 until inkey$<>""
151 hard inter off 
160 default : mouseon 
User avatar
thomas3
Captain Atari
Captain Atari
Posts: 180
Joined: Tue Apr 11, 2017 8:57 pm
Location: the people's republic of south yorkshire, uk.

Re: STOS STE vertical shooter: I need help please

Post by thomas3 »

Never used this extension but I'm guessing you need to use the hard physic command after screen swap but before wvbl?

Incidentally you can do vertical hardware scrolling with a few pokes and no extension :)
mOa
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 147
Joined: Sun May 12, 2002 11:53 pm

Re: STOS STE vertical shooter: I need help please

Post by mOa »

I'm glad you've answered my post because I have followed all your STOS works :thumbs:
Halas I'm still stuck

Here is the STe ext doc

Code: Select all

The STOS STE Extension

By Asa Burrows

The New STOS STE Commands :


x = STE

This function returns 1 if the machine is an STE or 0 if it isn't. You
can test to see if it's an STE or not and adjust your game to suit,
giving STE owners the extra features but still making the program
compatible with all STs.


Joysticks

Your STE now has the ability to use up to six of the little wagglers.

x= LSTICK (j)
Returns the current status of the joystick's left
position. The value x holds either -1 if the joystick is in the left
position or zero if it isn't. You can access up to six joysticks, j
holds the number of the stick you want, one to six.

The following functions work exactly the same way for the other
directions and the <fire> button.

x= RSTICK (j) right
x= USTICK (j) up
x= DSTICK (j) down
x= FSTICK (j) fire

To access joysticks one & two you need to use these other
commands.

STICKS ON
This command activates the interrupt routine for twin joysticks
control on the ST and STE, it also disables the mouse.

STICKS OFF
This de-activates the interrupt routine and reactivates the
mouse.

The new extension is completely compatible with the twin sticks
extension, so if you have that you can use the same commands without
any bother. They have been included in the STE extension to maintain
compatibility.

x =STICK1 and x =STICK2

Returns the status of joysticks 1 and 2 respectively. The variable
holds one byte laid out as follows. This is a bit of a bind and it's
better to stick with the easier joystick commands.

       Bit     description

       0       UP      if bit set
       1       DOWN    if bit set
       2       LEFT    if bit set
       3       RIGHT   if bit set
       4       UNUSED
       5       UNUSED
       6       UNUSED
       7       FIRE    if bit set

Light Gun/Pen

If you've a light gun or pen you can now write a shoot-'em-up for it.

x =LIGHT X and y =LIGHT Y

These two commands return the x and y co-ordinates of your gun or pen
when the <fire> button is pressed and holds it until it's pressed
again. You can check the button using the FSTICK (3) command because
the To check the <fire> button use the FSTICK (3) command, the button
is returned as joystick three.


Extended colour palette

The STE has a palette of 4096 colours rather than an ST's 512.

E PALETTE $RGB,$RGB,...(up to 16 colour values)

This command works exactly as the PALETTE command in STOS,
except that it uses a hex number for the colour values. Hex uses base
sixteen rather than the decimal base 10. Letters are used for values
over nine. Ten is represented by 'a', eleven by 'b' and so on. White
now becomes $fff.

E COLOUR colour,$RGB

The same as the COLOUR command but using hex values and access to the
4096 colours.

x= E COLOR (colour)

No it isn't a spelling mistake, it's just a limitation of
STOS. You can't use the same name for a command and function.
This command returns the RGB value of the colour number, 0 to 15.


STE DAC and Microwire Interface

The DAC is one of the best things added to the ST. This brilliant
Digital to Analogue Converter plays raw sample sound in stereo, and
with the Microwire Interface you can set left and right volume control
as well as treble and bass.

DAC CONVERT start address of sample, end address of sample

Because the STE DAC plays raw sampled sound you'll need to
convert your Maestro samples. DAC CONVERT does the job almost
instantly. Ideal for using the same sample data for the ST and STE.

DAC SPEED

Sets the speed of sample replay. 0=6Khz, 1=12.5Khz, 2=25Khz and 4 is a
pretty amazing 50Khz.

DAC RAW start address of sample,end address of sample

Plays your raw sample.

DAC MONO and DAC STEREO

Guess what, sets the sample to be mono or stereo.

DAC LOOP ON and DAC LOOP OFF

Want an endless wall of noise? Set the loop function on and off with
these commands.

DAC M VOLUME volume
DAC L VOLUME volume
DAC R VOLUME volume
DAC TREBLE volume
DAC BASS volume

These commands set the master, left and right volume as well as the
treble and bass. The volume can be anywhere from 0 to 12.

DAC MIX ON and DAC MIX OFF

These commands allow you to mix the PSG sound chip with the
STEs DAC.

DAC STOP

Tricky one this, it er, stops the DAC.


Hardware Scrolling

The STE has hardware scrolling which enables screen data to be shifted
in bytes rather than words using the hardware. All this adds up to
single pixel scrolling.

HARD SCREEN SIZE w,h,mode

Sets the screens logical size. w=width of screen and h=height of
screen ready for scrolling.

HARD SCREEN OFFSET x,y

This command tells the ST where to start displaying the screen.

x = HARD PHYSIC (screen address)

This command tells the ST where the screen is stored.

HARD INTER ON and HARD INTER OFF

Once you have set all the hardware scrolling commands you can turn on
the scrolling with these two. While the interrupt routine is running
you use the HARD SCREEN OFFSET to get scrolling effect. If an error
occurs while interrupt is on STOS turns hardware scrolling off.
I'm pretty sure my starting "hard screen offset 0,0" is wrong
or my Y increment should be negative or my for-next should be decreasing

Thank you
Encolpius
Atari nerd
Atari nerd
Posts: 44
Joined: Mon Aug 27, 2018 12:46 pm

Re: STOS STE vertical shooter: I need help please

Post by Encolpius »

Can I also add to this that the blit copy command in Asa Burrows extension isn't the best. It for some reason does everything one bitplane at a time in four separate operations which is rather inefficient. This may result in sprites or scenery appearing discoloured about halfway down.

I can post you my assembly language blitter library if you want. As well as standard blitting it also does masked blitting (if you have pre-masked) and even blitting screen$ blocks.

Also, one final point. Don't keep using "start(n)" because that makes it recalculate the start of the bank every time, wasting CPU time. Better to do something like M5=start(5) and then use M5 as the sauce / dest screen address.
mlynn1974
Captain Atari
Captain Atari
Posts: 435
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

Re: STOS STE vertical shooter: I need help please

Post by mlynn1974 »

I have this extension in my STOS installation but never used it. Asa Burrows? He did the STOS Column in ST Format Magazine before Billy, but I can't remember if this extension was included on ST Format Magazine.

For other coders if you save this text as .LST you can load it into STOS quite easily:
LOAD "DEMO.LST"
Then save it as a .BAS file for faster loading and saving.

I loaded a standard pi1 in a screen:
reserve as data screen 5
load "my.pi1",5

With TOS 1.62 the background scrolls vertically by about 30 pixels then crashes with a blank screen and the STOS arrow in middle of screen.

I think at the time someone from Glasgow did a few tests with this extension and found it quite unforgiving if an error occurs. That might be part of the problem. I'll try to have a more detailed look at the weekend.

+1 for not using start(n) repeatedly. Try to store it in a variable outside the loop. That is faster.
Still got, still working: Atari 4Mb STe, 520STFM (x2), 2.5Mb STF, Atari 2600JR, Flashback 8 Gold.
Hardware: Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).
mOa
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 147
Joined: Sun May 12, 2002 11:53 pm

Re: STOS STE vertical shooter: I need help please

Post by mOa »

Thank you all for your comments and tips. The good new is that I have found the problem (hard screen size 320,200,0 -> 320,400,0)
I've also changed the scroll direction
The bad new is that the physic screen is now moving with the scroll
+ I can only blit copy in work bank 6 :?

Code: Select all

10 mode 0 : key off : mouseoff : click off : auto back off : update off : synchro off : curs off 
20 get palette (5)
30 reserve as work 6,64000
40 rem logic=back : XP=0 : YP=0
50 copy ST5,ST5+32000 to ST6
60 copy ST5,ST5+32000 to ST6+32000
70 hard screen size 320,400,0 : hard screen offset 0,199
80 hard inter on 
90 XP=0 : YP=0 : ST5=start(5) : ST6=start(6)
100 X=hard physic(ST6)
110 repeat 
120 for Y=0 to 199
130 rem if blit busy=1 then 61
140 blit copy ST5,192,0,216,31,ST6,XP,YP,6
150 if blit busy=1 then 150
160 if jup and YP>0 then dec YP
170 if jdown and YP<168 then inc YP
180 if jleft and XP>0 then dec XP
190 if jright and XP<168 then inc XP
200 doke $FF8240,7 : doke $FF8240,0
210 rem X=hard physic(ST6-160*Y)
220 hard screen offset 0,199-Y
230 wait vbl 
240 next Y
250 until inkey$<>""
260 hard inter off 
270 mouseon : default

mlynn1974
Captain Atari
Captain Atari
Posts: 435
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

Re: STOS STE vertical shooter: I need help please

Post by mlynn1974 »

Yes, very nice. The first change I noted is this:
hard screen size 320,400,0
The hardware scroll area is like a sliding window larger than the physical screen. Imagine a game like Operation Wolf where the play area is bigger than the screen and you slide the visible window over the play area.

I think the reason why the blit is a problem is because with hard screen offset is setting the video ram address to that area, not the normal logical or physical screen address. When you blit the sprite it is being copied in to the background so you'd have to copy that bit of the background somewhere else, move the sprite and then in the next frame erase the sprite in its last position in the background. That's a slight disadvantage with hardware scrolling. It can still be used and save CPU time and it has been used in other games and demos to great effect.
Still got, still working: Atari 4Mb STe, 520STFM (x2), 2.5Mb STF, Atari 2600JR, Flashback 8 Gold.
Hardware: Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).
User avatar
thomas3
Captain Atari
Captain Atari
Posts: 180
Joined: Tue Apr 11, 2017 8:57 pm
Location: the people's republic of south yorkshire, uk.

Re: STOS STE vertical shooter: I need help please

Post by thomas3 »

Hi!
Just a thought. STOS's default 32k areas for logic and physic sit right next to each other in memory. If you're setting a 400p high screen, you'll end up with overflows.

Try making two 64k work banks, and then setting physic and logic to the start of each. Screen swap will still work if you do this. You can then use physic=default physic etc to restore.
mOa
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 147
Joined: Sun May 12, 2002 11:53 pm

Re: STOS STE vertical shooter: I need help please

Post by mOa »

Currently my scrolling is a loop (bank 6)
My struggle is not the scroll, it's the blitting objects
I think I must use relative coords for displaying objects in bank 6
Please How to convert adresses to coord to blit sprites?
Some use of leek?
Thank you
sorry but english is not my language
User avatar
thomas3
Captain Atari
Captain Atari
Posts: 180
Joined: Tue Apr 11, 2017 8:57 pm
Location: the people's republic of south yorkshire, uk.

Re: STOS STE vertical shooter: I need help please

Post by thomas3 »

Hi!
Each line of the screen is 160 bytes.

So, you should adjust your destination screen address on any blit commands to the start of your bank+y*160 :)
Encolpius
Atari nerd
Atari nerd
Posts: 44
Joined: Mon Aug 27, 2018 12:46 pm

Re: STOS STE vertical shooter: I need help please

Post by Encolpius »

As regards the crashing, what Tom said about adjacent physic and logic addresses might be to do with that also. Standard STOS commands and the most used extensions (Missing Link, Misty, Control, etc.) will automatically clip this, but if you try to paste, esp. with the blitter, an image to a coordinate on screen where y < 0, it will start the blit with the destination potentially in invalid memory. If this happens, you can find yourself staring at 11 bombs.

When I wrote my assembly language blitter library I made sure that if destination y < 0, it instead subtracts dest y from sauce y, and reduces the number of lines to blit accordingly. Since a - -b = a + b, this means it'll only paste the visible portion of the image. Blitting to x < 0 or x > 320 isn't such a problem though as that will still be a valid portion of screen memory so it'll just wrap around.

Alternatively, which version of the STE extension are you using? According to the Exxos STOS pages, there was a version 4.0 that fixes some of the crashing. Have you tried that one?
elliot
Atari maniac
Atari maniac
Posts: 78
Joined: Tue Mar 17, 2009 2:00 pm

Re: STOS STE vertical shooter: I need help please

Post by elliot »

Yep I saw the logical size was not right.

Also, if you use the x offset one of the extensions has a bug and misses one of the pixels out of every 16 on the x. That said I do not think it is this extension.
elliot
Atari maniac
Atari maniac
Posts: 78
Joined: Tue Mar 17, 2009 2:00 pm

Re: STOS STE vertical shooter: I need help please

Post by elliot »

If you;

.....
145 doke $FF8240,$70
150 if blit busy=1 then 150
.....
.....
225 doke $FF8240,0
230 wait vbl
235 doke $FF8240,7
.....

And remove line 200

You will get two nice bars (red and blue I think) for both CPU/Blitter usage if that us what you are trying to do there. If it is not compiled then it may be a be a flickering mess. It has been 30 years since I programed in STOS but I am sure I used to do something like this to check on what I am doing speed.
elliot
Atari maniac
Atari maniac
Posts: 78
Joined: Tue Mar 17, 2009 2:00 pm

Re: STOS STE vertical shooter: I need help please

Post by elliot »

Ooops this may be better;

.....
135 doke $FF8240,$70
140 blit copy ST5,192,0,216,31,ST6,XP,YP,6
150 if blit busy=1 then 150
155 doke $FF8240,7
.....
.....
225 doke $FF8240,0
230 wait vbl
235 doke $FF8240,7
.....
mOa
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 147
Joined: Sun May 12, 2002 11:53 pm

Re: STOS STE vertical shooter: I need help please

Post by mOa »

Thank you all for your return. I'm still struggling but there's a ray of hope in the horizon but now it's time to sleep. see you
mOa
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 147
Joined: Sun May 12, 2002 11:53 pm

Re: STOS STE vertical shooter: I need help please

Post by mOa »

OK right now I'm fed up with the hard scroll so let's use the blitter instead
I've found a nice extension called Stevie Wonder (no joke) by ACO
It has blitter functions that are quite neat like blitting a data bank like screen bank or blit merge for the sprites

Code: Select all

                 Stevie Wonder Extension
                 -----------------------
Credit
------

Programming
Design
&
Research:	Colin A Watt


Legend
------

	After aquiring a 2 Meg STE through extreme good luck, I
decided that the time had come for STOS users to take full advantage
of the STE's enhancements (let's NOT mention the STE or BLITTER
extensions).  After several weeks of extremely hard, fiddly work
and endless nights poring over inaccurate, badly written, apocryphal
documentation I emerged from my study tired, blood stained and
emotionally drained clutching the child of my genius - STEVIE WONDER.


Truth
-----

	After fluking an STE, I knocked up a dodgy STE extension in
5 minutes.



Commands
--------

	There now follows a short summary of the commands showing
the parameters used.  It would be a good idea to print this bit and
keep it at hand as a quick reference.
						   cut along dotted line 
/-----------------------------------------------------------------------\
| real screen		ADDR,WIDTH,HEIGHT,X,Y				|
|									|
| LE=screen size	(WIDTH,HEIGHT)					|
|									|
| blitter copy		SCREEN1,X1,Y1,X2,Y2,SCREEN2,X,Y			|
|									|
| real copy		SCREEN1,X1,Y1,X2,Y2,SCREEN2,X,Y			|
|									|
| blitter merge		SCREEN1,X1,Y1,X2,Y2,SCREEN2,X,Y,BUFFER		|
|									|
| blitter wipe		SCREEN						|
|									|
| dac play		ADDR,LENGTH/SAMPLE NO,FREQUENCY,STATUS		|
|									|
| dac stop								|
|									|
| dac volume master	VOLUME						|
|									|
|  "    "    left  	  "						|
|									|
|  "    "    right	  "						|
|									|
| dac treble		TREBLE						|
|									|
| dac bass		BASS						|
|									|
| dac mix		MIX						|
\-----------------------------------------------------------------------/

	Now we have an in-depth (ha!) explenation of the commands, there
uses and how to use them.

*PLEASE NOTE*
-------------

	All addresses are actual.  you would type start(5) instead of 5.
 This can be the cause of serious crashes so take care.

**************************************************************************


REAL SCREEN
-----------

	real screen	ADDR,WIDTH,HEIGHT,X,Y

	Real screen is a command for doing hardware-scrolling.  It is
a bit tricky to get your head around how this works if you are not
used to it but lets try anyway.  You define a screen which is larger
than the physical screen.  You then look into this screen at a
logical X and Y co-ordinate but you only see a portion of 320 X 200
pixels at one time.  Confused? never mind. 


ADDR	 is the address of a memory bank to use for the screen.  The
	size of this bank is calculated using the 'screen size' command.

WIDTH	is the logical width of the screen.  This must be a multiple of
	16 only, if its not then it gets rounded down.

HEIGHT	is the logical height of the screen.

X	is the X co-ordinate into the screen.

Y	is the Y co-ordinate into the screen.

*PLEASE NOTE*

	For complex technical reasons, when you define a 'real screen'
of 320 pixels wide, horizontal scrolling is in multiples of 16 only.
You can solve this problem by making it 336 wide.



Example
-------

10 LE=screen size(640,400)
20 reserve as screen 5,le
30 s5=start(5)
40 repeat : waitvbl : X=x mouse : Y=y mouse : M=mouse key
50 real screen(S5,640,400,X,Y)
60 until M<>0


	This example will define a screen which is twice as wide and
twice as high as the physical screen and let you scroll about it using
the mouse.


**************************************************************************


SCREEN SIZE
-----------

	LE=screen size	(WIDTH,HEIGHT)

	Screen size is a function which returns the correct length
of memory bank to reserve for the real screen command.

WIDTH	is the logical width of the screen.

HEIGHT	is the logical height of the screen


Example
-------

	See the example for 'real screen'.


**************************************************************************


BLITTER COPY
------------

	blitter copy	SCREEN1,X1,Y1,X2,Y2,SCREEN2,X,Y

	Blitter copy is a sort of screen copy routine which uses
the blitter.  Because it has to work with the 'real screen' command,
the size of the source screen is the standard 320 X 200,while the size 
of the destination screen is whatever dimensions that you have set
using the 'real screen' command.  If you are not using real screen
then this behaves just like screen copy.

	It also has the advantage of copying things to pixel positions
very quickly indeed (unlike screen copy).


SCREEN1	is the source screen.

X1 & Y1	are the co-ordinates of the top left-hand corner of the source
	block.

X2 & Y2	are the co-ordinates of the bottom right-hand corner of the
	source block.

SCREEN2	is the destination screen.

X & Y	are the co-ordinates on the destination screen to place the
	block.


Example
-------

10 reserve as screen 5,32000 : load "CINDY1.NEO",5
20 LE=screen size(640,400)
30 reserve as screen 6,le : wait 3
40 S5=start(5) : S6=start(6)
50 blitter copy s5,0,0,320,200,s6,0,0 
60 blitter copy s5,0,0,320,200,s6,320,0 
70 blitter copy s5,0,0,320,200,s6,0,200 
80 blitter copy s5,0,0,320,200,s6,320,200 
90 repeat : waitvbl : X=x mouse : Y=y mouse : M=mouse key
100 real screen(S6,640,400,X,Y)
110 until M<>0

	This will provide you with a nice hardware-scrolling
demo which has a nice picture of Cindy Crawford moving around
when you move the mouse.  Of course you need the right picture file... 


**************************************************************************


REAL COPY
---------

	real copy	SCREEN1,X1,Y1,X2,Y2,SCREEN2,X,Y

	Real copy is also a replacement screen copy command (sort of).
The difference between it and 'blitter copy' is that BOTH the source
and destination screens are assumed to be whatever sizes which you have
defined with 'real screen'.

SCREEN1	is the source screen.

X1 & Y1	are the co-ordinates of the top left-hand corner of the source
	block.

X2 & Y2	are the co-ordinates of the bottom right-hand corner of the
	source block.

SCREEN2	is the destination screen.

X & Y	are the co-ordinates on the destination screen to place the
	block.


Example
-------

10 reserve as screen 5,32000 : load "CINDY1.NEO",5
20 LE=screen size(640,400)
30 reserve as screen 6,le : wait 3
40 S5=start(5) : S6=start(6)
50 blitter copy s5,0,0,320,200,s6,0,0 
60 blitter copy s5,0,0,320,200,s6,320,0 
70 blitter copy s5,0,0,320,200,s6,0,200 
80 blitter copy s5,0,0,320,200,s6,320,200 
90 repeat : waitvbl : X=x mouse : Y=y mouse : M=mouse key
100 real screen(S6,640,400,X,Y)
110 real copy s6,0,0,160,100,s6,0,-2
120 blitter copy s5,0,0,64,64,s6,(640-x),(400-y)
130 until M<>0

	This example will be the hardware scrolly thing with 
Cindy's upper torso getting copied onto the screen and the top
portion scrolling along.


**************************************************************************


BLITTER MERGE
-------------

	blitter merge	SCREEN1,X1,Y1,X2,Y2,SCREEN2,X,Y,BUFFER

	Blitter merge is not entirely unlike 'blitter copy', the
only differences being the fact that the source block is merged
with the destination screen and the extra parameter.

SCREEN1	is the source screen.

X1 & Y1	are the co-ordinates of the top left-hand corner of the source
	block.

X2 & Y2	are the co-ordinates of the bottom right-hand corner of the
	source block.

SCREEN2	is the destination screen.

X & Y	are the co-ordinates on the destination screen to place the
	block.

BUFFER	This is an area of memory for internal use by the command.
	If STOS wasn't so inherently rubbish in the way extensions
	work, this parameter would not have been needed - take note
	Francois!  For safetys sake this should be 8400 bytes but if
	you are only copying small blocks, you can get away with less.
	The formula is ((WIDTH/8)+2)*HEIGHT.  If you are in doubt,
	just make it 8400 bytes.


Example
-------

5  reserve as work 4,8400
10 reserve as screen 5,32000 : load "CINDY1.NEO",5
20 LE=screen size(640,400)
30 reserve as screen 6,le : wait 3
40 S4=start(4) : S5=start(5) : S6=start(6)
50 blitter copy s5,0,0,320,200,s6,0,0 
60 blitter copy s5,0,0,320,200,s6,320,0 
70 blitter copy s5,0,0,320,200,s6,0,200 
80 blitter copy s5,0,0,320,200,s6,320,200 
90 repeat : waitvbl : X=x mouse : Y=y mouse : M=mouse key
100 real screen(S6,640,400,X,Y)
110 real copy s6,0,0,160,100,s6,0,-2
120 blitter merge s5,0,0,64,64,s6,(640-x),(400-y),s4
130 until M<>0

	This time Cindy's bossoms are merged onto the screen.

**************************************************************************


BLITTER WIPE
------------

	blitter wipe SCREEN

	This is a version of CLS which uses a certain piece of hardware
which is exclusive to the STE, can you guess which one?  It also works
fine with 'real screen'


SCREEN	is the address of a screen (really?)


Example
-------

10 LE=real length(640,200)
20 reserve as work 5,le : wait 3
25 S5=start(5)
30 blitter wipe S5

	This will reserve a 640 X 400 sized screen and clear it.  

**************************************************************************


DAC PLAY
--------

	dac play	ADDR,LENGTH/SAMPLE NO,FREQUENCY,STATUS

	Dac play is a sample replay which uses the STE's DAC chip.
The command can work in 2 ways.  The first way is using raw sample data
which means that the second parameter is the length of the sample.  The
second way is to use a specially formatted sample bank which means that
the second parameter is the sample number.  The command works out which
is which automatically.  The format of the sample bank is the same as
the 'digi play' command in the Missing Link extension, and a program to
make these up should have been saved out with this DOC file.  It as
called 'MAKE_DAC.BAS' or something.


ADDR			is the address of the sample data.

LENGTH/SAMPLE NO	is the sample length or sample number.

FREQUENCY		0=6.25 khz : 1=12.5 khz 
			2=25 khz : 3=50 khz.

STATUS			0=turn off sample : 1=play sample without loop
			2=play sample with loop.



Example
-------

10 load "DIGI.MBK",5
15 S5=start(5)
20 repeat : z$=inkey$ : until (Z$>="0" and Z$<="9") or Z$=" "
25 if Z$=" " then dac play 0,0,0,0 : default : end
30 T=asc(mid$(Z$,1,1))-48
40 dac play S5,T,0,1
50 goto 20


**************************************************************************


DAC STOP
--------

	dac stop

	This command stops the dac.  No but really!


Example
-------

10 load "DIGI.MBK",5
15 S5=start(5)
20 repeat : z$=inkey$ : until (Z$>="0" and Z$<="9") or Z$=" "
25 if Z$=" " then dac stop : default : end
30 T=asc(mid$(Z$,1,1))-48
40 dac play S5,T,0,1
50 goto 20


**************************************************************************


DAC VOLUME
----------

	dac volume	MODE,VOLUME

	Dac volume sets the volume of the DAC chip.

MODE	can be LEFT, RIGHT or MASTER

VOLUME is the new value which the volume takes.


Example
-------

10 load "DIGI.MBK",5
20 S5=start(5)
30 dac play S5,0,0,2
40 V=100
50 repeat : z$=inkey$ : C=scancode 
60 if c=72 and v>0 then dec V : dac volume master V
70 if c=80 and v<100 then inc V : dac volume master V
80 until Z$=" "
90 dac stop : default : end


**************************************************************************


DAC TREBLE/BASS

	dac treble	VALUE
	dac bass	VALUE

	These 2 commands set the intensity of the DAC's treble (high
frequency sound) and bass (low frequency sound).


VALUE	is the new value to set the treble or bass to.


Example
-------

10 load "DIGI.MBK",5
20 S5=start(5)
30 dac play S5,0,0,2
40 B=100 : T=100
50 repeat : z$=inkey$ : C=scancode 
60 if c=72 and v>0 then dec B : dac bass B
70 if c=80 and v<100 then inc B : dac bass B
80 if c=75 and v>0 then dec T : dac treble T
90 if c=77 and v<100 then inc T : dac treble T
100 until Z$=" "
110 dac stop : default : end


**************************************************************************


DAC MIX
-------

	dac mix		MIX

	Dac mix sets how the DAC chip is mixed with the old YM2149
soundchip.

MIX	is the new value to set the mix by.  This can be 0,1 or 2


0	-12 dB
1	Mix GI sound chip output
2	Do not mix GI sound chip output



**************************************************************************


	Well thats it as far as commands go.  This is by no means a
fully comprehensive STE extension as there are a ton of commands that
could be added.  What it is however, is the bare minimum that you need
in order to do STE demos using STOS.  It is possible to do sprites,
samples, scrolling and any other demo type things.  More commands
will be added if this proves to be lucrative er, I mean popular.


REGISTRATION
------------

	Yes its this bit again!  Stevie Wonder, like all other Top
Notch STOS extensions is shareware.  The registration fee is œ5.00
(five pounds sterling).  For your money you will receive a nice
disk with a lot of example sources to show you how to get the most
from STEVIE WONDER.  You will also have the warm glowing feeling
that comes of doing a genuinly good act that will get you into heaven.
Remember - God loves Shareware coders.



	Please copy or print out the form below and fill it in.

:========================================================================:

NAME
__________________________________________________________________________
ADDRESS
__________________________________________________________________________
__________________________________________________________________________
__________________________________________________________________________
__________________________________________________________________________
__________________________________________________________________________
POST CODE
__________________________________________________________________________
TELEPHONE NUMBER
__________________________________________________________________________

AGE
__________________________________________________________________________
M/F
__________________________________________________________________________
PROGRAMMING HOUSE/TEAM/GROUP (IF YOU ARE IN ONE)
__________________________________________________________________________
PSUDONYM (IF YOU HAVE ONE)
__________________________________________________________________________
WHERE YOU GOT STEVIE WONDER (PD LIBRARY, MAGAZINE,FRIEND ETC)
__________________________________________________________________________
MAIN USES
__________________________________________________________________________
SHAREWARE EXTENSIONS (PLEASE TICK IF YOU HAVE REGISTERED FOR ANY)

 __
|  |	THE MISSING LINK
 --
 __
|  |	MISTY
 --
 __
|  |	GBP EXTENSION
 --
 __
|  |	STE EXTENSION
 --
 __
|  |	BLITTER EXTENSION
 --
 __
|  |	STARS EXTENSION
 --

OTHER(S)
__________________________________________________________________________
__________________________________________________________________________

FULL PRICE EXTENSIONS (PLEASE TICK IF YOU OWN ANY)

 __
|  |	STOS 3D
 --
 __
|  |	STOS MAESTRO
 --
 __
|  |	STOS COMPILER
 --
 __
|  |	STOS SQUASHER
 --
 __
|  |	TOME
 --

OTHER(S)
__________________________________________________________________________
__________________________________________________________________________
HAVE YOU FOUND ANY BUGS?
__________________________________________________________________________
__________________________________________________________________________
__________________________________________________________________________
WHAT COMMANDS WOULD YOU LIKE TO SEE IN STEVIE WONDER
__________________________________________________________________________
__________________________________________________________________________
__________________________________________________________________________
__________________________________________________________________________

:========================================================================:



ADDRESS
-------

Once you have filled this form out, send it to:

Top Notch (STE dept.)
PO BOX 1083
GLASGOW
G14 9DG

If you are outside Europe (like North-America or Australasia) then
we would appreciate it if you would enclose an extra œ1.50 (one pound
and fifty pence sterling) to cover postage.  Trans-continantal postage
is not a cheap thing.


ADVERT
------

Other Top Notch STOS extensions are:

Misty
-----
		This extension features 28 commands renging from simple
		but useful commands like 'mouse off/on' to much faster
		versions of old STOS commnds like 'skopy' (new screen copy)
		and 'dot' (new plot).

The Missing Link
----------------
		This is the definitive STOS extension.  Anything you need
		to write fast platform games is here:

		World.	A multi-directional scrolling map with 1 command.
		Bob.	An amazingly fast sprite routine.
		Wipe.	A stunningly fast cls.
		Text.	A blindingly quick print command.
		Tile.	A screen full of scrolling tiles in 1 command.

		All in all there are 72 commands, making The Missing Link
		the biggest and best STOS extension ever.

CAST
----

Top Notch are:

	Colin A Watt.	Code, design and product
			imlementation.

	Billy Allan.	Code, project liasons and
			marketing.

	Stefan Lingdell.	Music and overseas development.

BYE
---

Wishing all you STE owners a mountain of good luck with STEVIE and
thanking you in advance for your registration.

	Colin A Watt	Billy  Allan	Stefan Lingdell

			     of
			     
 			TOP NOTCH

	5th September 1993

Colin A Watt
of
Top Notch

30/08/93

Beware of the STe scroll, it crashes on exit for me
What the difference between BLITTER COPY and REAL COPY? I don't understand :(

So your must install the extension on your stos directory

Here's the new code with a blitter sprite
Can someone check why my scrolling is so buggy please?
It should be a perfect loop in fact

Code: Select all

10 mode 0 : key off : mouseoff : click off : auto back off : update off : synchro off : curs off 
20 get palette (5)
30 reserve as work 6,64000
31 reserve as work 7,8400
35 XP=0 : YP=0 : ST5=start(5) : ST6=start(6) : ST7=start(7)
40 logic=back : XP=0 : YP=0
50 copy ST5,ST5+32000 to ST6
60 copy ST5,ST5+32000 to ST6+32000
110 repeat 
120 for Y=199 to 0 step-1
125 blitter copy ST6,0,Y,191,200+Y,logic,0,0
126 rem blitter copy ST6,0,YP,XP+48,YP+34,logic,0,YP
127 if blit busy=1 then 127
140 blitter merge ST5,192,0,224,34,logic,XP,YP,ST7
141 if blit busy=1 then 141
145 doke $FF8240,$70
146 screen swap : wait vbl 
160 if jup and YP>0 then dec YP
170 if jdown and YP<168 then inc YP
180 if jleft and XP>0 then dec XP
190 if jright and XP<168 then inc XP
225 doke $FF8240,$0
235 doke $FF8240,7
240 next Y
250 until inkey$<>""
270 mouseon : default

Thank you

extension + source + prg included
You do not have the required permissions to view the files attached to this post.
mlynn1974
Captain Atari
Captain Atari
Posts: 435
Joined: Mon Mar 03, 2008 10:33 pm
Contact:

Re: STOS STE vertical shooter: I need help please

Post by mlynn1974 »

Great stuff! I don't remember seeing Stevie Wonder at all in 1993 :)
The background picture for your game looks great.

>What the difference between BLITTER COPY and REAL COPY? I don't understand
I think BLITTER COPY has to work within 320x200, but REAL COPY can work with dimensions outwith the visible screen. You could copy a block from x=320..x=640 to x=0 with REAL COPY for instance. It also seems to be very tolerant of negative destination coordinates.

The problem I have with hardware scrolling is to make any animation smooth without tearing it must be double buffered but the hardware scrolling techniques available especially with Asa Burrow's STE extension is that it really cannot be double buffered with that daft HARD INTER. Even if you could it would use excessive memory (128kB) even to have 2 fully pre-drawn screens. Plenty of Speccy games managed very long playfields without hardware scrolling and very limited memory.

When I converted Grodan and the Kvack Kvack to the Amiga I didn't use hardware scrolling at all and blitted both layers (320x200, only one bit-plane each though) at 50Hz. I think the ST's Blitter is faster than the Amiga so it should provide even better performance.
Still got, still working: Atari 4Mb STe, 520STFM (x2), 2.5Mb STF, Atari 2600JR, Flashback 8 Gold.
Hardware: Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).
Encolpius
Atari nerd
Atari nerd
Posts: 44
Joined: Mon Aug 27, 2018 12:46 pm

Re: STOS STE vertical shooter: I need help please

Post by Encolpius »

Hmmmm. Do we even need hardware scrolling for a vertical shmup?

Here's how I would approach it. Basically, assuming that the user has a 1 meg STE with TOS 1.62. This gives us about 800 kb memory to play with. Firstly, I'd reserve a bank of length 160*the height in pixels of your playfield, as work. We'll call it M14 for argument's sake Eight screens high is 256 KB which is leaves us with plenty of space for everything else.

Something like "reserve as work 14,256000 : M14=start(14)" maybe.

Now, one of the undocumented features in STOS is that you don't have to store graphics in a screen bank; any bank will do. Then, at the outset of each level I'd populate this playfield using "chunks" of graphics that are stored as screen$ blocks; the level would basically be a text file that tells the STE to paste each block in a certain coordinate and also set at which stage in the level a new wave or type of enemy spawns.

You might want to use the Control extension for this and declare screensize 320,1600 (assuming the playfield is eight screens high) and set clip likewise. This enables you to paste it outside normal coordinates without clipping using quick screen$. This is your background.

Then at the start of the level use real copy to paste, with the blitter, the bottom 320*200 pixels of M14 to logic, and paste the player in his start position. You can do this by having a variable called something like YPOS which starts at 1400. The command might be something like "real copy M14,0,YPOS,320,YPOS+200,logic,0,0" or similar.

Each frame, the game runs something like this:

>Blit 0,YPOS,320,YPOS+200 to logic,0,0 and physic,0,0 using the blitter
>Blit all sprites in their correct places in logic (preshifting is your friend, however, for memory's sake it might be best to only preshift to 2 or even 4 pixel steps depending on how many frames of animation each sprite has; I was playing with a hack and slash game in early 2019 where the player sprite was 80px tall and she had pretty much every type of sword strike that the authors of Blossfechten ever dreamed of, so pre-shifting was off the cards but she was big enough that it didn't look wrong being locked to multiples of 16)
>Check for collisions and act upon them
>Read controls
>Determine enemy movements
>Adjust all sprite positions accordingly
>Reduce YPOS by 1 or however many pixels it is to scroll by
>Does YPOS now equal a position at which a new enemy spawns? If so, spawn it
>Is any enemy at Y>200? If so, despawn it
>If YPOS=0 then stop scrolling and introduce boss for level
>Screen swap : wait vbl

With the blitter you can paste an entire full screen in about 48,000 cycles if you use hog mode (not recommended, it makes interrupts go all wonky) or a bit more than that if you insert a nop loop until blit busy=0. The blitter is most efficient when doing big chunks or lots of small chunks of the same dimensions so you don't have to reprogram it between jobs as much.

The advantage of this approach is that you only need to double buffer the visible portion of the screen rather than having to double buffer the entire playfield, and if you need to reinstate a portion of the background to avoid sprite trails you can simply use something like "real copy M14,oldx,oldy+ypos,oldw,oldh+ypos,logic,oldx,oldy" to do that.
joska
Hardware Guru
Hardware Guru
Posts: 5013
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: STOS STE vertical shooter: I need help please

Post by joska »

mlynn1974 wrote: Mon May 10, 2021 12:11 am Even if you could it would use excessive memory (128kB) even to have 2 fully pre-drawn screens. Plenty of Speccy games managed very long playfields without hardware scrolling and very limited memory.
You only need one 320x400 (*) screen for fullscreen vertical scrolling on the STE. Two if using double-buffering, which I strongly recommend. Your level can be as long as you like if you use a tilebased approach. The screen will be a sliding "window" to your 320x400 framebuffer. If your game scrolls from the top and down /"window" sliding up), all you need to do is to draw the new tiles just above AND directly below this window. So when the window has slid to the top of the framebuffer you will have an identical copy in the bottom half and can simply move the window down again. This technique works for horisontal scrolling too.

With this approach double buffering only costs you ~64Kb, if you still want (or have) to use single buffering then it gets a little bit more complicated. Basically you have to make sure that you can draw all the sprites (and restore their backgrounds) in less than one VBL. This means that you will be able to draw them ahead of the "beam". So each VBL will start with sprite redraws, then your game logic, then prepare next redraw (sort sprites vertically so you draw them from top to bottom) and finally restore the sprite backgrounds (again from top to bottom) and wait for VBL.

Double buffering makes things a lot easier and give you more options. E.g. you can let the enemy sprites update at 25fps (more sprites!), while the player sprite is updated at 50fps for quicker response. And you don't have to worry about the beam, just start each VBL by restoring sprite backgrounds, run game logic, draw sprites, wait for next VBL. Not having to sort sprites vertically before you draw them also means it's a lot easier to control which sprites are in front and which are in the back.

(* I'd use a slightly bigger framebuffer. This will allow you to draw tiles instead of complete lines when scrolling. E.g. if your tiles are 16x16 pixels, you need to draw one tile per VBL if you scroll one line every second VBL. Then you will spend 20 VBL's drawing tiles, in this time your screen has scrolled 10 lines and you still have 12 VBL's left to copy the completed tilerow to the scrolled-out region at the bottom. It is easier to write efficient code for this than composing a complete 320 pixel line out of a tilemap and tiles.)
Jo Even

VanillaMiNT - Falcon060 - Milan060 - Falcon040 - MIST - Mega STE - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64
mOa
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 147
Joined: Sun May 12, 2002 11:53 pm

Re: STOS STE vertical shooter: I need help please

Post by mOa »

Thank you for your support Joska & Jon. I really appreciate it. I was aware of the scrolling technique you described
It's just I can't convert it in practice. So I think it's time to talk about my project
I am a ATARI ST fan since 95. Always wanted to create a game thus a STOS worshipper
Even with his unpolished interface STOS always has great potential for beginner coders like me
With the STe capabilities, STOS have a great power up. With a clever code It should outperform some commercial productions with an ease

On another side, I'm sorry to tell that but in my opinion the ATARI ST homebrew scene is desert compared to other
retrocomputers. Just check https://www.indieretronews.com to see another computer which starts with an A.
A lot a projects are popping out these days because of one game engine called SCORPION ENGINE

The aim of my project is to provide some template game code for enthusiasts to facilitate the creation of a game
Off course it will be fully documented with tutorials, etc..

So I'm hoping to release this with your help. I know it's ambitious but we can make if we gather our talents.

Now, the game itself would be a remake of CHOPPER X, an unfamous shooter by PARADOX to see if we can do better
The goal is not to make a arcade perfect conversion but something more enjoyable (shouldn't be too hard)
As it turns out, CHOPPER X is clearly a ripoff of TIGER HELI by TAITO so let's use the arcade artwork for it

The next step is to rip the map using TILED https://www.mapeditor.org. There's a code here (CVS2STOS) at the end of the page:
https://www.exxoshost.co.uk/atari/STOS/ ... index.htm

Thank you for reading
wietze
Captain Atari
Captain Atari
Posts: 356
Joined: Fri Mar 01, 2013 10:52 pm

Re: STOS STE vertical shooter: I need help please

Post by wietze »

Hi moa,

have you seen the developments DML has done on the AGT? It is not STOS, but it is a very elaborate and high performing games engine that may be suitable for your ends. Im not entirely sure if/how STOS fits in there, but I can recommend looking AGT in case you havent.

Regards,
Wietze
mOa
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 147
Joined: Sun May 12, 2002 11:53 pm

Re: STOS STE vertical shooter: I need help please

Post by mOa »

Yes I know about AGT but it's C programming
User avatar
thomas3
Captain Atari
Captain Atari
Posts: 180
Joined: Tue Apr 11, 2017 8:57 pm
Location: the people's republic of south yorkshire, uk.

Re: STOS STE vertical shooter: I need help please

Post by thomas3 »

Hey mOa,

If things are feeling tricky, maybe it is worth prototyping your game using the tools and commands from the Missing Link extension?

Sure, it will be slower and won't use ste functionality. But it might help you get something designed and running?

Joska's advice is excellent.
But STOS is too slow for the single buffering solution he describes, so you would need to double buffer. You can achieve the rolling scroll method he talks of, but you would need to be confident about drawing a line of tiles to a part of the screen that isn't displayed.

I wonder if your best solution is therefore to use higher level extensions and commands for now.

As you become more confident, you can replace the scroll code with hw scrolling.
User avatar
thomas3
Captain Atari
Captain Atari
Posts: 180
Joined: Tue Apr 11, 2017 8:57 pm
Location: the people's republic of south yorkshire, uk.

Re: STOS STE vertical shooter: I need help please

Post by thomas3 »

(it's also worth saying that however fast you get your scroll running, STOS is very inefficient and you may not see the performance gains you hope for).
mOa
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 147
Joined: Sun May 12, 2002 11:53 pm

Re: STOS STE vertical shooter: I need help please

Post by mOa »

Ok, following Thomas advice (Thank you) I've tried to use the landscape command from the Missing Link extension
which look nice and polyvalent buuuuut... i'm stuck in converting my map/tiles. The process of converting tiles to block is a real pain...
You must convert pictures of tiles -> sprites-> blocks using 2 or 3 different programs.

My map is 14x286 tiles of 16x16. Tiles fit into 2 screens. STOS sprite limit is 16 :evil:

On another hand, I've found a good tool to convert maps into tiles: https://pyxeledit.com/learn.php
I use the BETA version which is sufficient to sort the tiles. By exporting the map as text, You'll get a TILED compatible
data (see tilemap1.zip) . But CSV2STOS doesn't seem to work also :?

You can found many excellent game maps from here: http://hol.abime.net/hol_search.php?&N_ ... crolltype= Cheers for them :cheers:

It would be great to have a tool for ripping those maps all at once :mrgreen:

BTW I've changed the game for FOUNDATION'S WASTE https://www.atarilegend.com/games/176, equally bad than CHOPPER X
Thank you for reading
You do not have the required permissions to view the files attached to this post.
Post Reply

Return to “STOS”