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.

Beginners > Please explain

#12274 - REE - Wed Nov 05, 2003 11:56 pm

Hello, could some please explain to me exactly, 'what' i can do? I'm really quite lost, and from what i understand, you can code games, that can be played on a GBA emulator?

Is it possible for these games to then be put on an actual GBA cartridge? Like a real game?

Thanks, and any help would be great.

REE

#12275 - tepples - Thu Nov 06, 2003 12:45 am

Everything is explained in the FAQ.

To learn how to run your compiled GBA program on actual hardware (instead of in VisualBoyAdvance), see the "Testing your code" section. The "Miscellaneous" section deals with getting a game published commercially.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#12288 - yaustar - Thu Nov 06, 2003 9:08 pm

The question is rather open ended.
You can do pretty much anything on the GBA if you know how.
_________________
[Blog] [Portfolio]

#12291 - sajiimori - Thu Nov 06, 2003 10:26 pm

Make a port of Doom 3? ;-)

#12292 - yaustar - Thu Nov 06, 2003 10:38 pm

er---erm...hmmm
highly improbable but possible. After all they managed to get half life worknig on a 486 :p
_________________
[Blog] [Portfolio]

#12293 - Daikath - Thu Nov 06, 2003 11:21 pm

yaustar wrote:
er---erm...hmmm
highly improbable but possible. After all they managed to get half life worknig on a 486 :p


Link?!
_________________
?There are no stupid questions but there are a LOT of inquisitive idiots.?

#12294 - sajiimori - Thu Nov 06, 2003 11:29 pm

Half-life running on a 486 is not comparable. The recommended minimum CPU for Half-life was a Pentium 90, whereas 486's ranged from 20 to 133 MHz. Also, most 486 motherboards could handle 32MB RAM, which was also required by the game.

The expected minimum requirements for Doom 3 are a 1 GHz processor and 256 MB RAM, plus dedicated 3D hardware at least as powerful as the GeForce 1. The GBA's CPU runs at 1.5% of that speed (to say nothing of the vast, vast difference in architecture which should bring the figure below 0.1%), meets 0.1% of the memory requirement, and has no 3D hardware whatsoever (putting further pressure on the CPU to emulate it).

If a GBA were modified to hold an appropriate amount of memory, I'd imagine it could run Doom 3 at around a frame per 6 hours. With large sacrifices in quality and masterful hackery, I bet someone could get it up to around a frame per 15 minutes (and that's at 240x160 resolution).

Even then, you would no longer be talking about a real GBA, and you would no longer be talking about the real Doom 3.

#12295 - yaustar - Thu Nov 06, 2003 11:48 pm

Admitally, they had to put the the 486 is the equaliavant of a freezer to keep it stable.

As with doom 3, I was only kidding, just trying the beta killed my machine :(
I expect even some good PC's will have trouble getting it at a decent speed.

it be like running a GC emu on an atari 2600 (anyone remember gcubix?)

I think a port of quake would be more likely but they are having trouble with porting o the GP32 let alone the GBA.
_________________
[Blog] [Portfolio]

#12304 - sajiimori - Fri Nov 07, 2003 6:22 am

Quote:

Admitally, they had to put the the 486 is the equaliavant of a freezer to keep it stable.

The processor would not get any hotter running HL than any other application that used 100% of the CPU time.

Even if you mean they overclocked the processor, it still makes no sense. If an overclocked system can run HL, then the same system can run HL without overclocking -- merely with a lower frame rate. Nothing about overclocking allows a system to run a wider variety of applications.

#12308 - tepples - Fri Nov 07, 2003 5:26 pm

sajiimori wrote:
If an overclocked system can run HL, then the same system can run HL without overclocking -- merely with a lower frame rate

Perhaps the requirements document lists "running Half-Life" to include drawing at least x frames per second. Before you immediately call this a cop-out, consider that an app that crashes within one second has "run" at least the app's first instruction.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#12310 - sajiimori - Fri Nov 07, 2003 8:25 pm

True, but running one instruction and crashing would be a very odd definition of "working". ;-)

At this point I think the discussion degrades to semantics.

