little Blitter benchmark demo

All about demos on the Falcon, TT & clones

Moderators: Mug UK, [ProToS], lp, moondog/.tSCc., Moderator Team

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 969
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

little Blitter benchmark demo

Postby Frank B » Wed Aug 26, 2015 10:42 pm

Hi.

I've created a little bench mark demo for the ST blitter. It should run on any STE though I've not tested it on real hardware.
An earlier version of this was written for the PB disk magazine which was never released.

It renders some 32*30 two planes bobs in several modes. It can use the blitter, preshifted CPU sprites or a realtime CPU shifter using mcoders two planes techique.

It logs the amount of bobs on screen and the frame count taken to render them. It should be a fairly good comparison of CPU vs blitter.
The graphics were ripped from the ST ROM and from an old Amiga demo.

The keys are
1 and 2 to increase or decrease bobs on screen
3 - 5 for rendering modes (blitter, cpu preshift and real time cpu shift)
f1-f8 will let you play with the bob flight path.
6 - will toggle the raster timer. Don't switch this on unless VBL == 1. It'll flash like crazy :)

I've focused on the code being general purpose and maintainable. The earlier version could draw 30 bobs on the screen in a frame. This one is slower at the expense of being general purpose. I'll optimise it later.

Hope someone has fun with it :)

Enjoy
You do not have the required permissions to view the files attached to this post.

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

Re: little Blitter benchmark demo

Postby mlynn1974 » Thu Aug 27, 2015 12:35 am

Great program Frank! Thanks for sharing this.

It does raise the question that if a new game or demo is being created should programmers rely on the blitter, go for the most basic specification (520STFM - no blitter) or use software rendering if no blitter is available?

On STEEM I get 0x19 (25) bobs in 1 VBL with Blitter Rendering.
I remember PB magazine - by Agrajag!
Still got, still working: Atari 4Mb STe, 520STFM, 2.5Mb STF.
Hardware: Cumana CSA 354, Ultimate Ripper, Blitz Turbo, Synchro Express II (US and UK Versions).

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 969
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: little Blitter benchmark demo

Postby Frank B » Thu Aug 27, 2015 12:40 am

With preshifting you may need 16 copies of the mask and the sprite. You also need the source data to be one word wider for the shifting.
So a 2 column sprite becomes a 3 column sprite * 16 copies. The mask will need to have one word extra and also be duplicated 16 times.
It gets better. For maximum speed it's better to unroll the code for a specific size. That's consuming yet more memory.

With the blitter your sprite can be
a) only 2 words wide and not 3
b) the mask can be a single plane
c) the code is really small to drive the blitter.

My CPU realtime shift is calculating the masks on the fly. That turned out to be faster than shifting them.
So you can waste 20x + memory and still be slower than the blitter by about 25% or conserve on memory with a cpu shifter. If you do that you'll be 2.7x slower than the blitter. This is despite the algorithm being more efficient than the blitter which is reading and writing twice for masking.
It's amazing more people don't use it on the ST.

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2978
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: little Blitter benchmark demo

Postby AtariZoll » Thu Aug 27, 2015 7:43 am

Frank B wrote:...
It's amazing more people don't use it on the ST.


What is really "amazing" is fact, that game coders barely used it even in 1990, 3 years after it was released (1987 in Mega ST and with support in TOS 1.02) . I guess that they cared more about copy protection, even if knew that it is lost battle.
Famous Schrodinger's cat hypothetical experiment says that cat is dead or alive until we open box and see condition of poor animal, which deserved better logic. Cat is always in some certain state - regardless from is observer able or not to see what the state is.

User avatar
Anima
Atari Super Hero
Atari Super Hero
Posts: 666
Joined: Fri Mar 06, 2009 9:43 am
Contact:

Re: little Blitter benchmark demo

Postby Anima » Thu Aug 27, 2015 8:19 am

Nice demo. Time to show the power of the STE. ;)

How about four bitplanes and restoring the background not just clearing? How many 32 x 32 sprites will be possible to display in one frame?

wietze
Captain Atari
Captain Atari
Posts: 221
Joined: Fri Mar 01, 2013 10:52 pm

Re: little Blitter benchmark demo

Postby wietze » Thu Aug 27, 2015 8:33 am

Any chance that the source is disclosed together with the program?

User avatar
leonard
Moderator
Moderator
Posts: 640
Joined: Thu May 23, 2002 10:48 pm
Contact:

Re: little Blitter benchmark demo

Postby leonard » Thu Aug 27, 2015 9:19 am

Frank B wrote:I've created a little bench mark demo for the ST blitter.


Hi Frank,

Very nice initiative. Doing benchmark takes time and it's cool to have one. Anyway you may have a weird bug because there is a huge difference between emulators and real hardware. Here are deails, I hope it could help to fix:

