mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-05-24 15:00:55 -04:00
7154ac08e1
* initial freezard actor struct + setActionMode OK * daE_FZ_Draw * setReflectAngle * mBoundSoundset * daE_FZ_Execute & execute * demoDelete * daE_FZ_Delete & _delete * CreateHeap * useHeapInit * cc_set * mtx_set * action WIP * way_gake_check * executeRollMove * executeMove * draw WIP * executeDamage * checkpoint * create * checkpoint * daE_FZ_c::executeWait * checkpoint * daE_FZ_c::damage_check almost done * rm asm * rm headers * setup_profile WIP + doxygen update * fix merge issues * docs fix? * fix2 * doxygen updates * setup g_profile_E_FZ, profile setup script WIP * update github actions * update progress.md
83 lines
2.1 KiB
C++
83 lines
2.1 KiB
C++
#ifndef JKRARAMPIECE_H
|
|
#define JKRARAMPIECE_H
|
|
|
|
#include "JSystem/JSupport/JSUList.h"
|
|
#include "dolphin/arq.h"
|
|
#include "dolphin/os/OSMessage.h"
|
|
#include "dolphin/os/OSMutex.h"
|
|
|
|
class JKRAramBlock;
|
|
class JKRDecompCommand;
|
|
|
|
/**
|
|
* @ingroup jsystem-jkernel
|
|
*
|
|
*/
|
|
class JKRAMCommand {
|
|
public:
|
|
typedef void (*AsyncCallback)(u32);
|
|
|
|
JKRAMCommand();
|
|
~JKRAMCommand();
|
|
|
|
public:
|
|
/* 0x00 */ ARQRequest mRequest;
|
|
/* 0x20 */ JSULink<JKRAMCommand> mPieceLink;
|
|
/* 0x30 */ JSULink<JKRAMCommand> field_0x30;
|
|
|
|
/* 0x40 */ s32 mTransferDirection;
|
|
/* 0x44 */ u32 mDataLength;
|
|
/* 0x48 */ u32 mSrc;
|
|
/* 0x4C */ u32 mDst;
|
|
/* 0x50 */ JKRAramBlock* mAramBlock;
|
|
/* 0x54 */ u32 field_0x54;
|
|
/* 0x58 */ AsyncCallback mCallback;
|
|
/* 0x5C */ OSMessageQueue* field_0x5C;
|
|
/* 0x60 */ s32 field_0x60;
|
|
/* 0x64 */ JKRDecompCommand* mDecompCommand;
|
|
/* 0x68 */ OSMessageQueue mMessageQueue;
|
|
/* 0x88 */ OSMessage mMessage;
|
|
/* 0x8C */ void* field_0x8C;
|
|
/* 0x90 */ void* field_0x90;
|
|
/* 0x94 */ void* field_0x94;
|
|
};
|
|
|
|
/**
|
|
* @ingroup jsystem-jkernel
|
|
*
|
|
*/
|
|
class JKRAramPiece {
|
|
public:
|
|
static OSMutex mMutex;
|
|
// TODO: fix type
|
|
static JSUList<JKRAMCommand> sAramPieceCommandList;
|
|
|
|
public:
|
|
struct Message {
|
|
s32 field_0x00;
|
|
JKRAMCommand* command;
|
|
};
|
|
|
|
public:
|
|
static JKRAMCommand* prepareCommand(int, u32, u32, u32, JKRAramBlock*,
|
|
JKRAMCommand::AsyncCallback);
|
|
static void sendCommand(JKRAMCommand*);
|
|
|
|
static JKRAMCommand* orderAsync(int, u32, u32, u32, JKRAramBlock*, JKRAMCommand::AsyncCallback);
|
|
static BOOL sync(JKRAMCommand*, int);
|
|
static BOOL orderSync(int, u32, u32, u32, JKRAramBlock*);
|
|
static void startDMA(JKRAMCommand*);
|
|
static void doneDMA(u32);
|
|
|
|
private:
|
|
static void lock() { OSLockMutex(&mMutex); }
|
|
static void unlock() { OSUnlockMutex(&mMutex); }
|
|
};
|
|
|
|
inline BOOL JKRAramPcs(int direction, u32 source, u32 destination, u32 length,
|
|
JKRAramBlock* block) {
|
|
return JKRAramPiece::orderSync(direction, source, destination, length, block);
|
|
}
|
|
|
|
#endif /* JKRARAMPIECE_H */
|