#12312 - Gopher - Fri Nov 07, 2003 10:08 pm

so, it seems the answer to the original question is "Anything - except, maybe, port Doom 3, depending on how you define 'working'"
_________________
"Only two things are infinite: the universe, and human stupidity. The first is debatable." -Albert Einstein

#12313 - sajiimori - Fri Nov 07, 2003 10:45 pm

A better answer: You can do anything except all the things you can't.

#12326 - Daikath - Sat Nov 08, 2003 1:30 am

An even better answer"Work hard and all the things are are possible will be possible, even though they were possible."

A velly selious remalk indeed.
_________________
?There are no stupid questions but there are a LOT of inquisitive idiots.?

#12406 - REE - Tue Nov 11, 2003 11:34 pm

Thanks for the help, a few more questions (without making more topics).

I downloaded all the files for the gbadevkit, and I'm following a tutorial found at www.prodigygames.8k.com/articles/gbadftgu.html

I am saving these 'practice/example' files as .c extensions, yet my dev-c++ compiler won't compile them (gba.h not found).

I do not know how to run or compile these files, something obviously to do with the gba header, and so forth...where to i need to move them so the compiler can access them?

And what must I save the files as so i can use them in Visual Boy Advance?

Thanks

#12407 - yaustar - Wed Nov 12, 2003 1:54 am

Since the link does not work, I would reccomend these tutorials for beginners instead.

http://www.gbajunkie.co.uk
http://thepernproject.com

both will have the files you will need as well as step by step instructions.
_________________
[Blog] [Portfolio]

#12409 - tepples - Wed Nov 12, 2003 2:09 am

REE wrote:
I downloaded all the files for the gbadevkit, and I'm following a tutorial found at www.prodigygames.8k.com/articles/gbadftgu.html

I am saving these 'practice/example' files as .c extensions, yet my dev-c++ compiler won't compile them (gba.h not found).

For one thing, you have to configure Dev-C++ to launch DevKit Advance instead of launching MinGW. For another thing, different developers often make their own gba.h files; search the rest of the site for more downloads.

Quote:
I do not know how to run or compile these files, something obviously to do with the gba header, and so forth...where to i need to move them so the compiler can access them?

This is largely a Path issue. I could walk you through it on the command line, but because you're using Dev-C++ instead of the command line, please read Dev-C++ docs to see how to use it with a cross-GCC.

Quote:
And what must I save the files as so i can use them in Visual Boy Advance?

VBA can run .elf files, .gba files, and .mb files. GBA hardware can run .gba files and .mb files.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#12411 - IAMTHEEVILBEAN - Wed Nov 12, 2003 2:17 am

About that setting up gcc for dev kit......

I had it before but got a new computer and need a link to that info again please
_________________
Moose

#12412 - tepples - Wed Nov 12, 2003 2:49 am

Did you look for a devkitadv FAQ?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#12413 - REE - Wed Nov 12, 2003 3:08 am

Well i must be a total idiot, becuase i can't figure out a dang thing. I have no idea how to switch this crap or whatever, and all i know is that i can't get files i'm writing with gba headers to compile in dev c++.

To bad the GBAcc isn't for dl anymore.

Oh well, thanks anyways, i guess i'll just forget the gameboy programming.

#12414 - yaustar - Wed Nov 12, 2003 3:10 am

The search buton is a wonderful thing ;)

http://forum.gbadev.org/viewtopic.php?t=1736&highlight=dev+cpp+setup

edit: if you want to, I can either A) talk to you on MSN/yahoo messenger and take you through all the steps or B) make an AVI that steps through everything to get setup.
_________________
[Blog] [Portfolio]


Last edited by yaustar on Wed Nov 12, 2003 3:14 am; edited 1 time in total

#12415 - tepples - Wed Nov 12, 2003 3:10 am

Do you have the GBA headers? They do not come with DevKit Advance. Here's one.

Are you afraid of the command line?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#12416 - IAMTHEEVILBEAN - Wed Nov 12, 2003 3:28 am

THANK YOU yaustar! thats the topic I was looking for

you are a god

but not really

thanks
_________________
Moose

