Skip to content

Commit

Permalink
Move some headers from src to include/PRinternal (#77)
Browse files Browse the repository at this point in the history
* controller.h

* siint.h

* osint and viint

* piint.h

* rmonint.h

* Remove ARRLEN from controller.h

* PRinternal

* controller_gbpak.h and controller_voice.h
  • Loading branch information
hensldm authored Jun 7, 2024
1 parent 5e8f8f0 commit a1542b6
Show file tree
Hide file tree
Showing 216 changed files with 269 additions and 247 deletions.
2 changes: 0 additions & 2 deletions src/io/controller.h → include/PRinternal/controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
#include "PR/os_version.h"
#include "PR/rcp.h"

//should go somewhere else but
#define ARRLEN(x) ((s32)(sizeof(x) / sizeof(x[0])))
#define CHNL_ERR(format) (((format).rxsize & CHNL_ERR_MASK) >> 4)

typedef struct
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/debug/assert.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "os.h"
#include "../os/osint.h"
#include "PRinternal/osint.h"
#include "osint_debug.h"

void __assertBreak(void);
Expand Down
2 changes: 1 addition & 1 deletion src/debug/profile.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "PR/ultraerror.h"
#include "PR/ultralog.h"
#include "PR/sptask.h"
#include "../os/osint.h"
#include "PRinternal/osint.h"
#include "macros.h"
#include "osint_debug.h"

Expand Down
2 changes: 1 addition & 1 deletion src/gio/giointerrupt.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "PR/os_internal.h"
#include "../io/piint.h"
#include "PRinternal/piint.h"

void __osGIOInterrupt(s32 value) {
__osPiGetAccess();
Expand Down
2 changes: 1 addition & 1 deletion src/gio/giorawinterrupt.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "PR/os_internal.h"
#include "PR/rcp.h"
#include "../io/piint.h"
#include "PRinternal/piint.h"

void __osGIORawInterrupt(s32 value) {
register u32 stat;
Expand Down
2 changes: 1 addition & 1 deletion src/io/aisetfreq.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "PR/rcp.h"
#include "PR/ultraerror.h"
#include "../os/osint.h"
#include "PRinternal/osint.h"
// TODO: not sure if this should be here
extern s32 osViClock;

Expand Down
2 changes: 1 addition & 1 deletion src/io/aisetnextbuf.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "PR/os_internal.h"
#include "PR/ultraerror.h"
#include "PR/rcp.h"
#include "../os/osint.h"
#include "PRinternal/osint.h"

// TODO: this comes from a header
#ident "$Revision: 1.17 $"
Expand Down
2 changes: 1 addition & 1 deletion src/io/cartrominit.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "PR/os_internal.h"
#include "PR/R4300.h"
#include "PR/rcp.h"
#include "piint.h"
#include "PRinternal/piint.h"

#if BUILD_VERSION >= VERSION_J
OSPiHandle __CartRomHandle ALIGNED(8);
Expand Down
4 changes: 2 additions & 2 deletions src/io/contchannelreset.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "PR/os_internal.h"
#include "controller.h"
#include "siint.h"
#include "PRinternal/controller.h"
#include "PRinternal/siint.h"

s32 __osContChannelReset(OSMesgQueue* mq, int channel) {
s32 i;
Expand Down
2 changes: 1 addition & 1 deletion src/io/conteeplongread.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "PR/os_internal.h"
#include "controller.h"
#include "PRinternal/controller.h"

s32 osEepromLongRead(OSMesgQueue* mq, u8 address, u8* buffer, int length) {
s32 ret = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/io/conteeplongwrite.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "PR/os_internal.h"
#include "controller.h"
#include "PRinternal/controller.h"

s32 osEepromLongWrite(OSMesgQueue* mq, u8 address, u8* buffer, int length) {
s32 ret = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/io/conteepprobe.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "controller.h"
#include "siint.h"
#include "PRinternal/controller.h"
#include "PRinternal/siint.h"

s32 osEepromProbe(OSMesgQueue* mq) {
s32 ret = 0;
Expand Down
4 changes: 2 additions & 2 deletions src/io/conteepread.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "macros.h"
#include "PR/rcp.h"
#include "controller.h"
#include "siint.h"
#include "PRinternal/controller.h"
#include "PRinternal/siint.h"

OSPifRam __osEepPifRam ALIGNED(16);
#if BUILD_VERSION >= VERSION_L
Expand Down
5 changes: 3 additions & 2 deletions src/io/conteepwrite.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include "macros.h"
#include "PR/os_internal.h"
#include "PR/rcp.h"
#include "controller.h"
#include "siint.h"
#include "PRinternal/controller.h"
#include "PRinternal/siint.h"

static void __osPackEepWriteData(u8 address, u8* buffer);
s32 osEepromWrite(OSMesgQueue* mq, u8 address, u8* buffer) {
Expand Down
2 changes: 1 addition & 1 deletion src/io/contpfs.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "macros.h"
#include "PR/os_internal.h"
#include "PR/os_version.h"
#include "controller.h"
#include "PRinternal/controller.h"
#include "PR/rmon.h"

#if BUILD_VERSION >= VERSION_J
Expand Down
4 changes: 2 additions & 2 deletions src/io/contquery.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "PR/os_internal.h"
#include "controller.h"
#include "siint.h"
#include "PRinternal/controller.h"
#include "PRinternal/siint.h"

s32 osContStartQuery(OSMesgQueue* mq) {
s32 ret = 0;
Expand Down
5 changes: 3 additions & 2 deletions src/io/contramread.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include "macros.h"
#include "PR/os_internal.h"
#include "PR/rcp.h"
#include "controller.h"
#include "siint.h"
#include "PRinternal/controller.h"
#include "PRinternal/siint.h"

#define READFORMAT(ptr) ((__OSContRamReadFormat*)(ptr))

Expand Down
5 changes: 3 additions & 2 deletions src/io/contramwrite.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#include "macros.h"
#include "PR/os_internal.h"
#include "PR/rcp.h"
#include "controller.h"
#include "siint.h"
#include "PRinternal/controller.h"
#include "PRinternal/siint.h"

extern s32 __osPfsLastChannel;

Expand Down
5 changes: 3 additions & 2 deletions src/io/contreaddata.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "macros.h"
#include "PR/os_internal.h"
#include "controller.h"
#include "siint.h"
#include "PRinternal/controller.h"
#include "PRinternal/siint.h"

static void __osPackReadData(void);

Expand Down
4 changes: 2 additions & 2 deletions src/io/contreset.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "PR/os_internal.h"
#include "controller.h"
#include "siint.h"
#include "PRinternal/controller.h"
#include "PRinternal/siint.h"

void __osPackResetData(void);

Expand Down
4 changes: 2 additions & 2 deletions src/io/controller.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "macros.h"
#include "PR/os_internal.h"
#include "controller.h"
#include "siint.h"
#include "PRinternal/controller.h"
#include "PRinternal/siint.h"

OSPifRam __osContPifRam ALIGNED(16);
u8 __osContLastCmd;
Expand Down
4 changes: 2 additions & 2 deletions src/io/contsetch.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "PR/os_internal.h"
#include "controller.h"
#include "siint.h"
#include "PRinternal/controller.h"
#include "PRinternal/siint.h"

s32 osContSetCh(u8 ch) {
s32 ret = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/io/devmgr.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "PR/os_internal.h"
#include "PR/rcp.h"
#include "piint.h"
#include "PRinternal/piint.h"

void __osDevMgrMain(void* args) {
OSIoMesg* mb;
Expand Down
2 changes: 1 addition & 1 deletion src/io/dpsetnextbuf.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "PR/os_internal.h"
#include "PR/ultraerror.h"
#include "PR/rcp.h"
#include "../os/osint.h"
#include "PRinternal/osint.h"

// TODO: this comes from a header
#ident "$Revision: 1.17 $"
Expand Down
2 changes: 1 addition & 1 deletion src/io/epidma.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "piint.h"
#include "PRinternal/piint.h"
#include "PR/ultraerror.h"

s32 osEPiStartDma(OSPiHandle* pihandle, OSIoMesg* mb, s32 direction) {
Expand Down
2 changes: 1 addition & 1 deletion src/io/epigettype.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "piint.h"
#include "PRinternal/piint.h"

s32 osEPiGetDeviceType(OSPiHandle* pihandle, OSPiInfo* info) {
info->type = pihandle->type;
Expand Down
2 changes: 1 addition & 1 deletion src/io/epilinkhandle.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "piint.h"
#include "PRinternal/piint.h"

s32 osEPiLinkHandle(OSPiHandle* EPiHandle) {
u32 saveMask = __osDisableInt();
Expand Down
2 changes: 1 addition & 1 deletion src/io/epirawdma.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "piint.h"
#include "PRinternal/piint.h"
#include "PR/ultraerror.h"

// TODO: this comes from a header
Expand Down
2 changes: 1 addition & 1 deletion src/io/epirawread.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "piint.h"
#include "PRinternal/piint.h"
#include "PR/ultraerror.h"
#include "assert.h"

Expand Down
2 changes: 1 addition & 1 deletion src/io/epirawwrite.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "piint.h"
#include "PRinternal/piint.h"
#include "PR/ultraerror.h"

// TODO: this comes from a header
Expand Down
2 changes: 1 addition & 1 deletion src/io/epiread.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "piint.h"
#include "PRinternal/piint.h"
#include "PR/ultraerror.h"

s32 osEPiReadIo(OSPiHandle* pihandle, u32 devAddr, u32* data) {
Expand Down
2 changes: 1 addition & 1 deletion src/io/epiwrite.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "piint.h"
#include "PRinternal/piint.h"
#include "PR/ultraerror.h"

s32 osEPiWriteIo(OSPiHandle* pihandle, u32 devAddr, u32 data) {
Expand Down
2 changes: 1 addition & 1 deletion src/io/gbpakcheckconnector.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "macros.h"
#include "PR/os_internal.h"
#include "controller.h"
#include "PRinternal/controller.h"

s32 osGbpakCheckConnector(OSPfs* pfs, u8* status) {
s32 ret;
Expand Down
2 changes: 1 addition & 1 deletion src/io/gbpakgetbank.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "PR/os_internal.h"
#include "controller.h"
#include "PRinternal/controller.h"

s32 __osGbpakGetBank(OSPfs* pfs, u8* bank) {
s32 ret;
Expand Down
2 changes: 1 addition & 1 deletion src/io/gbpakgetstatus.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "PR/os_internal.h"
#include "controller.h"
#include "PRinternal/controller.h"

s32 osGbpakGetStatus(OSPfs* pfs, u8* status) {
s32 ret;
Expand Down
4 changes: 2 additions & 2 deletions src/io/gbpakinit.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "macros.h"
#include "PR/os_internal.h"
#include "controller.h"
#include "controller_gbpak.h"
#include "PRinternal/controller.h"
#include "PRinternal/controller_gbpak.h"

OSTimer __osGbpakTimer;
OSMesgQueue __osGbpakTimerQ ALIGNED(8);
Expand Down
4 changes: 2 additions & 2 deletions src/io/gbpakpower.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "PR/os_internal.h"
#include "controller.h"
#include "controller_gbpak.h"
#include "PRinternal/controller.h"
#include "PRinternal/controller_gbpak.h"

s32 osGbpakPower(OSPfs* pfs, s32 flag) {
s32 i;
Expand Down
2 changes: 1 addition & 1 deletion src/io/gbpakreadid.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "macros.h"
#include "PR/os_internal.h"
#include "controller.h"
#include "PRinternal/controller.h"
#include "os_version.h"

s32 osGbpakReadId(OSPfs* pfs, OSGbpakId* id, u8* status) {
Expand Down
2 changes: 1 addition & 1 deletion src/io/gbpakreadwrite.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "PR/os_internal.h"
#include "controller.h"
#include "PRinternal/controller.h"
#include "os_version.h"

s32 __osGbpakSetBank(OSPfs* pfs, u8 bank);
Expand Down
2 changes: 1 addition & 1 deletion src/io/gbpaksetbank.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "PR/os_internal.h"
#include "controller.h"
#include "PRinternal/controller.h"

s32 __osGbpakSetBank(OSPfs* pfs, u8 bank) {
int i;
Expand Down
4 changes: 2 additions & 2 deletions src/io/leointerrupt.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "PR/os_internal.h"
#include "PR/rcp.h"
#include "../os/osint.h"
#include "piint.h"
#include "PRinternal/osint.h"
#include "PRinternal/piint.h"
#include "macros.h"

extern OSPiHandle *__osDiskHandle;
Expand Down
4 changes: 2 additions & 2 deletions src/io/motor.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include "macros.h"
#include "PR/os_internal.h"
#include "PR/os_version.h"
#include "controller.h"
#include "siint.h"
#include "PRinternal/controller.h"
#include "PRinternal/siint.h"

#if BUILD_VERSION >= VERSION_J
static OSPifRam __MotorDataBuf[MAXCONTROLLERS] ALIGNED(8);
Expand Down
3 changes: 2 additions & 1 deletion src/io/pfsallocatefile.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "macros.h"
#include "PR/os_internal.h"
#include "controller.h"
#include "PRinternal/controller.h"
#include "PR/rmon.h"

#define ROUND_UP_DIVIDE(numerator, denominator) (((numerator) + (denominator)-1) / (denominator))
Expand Down
3 changes: 2 additions & 1 deletion src/io/pfschecker.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "macros.h"
#include "PR/os_internal.h"
#include "controller.h"
#include "PRinternal/controller.h"

s32 corrupted_init(OSPfs* pfs, __OSInodeCache* cache);
s32 corrupted(OSPfs* pfs, __OSInodeUnit fpage, __OSInodeCache* cache);
Expand Down
3 changes: 2 additions & 1 deletion src/io/pfsdeletefile.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "macros.h"
#include "PR/os_internal.h"
#include "controller.h"
#include "PRinternal/controller.h"

s32 osPfsDeleteFile(OSPfs* pfs, u16 company_code, u32 game_code, u8* game_name, u8* ext_name) {
s32 file_no;
Expand Down
3 changes: 2 additions & 1 deletion src/io/pfsfilestate.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "macros.h"
#include "PR/os_internal.h"
#include "controller.h"
#include "PRinternal/controller.h"

s32 osPfsFileState(OSPfs* pfs, s32 file_no, OSPfsState* state) {
s32 ret;
Expand Down
3 changes: 2 additions & 1 deletion src/io/pfsfreeblocks.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "macros.h"
#include "PR/os_internal.h"
#include "controller.h"
#include "PRinternal/controller.h"

s32 osPfsFreeBlocks(OSPfs* pfs, s32* bytes_not_used) {
int j;
Expand Down
3 changes: 2 additions & 1 deletion src/io/pfsgetlabel.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "macros.h"
#include "PR/os_internal.h"
#include "controller.h"
#include "PRinternal/controller.h"

s32 osPfsGetLabel(OSPfs* pfs, u8* label, int* len) {
int i;
Expand Down
Loading

0 comments on commit a1542b6

Please sign in to comment.