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.

Help Wanted > Programmers wanted

#17464 - dagamer34 - Mon Mar 08, 2004 11:12 pm

If you have any free time and like to criticize people, then I need your help. I have finally finished my GBA library and would like to have it "checked over". I have 2 requests.

Programming experts: Or some thing like it, I need people who know the GBA inside and out and the fastest way to execute code on it. I am sure my code is sloppy but hey, i'm not perfect. You will try to find code that doesn't "look right" or is un-optimized.

Beta testers: I also need outside people to test my library and see if I have missed anything or if anything is wrong. There are plenty of mistakes lurking around, but I don't have time to find them all. I don't have a lot of examples ready so if you want to help in this area, you'll have to be patient for a while.


If you want to help, just e-mail me at dagamer34@yahoo.com
_________________
Little kids and Playstation 2's don't mix. :(

#17465 - poslundc - Mon Mar 08, 2004 11:15 pm

I might be able to lend a hand... what kind of library is it?

Dan.

#17466 - dagamer34 - Mon Mar 08, 2004 11:24 pm

An all-purpose general GBA library.

What do you want to do Dan? I'm not exactly going to turn people down who want to help.
_________________
Little kids and Playstation 2's don't mix. :(

#17471 - poslundc - Tue Mar 09, 2004 12:38 am

Well, I'm happy to help out with some debugging and optimizing.

Sorry to pass the buck back to you, but you know your library better than anyone so it's really up to you to tell me what parts need the work done. :) Besides which, while I don't mind lending a hand, I've already got plenty of other commitments and I've had to back pretty much 90% out of one project already on account of other stuff in my life that has come up, so the more direction you can give me the better. As it is I will only probably be able to help out on small segments of your library.

My strengths lie predominantly in tile modes, audio, interrupts and raster effects, algorithm optimization and math optimization, modular code design, and assembly.

You can send me an e-mail if you have stuff to send or if you'd like to take it outside of the thread.

Dan.

#17479 - dagamer34 - Tue Mar 09, 2004 5:56 am

I know my sprite code will need some tweaking for certain. I will send you the examples tomorrow, latest wednesday.

For one thing, I am still using that &*^% switch statement in my DMA code which I KNOW is slow but the preprocessor doesn't like me for some reason...

Something like this off the top of my head:
Code:

#define DMA_COPY (ch, src, dest, word, mode) \
    REG_DMA##ch##SRC


I forget the rest, but it keeps complaining about how it doesn't expect the ## symbols. I know that is what is throwing it off. Not much to go on, but you get what I am trying to do, right?

Thanks for trying to help.[/code]
_________________
Little kids and Playstation 2's don't mix. :(

#17480 - poslundc - Tue Mar 09, 2004 6:13 am

Well, since the channel can be any variable expression (and not necessarily a fixed constant from 0-3) I don't think it's possible to code it directly into the constant expression.

You will have to use an arithmetic operator instead: something like (REG_DMA_BASE + (ch) * 12). This will then be optimized out to the correct address automatically if ch is a constant.

Anyway, send me stuff at your convenience and I'll take a look.

Dan.

#17482 - Cyberman - Tue Mar 09, 2004 7:00 am

Well Coding is perhaps a more appropriate forum for this.

As for checking code.. I suggest using PC Lint on your Code I don't know if you have a lot of money so I won't suggest DA-C by RistanCASE. The later is a syntax and program correctness checker to be sure you are using your code right basically. The former checks for variable usage and variable vagueness. Also proper macro use and much more.

Lint your code, it's not a mere suggestion. You'll find the majority of your errors not to be in implementation but program correctness (at least for me:) ).

code reviews should be done by peers, that seems that you want a code review ;)

Cyb
_________________
If at first you don't succeed parachuting is NOT for you.

#17486 - Sweex - Tue Mar 09, 2004 1:20 pm

For finding bugs, your best bet is to actually use it! Code some simple game but with all aspects of your library in it. You will find bugs while you develop your little test game.

(Atleast, that's the way I tend to do it!:-)
_________________
If everything fails, read the manual: If even that fails, post on forum!

#17573 - Cearn - Wed Mar 10, 2004 2:09 pm

dagamer34 wrote:
Something like this off the top of my head:
Code:

#define DMA_COPY (ch, src, dest, word, mode) \
    REG_DMA##ch##SRC


First: the code was
Code:

#define DMA_CPY(src, dst, ch, count, mode) \
{   \
    REG_DMA##ch##SAD = (u32)(src);         \
    REG_DMA##ch##DAD = (u32)(dst);         \
    REG_DMA##ch##CNT = (count) | (mode);   \
}

Second: Bloody hellfire, it still doesn't work? Then again, macros are known for their twitchiness. First, I'm pretty sure that space behind "DMA_COPY" shouldn't be there. Also, make sure there are no spaces behind the line separator ("\").
Funny, I got this one working the first time I tried it.

poslundc wrote:

Well, since the channel can be any variable expression (and not necessarily a fixed constant from 0-3) I don't think it's possible to code it directly into the constant expression.

You will have to use an arithmetic operator instead: something like (REG_DMA_BASE + (ch) * 12). This will then be optimized out to the correct address automatically if ch is a constant.

True, "ch" must be an actual constant. That's one of the conditions of the macro. You can use a variable, of course, but the compiler will complain about it if you try.
Using the arithmatic operator is probably a safer solution. Had I known that the compiler takes care of arithmatic with constants at compile time when I wrote the DMA_CPY macro, I probably would have used that as well.

#17574 - Lupin - Wed Mar 10, 2004 2:41 pm

I just use this:
Code:

#define DMACopyCH0(source,dest,wc,mode)      REG_DMA0SAD = (u32)source; \
                                   REG_DMA0DAD = (u32)dest; \
                                   REG_DMA0CNT = wc | mode;

#define DMAClearMemory32(dest,wc)                  REG_DMA3SAD = (u32)&clear; \
                                        REG_DMA3DAD = (u32)dest; \
                                          REG_DMA3CNT = wc | DMA_ENABLE | DMA_TIMEING_IMMEDIATE | DMA_32 | DMA_SOURCE_FIXED;


u32 clear = 0;



Just create 4 dma copy functions :)

#17604 - dagamer34 - Thu Mar 11, 2004 1:05 am

What do you know, it works now. It was that space between the DMA_Copy and the first '('. I have a tendency to do that.

And I have finished the examples if anyone cares.

I plan on starting my game soon. I just wanted outside input. I am the only programmer and am sure I have made mistakes that few may know how to solve. Starting a new topic to solve it is time-consuming for me.
_________________
Little kids and Playstation 2's don't mix. :(