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.

Graphics > Mode 3 or Mode 4?

#17234 - josath - Thu Mar 04, 2004 6:41 pm

I'm porting a very simple dos game to gba using mode 4, and i'm running in to some trouble with it, because it will only let me write 2 pixels at once. So, my question is,

-Should I stick with mode 4, and for each pixel, read the 2 pixels from vram, modify one, and then write it back to vram,
-or should I switch over to mode 3, and be able to write one pixel at a time?

Number of colors is not an issue, it's a CGA game (ie, 4 colors only).
Eventually, I will probably rewrite it to take advantage of the GBA's graphics hardware (sprites, bg scrolling, etc), but I want to see if I can get it up and running with more of a direct port first.

(in case anyone's interested, the game is called Sopwith, and I'm using this codebase here: http://sdl-sopwith.sf.net/

a screenshot of what i've done so far:
http://rorex.isa-geek.net/sopwith.png

a screenshot from the actual game i'm trying to port:
http://rorex.isa-geek.net/sopwith2.png

notice how the pixels are doubled in mine.

thanks!

EDIT:
Here's the game if you want to try it out, I have the input working enough to play now (read the included README.txt)
http://rorex.isa-geek.net/sopwith.zip

#17236 - sajiimori - Thu Mar 04, 2004 7:51 pm

Since you're not concerned about speed yet, just read 2, modify, and write 2. If it turns out to be fast enough, great, and if not you can think about sprites. Also, you could try to rearrange the code so that it always writes 2 pixels, which is easy if you're already drawing rows of pixels at a time.

#17238 - Lupin - Thu Mar 04, 2004 8:08 pm

i have the same problem... but in my case it's not about speed or colors, it is about registers :)

I have a voxel renderer that always renders 2 columns, but I also need as twice as much registers as i need for rendering 1 column and that's why i have to use stack operations (i am pushing/poping to the stack in a loop which is definately bad for speed). But if i would use mode3 i would have no backbuffer, though at the current state my rom works just fine without one i would perhaps need one if i add more stuff to it.

#17240 - tepples - Thu Mar 04, 2004 8:24 pm

If you use rotated/stretched mode 5, you will have your back buffer and your word-sized pixels, but you will drop down to 120x160, but you will probably also double your frame rate.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#17241 - josath - Thu Mar 04, 2004 9:51 pm

yay! I got it working! (except for 1 or two minor cosmetic things)

see screenshots and play it here:

http://rorex.isa-geek.net/sopwith/

#17246 - Lupin - Thu Mar 04, 2004 11:59 pm

nice port! I will test it on my gba :)

tepples, i also thought about that, but i want to write something special that's not like all the other voxel renderers ;P

I really want full resolution because it looks way better.

Did you play V-Rally3? It has fullscreen 3D gfx, that's way better than these mode 5 3D gfx engines (though it has less detail of course)! I really wonder how they got full 3D work in full resolution...

#17263 - sajiimori - Fri Mar 05, 2004 5:56 am

How cute!! I love it. :D

#17265 - headspin - Fri Mar 05, 2004 9:18 am

Used to play this game in highschool, nice port!

#17277 - josath - Fri Mar 05, 2004 4:02 pm

a question: is 'news@gbadev.org' the correct address to get your demo posted on the front page? i sent in something more than a week ago and it never got posted

EDIT: Never mind, they just posted them =P