GP32 Spritetest From Una-i Library


0-bake

Active Member
Joined
Dec 15, 2003
Messages
538
hi,

i just tried to compile the spritetest program from the new una-i library. i set up the paths in the existing makefile, but i can't be compiled:

D:\gp32dev\projects\SpriteTest>make
arm-elf-gcc -Id:/gp32dev/gp32_MrMirko/gp32_SDK/lib.src/include -Id:/gp32dev/gp32
_MrMirko/MicroLib -O2 -s -w -mtune=arm9tdmi -c -o sprites/garfield.o sprites/g
arfield.c
arm-elf-gcc -Id:/gp32dev/gp32_MrMirko/gp32_SDK/lib.src/include -Id:/gp32dev/gp32
_MrMirko/MicroLib -O2 -s -w -mtune=arm9tdmi -c -o sprites/odie.o sprites/odie.
c
arm-elf-gcc -Id:/gp32dev/gp32_MrMirko/gp32_SDK/lib.src/include -Id:/gp32dev/gp32
_MrMirko/MicroLib -O2 -s -w -mtune=arm9tdmi -c -o sprites/test.o sprites/test.
c
arm-elf-c++ -Id:/gp32dev/gp32_MrMirko/gp32_SDK/lib.src/include -Id:/gp32dev/gp32
_MrMirko/MicroLib -O2 -s -w -mtune=arm9tdmi -c -o cpp.o cpp.cpp
arm-elf-gcc -Id:/gp32dev/gp32_MrMirko/gp32_SDK/lib.src/include -Id:/gp32dev/gp32
_MrMirko/MicroLib -O2 -s -w -mtune=arm9tdmi -c -o main.o main.c
arm-elf-c++ -Id:/gp32dev/gp32_MrMirko/gp32_SDK/lib.src/include -Id:/gp32dev/gp32
_MrMirko/MicroLib -O2 -s -w -mtune=arm9tdmi -c -o sprite.o sprite.cpp
sprite.cpp: In function `void swap_screen()':
sprite.cpp:22: error: invalid conversion from `u32' to `void*'
sprite.cpp:22: error: initializing argument 1 of `void gp_setFramebuffer(void*
, int)'
sprite.cpp: In function `int cpp_main()':
sprite.cpp:43: error: invalid conversion from `u32' to `void*'
sprite.cpp:43: error: initializing argument 1 of `short int gp_initFramebuffer
(void*, u16, u16)'
make: *** [sprite.o] Error 1

does anyone have the same prob? is it an error in the spritetest.cpp?
 
hi,

i just tried to compile the spritetest program from the new una-i library. i set up the paths in the existing makefile, but i can't be compiled:

D:\gp32dev\projects\SpriteTest>make
arm-elf-gcc -Id:/gp32dev/gp32_MrMirko/gp32_SDK/lib.src/include -Id:/gp32dev/gp32
_MrMirko/MicroLib -O2 -s -w -mtune=arm9tdmi -c -o sprites/garfield.o sprites/g
arfield.c
arm-elf-gcc -Id:/gp32dev/gp32_MrMirko/gp32_SDK/lib.src/include -Id:/gp32dev/gp32
_MrMirko/MicroLib -O2 -s -w -mtune=arm9tdmi -c -o sprites/odie.o sprites/odie.
c
arm-elf-gcc -Id:/gp32dev/gp32_MrMirko/gp32_SDK/lib.src/include -Id:/gp32dev/gp32
_MrMirko/MicroLib -O2 -s -w -mtune=arm9tdmi -c -o sprites/test.o sprites/test.
c
arm-elf-c++ -Id:/gp32dev/gp32_MrMirko/gp32_SDK/lib.src/include -Id:/gp32dev/gp32
_MrMirko/MicroLib -O2 -s -w -mtune=arm9tdmi -c -o cpp.o cpp.cpp
arm-elf-gcc -Id:/gp32dev/gp32_MrMirko/gp32_SDK/lib.src/include -Id:/gp32dev/gp32
_MrMirko/MicroLib -O2 -s -w -mtune=arm9tdmi -c -o main.o main.c
arm-elf-c++ -Id:/gp32dev/gp32_MrMirko/gp32_SDK/lib.src/include -Id:/gp32dev/gp32
_MrMirko/MicroLib -O2 -s -w -mtune=arm9tdmi -c -o sprite.o sprite.cpp
sprite.cpp: In function `void swap_screen()':
sprite.cpp:22: error: invalid conversion from `u32' to `void*'
sprite.cpp:22: error: initializing argument 1 of `void gp_setFramebuffer(void*
, int)'
sprite.cpp: In function `int cpp_main()':
sprite.cpp:43: error: invalid conversion from `u32' to `void*'
sprite.cpp:43: error: initializing argument 1 of `short int gp_initFramebuffer
(void*, u16, u16)'
make: *** [sprite.o] Error 1

does anyone have the same prob? is it an error in the spritetest.cpp?

sprite.cpp:22: error: invalid conversion from `u32' to `void*'
gp_setFramebuffer((u32)framebuffer[swapper],1);
But the Prototype says :
void gp_setFramebuffer (void *addr,int vsync);

