Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3448458

Browse files
committed
Allowed loading of objects
1 parent 94c1e8d commit 3448458

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,7 @@ devkitARM
4646
*.exe
4747
*.sav
4848
*.ini
49+
50+
# Eclipse
51+
.project
52+
.cproject

main.c

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,33 @@ void callback (u8 index) {
139139
}
140140
}
141141

142+
typedef struct resource {
143+
u32 tiles;
144+
u16 offset;
145+
u16 tag;
146+
} resource;
147+
148+
typedef struct sprite {
149+
u16 attr0;
150+
u16 attr1;
151+
u16 attr2;
152+
u16 rotscale;
153+
} sprite;
154+
155+
typedef struct template {
156+
u16 tiles_tag;
157+
u16 pal_tag;
158+
sprite *oam;
159+
u32 animation;
160+
u32 graphics;
161+
u32 rotscale;
162+
u32 callback;
163+
} template;
164+
165+
resource graphics = { 0x8462A10, 0x600, 0x1000 };
166+
resource palette = { 0x84629D0, 0x1000, 0 };
167+
template temp = { 0x1000, 0x1000, (sprite*)0x83ACAF8, 0x8462F44, 0, 0x8231CFC, 0x800760D };
168+
142169
void helloThere(u8 index) {
143170
task *tasks = (task *) 0x3005090;
144171

@@ -149,6 +176,21 @@ void helloThere(u8 index) {
149176
u32 **ptr = (u32**) 0x0203B108;
150177
char *dest = (char*) 0x02021D18;
151178
u8 b = 8;
179+
u8 i;
180+
181+
u16 (*object_from_compressed)(u32*) = (u16 (*)(void)) 0x0800EBCC + 1;
182+
u8 (*object_apply_palette)(u32*) = (u8 (*)(void)) 0x08008928 + 1;
183+
u8 (*object_search)(u32*,u16,u16,u8) = (u8 (*)(void)) 0x08006F8C + 1;
184+
185+
//object_from_compressed((u32*) 0x8462F14);
186+
//object_apply_palette((u32*) 0x8462F24);
187+
188+
object_from_compressed((u32*) &graphics);
189+
object_apply_palette((u32*) &palette);
190+
for (i = 0; i < 3; ++i) {
191+
//object_search(0x8462F50 + (i * 0x18), ((i << 0x15) + 0x580000) >> 0x10, 0x70, 1);
192+
object_search((u32*) &temp, ((i << 0x15) + 0x580000) >> 0x10, 0x70, 1);
193+
}
152194

153195
loadMessageBox(0, 0);
154196
fdecoder(dest, (char*) caHelloThere);

0 commit comments

Comments
 (0)