Lawliet
很zuo的男人
级别: 火花会员
编号: 93177
精华: 7
发帖: 1091
威望: 35 点
配偶: 单身
火 花 币: 21955 HHB
注册时间:2008-08-30
最后登陆:2012-09-29
|
求助C++高手 (GBA火纹魔法动画相关)
最近在研究GBA三作魔法动画的制作和导入导出,现在已经能够一定程度地实现原创魔法动画导入,但是对于游戏内本身的魔法动画构造却还是一头雾水。希望哪位高人能帮忙一起研究一下,小弟在此先谢过。
CSA :: SA { frameData frameDataPointerTable[] = new frameData[0x100];
byte processStream[] = new byte[] { 25, 0, 0, 0, 3, 0, 0, 0, (byte) AUTO_PATCH_ADDR, (byte) AUTO_PATCH_ADDR >> 8, (byte) AUTO_PATCH_ADDR >> 16, (byte) AUTO_PATCH_ADDR >> 24, 0, 0, 0, 0, 0, 0, 0, 0 }
CSA(int ID) { super(); setProcessingPointer((processerStream *) processStream); setStreamPointer(ID); //Offset table of frame data pointers }
setStreamPointer(int ID) { * (frameData **) 0x0203FFFC = frameDataTable[ID]; } }
CSA csaProcessor;
.org PCTable + (MAX_ID << 2) .long csaProcessor .long csaProcessor ...
.org AUTO_PATCH_ADDR void processAnimation() { int word1 = ** (int **) 0x0203FFFC; int word2 = * (int *) ((* (int *) 0x0203FFFC) + 4); int word3 = * (int *) ((* (int *) 0x0203FFFC) + 8); int word4 = * (int *) ((* (int *) 0x0203FFFC) + 12); int word5 = * (int *) ((* (int *) 0x0203FFFC) + 16);
switch ((word1 >> 24) & 0xFF) { case 0x85: switch (word1 & 0xFF) { case 0x48: playSound((short) word1 >> 8); break; case 0x1A: case 0x08: enemy.setHitFlags(0x09); if (enemy.getHealth() > enemy.getTargetHealth()) enemy.setHealth(--enemy.getHealth()); break; case 0x1F: playHitSound(); break; default: if ((word1 & 0xFF) > 0x13) processCommand((byte) word1) break; } (* (int *) 0x0203FFFC) += 4; break; case 0x86: if (--delay <= 0) { delay = (byte) word1; drawSprites((sheet *) word2, (FE_OAM *) word3); drawBG((sheet *) word4, (TSA *) word5); (* (int *) 0x0203FFFC) += 20; } break; case 0x80: terminateAnimation(); break; } }
|
|
[楼 主]
|
Posted:2009-02-21 12:44| |
顶端
| |