Multiple screens and M Blit - is there a better way?

STOS-related stuff in here please

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

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

Multiple screens and M Blit - is there a better way?

Postby EstTeeEfEm » Sat Jan 16, 2016 1:01 pm

Ok, so the code runs in this order

    Background - BLIT

    Sprite - BOB

    Foreground - M BLIT

I'm struggling for speed on the sprites, its really quite important I crack this little problem in order to progress, whats the best method to gain speed.. i dont mind if its the blitter or some wierd ASM rout for merging but the speed of the BOBS is painful, even compiled.
This is one of those issues that I keep coming across, surely someone has a solution? Or does someone want to MAKE a solution lol (I.E a small extension or PRG i can call? that will copy a picture to 'N' screen minus colour 0)

Thanks guys, this one's really getting annoying ;)

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

Re: Multiple screens and M Blit - is there a better way?

Postby exxos » Sat Jan 16, 2016 1:03 pm

Welcome to the limitations of the ST ;)
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

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

Re: Multiple screens and M Blit - is there a better way?

Postby EstTeeEfEm » Sat Jan 16, 2016 1:08 pm

Loads of games use bits of the foreground to make the sprites appear to move behind.. there must be some way to do this in STOS? Defeat is not an option ;)

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

Re: Multiple screens and M Blit - is there a better way?

Postby exxos » Sat Jan 16, 2016 2:33 pm

It's not something I ever tried myself. I could never get enough speed out of a moving background and the bobs on top so never tried to do anything more than that. Your only possible option is to try using SKOPY (IIRC) to only copy 1 bit planes. This would limit your background image colours to probably 2, same with foreground.

I'm not sure but you could try JOEY's instead of BOBs, they use less bitplanes, of course less planes is less data to copy around and the faster things go. If your trying to use 16 colours backgrounds and foregrounds plus bobs, I don't think your ever going to anything running fast.
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
Mikefulton
Captain Atari
Captain Atari
Posts: 169
Joined: Sun Nov 29, 2015 10:27 am

Re: Multiple screens and M Blit - is there a better way?

Postby Mikefulton » Sat Jan 16, 2016 6:40 pm

EstTeeEfEm wrote:Ok, so the code runs in this order

    Background - BLIT

    Sprite - BOB

    Foreground - M BLIT

I'm struggling for speed on the sprites, its really quite important I crack this little problem in order to progress, whats the best method to gain speed.. i dont mind if its the blitter or some wierd ASM rout for merging but the speed of the BOBS is painful, even compiled.
This is one of those issues that I keep coming across, surely someone has a solution? Or does someone want to MAKE a solution lol (I.E a small extension or PRG i can call? that will copy a picture to 'N' screen minus colour 0)

Thanks guys, this one's really getting annoying ;)


Let me make sure I understand your terminology. The background is drawn via a single rectangle blit. The sprites are drawn one by one with individual rectangle blits to the screen buffer. Then the foreground is drawn via a masked blit.

That's a lot of RAM access. Especially if the masked blit for the foreground is a single full screen rectangle. It's got to read the screen, the mask, then write back to the screen.

Most likely the foreground doesn't really cover that much of the screen, probably no more than 20%, maybe even less, so a full screen masked blit is simply not very efficient.

Take the foreground and identity a number of bounding boxes where there is data. Then, instead of a single full screen masked blit, do an individual masked blit for each bounding box. Your mask and foreground rasters can still be the size of the full screen. Just do smaller multiple rectangles instead of one big one.

If the foreground is only 20% of the screen, for example, this will eliminate about 60% of the pixel RAM access for each frame.
Last edited by Mikefulton on Sat Jan 16, 2016 9:53 pm, edited 1 time in total.

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

Re: Multiple screens and M Blit - is there a better way?

Postby EstTeeEfEm » Sat Jan 16, 2016 6:45 pm

Take the foreground and identity a number of bounding boxes where there is data. Then, instead of a single full screen masked blit, do an individual masked blit for each bounding box


Hmm, I never considered this? But you're right in what you say, there is only roughly about 20% of the foreground needed. I'll have to have a look at it tomorrow..
But thanks, sometimes it just needs someone else to tell you the obvious ;)

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

Re: Multiple screens and M Blit - is there a better way?

Postby Mikefulton » Sun Jan 17, 2016 4:36 am

EstTeeEfEm wrote:
Take the foreground and identity a number of bounding boxes where there is data. Then, instead of a single full screen masked blit, do an individual masked blit for each bounding box


Hmm, I never considered this? But you're right in what you say, there is only roughly about 20% of the foreground needed. I'll have to have a look at it tomorrow..
But thanks, sometimes it just needs someone else to tell you the obvious ;)


Let us know what happens after you try it!

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

Re: Multiple screens and M Blit - is there a better way?

Postby Mikefulton » Wed Jan 27, 2016 7:45 pm

EstTeeEfEm wrote:
Take the foreground and identity a number of bounding boxes where there is data. Then, instead of a single full screen masked blit, do an individual masked blit for each bounding box


Hmm, I never considered this? But you're right in what you say, there is only roughly about 20% of the foreground needed. I'll have to have a look at it tomorrow..
But thanks, sometimes it just needs someone else to tell you the obvious ;)


Hey never heard back... did you have a chance to try it out?

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

Re: Multiple screens and M Blit - is there a better way?

Postby EstTeeEfEm » Mon Feb 01, 2016 2:58 pm

Sorry, i've been proper busy of late...
I havent tried it out yet in full however I did get something going, i've had my hands full with real life events lol...

There is a speed increase though and it CAN be significant but you have to work round the multiple 16 rule which is a bit awkward..
I really need to crack this 2 screen scrolling though.. i KNOW it can be done lol, just the misty DOCS are a bit vague, or i dont get them ? :P


Social Media

     

Return to “STOS”

Who is online

Users browsing this forum: No registered users and 2 guests