Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1] 2   Go Down

Author Topic: Porting games to GBA  (Read 5454 times)

0 Members and 1 Guest are viewing this topic.

Hyperhal

Certified DSL Owner
Porting games to GBA
« on: April 07, 2006, 02:24:29 am »
  • Rock Howard
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 163
I wanted to know how hard it would be to port something from PC to GBA. Could you just write a C++/C program, then use a GBA compiler? Is there a certain language you need to work with?

Obviously you couldn't use things like DirectX for a GBA game, but are there replacements that give effects similar to that of DX? Or is it that when your working with the GBA, there are more commands at your fingertips.

I also know that It'd be pretty useless to do this if your game was 500MB+, so you don't need to explain that part >_>
Logged
I guess I should start visiting this website again. ._.

Limey

Re: Porting games to GBA
« Reply #1 on: April 07, 2006, 02:28:06 am »
I'm pretty sure you can code GBA games with a slightly modified version of C++, though I'm not sure what and what can't be included.  And I'm terrible at all coding languages, so dont really trust me XD
Logged
Re: Porting games to GBA
« Reply #2 on: April 07, 2006, 03:12:03 am »
  • The hero of Link
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 112
not shure, but I bet if you can get around all the spam the nintendo forums would work.
Logged
  • A.D. Zelda

pxl_moon (dotyue)

Team Dekunutz
Re: Porting games to GBA
« Reply #3 on: April 07, 2006, 10:20:53 am »
  • .越//
  • *
  • Reputation: +5/-1
  • Offline Offline
  • Gender: Male
  • Posts: 2280
you should search over google for gba development and/or tutorials for the beginning...
Logged

~~Resources~~
~Minish Cap Style~

Minish Cap Beta:Firerod Icon, Majoras Mask:ChuChu, Ocarina of Time:Gossip Stone, Oracle Series:Link plays the "Herpes of Ages", Impa, Wand Maker: HUD
~GB-Zelda Style~
Ocarina of Time: Deku Caca
~Other~
Paper Mario Style Zelda&Link, Tetra Trackers HUD-Cleanups

Re: Porting games to GBA
« Reply #4 on: April 07, 2006, 10:54:36 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 2245
it really depends if you planned to port it to the gba in the first place keeping in with all its restrictions and whatnot
most developers i believe keep there platform dependent coding (graphics, input, sound etc.) separate from the rest of it so they are able to port things more easily since they don't have to deal with the games coding
Logged

Ben

Re: Porting games to GBA
« Reply #5 on: April 07, 2006, 11:07:16 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 437
Well it's intresting to say the least, porting. I've yet to find a library for C++ that can just simply draw bitmaps on the GBAs screen, because if it could I'd be away :D.
Logged
Want a place to upload your sprites and games for FREE? Look no further than GameDevotion
Re: Porting games to GBA
« Reply #6 on: April 07, 2006, 11:29:58 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 2245
i'm guessing it might be because of the overhead, usually when you try to simplify things too much it creates a lot more work from the backend side of things and with the gba you just can't have that, i draw 2 sprites and have them randomly move around and you are even able to notice the slowdown of that because my code was unoptimized
Logged

Ben

Re: Porting games to GBA
« Reply #7 on: April 07, 2006, 12:17:25 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 437
Well it's just like Ham uses objects, which you have to move, but they are nothing like GM objects, it's weird.
Logged
Want a place to upload your sprites and games for FREE? Look no further than GameDevotion
Re: Porting games to GBA
« Reply #8 on: April 08, 2006, 07:44:30 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 150
Programming for the GBA is much easier than programming for Win32/DirectX, because you don't have to deal with libraries and surfaces et cetra. You have direct, unquestioned access to the bare hardware: if you want to draw a pixel, all you have to do is write the color to a specific spot in memory that never changes.

On the other hand, on the GBA, you only have 16.8mhz to play with. That gives you only 300k clock cycles per frame (the GBA runs at 60fps, you can't change this, although you could only update the display every second frame, thus 30fps and 600k clock cycles per frame). Mind you, the ARM7 is a beautiful little processor that is more efficient clock-for-clock than a Pentium, but still, you don't have a lot of procesing power which limits what you can't do. You can't reasonably expect to program a 3D game for the GBA; there simply isn't enough power to do it (some professional teams have managed this feat, but they had teams of programmers with years of experience optimizing for the gameboy).

However, you *can* do quality sprite-based 2D games, working with the hardware to give you some great effects. Hardware transparency/alpha blending that doesn't incur a performance hit of any sort? You betcha. =)

Here's a demo of a concept program I did a year and a half ago: http://home.comcast.net/~mithrandel/misc/output.gba. This was actually one of the first real programs that I did in C++ - all of my C++ programming up to the point was limited to math and array dll's. If you think you want to get started with GBA developement, give me the word, and I'll help you get set up with a compiler and all the documentation you'll need to access the display and sound registers and whatnot. =)
« Last Edit: April 08, 2006, 07:47:32 am by FarFromHomeFish »
Logged

