mirror of
https://github.com/zeldaret/oot.git
synced 2025-02-12 00:20:10 +00:00
* git subrepo clone git@github.com:Thar0/com-plugin.git tools/com-plugin subrepo: subdir: "tools/com-plugin" merged: "e8543312d" upstream: origin: "git@github.com:Thar0/com-plugin.git" branch: "main" commit: "e8543312d" git-subrepo: version: "0.4.6" origin: "https://github.com/ingydotnet/git-subrepo" commit: "110b9eb" * ique-cn OK * Review suggestions * Most suggestions * git subrepo pull tools/com-plugin subrepo: subdir: "tools/com-plugin" merged: "81595ed1c" upstream: origin: "git@github.com:Thar0/com-plugin.git" branch: "main" commit: "81595ed1c" git-subrepo: version: "0.4.6" origin: "https://github.com/ingydotnet/git-subrepo" commit: "110b9eb" * Fix other versions
75 lines
2.6 KiB
C
75 lines
2.6 KiB
C
#ifndef ULTRA64_MESSAGE_H
|
|
#define ULTRA64_MESSAGE_H
|
|
|
|
#define OS_MESG_NOBLOCK 0
|
|
#define OS_MESG_BLOCK 1
|
|
|
|
#ifndef BBPLAYER
|
|
#define OS_NUM_EVENTS 15
|
|
#else
|
|
#define OS_NUM_EVENTS 31
|
|
#endif
|
|
|
|
#define OS_EVENT_SW1 0 /* CPU SW1 interrupt */
|
|
#define OS_EVENT_SW2 1 /* CPU SW2 interrupt */
|
|
#define OS_EVENT_CART 2 /* Cartridge interrupt: used by rmon */
|
|
#define OS_EVENT_COUNTER 3 /* Counter int: used by VI/Timer Mgr */
|
|
#define OS_EVENT_SP 4 /* SP task done interrupt */
|
|
#define OS_EVENT_SI 5 /* SI (controller) interrupt */
|
|
#define OS_EVENT_AI 6 /* AI interrupt */
|
|
#define OS_EVENT_VI 7 /* VI interrupt: used by VI/Timer Mgr */
|
|
#define OS_EVENT_PI 8 /* PI interrupt: used by PI Manager */
|
|
#define OS_EVENT_DP 9 /* DP full sync interrupt */
|
|
#define OS_EVENT_CPU_BREAK 10 /* CPU breakpoint: used by rmon */
|
|
#define OS_EVENT_SP_BREAK 11 /* SP breakpoint: used by rmon */
|
|
#define OS_EVENT_FAULT 12 /* CPU fault event: used by rmon */
|
|
#define OS_EVENT_THREADSTATUS 13 /* CPU thread status: used by rmon */
|
|
#define OS_EVENT_PRENMI 14 /* Pre NMI interrupt */
|
|
#ifdef BBPLAYER
|
|
#define OS_EVENT_FLASH 23 /* NAND flash operation complete */
|
|
#define OS_EVENT_AES 24 /* AES decryption complete */
|
|
#define OS_EVENT_IDE 25 /* IDE transfer complete */
|
|
#define OS_EVENT_PI_ERR 26 /* PI Error? */
|
|
#define OS_EVENT_USB0 27 /* USB Controller 0 */
|
|
#define OS_EVENT_USB1 28 /* USB Controller 1 */
|
|
#define OS_EVENT_UNK_29 29 /* ? */
|
|
#define OS_EVENT_MD 30 /* Memory card removed */
|
|
#endif
|
|
|
|
#ifdef _LANGUAGE_C
|
|
|
|
#include "thread.h"
|
|
|
|
typedef void* OSMesg;
|
|
typedef u32 OSEvent;
|
|
|
|
typedef struct OSMesgQueue {
|
|
/* 0x00 */ OSThread* mtqueue;
|
|
/* 0x04 */ OSThread* fullqueue;
|
|
/* 0x08 */ s32 validCount;
|
|
/* 0x0C */ s32 first;
|
|
/* 0x10 */ s32 msgCount;
|
|
/* 0x14 */ OSMesg* msg;
|
|
} OSMesgQueue; // size = 0x18
|
|
|
|
/* Get count of valid messages in queue */
|
|
#define MQ_GET_COUNT(mq) ((mq)->validCount)
|
|
|
|
/* Determine if message queue is empty or full */
|
|
#define MQ_IS_EMPTY(mq) (MQ_GET_COUNT(mq) == 0)
|
|
#define MQ_IS_FULL(mq) (MQ_GET_COUNT(mq) >= (mq)->msgCount)
|
|
|
|
#else
|
|
|
|
/* OSMesgQueue struct member offsets */
|
|
|
|
#define MQ_MTQUEUE 0x00
|
|
#define MQ_FULLQUEUE 0x04
|
|
#define MQ_VALIDCOUNT 0x08
|
|
#define MQ_FIRST 0x0C
|
|
#define MQ_MSGCOUNT 0x10
|
|
#define MQ_MSG 0x14
|
|
|
|
#endif
|
|
|
|
#endif
|