Finished up the rest of the data sections

This commit is contained in:
David Benepe
2021-05-27 19:19:59 -07:00
committed by Antonio Castelli
parent 1b3b2b3a64
commit 02861089ad
17 changed files with 2972 additions and 1184 deletions
+1201 -1171
View File
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -4,7 +4,8 @@
#include "macros.h"
#include "libultra_internal.h"
extern OSTimer *D_800E4910;
OSTimer *D_800E4910 = (OSTimer *)0x8012D200;
extern OSTime __osCurrentTime;
extern u32 __osBaseCounter;
extern u32 D_8012D22C;
+1 -2
View File
@@ -5,15 +5,14 @@
#include "macros.h"
#include "libultra_internal.h"
#define OS_VIM_STACKSIZE 4096
extern OSTime __osCurrentTime;
extern u32 __osBaseCounter;
extern u32 D_8012D22C; //__osViIntrCount
OSDevMgr __osViDevMgr = {0};
extern OSDevMgr __osViDevMgr;
extern u8 viThreadStack[OS_VIM_STACKSIZE];
extern OSThread viThread;
extern OSMesgQueue viEventQueue;
+2
View File
@@ -5,6 +5,8 @@
#include "types.h"
#include "macros.h"
ALGlobals *alGlobals = NULL;
GLOBAL_ASM("lib/asm/non_matchings/unknown_0C91A0/alCSPPlay.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0C91A0/alCSPStop.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0C91A0/func_800C8600.s")
+2
View File
@@ -4,4 +4,6 @@
#include "types.h"
#include "macros.h"
u8 D_800E3790 = 0;
GLOBAL_ASM("lib/asm/non_matchings/unknown_0C9970/func_800C8D70.s")
+27
View File
@@ -4,4 +4,31 @@
#include "types.h"
#include "macros.h"
// This probably does not belong here. Please move it to the appropriate place!
#define EQPOWER_LENGTH 128
static s16 eqpower[ EQPOWER_LENGTH ] = {
32767, 32764, 32757, 32744, 32727, 32704,
32677, 32644, 32607, 32564, 32517, 32464,
32407, 32344, 32277, 32205, 32127, 32045,
31958, 31866, 31770, 31668, 31561, 31450,
31334, 31213, 31087, 30957, 30822, 30682,
30537, 30388, 30234, 30075, 29912, 29744,
29572, 29395, 29214, 29028, 28838, 28643,
28444, 28241, 28033, 27821, 27605, 27385,
27160, 26931, 26698, 26461, 26220, 25975,
25726, 25473, 25216, 24956, 24691, 24423,
24151, 23875, 23596, 23313, 23026, 22736,
22442, 22145, 21845, 21541, 21234, 20924,
20610, 20294, 19974, 19651, 19325, 18997,
18665, 18331, 17993, 17653, 17310, 16965,
16617, 16266, 15913, 15558, 15200, 14840,
14477, 14113, 13746, 13377, 13006, 12633,
12258, 11881, 11503, 11122, 10740, 10357,
9971, 9584, 9196, 8806, 8415, 8023,
7630, 7235, 6839, 6442, 6044, 5646,
5246, 4845, 4444, 4042, 3640, 3237,
2833, 2429, 2025, 1620, 1216, 810,
405, 0
};
GLOBAL_ASM("lib/asm/non_matchings/unknown_0C9A20/func_800C8E20.s")
+7
View File
@@ -8,6 +8,13 @@ GLOBAL_ASM("lib/asm/non_matchings/unknown_0CCF90/alMainBusParam.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CCF90/alMainBusPull.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CCF90/alSaveParam.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CCF90/alSavePull.s")
s32 D_800E38A0 = 0; // Not sure what this is.
s32 D_800E38A4 = 62500000; // OSTime osClockRate = OS_CLOCK_RATE;
u32 D_800E38A8 = 0; // u32 __osShutdown = 0;
u32 D_800E38AC = 0x3FFF01; // u32 __OSGlobalIntMask = OS_IM_ALL;
s32 D_800E38B0 = 0; // Not sure what this is.
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CCF90/osInitialize.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CCF90/osSetThreadPri.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CCF90/guPerspectiveF.s")
+2
View File
@@ -4,6 +4,8 @@
#include "types.h"
#include "macros.h"
s32 D_800E38C0 = 0;
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CD820/func_800CCC20.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CD820/func_800CCE18.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CD820/func_800CCEE8.s")
+2
View File
@@ -4,6 +4,8 @@
#include "types.h"
#include "macros.h"
s32 D_800E38D0 = 0;
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CE200/__osSiCreateAccessQueue.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CE200/__osSiGetAccess.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0CE200/__osSiRelAccess.s")
+7 -2
View File
@@ -25,8 +25,13 @@ typedef struct
/* 0x24 */ __OSViScale y;
} __OSViContext;
extern __OSViContext *__osViCurr;
extern __OSViContext *__osViNext;
static __OSViContext vi[2] = {0};
__OSViContext *__osViCurr = &vi[0];
__OSViContext *__osViNext = &vi[1];
#define VI_NTSC_CLOCK 48681812
s32 osViClock = VI_NTSC_CLOCK;
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D29F0/func_800D1DF0.s")
+5 -1
View File
@@ -30,4 +30,8 @@ void __osPiGetAccess(void)
void __osPiRelAccess(void)
{
osSendMesg(&piAccessQueue, NULL, OS_MESG_NOBLOCK);
}
}
// Used with _Litob.s. Please move this later!
char D_800E4920[20] = "0123456789abcdef"; // lowercase hex digits
char D_800E4934[20] = "0123456789ABCDEF"; // uppercase hex digits
+8
View File
@@ -4,6 +4,14 @@
#include "types.h"
#include "macros.h"
// Unused? Probably unrelated to this file, but not sure what it could be.
s32 D_800E48A0[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D43F0/alCopy.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D43F0/_Putfld.s")
// Both of these are used in _Printf
char D_800E48C0[36] = " ";
char D_800E48E4[32] = "00000000000000000000000000000000";
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D43F0/_Printf.s")
+12 -2
View File
@@ -5,8 +5,18 @@
#include "libultra_internal.h"
#include "viint.h"
extern OSThread* __osRunningThread;
extern OSThread* __RunQueue;
struct __osThreadTail
{
OSThread *next;
OSPri priority;
} __osThreadTail;
struct __osThreadTail __osThreadTail = {0, -1};
OSThread *__osActiveQueue = &__osThreadTail.next;
OSThread *__RunQueue = &__osThreadTail.next;
extern OSThread *__osRunningThread = NULL;
extern OSThread *D_800E4894 = NULL; // __osFaultedThread
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/__osViSwapContext.s")
GLOBAL_ASM("lib/asm/non_matchings/unknown_0D3020/func_800D63F0.s")
+70
View File
@@ -0,0 +1,70 @@
#ifndef _VIINT_H
#define _VIINT_H
#include "libultra_internal.h"
#define OS_TV_TYPE_PAL 0
#define OS_TV_TYPE_NTSC 1
#define OS_TV_TYPE_MPAL 2
//TODO: figure out what this is
#define VI_STATE_01 0x01
#define VI_STATE_XSCALE_UPDATED 0x02
#define VI_STATE_YSCALE_UPDATED 0x04
#define VI_STATE_08 0x08 //related to control regs changing
#define VI_STATE_10 0x10 //swap buffer
#define VI_STATE_BLACK 0x20 //probably related to a black screen
#define VI_STATE_REPEATLINE 0x40 //repeat line?
#define VI_STATE_FADE 0x80 //fade
#define VI_CTRL_ANTIALIAS_MODE_3 0x00300 /* Bit [9:8] anti-alias mode */
#define VI_CTRL_ANTIALIAS_MODE_2 0x00200 /* Bit [9:8] anti-alias mode */
#define VI_CTRL_ANTIALIAS_MODE_1 0x00100 /* Bit [9:8] anti-alias mode */
#define VI_SCALE_MASK 0xfff //see rcp scale_x/scale_y
#define VI_2_10_FPART_MASK 0x3ff
#define VI_SUBPIXEL_SH 0x10
#define BURST(hsync_width, color_width, vsync_width, color_start) \
(hsync_width | (color_width << 8) | (vsync_width << 16) | (color_start << 20))
#define WIDTH(v) v
#define VSYNC(v) v
#define HSYNC(duration, leap) (duration | (leap << 16))
#define LEAP(upper, lower) ((upper << 16) | lower)
#define START(start, end) ((start << 16) | end)
#define FTOFIX(val, i, f) ((u32)(val * (f32)(1 << f)) & ((1 << (i + f)) - 1))
#define F210(val) FTOFIX(val, 2, 10)
#define SCALE(scaleup, off) (F210((1.0f / (f32)scaleup)) | (F210((f32)off) << 16))
#define VCURRENT(v) v //seemingly unused
#define ORIGIN(v) v
#define VINTR(v) v
#define HSTART START
typedef struct
{
/* 0x0 */ f32 factor;
/* 0x4 */ u16 offset;
/* 0x8 */ u32 scale;
} __OSViScale;
typedef struct
{
/* 0x0 */ u16 state;
/* 0x2 */ u16 retraceCount;
/* 0x4 */ void *framep;
/* 0x8 */ OSViMode *modep;
/* 0xC */ u32 control;
/* 0x10 */ OSMesgQueue *msgq;
/* 0x14 */ OSMesg msg;
/* 0x18 */ __OSViScale x;
/* 0x24 */ __OSViScale y;
} __OSViContext;
void __osViSwapContext(void);
extern __OSViContext *__osViCurr;
extern __OSViContext *__osViNext;
__OSViContext *__osViGetCurrentContext(void);
void __osViInit(void);
#endif
+1602
View File
File diff suppressed because it is too large Load Diff
+12 -4
View File
@@ -5,16 +5,24 @@
#include "macros.h"
#include "libultra_internal.h"
extern s32 D_800E3770; // boolean
extern s32 D_800E3774;
extern s32 D_800E3778;
extern s32 D_800E377C;
/************ .data ************/
s32 D_800E3770 = 0;
s32 D_800E3774 = -1;
s32 D_800E3778 = -1;
s32 D_800E377C = 0;
/*******************************/
/************ .bss ************/
extern OSMesgQueue D_8012ACA0;
extern OSMesg D_8012ACB8;
extern OSThread D_8012AAF0;
extern void *D_8012CCC0;
/*****************************/
void func_800C74A0(void *arg);
void func_800C7350(void) {
+10 -1
View File
@@ -19,6 +19,12 @@ LIB_ASM_DIR = ROOT_DIR + '/lib/asm'
LIB_SRC_DIR = ROOT_DIR + '/lib/src'
BUILD_DIR = 'build/' + VERSION
LATE_DATA_FILES = [
BUILD_DIR + '/lib/src/unknown_0D43F0.o',
BUILD_DIR + '/lib/src/osTimer.o',
BUILD_DIR + '/lib/src/unknown_0D3020.o'
]
class GenerateLD:
def __init__(self, file):
print('Generating linker file...')
@@ -76,7 +82,10 @@ class GenerateLD:
self.gen_line('.main_data . : AT(romPos) SUBALIGN(16)')
self.gen_open_block()
for file in self.files:
self.gen_line(file[0] + '(.data);')
if file[0] not in LATE_DATA_FILES:
self.gen_line(file[0] + '(.data);')
for file in LATE_DATA_FILES:
self.gen_line(file + '(.data);')
self.gen_line(BUILD_DIR + '/data/dkr.data.o(.data);')
self.gen_close_block()
self.gen_line('romPos += SIZEOF(.main_data);')