#12417 - REE - Wed Nov 12, 2003 3:38 am

Yes i had the GBA header..., I followed the other thread, and I'm almost sure i switched everything over right...now i can compile the files, but when I try to run them, it says "Source can not be compiled"

Something obviously still isn't right....

but thanks for the help...it's been great...

And no, i'm not afraid of the command line at all.

#12418 - yaustar - Wed Nov 12, 2003 3:40 am

have you edited the output to a .elf file rather then an .exe one?
_________________
[Blog] [Portfolio]

#12419 - IAMTHEEVILBEAN - Wed Nov 12, 2003 3:42 am

How do you do that
_________________
Moose

#12420 - yaustar - Wed Nov 12, 2003 3:45 am

Alt+P
Build options
override output (read link to thread above) (.elf)

REE: try getting a example from http://www.gbajunkie.co.uk and just excuteing the make.bat file to see if that works (edit it so it has a 'pause' at the end and is pointing to the right directory)
_________________
[Blog] [Portfolio]


Last edited by yaustar on Wed Nov 12, 2003 3:49 am; edited 1 time in total

#12421 - IAMTHEEVILBEAN - Wed Nov 12, 2003 3:49 am

Yeah I did but......

Alt-p

then what tab is that under

there are a bunch of output things and I dont want to fuck anything up
_________________
Moose

#12422 - yaustar - Wed Nov 12, 2003 3:50 am

yaustar wrote:

Build options


ahem
_________________
[Blog] [Portfolio]

#12423 - yaustar - Wed Nov 12, 2003 3:51 am

REE: email me your project and I see if it is a complar setup problem of a coding/structure problem.

yaustar_8p@yahoo.co.uk
_________________
[Blog] [Portfolio]

#12446 - REE - Fri Nov 14, 2003 4:05 am

Ok, thanks to ya'll, i finally got these programs working! It was a combination of the .elf extension, devkit compiler set up, and putting headers in the right locations...i bascially started from scratch.

Thanks alot guys.

Now, i'm hacking my way through, The Pern Project, tutorial...which reminds me, does anyone have a place i can download the 'conio.h' header?

Thanks for everything.

REE

#12450 - yaustar - Fri Nov 14, 2003 1:01 pm

Glad you are getting on :)
What do you need conio.h for, I have only used it for getch()
_________________
[Blog] [Portfolio]

#12451 - tepples - Fri Nov 14, 2003 2:03 pm

Conio.h is a header from Borland C++ for DOS that lets programs use PC BIOS functions to read from the keyboard and write to the screen. Headers, in general, don't work right unless there's a supporting library behind them.

However, it'd be straightforward to reimplement the conio library in terms of the GBA's 30-column text mode. My AGBTTY package implements the output half of what you're looking for. I still haven't implemented a 'getch()' that passes along the PC BIOS codes for the arrow keys, L, R, B, A, Tab, and Enter.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#12536 - REE - Mon Nov 17, 2003 5:16 am

Meh.

Images and what not really aren't going well for me?

Code:
#include "gba.h"
#include "screenmode.h"
#include "imagetest.h"

u16*theVideoBuffer=(u16*)VideoBuffer;
u16*theScreenPalette=(u16*)BGPaletteMem;
#define RGB(r,g,b)(r+(g<<5)+(b<<10))

int main()
{
    SetMode(MODE_4|BG2_ENABLE);
   
    u16 i;
    for (i=0; i<256; i++)
        theScreenPalette[i]=imagetestPalette[i];
       
    u16* tempData=(u16*)imagetest;
   
    u16 x, y;
    for (x=0; x<120; x++)
        for (y=0; y<160; y++)
               theVideoBuffer[y*120+x]=tempData[y*120+x];
               
        return 0;
}


Now, correct me if i'm wrong, but that code should work as long as imagetest.h is correct, right?

Well, i try to compile that, and it never finishes compiling, i have to cancel, and then my 'log' shows a neverending sequence of:
[Warning]: initiliazation
[Warning]: argument

So i really don't know what i'm doing wrong, more than likely, something to do with how i converted the imagetest from a bmp to a .h....

