ROM Hack How to use pack(CodeWarrior)

wannya

Active Member
OP
Newcomer
Joined
Sep 17, 2007
Messages
37
Trophies
0
Website
www.angeleden.net
XP
117
Country
Switzerland
Google(Very Sorry)

Metrowerks CodeWarrior for Nintendo DS

How to use pre-compiled instruction pack

__attribute__ ((packed))
# pragma pack (1)
# pragma options align = packed
Have failed
 

cory1492

Well-Known Member
Member
Joined
Jun 23, 2005
Messages
1,497
Trophies
1
Location
Home, WhereElse?
XP
335
Country
Canada
Examples for porting PC to codewarrior are...
Code:
#pragma options align=packed
typedef struct
{
ÂÂÂÂchar foo;
ÂÂÂÂshort bar;
} foobar;
#pragma options align=reset
Code:
#pragma pack(push, 1)
typedef struct
{
ÂÂÂÂchar foo;
ÂÂÂÂshort bar;
} foobar;
#pragma pack(pop)
This is for struct alignment in memory only. Not the same as GCC "__attribute__ ((packed))" when using sizeof() which as far as I can tell has no equal in codewarrior compilers.

Search your local headers for the toolchain to see if there are any "pack" used? I've never seen the DS official versions myself. Hope that helps...
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: @salazarcosplay, and I wouldnt like to watch an episode of a show atleast twice to review it...