Ben

Re: Porting games to GBA
« Reply #9 on: April 08, 2006, 01:35:47 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 437
....
But surfaces are useful :(.
How are you supposed to do destructable terrain without them?

60fps is a little bit of overkill to be honest, 30fps is what most GM games run at anyway.
I'd certainly like to learn to programme for the GBA (even if it is on it's way out), just don't say there's not an equivalent to a surface.
Anyway computer processors are completely different to console ones, in console ones you actually use the entire processor, rather than stupid computer ones where windows is hogging everything and there's practically no visual difference between an AMD 3400+ and a 2200+...
Logged
Want a place to upload your sprites and games for FREE? Look no further than GameDevotion
Re: Porting games to GBA
« Reply #10 on: April 08, 2006, 09:42:56 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 150
Quote
...just don't say there's not an equivalent to a surface.
Since you have direct access to the hardware with the GBA, there's no need to have surface classes (more commonly known as 'textures' when you're working with 3D rendering). You have to create your own surface classes if you want to encapsulate variables with the bitmap data.

If you're talking about surfaces in the mathmatical sense (see wikipedia: http://en.wikipedia.org/wiki/Surface), unfortunately, the GBA doesn't have the power to transform surfaces in real-time because it has a relatively slow processor. You're not going to be able to deform 3D terrain with only 16.8mhz; although you *could* display an explosion sprite instead of cratering the area where an explosion occured. A 64x64 explosion sprite wouldn't cost you more than a few clock cycles to display. If you want to transform and light surfaces on a handheld, you would be better off programming for the PSP =)

An important thing to realize about the GBA is that as long as you draw the kinds of sprites that the GBA was designed to draw, all your drawing operations are nearly free. By comparison, with computer graphics (such as directdraw), you need to copymem32 every pixel that you want to be displayed to the screen, which costs you a ton of clock cycles. Similarly, you can do 4 layers of parallax (sonic on the sega genesis could only do two or three, I think) with no performance penalty! That's absolutely awesome!

To get a handle on what the GBA is designed to do, and what it realistically can't do, take a look at the CowBite Virtual Hardware Specification, located here: http://www.cs.rit.edu/~tjh8300/CowBite/CowBiteSpec.htm. When I was considering programming on the GBA, I built my own compiler suite based on GBADevAdv (mine gives you a little more leeway when optimizing than the default build; my builds are a few kb bigger, but they can compile code with the -O3 (maximum optimizations switch) that the default compiler would error out on). Unfortunately, I don't have that compiler on my current computer, I'll need to retrieve it off of an external hard drive. If people on ZFGC have interest programming, I'll post it here. =)
Logged
Re: Porting games to GBA
« Reply #11 on: April 09, 2006, 12:46:12 am »
  • Wooper Don't Give a !@#$%
  • *
  • Reputation: +16/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1457
Wow FarFromHomeFish... You really know what you're talking about.

While you're in this topic, I have a quick question. With PC programming (DirectX specifically), what's better to use? DirectDraw, or Direct3D 9 with textured quads? I'm a little slow with learning the really complex computer stuff, so I'd like to know which would be better for making a 2D game in...
Logged
ROLL TIDE WHAT? **** YOU!!! Geaux Tiga

~The Gaurdians of ZFGC~
Kirby, metallica48423, Max, Vash, walnut100
  • Gamers & Developers Unlimited

gm112

