#4652 - Saj - Sun Apr 06, 2003 11:18 am
Is it possible to get some 'sticky' posts that stay at the top of every topic.
Quote: |
I am new and would love to make gba games but just needs to know were to start. Like graphic's , sound , c++ , any thing plezz just tell me were I need to start . any link's or something...
|
As Gba programming is becoming increasingly popular, the forum seems to be getting flooded with these types of questions and it would make the forum a lot cleaner if it wasn't cluttered with millions of trivial posts.
I agree that people should read the previous posts before posting these types of questions but they don't.
So if you could please make some 'STICKY' posts (this may require a new phpBB hack but a lot of other forums have them) and do some 'spring cleaning', the forums would be easier for everyone (amateurs and experts).
_________________
---------------------------------------------------
Click here to give free food to starving animals.
--------------------------------------------------
Last edited by Saj on Sun Apr 06, 2003 7:52 pm; edited 1 time in total
#4654 - Sweex - Sun Apr 06, 2003 1:21 pm
Sounds like a good idea to me. In addition to that, it might be a good idea to have a FAQ as well?
#4658 - tepples - Sun Apr 06, 2003 4:26 pm
Sweex wrote: |
it might be a good idea to have a FAQ as well? |
I've been working on a FAQ. Any suggestions?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#4663 - sgeos - Sun Apr 06, 2003 5:22 pm
[quote="tepples"]I've been working on [url=http://forum.gbadev.org/viewtopic.php?t=418]a FAQ[/url]. Any suggestions?[/quote]
Q. I'm new, where should I start.
A. Start by learning a programming language of your choice. C and C++ and portable and good to start with. Make some *text based non-gba* programs first to get the hang of the langauge and programming in general. This way you won't create a borken program due to something you don't know about the gba. *Next*, read the hardware details about what the gba can do, *then* start writing programs for it. You'll know you are creating really nice code when you can get it to run in a text based program *and* on the gba. I suggest the curses API for making really nice looking text programs. Again, before you start making really nice looking text programs, make some basic ones that use only the standard library.
-Brendan
#4666 - niltsair - Sun Apr 06, 2003 5:54 pm
Q: How can i create savegame in my demo/game.
It's rather trivial when you know it, but untill you do it's hard to find it. So it ocld be a good thign to write it down.
#4667 - Lord Graga - Sun Apr 06, 2003 6:28 pm
niltsair wrote: |
Q: How can i create savegame in my demo/game. |
You could use these simple functions:
Code: |
#define SRAM 0x0E000000 //32k SRAM = 0x0e000000 - 0x0e00ffff
void SaveByte(u16 offset, u8 value)
{ *(u8*)(SRAM + offset) = value; }
void SaveString(u16 offset, char *string)
{ u16 i;
for(i = 0; i < 32768; i++)
{ if(string[i] == NULL)
{
break;
}
*(u8*)(SRAM + offset + i) = string[i];
}
}
void SaveInt(u16 offset, u16 value)
{ u8 hiByte, lowByte;
hiByte = value>>8;
lowByte = (value<<8)>>8;
*(u8*)(SRAM + offset) = hiByte;
*(u8*)(SRAM + offset + 1) = lowByte;
}
u8 LoadByte(u16 offset)
{ return *(u8*)(SRAM + offset); }
int LoadInt(u16 offset)
{ u8 hiByte, lowByte;
hiByte = *(u8*)(SRAM + offset);
lowByte = *(u8*)(SRAM + offset + 1);
return ((hiByte<<8) | lowByte);
}
void LoadString(u16 offset, u16 length, char *string)
{ u16 i;
for(i = 0; i != length; i++)
string[i] = *(u8*)(SRAM + offset + i);
} |
#4669 - niltsair - Sun Apr 06, 2003 6:54 pm
I know how to do it :-)
I just thought it should be on the faq page.
#4673 - tepples - Sun Apr 06, 2003 8:30 pm
Thanks sgeos and Lord Graga for the suggestions.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#4674 - sgeos - Sun Apr 06, 2003 8:46 pm
Lord Graga uses complicated save/load functions. These are mine:
void save(unsigned char *data, int length, int offset)
{
int ctr;
for (ctr = 0; ctr < length; ctr++)
*(unsigned char *)(0x0E000000 + offset + ctr) = data[ctr];
}
void load(unsigned char *data, int length, int offset)
{
int ctr;
for (ctr = 0; ctr < length; ctr++)
data[ctr] = *(unsigned char *)(0x0E000000 + offset + ctr);
}
Usage. This ought to work, although I usually calculate sizeof myslef:
unsigned long data[32];
save((unsigned char *)&data[0], sizeof(data), 0);
load((unsigned char *)&data[0], sizeof(data), 0);
I think the short answer for save load is- read from or write to 0x0E000000 one character at a time.
-Brendan
#4680 - niltsair - Sun Apr 06, 2003 10:29 pm
Like someone mentionned in another post, a Beginner Forum would be a big help, reducing the number of recuring questions. And include in it tepples's Faq.
#4689 - tepples - Mon Apr 07, 2003 3:08 am
Sorry, Lord Graga. I find the method suggested by sgeos (make a struct, then use a byte-at-a-time memcpy() to put it in SRAM) quite a bit simpler and more logical. A variation on sgeos's method, tweaked and refactored a bit to fit in with the rest of the C standard library, is now in my unofficial FAQ.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#4692 - sgeos - Mon Apr 07, 2003 4:03 am
[quote="tepples"]I find the method suggested by sgeos (make a struct, then use a byte-at-a-time memcpy() to put it in SRAM) quite a bit simpler and more logical.[/quote]
I just used an array and a for loop, not a struct or memcpy(). At any rate, whatever works.
-Brendan
#4703 - niltsair - Mon Apr 07, 2003 10:10 am
Another common problem you might mention :
Why is the display of my first demo all weird?
-Video memory must be written 16 or 32 bits a time. (not 8bits)
-In text mode, Tiles and Map use the same address space. If you're both copying them in the same area, you'll overwrite your datas.
----Copy your Tiles at Position 0(and up)
----Copy your Maps at position 31 and (and down)
Technicalities
-There's 1024 Tile's positions. (0-1023)
-There's 32 Map's Positions. (0-31)
-For each Map in video memory, you lose 32 Tile's positions
#4708 - sgeos - Mon Apr 07, 2003 3:27 pm
Q. I followed the tutorial and just wrote my first GBA program! After compiling it the screen is all white? Why isn't it working?
A. Did you use objcpoy? objcopy -v -O binary file.elf file.bin
I remember when I asked that question a long, long time ago. =P Not sure it as relevant now, but I figured I bring it up.
-Brendan
#4864 - Daikath - Sun Apr 13, 2003 1:31 pm
Q: I have tried everything but I cannot make my sprite animate or move
A: Have you made the REG_VCOUNT a volatile pointer?
Was stuck on that for almost a month I think.
_________________
?There are no stupid questions but there are a LOT of inquisitive idiots.?
#4873 - jenswa - Sun Apr 13, 2003 7:50 pm
Hmm reading this post, i see all kind of errors,
which i haven't experienced, like that 16 and 32 bits at a time.
But i think a gba beginner forum is a good idea.
So i can ask real simple stuff, like i always do.
Isn't it an idea to explain the u8, s16, volatile stuff maybe?
_________________
It seems this wasn't lost after all.
#4890 - MayFly - Mon Apr 14, 2003 5:06 am
I humbly propose that a Novice (I am not a great fan of the term newbie) and a FAQ forum should be created.
These two forums should be located in the ?News? portion of the forum index. They would be the first forums folks would see. People who ask relatively basic questions in other forums should be kindly directed to the new forums. No forum should be allowed with the title ?Please help?, or ?Newbie question?? or titles along these lines.
I would eventually like to see various FAQs, each one dealing with specific areas of the GBA (i.e. development enviornment, graphics, sounds, etc).
Note to self (and others): should help/contribute to such cause? perhaps we should use Tepples' FAQ as a baseline.
MayFly
#4921 - SimonB - Tue Apr 15, 2003 12:11 am
a "Beginners" forum has been created. tepples FAQ was moved there (hope thats ok tepples!).
Also, a "Retailers Feedback" forum was created where people can leave comments on different gba dev hardware retailers.
erm and yes....hopefully the mysql problems will be gone soon heh. sorry about that :)
/Simon
#4924 - sgeos - Tue Apr 15, 2003 1:27 am
Just a thought- you might want a beginners' coding and a beginners' gba forum. Coding for the people who just started programming 3 days ago, and gba for those who just started mucking with the gba 3 days ago.
-Brendan
#4925 - SimonB - Tue Apr 15, 2003 1:31 am
they can go learn how to code some place else then come back when
they want to do gba :)
Si
#4929 - tepples - Tue Apr 15, 2003 4:32 am
I've reworded a few portions of the FAQ to help it make sense in the new location.
I hope the FAQ proves helpful.
But if the beginner forum takes off, the FAQ will get pushed down. I'd suggest making it sticky.
And because there are now two documents called "FAQ" on forum.gbadev.org (the phpBB FAQ and my FAQ), and beginners may get confused wondering why there aren't any gbadev specific questions in the document linked to at the top as "FAQ", I guess it'd be useful to insert a link to my FAQ post in the site's phpBB FAQ page.
To sgeos: Step 1 of my FAQ seems to imply that if you've been coding for three days, you should stick to text-based programs and bring up issues in forums dedicated to text-based programs. (edit: comp.lang.c FAQ link added.)
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
Last edited by tepples on Tue Apr 15, 2003 6:45 am; edited 1 time in total
#4930 - sgeos - Tue Apr 15, 2003 4:49 am
tepples- I've read it, but that doesn't mean that every random person who wanders in will read your FAQ, even if they ought to. We'll get posts pertaining to basic programming and I think it would be nice if there was a specific place for them. (Maybe we should have a link to the comp.lang.c FAQ) =P
-Brendan