How to solve this bug ?
Remove the (u32) in line 22 of sprite.cpp, Thats it...

Cheers ...
 
Last edited by a moderator:
cool, thats nice :)

but i guess, the problem is to find somewhere else, because the cddtest doesn't compile correctly, as well.

CppTest.cpp: In function `int cpp_main()':
CppTest.cpp:45: error: invalid conversion from `u32' to `void*'
CppTest.cpp:45: error: initializing argument 1 of `short int gp_initFramebuffe
r(void*, u16, u16)'

line 45: gp_initFramebuffer((u32)FRAMEBUFFER1,16,85);

i am using the devkit from mmirko's page (gp32_MrMirko-v2.1.rar) and the sdk version 0.9 (mirkoSDK090.tar.bz2).

i don't know, if the Una-i author also used this settings. i can't understand spanish, so i can't read the readme...
 
oh hi, Mr.Mirko!

i tried it, and it was the solution (how ever this happend), but things went worse:

D:\gp32dev\projects\SpriteTest>make
arm-elf-c++ -Id:/gp32dev/gp32_MrMirko/gp32_SDK/lib.src/include -Id:/gp32dev/gp32
_MrMirko/MicroLib -O2 -s -w -mtune=arm9tdmi -c -o sprite.o sprite.cpp
make -C d:/gp32dev/gp32_MrMirko/MicroLib
make[1]: Entering directory `d:/gp32dev/gp32_MrMirko/MicroLib'
make -C uCore
make[2]: Entering directory `d:/gp32dev/gp32_MrMirko/MicroLib/uCore'
arm-elf-gcc -c -o crt0.o crt0.S
cp crt0.o ../
make[2]: Leaving directory `d:/gp32dev/gp32_MrMirko/MicroLib/uCore'
make -C uMath
make[2]: Entering directory `d:/gp32dev/gp32_MrMirko/MicroLib/uMath'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `d:/gp32dev/gp32_MrMirko/MicroLib/uMath'
make -C uColor
make[2]: Entering directory `d:/gp32dev/gp32_MrMirko/MicroLib/uColor'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `d:/gp32dev/gp32_MrMirko/MicroLib/uColor'
make -C uSprite
make[2]: Entering directory `d:/gp32dev/gp32_MrMirko/MicroLib/uSprite'
arm-elf-c++ -I.. -Id:/gp32dev/gp32_MrMirko/gp32_SDK/lib.src/include -O2 -g3 -s -
w -mtune=arm9tdmi -c -o uSprite.o uSprite.cpp
uSprite.cpp:221: error: conflicting declaration 'typedef struct SHEADER SHEADER'

d:/gp32dev/gp32_MrMirko/gp32_SDK/lib.src/include/sprite.h:11: error: 'SHEADER' h
as a previous declaration as `typedef struct SHEADER SHEADER'
uSprite.cpp:221: error: declaration of `typedef struct SHEADER SHEADER'
d:/gp32dev/gp32_MrMirko/gp32_SDK/lib.src/include/sprite.h:11: error: conflicts w
ith previous declaration `typedef struct SHEADER SHEADER'
uSprite.cpp:221: error: declaration of `typedef struct SHEADER SHEADER'
d:/gp32dev/gp32_MrMirko/gp32_SDK/lib.src/include/sprite.h:11: error: conflicts w
ith previous declaration `typedef struct SHEADER SHEADER'
uSprite.cpp:221: error: declaration of `typedef struct SHEADER SHEADER'
d:/gp32dev/gp32_MrMirko/gp32_SDK/lib.src/include/sprite.h:11: error: conflicts w
ith previous declaration `typedef struct SHEADER SHEADER'
make[2]: *** [uSprite.o] Error 1
make[2]: Leaving directory `d:/gp32dev/gp32_MrMirko/MicroLib/uSprite'
make[1]: *** [all] Error 2
make[1]: Leaving directory `d:/gp32dev/gp32_MrMirko/MicroLib'
make: *** [all] Error 2



