gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > Slow Zoom ?

#1584 - TrisOver - Mon Jan 20, 2003 3:28 pm

I want to display tiles of 6x6 pixels at screen (but classic 8x8pixels in VRAM), cause I must use Tiles Mode but I must display 26 tiles vertically (26x6=156<=160 / 26x8=208>160)

If I use a zoom (fixed zoom 75%) to display them in a "background Rotation", will display be slower ? a little bit / a lot ?

With my emulator, I don't see any difference cause my code don't have yet a lot of work ... but I want to add game engine with animations and sounds/music later.

#1606 - tepples - Mon Jan 20, 2003 6:26 pm

TrisOver wrote:
I want to display tiles of 6x6 pixels at screen (but classic 8x8pixels in VRAM), cause I must use Tiles Mode but I must display 26 tiles vertically (26x6=156<=160 / 26x8=208>160)

Can you do a 30x26 tile screen? Or do you need 40x26? If you can get away with 30x26, you can add 2 to the Y scroll register every 6 lines.

Quote:
If I use a zoom (fixed zoom 75%) to display them in a "background Rotation", will display be slower ? a little bit / a lot ?

Using the hardware zoom (mode 2) won't be much slower, but 1. you will have to use 256-color tiles, 2. you'll only be able to use 256 of them on one background, 3. you'll always have to write two tiles at once to the map (no byte writes to VRAM), and 4. you'll only be able to use two background layers.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#1666 - TrisOver - Tue Jan 21, 2003 9:41 am

But your method to display 8x6 is very interesting. I'm new on GBA and I didn't think about this kind of way (change background x every line !). Perhaps I use this way another time

#1668 - Scritch - Tue Jan 21, 2003 10:45 am

I did not think of it too. Good idea to modify Y position, as the GBA GPU works line by line...
For TrisOver: The easiest to do this is of course to use HBL Interrupt. Your code is then called at each end of line. For people used to work on other hardware it is quite rare to do modification during H-Blank, but with GBA it is a lot used, for example for mode7-like effects...

#1670 - Scritch - Tue Jan 21, 2003 11:42 am

In fact, the better is maybe to the the V-Count interrupt:
V-Count: Occurs when the vcount reaches the number specified in REG_DISPSTAT.

#1676 - Splam - Tue Jan 21, 2003 3:25 pm

Vcount interrupt will slow everything down too much if you use it on every like (same thing as doing it with Hblank). DMA is the fastest way to change something on every line, just use a premade table for your screen positions.

My c64 emu was going to use this method to scale the screen (tiles) as the c64 is basically a tile based system, but I found it's actually faster if you can optimise your code enought to scale it in software because in a worst case (whole screen is changed) you're actually drawing a hell of a lot less data to vram, besides c64 uses a lot of line based raster techniques so I pretty much have to draw each line instead of tiles.

#1715 - tepples - Tue Jan 21, 2003 10:12 pm

TrisOver wrote:
But your method to display 8x6 is very interesting.

Columns Crown and Puyo Pop, both by Sega, use nearly the same method to decrease the number of lines per tile in mode 0. Puyo Pop also uses a slick trick to get 12x12 pixel tiles: put tiles in odd columns in one layer and tiles in even columns in another layer, and offset the odd columns' layer by 12 pixels in the X direction.

(EDIT: a slight clarification to what I meant by "offset the odd columns by 12 pixels").
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#1716 - ampz - Tue Jan 21, 2003 10:24 pm

Hmm, that will only give you something like 12*8. Not sure what the benefit would be either.

#1717 - tepples - Tue Jan 21, 2003 10:28 pm

ampz wrote:
Hmm, that will only give you something like 12*8

If you combine the 12-wide trick with the 6-high trick you get 12x6, or 12x12 as stacked.

Quote:
Not sure what the benefit would be either.

It'd be useful for fitting a puzzle game's fixed-size playfield fully on the screen without having to shrink playfield cells to 8x8 pixels (eyestrain!).
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.