- on emulators, (tested SainT and HATARI), I can display $19 balls in 1VBL (blitter mode)
-on real hardware, in blitter mode, the first weird thing is that the clear does not work. Sprites are leaving "not cleared" data on the screen. (they are well displayed, but the clear is not ok). And worst, I can only display $11 of them in 1 VBL
Leonard/OXYGENE.

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 969
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: little Blitter benchmark demo

Postby Frank B » Thu Aug 27, 2015 12:00 pm

leonard wrote:
Frank B wrote:I've created a little bench mark demo for the ST blitter.


Hi Frank,

Very nice initiative. Doing benchmark takes time and it's cool to have one. Anyway you may have a weird bug because there is a huge difference between emulators and real hardware. Here are deails, I hope it could help to fix:

- on emulators, (tested SainT and HATARI), I can display $19 balls in 1VBL (blitter mode)
-on real hardware, in blitter mode, the first weird thing is that the clear does not work. Sprites are leaving "not cleared" data on the screen. (they are well displayed, but the clear is not ok). And worst, I can only display $11 of them in 1 VBL


Oh that's a bummer. I'm thousands of miles away from real hardware to test on. The original one worked fine on real hardware. I'll have a look when I'm home :) I think I know what the issue might be.

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 969
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: little Blitter benchmark demo

Postby Frank B » Thu Aug 27, 2015 12:02 pm

wietze wrote:Any chance that the source is disclosed together with the program?



Yes. Once it works on real hardware :)

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 969
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: little Blitter benchmark demo

Postby Frank B » Thu Aug 27, 2015 12:03 pm

Frank B wrote:
leonard wrote:
Frank B wrote:I've created a little bench mark demo for the ST blitter.


Hi Frank,

Very nice initiative. Doing benchmark takes time and it's cool to have one. Anyway you may have a weird bug because there is a huge difference between emulators and real hardware. Here are deails, I hope it could help to fix:

- on emulators, (tested SainT and HATARI), I can display $19 balls in 1VBL (blitter mode)
-on real hardware, in blitter mode, the first weird thing is that the clear does not work. Sprites are leaving "not cleared" data on the screen. (they are well displayed, but the clear is not ok). And worst, I can only display $11 of them in 1 VBL


Oh that's a bummer. I'm thousands of miles away from real hardware to test on. The original one worked fine on real hardware. I'll have a look when I'm home :) I think I know what the issue might be. Did you test it on the STe or the ST with a blitter?

wietze
Captain Atari
Captain Atari
Posts: 221
Joined: Fri Mar 01, 2013 10:52 pm

Re: little Blitter benchmark demo

Postby wietze » Thu Aug 27, 2015 12:06 pm

Frank B wrote:
wietze wrote:Any chance that the source is disclosed together with the program?



Yes. Once it works on real hardware :)


Lovely; looking forward to it.

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 969
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: little Blitter benchmark demo

Postby Frank B » Thu Aug 27, 2015 12:24 pm

This version will hopefully at least fix the clear problem on real hardware.
You do not have the required permissions to view the files attached to this post.

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 969
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: little Blitter benchmark demo

Postby Frank B » Thu Aug 27, 2015 12:25 pm

Anima wrote:Nice demo. Time to show the power of the STE. ;)

How about four bitplanes and restoring the background not just clearing? How many 32 x 32 sprites will be possible to display in one frame?


Probably about half :)

User avatar
dml
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 3472
Joined: Sat Jun 30, 2012 9:33 am

Re: little Blitter benchmark demo

Postby dml » Thu Aug 27, 2015 1:27 pm

Cool stuff Frank. Hope the fix turns out to be a minor one :-) I had a couple of suggestions but I'll wait until you're back in town!

BTW does anyone know who first used the blitter in a (ST/e) demo, or in a game and what the titles and were / date of release? More of a trivia question but somebody out there may know...

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 969
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: little Blitter benchmark demo

Postby Frank B » Thu Aug 27, 2015 1:43 pm

dml wrote:Cool stuff Frank. Hope the fix turns out to be a minor one :-) I had a couple of suggestions but I'll wait until you're back in town!

BTW does anyone know who first used the blitter in a (ST/e) demo, or in a game and what the titles and were / date of release? More of a trivia question but somebody out there may know...


The earliest game I know of is power drift. The first time I saw it used in a game was Chronicles of Omega.

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 969
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: little Blitter benchmark demo

Postby Frank B » Thu Aug 27, 2015 1:46 pm

wietze wrote:
Frank B wrote:
wietze wrote:Any chance that the source is disclosed together with the program?



Yes. Once it works on real hardware :)


Lovely; looking forward to it.



I'm planning on adding an 030 sprite renderer too. This would be for TT and Falcon. The unrolled one won't perform as well on those machines.
When I'm done I'll port it to the Amiga :)

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2978
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: little Blitter benchmark demo

Postby AtariZoll » Thu Aug 27, 2015 2:36 pm

