STOS corner


Martin Milner responds to the call for programming coverage!...

I intend to present news of the latest versions of the new extensions which are under development and, unlike previous STOS columns, I'll be venturing beyond the README files which has resulted in powerful commands and features being totally overlooked for the most part!
I'll be taking a detailed look at:
 
 
 

 

Please do write in with any STOS related queries you may have and I'll do my best to answer them. If you have got any hints and tips for STOS programmers, then send them in so we can all benefit from your experience.

Jaguar joypads on the STe/Falcon

Did you know your programs can easily support the jaguar joypad plugged into the ports at the front left-hand side of your STe/Falcon?
Use the jagjoy command available in the registered version of the CONTROL extension, or the jagpad command from Anthony Jacques Falcon extension.
However if you use these commands on a machine without the ports, such as the STFM your program will crash. To avoid this check for the Cookie Jar which is present on all STe/TT/Falcon computers.
Using the 'cookieptr' command from Anthony Hoskins system control extension. If 0 is returned there are NO joypad ports (or DMA hardware for that matter). If the cookie jar is present you can test the _SND cookie for DMA hardware and the _CPU cookie for CPU type.

Reducing memory requirements

Ever despaired how much memory pre-shifted sprites use up? The Missing Link is fast and versatile, but those bob banks don't half use up memory! The solution is to use the Blitter extension to pre-shift your backgrounds, (instead of your sprites), and display the resultant images on-screen.
How's it done? First off all, you'll need the STe Blitter extension by Asa Burrows. Because you haven't got masks for your sprites, you can't just display them in replace mode on the screen. You need to copy the relevant bit of background to a work screen (pre-shifted by the appropriate amount), display your sprite on it and then copy that to the correct position on your logical screen. The blitter extensions source co-ordinates have to be multiples of 16 which makes things more complicated and although it will right clip your sprites, it won't accept co-ordinates off the top or left-hand side of your screen without crashing the machine!
It sounds like it might not even be worth doing, but the speed the blitter copies graphics around means that the whole complicated looking routine doesn't actually run much slower than using pre-shifted sprites and the missing link extension - so long as you don't have too many sprites on-screen simultaneously. There's an example routine on the Reader disk, taken from one of my own programs - it saves many kilobytes of memory.
Until next time...

 
[Home] [Info] [Back] [Next]