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 > Can someone test this one on Hardware please?

#9420 - iuiz - Mon Aug 04, 2003 2:10 pm

Hiho,

I read the tutorials from GbaJuknie and I have tried to play a little bit with the Code. I managed to get a Background with some Sprites in the foreground. But as I doesnt have a Linker Device, I do not know, if it runs on Hardware.

It would be nice if someone can test it on Hardware. I had no Problems on VisualBoyAdvance.

http://halof.com/srolling.zip

The Graphics are not from me. I ripped them from the tutorial. So please dont flame me ;).


Cu,
iuiz

PS: Sorry for my bad english.

#9444 - yaustar - Tue Aug 05, 2003 12:17 am

No, soory. It wont work because you havent fixed the 'header' of the rom. You have to download some of the tools from gbadev.org to fix it.

PS Can you release the source please?

edit: I fixed the header file, it works fine on the gba though it takes it's time to load the data...it's also the same in the emu
_________________
[Blog] [Portfolio]

#9460 - iuiz - Tue Aug 05, 2003 2:18 pm

Ok, here ist the Source. There is some "DeadCode" in it, because it was 3 o'clock, when i finale came to this point and I have not optimized the Code in any way :). It is my FIRST atmept to create a game or a Demo on the GBA (Ok, I drew an Pixel some Month ago....).


Can you say me what you mean by fixing the header, and how to do this?
And does someone know, why it takes this much time to start (I thought it was normal).

How to compile my Code, using MSVC++98 :):
I also added my Project files within the Package. As I don't like make Files I created some 'userdefinded build options' (I have the german MSVC++ Version from 1998, so it might be called differnt ;)). Press 'alt+f7' and select the main.c, and you will see, what I mean. After the main.c is build it will automaticaly start "E:\gba\rpg\emulator\VBA.exe E:\gba\rpg\main.gba" (alt+f7, select the Projekt and then the most right option (it must be something like "run after build/processing").
If it dont works, compile it with this make.bat:
Code:
path=C:\devkitadv\bin
gcc  -o main.elf main.cpp bg.cpp -lm
objcopy -O binary main.elf main.gba


//edit:
Here is the file: www.Halof.com/rpg_source.zip

#9473 - Saikou - Tue Aug 05, 2003 5:33 pm

It appears the delay on startup is caused by calculating the sine and cosine tables. It would be quicker if you used a precalculated table, but that would take up a little ROM space.

As for the header, each GBA ROM must contain a header which contains the nintendo logo and a checksum among other things, and if these aren't there or are invalid, the GBA won't run it. By default, the DevKitAdv compiler won't add the header, but you can modify the linkscript/crt0.s to do that, or a lot easier, use a header tool.

#9474 - iuiz - Tue Aug 05, 2003 6:11 pm

Ok, thank you. :)

#9475 - tepples - Tue Aug 05, 2003 7:21 pm

Saikou wrote:
It appears the delay on startup is caused by calculating the sine and cosine tables. It would be quicker if you used a precalculated table, but that would take up a little ROM space.

Heck, a precalculated table may take up less space than the floating-point arithmetic library that cos() pulls in. And if you use linear interpolation at evalutation time (rather than nearest-neighbor), you can make the table smaller at the expense of a little bit of speed.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#9539 - yaustar - Thu Aug 07, 2003 11:23 pm

can someone post a link to download the precalc cos and sin tables please.
_________________
[Blog] [Portfolio]

#9544 - tepples - Fri Aug 08, 2003 4:20 am

If you know C, and you have a native code compiler, you can write a program to generate a cosine table at any resolution you want.

If you have Windows, and you don't have a Win32-targeted compiler, get MinGW.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#9547 - yaustar - Fri Aug 08, 2003 4:32 am

point well taken... (-.-;)

edit: I done it!!!! I would have done it yesterday but I forget what a radian was (PI/180) Just to help out other people, you can find it on this page called 'sin_cos.zip'

http://www31.brinkster.com/yaustar/dev/gba.html

with the source code here

http://www31.brinkster.com/yaustar/dev/cpp.html
_________________
[Blog] [Portfolio]