the problem seems to be this:
arm-elf-c++ -I.. -Id:/gp32dev/gp32_MrMirko/gp32_SDK/lib.src/include -O2 -g3 -s -
w -mtune=arm9tdmi -c -o uSprite.o uSprite.cpp
uSprite.cpp:221: error: conflicting declaration 'typedef struct SHEADER SHEADER'

lines 214-221 in usprite.cpp:
typedef struct {
char magic[4];
u16 size_x;
u16 size_y;
u16 info;
u16 alpha;
//u16 raw[0];
} SHEADER;

what ever SHEADER is or means, i don't get it. could you please help me again?
thanks
 
wow, is this really that much faster? The SDK routines are really slow (AFAIK cache miss on every pixel)... maybe those one should replace the old one...

@ Mirko: what cha doin lately?
 
Sorry for all that problems I didn´t expect you to use in that way :)

Your best solution would be just to copy uSprite.* uColor.* and use then in you own proyects.

All that hapened because I use a self modified old version or mr.mirko's sdk at the times when c++ didn't work.

I would like to post allso the Release.txt file in english where that is mentioned...

As I cant attach files...

Release Notes:

* Its unsuported at the moment.

* Thesee are my aown paths... you can change them but modify .bat files.
- D:\PRJS\gp32\dev\MyPRJ\Mirko\cpp los sources
- D:\PRJS\gp32\dev\gp32_MrMirko el sdk

* The best thing you can do any way is to grab uSprite.* and uColor.* files and use then in your own proyects.

* This was don with an outdated and self modified version of mirko's sdk, soon I'll release a new version with beter compatibility

* Now there are 2 version of the functions at uSprite.h, ones use mirko's sprite format and others use raw memory


* The librery supports these operations at the moment:
- ADD
- SUB
- BLEND with 32 levels.

* It also freatures colokey.


* This is the current coordinate system:

X
^
|
|
+------------> Y

* Sprites are spected in the same way, memori is lineas in X, I thing thas the mirko's convertes suports that.


* My Todo List:
- Improbe the compatibility with mirkos's sdk, and in the furure suport for more sdk's
- Add Hot Spot support in the sprites
- Add zoom to sprites.
- Integrate a fixed point library
- Star A poligon rasterizer library
- ....
 
wow, is this really that much faster? The SDK routines are really slow (AFAIK cache miss on every pixel)... maybe those one should replace the old one...

@ Mirko: what cha doin lately?

2 times faster is really a lot faster :)

@ Mirko: what cha doin lately?
Iam in heavy univerity learing phase...
And in spare time i must work to pay some bills ... :(
But i hope i have some more time @ Christmas ...
 
Last edited by a moderator:
wow, is this really that much faster? The SDK routines are really slow (AFAIK cache miss on every pixel)... maybe those one should replace the old one...

@ Mirko: what cha doin lately?

2 times faster is really a lot faster :)


Well, I would not say that its 2x faster allways, really I have not bechmarked again sdk sprite lib, just happen that I used your example for reference :) and in that test there was a win. My intention was to build a more general raster engine.
 
Last edited by a moderator:
Back
Top