building for android impl

currently builds a "Metaforce" apk, will need to change name of course. Running the apk using Android Studio's emulator can get in game, however running on a samsung phone does not seem to work.
This commit is contained in:
CraftyBoss
2026-04-10 03:53:57 -07:00
parent 7ed05711a7
commit 417360b1ce
41 changed files with 6417 additions and 4 deletions
+8
View File
@@ -55,7 +55,11 @@ void JASDriver::initAI(void (*param_0)(void)) {
for (int i = 0; i < 3; i++) {
sDmaDacBuffer[i] = JKR_NEW_ARRAY_ARGS(s16, dacSize, JASDram, 0x20);
JUT_ASSERT(102, sDmaDacBuffer[i])
#if ANDROID
JASCalc::_bzero(sDmaDacBuffer[i], size);
#else
JASCalc::bzero(sDmaDacBuffer[i], size);
#endif
DCStoreRange(sDmaDacBuffer[i], size);
}
sDspDacBuffer = JKR_NEW_ARRAY_ARGS(s16*, data_804507A8, JASDram, 0);
@@ -63,7 +67,11 @@ void JASDriver::initAI(void (*param_0)(void)) {
for (int i = 0; i < data_804507A8; i++) {
sDspDacBuffer[i] = JKR_NEW_ARRAY_ARGS(s16, getDacSize(), JASDram, 0x20);
JUT_ASSERT(119, sDspDacBuffer[i]);
#if ANDROID
JASCalc::_bzero(sDspDacBuffer[i], size);
#else
JASCalc::bzero(sDspDacBuffer[i], size);
#endif
DCStoreRange(sDspDacBuffer[i], size);
}
sDspDacWriteBuffer = data_804507A8 - 1;
+12
View File
@@ -69,7 +69,11 @@ JASBasicBank* JASBNKParser::Ver1::createBasicBank(void const* stream, JKRHeap* h
JUT_ASSERT(145, list_chunk);
u8* envt = JKR_NEW_ARRAY_ARGS(u8, envt_chunk->mSize, heap, 2);
#if ANDROID
JASCalc::_bcopy(envt_chunk->mData, envt, envt_chunk->mSize);
#else
JASCalc::bcopy(envt_chunk->mData, envt, envt_chunk->mSize);
#endif
BE(u32)* ptr = &osc_chunk->mCount;
u32 count = *ptr++;
@@ -215,7 +219,11 @@ JASBasicBank* JASBNKParser::Ver0::createBasicBank(void const* stream, JKRHeap* h
int size = endPtr - points;
JASOscillator::Point* table = JKR_NEW_ARRAY_ARGS(JASOscillator::Point, size, heap, 0);
JUT_ASSERT(396, table != NULL);
#if ANDROID
JASCalc::_bcopy(points, table, size * sizeof(JASOscillator::Point));
#else
JASCalc::bcopy(points, table, size * sizeof(JASOscillator::Point));
#endif
osc->mTable = table;
} else {
osc->mTable = NULL;
@@ -227,7 +235,11 @@ JASBasicBank* JASBNKParser::Ver0::createBasicBank(void const* stream, JKRHeap* h
int size = endPtr - points;
JASOscillator::Point* table = JKR_NEW_ARRAY_ARGS(JASOscillator::Point, size, heap, 0);
JUT_ASSERT(409, table != NULL);
#if ANDROID
JASCalc::_bcopy(points, table, size * sizeof(JASOscillator::Point));
#else
JASCalc::bcopy(points, table, size * sizeof(JASOscillator::Point));
#endif
osc->rel_table = table;
} else {
osc->rel_table = NULL;
@@ -13,7 +13,11 @@ void JASBasicBank::newInstTable(u8 num, JKRHeap* heap) {
JUT_ASSERT(31, num <= JASBank::PRG_OSC);
mInstNumMax = num;
mInstTable = JKR_NEW_ARRAY_ARGS(JASInst*, mInstNumMax, heap, 0);
#if ANDROID
JASCalc::_bzero(mInstTable, mInstNumMax * 4);
#else
JASCalc::bzero(mInstTable, mInstNumMax * 4);
#endif
}
}
@@ -13,7 +13,11 @@ JASBasicInst::JASBasicInst() {
mPitch = 1.0;
mKeymapCount = 0;
mKeymap = NULL;
#if ANDROID
JASCalc::_bzero(field_0xc, sizeof(field_0xc));
#else
JASCalc::bzero(field_0xc, sizeof(field_0xc));
#endif
}
JASBasicInst::~JASBasicInst() {
+8
View File
@@ -33,7 +33,11 @@ void JASCalc::bcopyfast(const void* src, void* dest, u32 size) {
}
}
#if ANDROID
void JASCalc::_bcopy(const void* src, void* dest, u32 size) {
#else
void JASCalc::bcopy(const void* src, void* dest, u32 size) {
#endif
u32* usrc;
u32* udest;
@@ -90,7 +94,11 @@ void JASCalc::bzerofast(void* dest, u32 size) {
}
}
#if ANDROID
void JASCalc::_bzero(void* dest, u32 size) {
#else
void JASCalc::bzero(void* dest, u32 size) {
#endif
u32* udest;
u8* bdest = (u8*)dest;
if ((size & 0x1f) == 0 && (reinterpret_cast<uintptr_t>(dest) & 0x1f) == 0) {
@@ -434,8 +434,14 @@ void JASDsp::initBuffer() {
JUT_ASSERT(354, CH_BUF);
FX_BUF = JKR_NEW_ARRAY_ARGS(FxBuf, 4, JASDram, 0x20);
JUT_ASSERT(356, FX_BUF);
#if ANDROID
JASCalc::_bzero(CH_BUF, sizeof(TChannel) * DSP_CHANNELS);
JASCalc::_bzero(FX_BUF, sizeof(FxBuf) * 4);
#else
JASCalc::bzero(CH_BUF, sizeof(TChannel) * DSP_CHANNELS);
JASCalc::bzero(FX_BUF, sizeof(FxBuf) * 4);
#endif
for (u8 i = 0; i < 4; i++) {
setFXLine(i, NULL, NULL);
}
@@ -459,7 +465,11 @@ int JASDsp::setFXLine(u8 param_0, s16* buffer, JASDsp::FxlineConfig_* param_2) {
if (buffer != NULL && param_2 != NULL) {
u32 bufsize = param_2->field_0xc * 0xa0;
puVar3->field_0x4 = buffer;
#if ANDROID
JASCalc::_bzero(buffer, bufsize);
#else
JASCalc::bzero(buffer, bufsize);
#endif
JUT_ASSERT(420, ((u32)((uintptr_t)buffer) & 0x1f) == 0);
JUT_ASSERT(421, (bufsize & 0x1f) == 0);
DCFlushRange(buffer, bufsize);
+4
View File
@@ -18,7 +18,11 @@ void JASDrumSet::newPercArray(u8 num, JKRHeap* heap) {
JUT_ASSERT(39, num <= 128);
mPercNumMax = num;
mPercArray = JKR_NEW_ARRAY_ARGS(TPerc*, mPercNumMax, heap, 0);
#if ANDROID
JASCalc::_bzero(mPercArray, mPercNumMax * sizeof(TPerc*));
#else
JASCalc::bzero(mPercArray, mPercNumMax * sizeof(TPerc*));
#endif
}
}
+4
View File
@@ -53,7 +53,11 @@ int JASReportCopyBuffer(char *param_1,int lines) {
r30 = sLineMax - 1;
}
src = &sBuffer[r30 * 64];
#if ANDROID
JASCalc::_bcopy(src, dest, 64);
#else
JASCalc::bcopy(src, dest, 64);
#endif
r30--;
dest += 64;
}
@@ -33,7 +33,11 @@ void* JASTaskThread::allocCallStack(JASThreadCallback callback, const void* msg,
}
callStack->msgType_ = 1;
#if ANDROID
JASCalc::_bcopy(msg, callStack->msg.buffer, msgSize);
#else
JASCalc::bcopy(msg, callStack->msg.buffer, msgSize);
#endif
callStack->callback_ = callback;
return callStack;
}