Fix armem bug

This commit is contained in:
dbalatoni13 2025-04-12 21:05:05 +02:00
parent 0250682281
commit c133583b3b
11 changed files with 804 additions and 112 deletions

View file

@ -126,10 +126,7 @@ void ObjectSetup(void)
HuSprGrpMemberSet(group, 1, sprite_hudson);
HuSprPosSet(group, 1, 288, 240);
HuSprAttrSet(group, 1, HUSPR_ATTR_DISPOFF);
#ifdef __MWERKS__
// TODO PC
HuWinInit(1);
#endif
BootTitleCreate();
SystemInitF = 1;
}
@ -162,13 +159,10 @@ void ObjectSetup(void)
WipeColorSet(255, 255, 255);
if (!SystemInitF) {
tick_prev = OSGetTick();
#ifdef __MWERKS__
// TODO PC
CharManInit();
HuWindowInit();
MGSeqInit();
HuWinInit(1);
#endif
BootTitleCreate();
data = HuSprAnimReadFile(TITLE_HUDSON_ANM);
sprite_hudson = HuSprCreate(data, 0, 0);
@ -270,8 +264,6 @@ void ObjectSetup(void)
HuPrcVSleep();
}
skip_wait = FALSE;
#ifdef __MWERKS__
// TODO PC
while (!HuTHPEndCheck()) {
UpdateDemoMess();
if (HuPadBtnDown[0] & (PAD_BUTTON_START | PAD_BUTTON_A)) {
@ -280,16 +272,12 @@ void ObjectSetup(void)
}
HuPrcVSleep();
}
#endif
WipeCreate(WIPE_MODE_OUT, WIPE_TYPE_NORMAL, 30);
while (WipeStatGet()) {
HuPrcVSleep();
}
#ifdef __MWERKS__
// TODO PC
HuWinKill(demoWinId);
HuTHPClose();
#endif
HuPrcVSleep();
HuSprGrpKill(group_thp);
if (!skip_wait) {
@ -344,16 +332,10 @@ void ObjectSetup(void)
int i;
for (i = 0; demoMessTimeTbl[i * 2] != -1; i++) {
if (frame == demoMessTimeTbl[i * 2]) {
#ifdef __MWERKS__
// TODO PC
HuWinMesSet(demoWinId, MAKE_MESSID(54, i));
#endif
}
if (frame == demoMessTimeTbl[(i * 2) + 1]) {
#ifdef __MWERKS__
// TODO PC
HuWinHomeClear(demoWinId);
#endif
}
}
}

View file

@ -39,8 +39,13 @@ void HuARInit(void) {
for (i = 0; i < 64; i++) {
ARInfo[i].amemptr = 0;
}
#ifdef TARGET_PC
size = ARGetSize() - 0x20;
ARBase = 0x20;
#else
size = ARGetSize() - 0x808000;
ARBase = 0x808000;
#endif
ARInfo[0].amemptr = ARBase;
ARInfo[0].size = size;
ARInfo[0].flag = 0;
@ -272,7 +277,7 @@ void *HuAR_ARAMtoMRAMNum(u32 src, s32 num) {
ARQueBuf[arqIdx].dst = dst;
arqCnt++;
PPCSync();
ARQPostRequest(&ARQueBuf[arqIdx].req, 0x1234, 1, 0, src, (u32) dst, size, ArqCallBackAM);
ARQPostRequest(&ARQueBuf[arqIdx].req, 0x1234, 1, 0, src, (uintptr_t) dst, size, ArqCallBackAM);
arqIdx++;
arqIdx &= 0xF;
return dst;

View file

@ -3,6 +3,8 @@
#include "game/process.h"
#include "dolphin/dvd.h"
#include "port/byteswap.h"
#define PTR_OFFSET(ptr, offset) (void *)(((u8 *)(ptr)+(u32)(offset)))
#define DATA_EFF_SIZE(size) (((size)+1) & ~0x1)
@ -22,7 +24,12 @@ static FileListEntry DataDirStat[] = {
u32 DirDataSize;
static u32 DataDirMax;
static s32 shortAccessSleep;
static DataReadStat ATTRIBUTE_ALIGN(32) ReadDataStat[DATA_MAX_READSTAT];
static DataReadStat ATTRIBUTE_ALIGN(32)
#if TARGET_PC
ReadDataStat[DATA_MAX_READSTAT + 1]; // to avoid bug
#else
ReadDataStat[DATA_MAX_READSTAT];
#endif
void HuDataInit(void)
{

View file

@ -2,6 +2,7 @@
#include "game/data.h"
#include "game/gamework_data.h"
#include "game/object.h"
#include "game/pad.h"
#include "game/window.h"

View file

@ -1,13 +1,17 @@
#include "game/audio.h"
#include "game/object.h"
#include "game/hsfman.h"
#include "game/pad.h"
#include "game/objsub.h"
#include "game/minigame_seq.h"
#include "game/sprite.h"
#include "game/hsfman.h"
#include "game/audio.h"
#include "ext_math.h"
#ifndef __MWERKS__
void MGSeqPauseKill(void);
#include "game/wipe.h"
#endif
Vec CRot;
Vec Center;
float CZoom;

View file

@ -17,8 +17,7 @@ BOOL ARCheckInit()
u32 ARGetSize()
{
// TODO
return 0x8000;
return sizeof(ARAM);
}
void ARStartDMA(u32 type, u32 mainmem_addr, u32 aram_addr, u32 length)

View file

@ -5,7 +5,7 @@
extern u8 ARAM[16 * 1024 * 1024];
void ARQPostRequest(ARQRequest *task, u32 owner, u32 type, u32 priority,
u32 source, u32 dest, u32 length, ARQCallback callback)
uintptr_t source, uintptr_t dest, u32 length, ARQCallback callback)
{
printf("ARQPostRequest: 0x%X, 0x%X, 0x%X\n",
(unsigned int)source, (unsigned int)dest, (unsigned int)length);
@ -13,11 +13,11 @@ void ARQPostRequest(ARQRequest *task, u32 owner, u32 type, u32 priority,
{
case ARQ_TYPE_MRAM_TO_ARAM:
memcpy(ARAM + dest, (void *)source, length);
callback((u32)task);
callback((uintptr_t)task);
break;
case ARQ_TYPE_ARAM_TO_MRAM:
memcpy((void *)dest, ARAM + source, length);
callback((u32)task);
callback((uintptr_t)task);
break;
}
}

View file

@ -692,5 +692,56 @@ s32 HuSoftResetButtonCheck(void)
return 0;
}
s16 HuTHPSprCreateVol(char *path, s16 loop, s16 prio, float volume)
{
return 0;
}
s16 HuTHPSprCreate(char *path, s16 loop, s16 prio)
{
return 0;
}
s16 HuTHP3DCreateVol(char *path, s16 loop, float volume)
{
return 0;
}
s16 HuTHP3DCreate(char *path, s16 loop)
{
return 0;
}
void HuTHPStop(void)
{
}
void HuTHPClose(void)
{
}
void HuTHPRestart(void)
{
}
BOOL HuTHPEndCheck(void)
{
return TRUE;
}
s32 HuTHPFrameGet(void)
{
return 0;
}
s32 HuTHPTotalFrameGet(void)
{
return 0;
}
void HuTHPSetVolume(s32 left, s32 right)
{
}
// TODO remove
u8 fadeStat = 0;