mirror of https://github.com/PrimeDecomp/prime.git
Cleanup HW register usage
This commit is contained in:
parent
1e5c3990ea
commit
b1137488f6
|
@ -58,7 +58,8 @@
|
|||
"osfastcast.h": "c",
|
||||
"osfont.h": "c",
|
||||
"arq.h": "c",
|
||||
"string.h": "c"
|
||||
"string.h": "c",
|
||||
"hw_regs.h": "c"
|
||||
},
|
||||
"files.autoSave": "onFocusChange",
|
||||
"files.insertFinalNewline": true,
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define _DOLPHIN_DVDPRIV
|
||||
|
||||
#include <dolphin/dvd.h>
|
||||
#include <dolphin/dvd_regs.h>
|
||||
#include <dolphin/hw_regs.h>
|
||||
#include <types.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -37,10 +37,9 @@ typedef struct DVDBB2 {
|
|||
|
||||
typedef void (*DVDOptionalCommandChecker)(DVDCommandBlock* block, void (*cb)(u32 intType));
|
||||
typedef void (*DVDLowCallback)(u32 intType);
|
||||
|
||||
extern DVDDiskID* DVDGetCurrentDiskID();
|
||||
DVDLowCallback DVDLowClearCallback();
|
||||
BOOL DVDLowSeek(u32 offset, DVDLowCallback callback);
|
||||
|
||||
void __DVDLowSetWAType(u32 type, u32 location);
|
||||
DVDCommandBlock* __DVDPopWaitingQueue();
|
||||
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
#ifndef _DOLPHIN_DSP_REGS
|
||||
#define _DOLPHIN_DSP_REGS
|
||||
|
||||
#include "types.h"
|
||||
|
||||
vu16 __DSPRegs[32] : 0xCC005000;
|
||||
vu32 __AIRegs[8] : 0xCC006C00;
|
||||
|
||||
#endif // _DOLPHIN_DSP_REGS
|
|
@ -1,6 +0,0 @@
|
|||
#ifndef _DOLPHIN_DVD_REGS
|
||||
#define _DOLPHIN_DVD_REGS
|
||||
|
||||
vu32 __DIRegs[16] : 0xCC006000;
|
||||
|
||||
#endif // _DOLPHIN_DVD_REGS
|
|
@ -0,0 +1,35 @@
|
|||
#ifndef _DOLPHIN_HW_REGS
|
||||
#define _DOLPHIN_HW_REGS
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __MWERKS__
|
||||
vu16 __VIRegs[59] : 0xCC002000;
|
||||
vu32 __PIRegs[12] : 0xCC003000;
|
||||
vu16 __MEMRegs[64] : 0xCC004000;
|
||||
vu16 __DSPRegs[32] : 0xCC005000;
|
||||
vu32 __DIRegs[16] : 0xCC006000;
|
||||
vu32 __SIRegs[64] : 0xCC006400;
|
||||
vu32 __EXIRegs[16] : 0xCC006800;
|
||||
vu32 __AIRegs[8] : 0xCC006C00;
|
||||
|
||||
#else
|
||||
#define __VIRegs ((vu16*)0xCC002000)
|
||||
#define __PIRegs ((vu32*)0xCC003000)
|
||||
#define __MEMRegs ((vu16*)0xCC004000)
|
||||
#define __DSPRegs ((vu16*)0xCC005000)
|
||||
#define __DIRegs ((vu32*)0xCC006000)
|
||||
#define __SIRegs ((vu32*)0xCC006400)
|
||||
#define __EXIRegs ((vu32*)0xCC006800)
|
||||
#define __AIRegs ((vu32*)0xCC006C00)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _DOLPHIN_HW_REGS
|
|
@ -12,7 +12,7 @@ OSTime __OSGetSystemTime();
|
|||
OSTime __OSTimeToSystemTime(OSTime);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _DOLPHIN_OSPRIV
|
||||
|
|
|
@ -22,11 +22,7 @@ void VISetWindowFullscreen(bool fullscreen);
|
|||
bool VIGetWindowFullscreen();
|
||||
#endif
|
||||
|
||||
#ifdef __MWERKS__
|
||||
vu16 __VIRegs[59] : 0xCC002000;
|
||||
#else
|
||||
vu16 __VIRegs[59];
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "dolphin/ai.h"
|
||||
#include "dolphin/dsp_regs.h"
|
||||
#include "dolphin/hw_regs.h"
|
||||
#include "dolphin/os.h"
|
||||
|
||||
const char* __AIVersion = "<< Dolphin SDK - AI\trelease build: Sep 5 2002 05:34:25 (0x2301) >>";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include "dolphin/ar.h"
|
||||
|
||||
#include "dolphin/dsp_regs.h"
|
||||
#include "dolphin/hw_regs.h"
|
||||
#include "dolphin/os.h"
|
||||
|
||||
static const char* __ARVersion =
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include <dolphin/CARDPriv.h>
|
||||
#include <dolphin/OSRtcPriv.h>
|
||||
#include <dolphin/vi.h>
|
||||
#include <dolphin/hw_regs.h>
|
||||
|
||||
static void FormatCallback(s32 chan, s32 result) {
|
||||
CARDControl* card;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#include "dolphin/dsp.h"
|
||||
#include "dolphin/os.h"
|
||||
|
||||
#include "dolphin/dsp_regs.h"
|
||||
#include "dolphin/hw_regs.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "dolphin/dsp.h"
|
||||
#include "dolphin/dsp_regs.h"
|
||||
#include "dolphin/hw_regs.h"
|
||||
|
||||
DSPTaskInfo* __DSP_curr_task;
|
||||
DSPTaskInfo* __DSP_first_task;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <dolphin/DVDPriv.h>
|
||||
#include <dolphin/dvd.h>
|
||||
#include <dolphin/dvd_regs.h>
|
||||
#include <dolphin/hw_regs.h>
|
||||
#include <dolphin/os.h>
|
||||
#include <dolphin/os/OSBootInfo.h>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <dolphin/DVDPriv.h>
|
||||
#include <dolphin/dvd.h>
|
||||
#include <dolphin/dvd_regs.h>
|
||||
#include <dolphin/hw_regs.h>
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
extern DVDDiskID* DVDGetCurrentDiskID();
|
||||
|
||||
extern OSTime __OSGetSystemTime();
|
||||
vu32 __PIRegs[12] : 0xCC003000;
|
||||
|
||||
static BOOL FirstRead = TRUE;
|
||||
static volatile BOOL StopAtNextInt = FALSE;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#include <dolphin/DVDPriv.h>
|
||||
#include <dolphin/dvd.h>
|
||||
#include <dolphin/dvd_regs.h>
|
||||
#include <dolphin/hw_regs.h>
|
||||
#include <dolphin/os.h>
|
||||
#include <dolphin/os/OSBootInfo.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#include "dolphin/os.h"
|
||||
#include "dolphin/hw_regs.h"
|
||||
|
||||
#pragma scheduling off
|
||||
|
||||
vu32 __EXIRegs[16] : 0xCC006800;
|
||||
|
||||
static const char* __EXIVersion =
|
||||
"<< Dolphin SDK - EXI\trelease build: Sep 5 2002 05:33:04 (0x2301) >>";
|
||||
|
||||
|
|
|
@ -605,7 +605,6 @@ void __OSPSInit(void)
|
|||
// clang-format on
|
||||
}
|
||||
|
||||
vu32 __DIRegs[16] : 0xCC006000;
|
||||
#define DI_CONFIG_IDX 0x9
|
||||
#define DI_CONFIG_CONFIG_MASK 0xFF
|
||||
u32 __OSGetDIConfig(void) { return (__DIRegs[DI_CONFIG_IDX] & DI_CONFIG_CONFIG_MASK); }
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#include "types.h"
|
||||
#include "dolphin/hw_regs.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
@ -17,7 +18,6 @@ static u8 DSPInitCode[128] = {
|
|||
// clang-format on
|
||||
};
|
||||
|
||||
volatile u16 __DSPRegs[] : 0xCC005000;
|
||||
#define __DSPWorkBuffer (void*)0x81000000
|
||||
|
||||
void __OSInitAudioSystem(void) {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
#include <dolphin/PPCArch.h>
|
||||
#include <dolphin/dsp_regs.h>
|
||||
#include <dolphin/dvd_regs.h>
|
||||
#include <dolphin/hw_regs.h>
|
||||
#include <dolphin/os.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
|
|
@ -1,15 +1,9 @@
|
|||
#include <dolphin/os.h>
|
||||
#include <dolphin/hw_regs.h>
|
||||
|
||||
static asm void ExternalInterruptHandler(register __OSException exception,
|
||||
register OSContext* context);
|
||||
|
||||
// TODO: Move these to a more appropriate location
|
||||
vu32 __PIRegs[12] : 0xCC003000;
|
||||
vu32 __EXIRegs[16] : 0xCC006800;
|
||||
vu16 __MEMRegs[64] : 0xCC004000;
|
||||
vu16 __DSPRegs[32] : 0xCC005000;
|
||||
vu32 __AIRegs[8] : 0xCC006C00;
|
||||
|
||||
extern void __RAS_OSDisableInterrupts_begin(void);
|
||||
extern void __RAS_OSDisableInterrupts_end(void);
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "dolphin/OSRtcPriv.h"
|
||||
#include "dolphin/os.h"
|
||||
#include "dolphin/vi.h"
|
||||
#include "dolphin/hw_regs.h"
|
||||
|
||||
volatile u8 DAT_800030e2 : 0x800030e2;
|
||||
typedef struct Unk {
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "dolphin/sipriv.h"
|
||||
#include "dolphin/vi.h"
|
||||
#include "dolphin/hw_regs.h"
|
||||
|
||||
#pragma dont_inline on
|
||||
static u32 SamplingRate;
|
||||
|
||||
|
|
Loading…
Reference in New Issue