Update UNF (still broken though ) :(

This commit is contained in:
CrashOveride95
2021-04-11 18:20:32 -04:00
parent 623bf3bfcb
commit 5048caff1e
7 changed files with 822 additions and 606 deletions

View File

@@ -73,7 +73,7 @@ extern "C" {
*/
/* Perform alignment on input 's' */
//#define ALIGN(s, align) (((u32)(s) + ((align)-1)) & ~((align)-1))
#define ALIGN(s, align) (((u32)(s) + ((align)-1)) & ~((align)-1))
//commented out due to sm64 conflict
/***************************************

View File

@@ -44,6 +44,7 @@ DECLARE_SEGMENT(framebuffers)
extern u8 _goddardSegmentStart[];
extern u8 _engineSegmentStart[];
extern u8 _engineSegmentBssEnd[];
extern u8 _mainSegmentEnd[];
extern u8 _engineSegmentEnd[];
extern u8 _framebuffersSegmentBssEnd[];

View File

@@ -315,7 +315,9 @@ void thread3_main(UNUSED void *arg) {
setup_mesg_queues();
alloc_pool();
load_engine_code_segment();
#ifndef UNF
crash_screen_init();
#endif
#ifdef UNF
debug_printf("Super Mario 64\n");
@@ -475,8 +477,14 @@ void thread1_idle(UNUSED void *arg) {
}
}
static void ClearRAM(void)
{
bzero(_mainSegmentEnd, (size_t)osMemSize - (size_t)OS_K0_TO_PHYSICAL(_mainSegmentEnd));
}
void main_func(void) {
osInitialize();
ClearRAM();
__osInitialize_common();
create_thread(&gIdleThread, 1, thread1_idle, NULL, gIdleThreadStack + 0x800, 100);
osStartThread(&gIdleThread);

File diff suppressed because it is too large Load Diff

View File

@@ -7,17 +7,17 @@
// Settings
#define DEBUG_MODE 1 // Enable/Disable debug mode
#define DEBUG_INIT_MSG 0 // Print a message when debug mode has initialized
#define USE_FAULTTHREAD 0 // Create a fault detection thread
#define OVERWRITE_OSPRINT 0 // Replaces osSyncPrintf calls with debug_printf
#define DEBUG_INIT_MSG 1 // Print a message when debug mode has initialized
#define USE_FAULTTHREAD 1 // Create a fault detection thread (libultra only)
#define OVERWRITE_OSPRINT 0 // Replaces osSyncPrintf calls with debug_printf (libultra only)
#define MAX_COMMANDS 25 // The max amount of user defined commands possible
// Fault thread definitions
// Fault thread definitions (libultra only)
#define FAULT_THREAD_ID 13
#define FAULT_THREAD_PRI 125
#define FAULT_THREAD_STACK 0x2000
// USB thread definitions
// USB thread definitions (libultra only)
#define USB_THREAD_ID 14
#define USB_THREAD_PRI 126
#define USB_THREAD_STACK 0x2000
@@ -49,15 +49,23 @@
/*==============================
debug_screenshot
Sends the currently displayed framebuffer through USB.
@param The size of each pixel of the framebuffer in bytes
Typically 4 if 32-bit or 2 if 16-bit
@param The width of the framebuffer
@param The height of the framebuffer
debug_dumpbinary
Dumps a binary file through USB
@param The file to dump
@param The size of the file
==============================*/
extern void debug_screenshot(int size, int w, int h);
extern void debug_dumpbinary(void* file, int size);
/*==============================
debug_screenshot
Sends the currently displayed framebuffer through USB.
DOES NOT PAUSE DRAWING THREAD! Using outside the drawing
thread may lead to a screenshot with visible tearing
==============================*/
extern void debug_screenshot();
/*==============================
@@ -126,7 +134,7 @@
// Overwrite library functions with useless macros if debug mode is disabled
#define debug_initialize()
#define debug_printf(a, __VA_ARGS__)
#define debug_printf(__VA_ARGS__)
#define debug_screenshot(a, b, c)
#define debug_assert(a)
#define debug_pollcommands()

File diff suppressed because it is too large Load Diff

View File

@@ -4,11 +4,14 @@
/*********************************
DataType macros
*********************************/
// UNCOMMENT THE #DEFINE IF USING LIBDRAGON
//#define LIBDRAGON
// Settings
#define USE_OSRAW 0 // Use if you're doing USB operations without the PI Manager
#define DEBUG_ADDRESS_SIZE 1*1024*1024 // Max size of USB I/O. The bigger this value, the more ROM you lose!
#define USE_OSRAW 0 // Use if you're doing USB operations without the PI Manager (libultra only)
#define DEBUG_ADDRESS_SIZE 8*1024*1024 // Max size of USB I/O. The bigger this value, the more ROM you lose!
// Cart definitions
#define CART_NONE 0
#define CART_64DRIVE 1
@@ -27,7 +30,6 @@
extern int usb_readblock;
/*********************************
Convenience macros
*********************************/
@@ -78,7 +80,7 @@
@return The data header, or 0
==============================*/
extern u32 usb_poll();
extern unsigned int usb_poll();
/*==============================