Re: Porting games to GBA
« Reply #12 on: April 09, 2006, 01:58:50 am »
open gl is the best
Logged
Re: Porting games to GBA
« Reply #13 on: April 09, 2006, 02:13:05 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 150
DirectDraw7 is much simpler to implement than DirectXGraphics9, and will run faster (reason being that all you're doing with directdraw is copying pixels in your source surfaces (i.e., your sprites and tiles) to your destination surface (the backbuffer). However, with directdraw7, you lose the ability to use hardware to easily rotate sprites, and you can't do hardware transparency - translucency (alpha mapped surfaces) are just about out of the question. You can't do paletted sprites either...

...of course, you can still do all these things in software - Diablo 2 does all its transparency, translucency, and palettes in software at runtime. And it's plenty speedy - my friend ran D2 just fine on his 233mhz P2.

So, take your pick: DirectDraw is easier to implement and faster, but DirectXGraphics allows you to use awesome sparkly effects.
Logged
Re: Porting games to GBA
« Reply #14 on: April 09, 2006, 02:22:41 am »
  • Wooper Don't Give a !@#$%
  • *
  • Reputation: +16/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1457
Ok thanks. I guess I'll be studying Direct3D 9 :P
Logged
ROLL TIDE WHAT? **** YOU!!! Geaux Tiga

~The Gaurdians of ZFGC~
Kirby, metallica48423, Max, Vash, walnut100
  • Gamers & Developers Unlimited

Ben

Re: Porting games to GBA
« Reply #15 on: April 09, 2006, 10:26:02 am »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Posts: 437
Oh right so I'll just have to create my own "surfaces".
I didn't mean like to manipulate though, I meant just so I could say double buffer, instead of blitting to the screen constantly you blit to the buffer then at the end of the step to the screen.
I didn't mean like rotation stuff :).

Anyway, if you know a way to simply just draw to the screen please post it :)
Logged
Want a place to upload your sprites and games for FREE? Look no further than GameDevotion

WIP

Re: Porting games to GBA
« Reply #16 on: April 09, 2006, 03:35:50 pm »
open gl is the best
GL is gay in quite a few ways. Render to texture, anyone?
Logged
Re: Porting games to GBA
« Reply #17 on: April 09, 2006, 03:38:33 pm »
  • Wooper Don't Give a !@#$%
  • *
  • Reputation: +16/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1457
open gl is the best

Wow, I didn't even see this post. Anyway, you don't know what you're talking about. I asked specifically for 2D games, and OpenGL's the worst API available for 2D games. I've done my research on this...
Logged
ROLL TIDE WHAT? **** YOU!!! Geaux Tiga

~The Gaurdians of ZFGC~
Kirby, metallica48423, Max, Vash, walnut100
  • Gamers & Developers Unlimited
Re: Porting games to GBA
« Reply #18 on: April 09, 2006, 04:08:21 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 150
Quote
Anyway, if you know a way to simply just draw to the screen please post it

The GBA has 6 'modes' you can use while drawing to the screen. Look at sections 4, 5, and 6 in the CowBite spec, and that'll tell you all about drawing on the GBA. Come to think of it, read through the entire CowBite spec. Memorize it. Print it out and keep it on your bedside table. =)

In short, in modes 0, 1, and 2, you draw sprites by putting the sprite picture in memory, and then you have to *tell* the gba that that you want a sprite on screen by setting the appropriate registers in the OAM (if you just went ???, don't worry, it all makes sense after you've read through CowBite). You can't simply 'draw' to the screen in these modes. You're limited to 128 sprites per frame, of which 32 can be scaled and rotated (I'm almost positive I'm right on those numbers, but it's been over a year since I've worked wit h the GBA; I may be off).

Then there's modes 3, 4, and 5. In these modes, you can draw directly to the screen, but you'll you have work with the limitations of the GBA. You'll have to handle your own transparency when you draw to the screen, since the GBA will only do transparency for you if you're drawing sprites with the OAM. Since the GBA doesn't have enough video ram to double buffer at full-size in 16bit mode, you're either to have to draw in 8bit (which presents its own problem, since the port size to VRAM is 16bit only, which means that if you want to draw a single pixel, you'll have to read the 16bits out of memory (two pixels), AND the old pixel out and OR the new pixel in, and then write the 16bits back to VRAM. Which is slow.

What I'm trying to do here is to gently nudge you in the direction of using modes 0, 1, and 2, because in those modes you're going to be using all the 2D abilities of the GBA to its fullest (the GBA is one of the most amazing 2D consoles out there when you use its built-in sprite rendering hardware through the OAM). You won't have direct access to the backbuffer in these modes, but you will be able to draw 128 sprites per frame, with no slowdown whatsoever. And that's pretty darn fast. =)

I found my compiler at last, and I'm going to be posting it to this forum once I put together a simple example project which will give you an idea of how to create programs for the GBA.
« Last Edit: April 09, 2006, 04:11:22 pm by FarFromHomeFish »
Logged

Hyperhal

Certified DSL Owner
Re: Porting games to GBA
« Reply #19 on: April 11, 2006, 04:03:57 am »
  • Rock Howard
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 163
Thanks for all the info. I just really didn't know *anything* about GBA programming, or anything around that field. This is given me something to live off of now, and the future GBA programmers'll be thankful for this info too.

Sounds hard but looks easy o.o
Logged
I guess I should start visiting this website again. ._.
Pages: [1] 2   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.055 seconds with 78 queries.

anything