mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-29 16:14:59 -04:00
Push work on m_card
This commit is contained in:
+1137
-15
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,38 @@
|
||||
static u8* mCD_set_bti_data(u8* data, int res_fileNo, int tlut_size, int count, int pal_size) {
|
||||
u32 addr = JW_GetAramAddress(res_fileNo);
|
||||
u32 size = ALIGN_NEXT(JW_GetResSizeFileNo(res_fileNo), 32);
|
||||
CResTIMG* buf = (CResTIMG*)mCD_malloc_32(size);
|
||||
int idx;
|
||||
|
||||
if (buf != NULL) {
|
||||
u8* tex_p;
|
||||
u16* pal_p;
|
||||
|
||||
_JW_GetResourceAram(addr, (u8*)buf, size);
|
||||
DCStoreRangeNoSync(buf, size);
|
||||
tex_p = (u8*)(buf) + buf->mImageDataOffset;
|
||||
idx = count > 1 ? RANDOM(count) : count;
|
||||
|
||||
while (TRUE) {
|
||||
u8* dst = tex_p;
|
||||
|
||||
count--;
|
||||
if (count == idx) {
|
||||
dst = tex_p + tlut_size;
|
||||
}
|
||||
|
||||
bcopy(dst, data, tlut_size);
|
||||
data += tlut_size;
|
||||
if (count == 0) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
pal_p = (u16*)((u8*)(buf) + buf->mPaletteOffset);
|
||||
bcopy(pal_p, data, pal_size);
|
||||
data += pal_size;
|
||||
zelda_free(buf);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "jsyswrap.h"
|
||||
#include "dolphin/PPCArch.h"
|
||||
|
||||
#pragma inline_depth(smart)
|
||||
#pragma inline_max_size(1000)
|
||||
|
||||
#include "../src/static/libforest/emu64/emu64_utility.cc"
|
||||
@@ -5292,7 +5293,7 @@ u32 emu64::emu64_taskstart_r(Gfx* dl_p) {
|
||||
EMU64_PRINT_LEVEL4_FLAG
|
||||
|
||||
void emu64::emu64_taskstart(Gfx* dl_p) {
|
||||
static u8 flag = 0;
|
||||
static int flag = 0;
|
||||
|
||||
PPCSync();
|
||||
if ((int)aflags[AFLAGS_RUN_MODE] != EMU64_RUN_MODE_SKIP) {
|
||||
@@ -5415,9 +5416,12 @@ extern void emu64_cleanup(void) {
|
||||
emu64_class.emu64_cleanup();
|
||||
}
|
||||
|
||||
// hack - inlines in emu64_taskstart C wrapper otherwise
|
||||
#pragma dont_inline on
|
||||
extern void emu64_taskstart(Gfx* gfx) {
|
||||
emu64_class.emu64_taskstart(gfx);
|
||||
}
|
||||
#pragma dont_inline reset
|
||||
|
||||
extern void emu64_set_ucode_info(int len, ucode_info* info) {
|
||||
emu64_class.emu64_set_ucode_info(len, info);
|
||||
|
||||
Reference in New Issue
Block a user