I tried it on Falcon. Good thing is that crashes not :D But in blitter mode, it leaves traces of sprites all around - so something is really not OK with rendering. And of course. ST low res (4 bpp) is what is really relevant mode.
Famous Schrodinger's cat hypothetical experiment says that cat is dead or alive until we open box and see condition of poor animal, which deserved better logic. Cat is always in some certain state - regardless from is observer able or not to see what the state is.

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 969
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: little Blitter benchmark demo

Postby Frank B » Thu Aug 27, 2015 2:46 pm

AtariZoll wrote:I tried it on Falcon. Good thing is that crashes not :D But in blitter mode, it leaves traces of sprites all around - so something is really not OK with rendering. And of course. ST low res (4 bpp) is what is really relevant mode.


Yes :) Please try this attached version. I've found another potential issue in the code with an equate.
Incidentally I'm not attempting to align the screen yet to a four byte boundary. It might be a bit odd from run to run on a Falcon.
I'm planning to remove the STe screen dependancy anyway and make it work on the ST.
You do not have the required permissions to view the files attached to this post.

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 969
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: little Blitter benchmark demo

Postby Frank B » Thu Aug 27, 2015 4:16 pm

Yet another issue found by reviewing the code.
I had an equate for blit mode which enabled/disabled hog mode. I was preloading this register and bseting the busy bit in places.
In other places the code was assumung bits 6 and 7 set. This would mean a load of that register with the equate would also start the blitter.
Yuck... I can't test so I'll stop now till I'm near real hw. Leonard the $11 a frame is consistent with bus shared mode. I suspect it is related to the problem I've just described.
You do not have the required permissions to view the files attached to this post.

User avatar
leonard
Moderator
Moderator
Posts: 640
Joined: Thu May 23, 2002 10:48 pm
Contact:

Re: little Blitter benchmark demo

Postby leonard » Thu Aug 27, 2015 4:32 pm

Frank B wrote:Yet another issue found by reviewing the code.
I had an equate for blit mode which enabled/disabled hog mode. I was preloading this register and bseting the busy bit in places.
In other places the code was assumung bits 6 and 7 set. This would mean a load of that register with the equate would also start the blitter.
Yuck... I can't test so I'll stop now till I'm near real hw. Leonard the $11 a frame is consistent with bus shared mode. I suspect it is related to the problem I've just described.


The clearing problem is fixed. But the slow problem is not :( Tested bench3.tos and it's a bit slower than before. I can only display $9 sprites in blitter mode ( $10 drop to 2 VBL). Btw I test on an original 520 STE, extended to 4MB

I think you could still look to HOG mode related stuff, sounds good idea.

PS: You still have a small clear problem even on emulators when the user reduce the number of sprites. During the reduce you can see some bad clear artifacts.
Leonard/OXYGENE.

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 969
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: little Blitter benchmark demo

Postby Frank B » Thu Aug 27, 2015 4:33 pm

Oh yeah. I know about the reduce issue. I'm a bit confused how it could be so slow but will look into that on real hardware when I get back to Scotland.

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 969
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: little Blitter benchmark demo

Postby Frank B » Thu Aug 27, 2015 5:18 pm

I just had a brainstorming session with Doug. I think we worked out what the issue is. I think the real hardware clears both the busy bit and the bus sharing bit at the end of each blit. The hog mod state doesn't persist from blit to blit. It needs to be set each time. If this is the case it would explain the code running at half speed. It would also be a bug in both Hatari and steem. My wifi at this airport is horrible. I may not be able to upload the next build.

User avatar
leonard
Moderator
Moderator
Posts: 640
Joined: Thu May 23, 2002 10:48 pm
Contact:

Re: little Blitter benchmark demo

Postby leonard » Thu Aug 27, 2015 5:43 pm

Frank B wrote:I just had a brainstorming session with Doug. I think we worked out what the issue is. I think the real hardware clears both the busy bit and the bus sharing bit at the end of each blit. The hog mod state doesn't persist from blit to blit. It needs to be set each time. If this is the case it would explain the code running at half speed. It would also be a bug in both Hatari and steem. My wifi at this airport is horrible. I may not be able to upload the next build.


it really make sense! I'll test your new version when you post. Btw I always prefer using move.b #$c0,$8a3c instead of bset #7,$8a3c :)

I noticed you "wait" blitter completion at the begining of blit operation. This is obviously safer in blitter shared bus mode. But in your case (HOG mode) I guess you could remove all the "busy wait" loop test.
Leonard/OXYGENE.

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 969
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: little Blitter benchmark demo

Postby Frank B » Thu Aug 27, 2015 5:45 pm

Guess what I've done on build four for added speed :)

User avatar
Frank B
Atari Super Hero
Atari Super Hero
Posts: 969
Joined: Wed Jan 04, 2006 1:28 am
Location: Boston

Re: little Blitter benchmark demo

Postby Frank B » Thu Aug 27, 2015 5:47 pm

I will upload a new build when i get to New York. The wifi here is completely unusable.


Social Media

     

Return to “Demos”

Who is online

Users browsing this forum: No registered users and 2 guests