Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Displaying Emulated Graphics

Reply to topic
Author Message
Chris
  • Guest
Reply with quote
Displaying Emulated Graphics
Post Posted: Wed Aug 04, 1999 8:11 am
Which is a better method of displaying graphics

a) drawing all the video ram line by line (hblank)

or

b) breaking the video ram into 8x8 images and showing tiles

I don't really know how to explain what I mean but is simple. Is it better to have the emulated display
line-based or tile-based? Which is easier?

Chris :o)
 
Nyef
  • Guest
Reply with quote
Post Posted: Wed Aug 04, 1999 12:48 pm
Quote
> Which is a better method of displaying graphics

> a) drawing all the video ram line by line (hblank)

> or

> b) breaking the video ram into 8x8 images and showing tiles

> I don't really know how to explain what I mean but is simple. Is it better to have the emulated display
> line-based or tile-based? Which is easier?

Line-based is better, because it handles most (if not all) raster effects automatically.
Tile-based is supposed to be easier, but I still haven't figured out how it do it (I guess
the right way will always seem easier to me). :-)

Quote
> Chris :o)

--Nyef
 
Limbs a Flyin'
  • Guest
Reply with quote
Post Posted: Wed Aug 04, 1999 12:50 pm
line by line, as (if you do it right) will handle any mid screen effects (palette changes and the like). or you could store a big list of checksums of each game and use tile based on the games where you can get away with it. (perhaps this is what brsms does?)

either that or be smarter still and do it mostly tile based, but drawing line based only when necessary. ;) (i mean per frame, not the big list of games method like above - which is not the best idea anyway)

it might be easyer to do tile based first, but dont be ashamed to re-write the graphic routine more than once if necessary during the development process


Quote
> Which is a better method of displaying graphics

> a) drawing all the video ram line by line (hblank)

> or

> b) breaking the video ram into 8x8 images and showing tiles

> I don't really know how to explain what I mean but is simple. Is it better to have the emulated display
> line-based or tile-based? Which is easier?

> Chris :o)
 
  • Joined: 24 Jun 1999
  • Posts: 1732
  • Location: Paris, France
Reply with quote
BrSMS
Post Posted: Wed Aug 04, 1999 7:43 pm
Quote
> line by line, as (if you do it right) will handle any mid screen effects (palette changes and the like). or you could store a big list of checksums of each game and use tile based on the games where you can get away with it. (perhaps this is what brsms does?)

Yes, it is exactly what it does. That's also why most new dumps aren't working properly with BrSMS by default: the default behavior is to use the tile engine. You can pass the -line parameter to get the games working, though.
  View user's profile Send private message Visit poster's website
Chris
  • Guest
Reply with quote
Re: BrSMS
Post Posted: Thu Aug 05, 1999 1:54 am
What's a checksum? I noticed that Genecyst has this feature and I here that word mentioned a lot in
emulators.

But what you are saying is that Brsms uses a big pre-defined checksum table just so it can properly
display it's graphics in tile mode? Why? Why would you need a checksum table in the first place?

Oh, and I did my own little experiementation in Qbasic. I made two small for...loops that drew
256x192 in the center of the 320x200 mode 13h display. One loop would draw a pixel from left
to right, goto the next row and do the same thing over and over again until the whole 256x192
display was complete (line-based) while the other loop drew 8x8 tiles left to right. For some
reason I guess because I was plotting whole tiles and not just pixel after pixel is was a whole
lot faster. The line-by-line took 3 1/2 seconds to render each frame while the tile-based took
mabye 1/4 of a second. Even though I did this experiement in Qbasic, will things be different
if this same experient were done in a faster language like Assembler or C? It would obvously
be faster than Qbasic but would there still be a slight speed difference between the line and
tile based engines? I'm really aiming to the assembly buffs out there to answer this one
because I would like my emulator graphics engine to be line-based for raster effects and
stuff.

Chris :o)
 
Lin Ke-Fong
  • Guest
Reply with quote
Post Posted: Thu Aug 05, 1999 5:34 am
[tile based vs line by line]

Quote
> Line-based is better, because it handles most (if not all) raster effects automatically.
> Tile-based is supposed to be easier, but I still haven't figured out how it do it (I guess
> the right way will always seem easier to me). :-)

Being capable of both is better :)

If you use tile, maybe you can use hardware acceleration, for instance DirectX which has the pretty
feature of sort of "zbuffered sprites", which if implemented properly in hardware can be very easy to
use and fast.

But like said before, line by line allows all raster effects, so we have better emulation.
 
  • Joined: 24 Jun 1999
  • Posts: 1732
  • Location: Paris, France
Reply with quote
Re: BrSMS
Post Posted: Thu Aug 05, 1999 7:18 am
Quote
> What's a checksum? I noticed that Genecyst has this feature and I here that word mentioned a lot in
> emulators.

A checksum is basically a value computed from a piece of data. The goal for that is to be able to generate a completely different, say unique, value for each piece of data. So you can recognize a file by it's checksum.

Quote
> But what you are saying is that Brsms uses a big pre-defined checksum table just so it can properly
> display it's graphics in tile mode? Why? Why would you need a checksum table in the first place?

It's not necessary. In BrSMS, it is used to choose which graphic engine and interrupt handler will be used. BrSMS doesn't seem to have a "generic" emulation but more like a bunch of hacks to get all games working (which isn't a bad idea, but it's unfair on an emulation point of view ;-)
  View user's profile Send private message Visit poster's website
  • Joined: 29 Jun 1999
  • Posts: 68
  • Location: Houston TX
Reply with quote
Re: BrSMS
Post Posted: Thu Aug 05, 1999 9:24 pm
Quote
> mabye 1/4 of a second. Even though I did this experiement in Qbasic, will things be different
> if this same experient were done in a faster language like Assembler or C? It would obvously
> be faster than Qbasic but would there still be a slight speed difference between the line and
> tile based engines? I'm really aiming to the assembly buffs out there to answer this one
> because I would like my emulator graphics engine to be line-based for raster effects and
> stuff.

Line by line position is slower because you have to calculate the position every 8 pixels. This could be sped up considerable by using shifts and adds (in assembly), instead of multiplication. It could also be sped up by drawing 8 lines at a time (assuming 8 x 8 tiles) and just plotting the pixels as

x, x + SCREENWIDTH, x + SCREENWIDTH << 1,...
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!