mirror of
https://github.com/n64decomp/mk64
synced 2026-06-11 20:48:41 -04:00
5c23113592
* libultra from sm64 integrated; 3 libultra functions matched * All of libultra done! authored-by: farisawan-2000 <farisawan.2000@gmail.com>
39 lines
1.1 KiB
C
39 lines
1.1 KiB
C
#define MK64
|
|
|
|
#include "libultra_internal.h"
|
|
#include "hardware.h"
|
|
|
|
// this file must include some globally referenced data because it is not called anywhere
|
|
// data, comes shortly before _Ldtob I think, before crash_screen
|
|
|
|
extern OSPiHandle *__osPiTable;
|
|
// bss
|
|
OSPiHandle LeoDiskHandle;
|
|
OSPiHandle *__osDiskHandle;
|
|
|
|
OSPiHandle *osLeoDiskInit(void) {
|
|
s32 sp1c;
|
|
LeoDiskHandle.type = 2;
|
|
LeoDiskHandle.baseAddress = (0xa0000000 | 0x05000000);
|
|
LeoDiskHandle.latency = 3;
|
|
LeoDiskHandle.pulse = 6;
|
|
LeoDiskHandle.pageSize = 6;
|
|
LeoDiskHandle.relDuration = 2;
|
|
#ifdef VERSION_SH
|
|
LeoDiskHandle.domain = 1;
|
|
#endif
|
|
HW_REG(PI_BSD_DOM2_LAT_REG, u32) = LeoDiskHandle.latency;
|
|
HW_REG(PI_BSD_DOM2_PWD_REG, u32) = LeoDiskHandle.pulse;
|
|
HW_REG(PI_BSD_DOM2_PGS_REG, u32) = LeoDiskHandle.pageSize;
|
|
HW_REG(PI_BSD_DOM2_RLS_REG, u32) = LeoDiskHandle.relDuration;
|
|
bzero(&LeoDiskHandle.transferInfo, sizeof(__OSTranxInfo));
|
|
sp1c = __osDisableInt();
|
|
LeoDiskHandle.next = __osPiTable;
|
|
__osPiTable = &LeoDiskHandle;
|
|
__osDiskHandle = &LeoDiskHandle;
|
|
__osRestoreInt(sp1c);
|
|
return &LeoDiskHandle;
|
|
}
|
|
|
|
#undef MK64
|