But i can't put my finger on it.

And then i was wondering if anyone could give a simple step by step tutorial on how to put a self created backround image up.

If it isn't to much of a hassle.

Thanks,
REE

#12542 - yaustar - Mon Nov 17, 2003 2:14 pm

Code:

#include "gba.h"
#include "screenmode.h"
#include "imagetest.h"

int main()
{
    SetMode(MODE_4|BG2_ENABLE);
   
    u16 i;
    for (i=0; i<256; i++)
    {
        BGPaletteMem[i]=imagetestPalette[i];
    }       
    u16 x, y;
    while(1)
    {     
         for (y=0; y<240; y++)
         {
             for (x=0; x<160; x++)
             {
                   VideoBuffer[y*120+x]=imagetestData[y*120+x];
             }
         }
    }
               
    return 0;
}

The only other thing that *could* be wrong is that you have used the wrong tool to convert the picture but this shouldn't bring up compilar problems ( i reccommend pcx2gba)

gbajunkie's (sorry but I love this guys tutorials) chapter 3 will help as well
_________________
[Blog] [Portfolio]

#12559 - REE - Mon Nov 17, 2003 9:55 pm

yaustar wrote:

The only other thing that *could* be wrong is that you have used the wrong tool to convert the picture but this shouldn't bring up compilar problems ( i reccommend pcx2gba)

gbajunkie's (sorry but I love this guys tutorials) chapter 3 will help as well


Well, i have both the tutorial and program, but pcx2gba runs in dos....and it won't work when i try to double click it...

#12560 - tepples - Mon Nov 17, 2003 10:22 pm

REE wrote:
but pcx2gba runs in dos....and it won't work when i try to double click it...

Are you sure it runs in DOS? Many so-called "DOS programs" are actually Windows command line apps, designed to be run from the Windows command prompt (Start > Programs > Command Prompt or Start > Programs > Accessories > Command Prompt, and in some Windows versions, Command Prompt is called MS-DOS Prompt) or from a batch file or makefile.

The Windows command prompt is based on that of MS-DOS, and its principles of operation haven't changed since MS-DOS 2.0 in the early 1980s. If you have never used the Windows command prompt before, please read a DOS tutorial.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#12566 - yaustar - Tue Nov 18, 2003 1:32 am

pcx->gba is a command line tool (actually pretty much ALL the tools that look like dos and commandline base) The readme should provide the neccassary info for it. For Dovoto's you can click and drag the pcx file onto the exe and it converts it for you.
_________________
[Blog] [Portfolio]

#12568 - REE - Tue Nov 18, 2003 2:47 am

Blah. I'm moving in baby steps, but at least i'm moving?

I converted the image from pcx to a c header, and it created a header with palette and data info.

Doesn't reconize my header when i compile. I get error: {no new line at end of function]

or something along those lines....

so fustarating.

#12570 - yaustar - Tue Nov 18, 2003 4:21 am

the gcc compliar is a pain with that, each file you use MUST have a blank line at the bottom. Just push return twice at the bottom of the file ;)
_________________
[Blog] [Portfolio]

#12695 - REE - Sun Nov 23, 2003 3:38 am

Hey guys.

Hmmm...

I have been able to get a backround on the screen using gbajunkie's tutorial, and now i have back tracked to getting a plain image displayed on the screen.

My code is correct, the problem seems to lie in the graphics converter or some where along those lines. I seem to be losing my spriteData element, while maintaining the spritePalette (to the best of my knowledge).

I'm attempting to draw the sprite in Paint -- save as 256 bitmap, opening the image up in another imaging program, converting and saving as a .pcx, and then converting to the gba header file.

When this is done, my gba header file consists of 'perculier' Data info, either a full set of black code or white code.

I think the problem either lies with how i'm orginally making the sprite (any tips?) or how i'm converting it.

Any help would be appreiciated.

Thanks

#12700 - yaustar - Sun Nov 23, 2003 2:56 pm

Are we trying to convert a background image or a sprite image here (and what mode on the GBA?)

Again email me the image and see what I can do for you...
_________________
[Blog] [Portfolio]