Files
Diddy-Kong-Racing/include/PR/os.h
T
41385fc098 7 new matches, and code cleanup (#215)
* Match func_8007EF80

* Match func_80027E24

* Add some names to the function

* Match func_80029DE0

* BoundingBox variables named

* Fix NON_EQUIVALENT functions not building due to struct changes

* Documenting

* Match get_level_segment_index_from_position

* Minor revision of last match

* Match traverse_segments_bsp_tree

* Match render_level_geometry_and_objects

* Cleaned up some warnings

* Update math.c includes to more specifically include our version of math.h, which fixes generating ctx.c

* Add a livediff.sh helper script

* Match func_80067D3C

* Map instances of + 0x8000000 to OS_PHYSICAL_TO_K0, because that's what made sense to me with that

* Convert a lot of data types to Mtx, update some vairable names, and fix some warnings

* Clean up the func_80068408 fast3d_cmd

* Fix unused parameter warnings in object_functions.c

* Commit suggestions from Faschz

* WIP func_8007BA5C

* func_8007BA5C WIP

* More func_8007BA5C work

* Leaving func_8007BA5C as is for now.

* WIP func_8007BF34

* Update some signatures and add some externs to help ctx.c generation

* WIP func_8007B4E8

* Fix missing reference to a var in a non-matching func

* Update src/textures_sprites.h

Co-authored-by: AntonioCastelli <aatcastelli@gmail.com>

* Update src/unknown_0255E0.c

Co-authored-by: AntonioCastelli <aatcastelli@gmail.com>

* Rename some vars in func_8002A134

Co-authored-by: Ryan Myers <foldor@gmail.com>
Co-authored-by: AntonioCastelli <aatcastelli@gmail.com>
2022-03-28 08:36:12 -04:00

55 lines
1.5 KiB
C

#ifndef _ULTRA64_OS_INTERNAL_H_
#define _ULTRA64_OS_INTERNAL_H_
/* Internal functions used by the operating system */
/* Do not include this header in application code */
#include "os_thread.h"
/*
* Leo Disk
*/
/* transfer mode */
#define LEO_BLOCK_MODE 1
#define LEO_TRACK_MODE 2
#define LEO_SECTOR_MODE 3
/* Variables */
/*
* CPU counter increments at 3/4 of bus clock rate:
*
* Bus Clock Proc Clock Counter (1/2 Proc Clock)
* --------- ---------- ------------------------
* 62.5 Mhz 93.75 Mhz 46.875 Mhz
*/
extern u64 osClockRate;
#define OS_CLOCK_RATE 62500000LL
#define OS_CPU_COUNTER (OS_CLOCK_RATE*3/4)
#define OS_NSEC_TO_CYCLES(n) (((u64)(n)*(OS_CPU_COUNTER/15625000LL))/(1000000000LL/15625000LL))
#define OS_USEC_TO_CYCLES(n) (((u64)(n)*(OS_CPU_COUNTER/15625LL))/(1000000LL/15625LL))
#define OS_CYCLES_TO_NSEC(c) (((u64)(c)*(1000000000LL/15625000LL))/(OS_CPU_COUNTER/15625000LL))
#define OS_CYCLES_TO_USEC(c) (((u64)(c)*(1000000LL/15625LL))/(OS_CPU_COUNTER/15625LL))
/* Functions */
u32 __osProbeTLB(void *);
u32 __osDisableInt(void);
void __osRestoreInt(u32);
OSThread *__osGetCurrFaultedThread(void);
/* Address translation routines and macros */
extern u32 osVirtualToPhysical(void *);
extern void * osPhysicalToVirtual(u32);
#define OS_K0_TO_PHYSICAL(x) (u32)(((char *)(x)-0x80000000))
#define OS_K1_TO_PHYSICAL(x) (u32)(((char *)(x)-0xa0000000))
#define OS_PHYSICAL_TO_K0(x) (void *)(((u32)(x)+0x80000000))
#define OS_PHYSICAL_TO_K1(x) (void *)(((u32)(x)+0xa0000000))
#endif