Implement & link initial_menu

This commit is contained in:
Cuyler36
2023-05-23 18:49:30 -04:00
parent 2f7b56bdef
commit b709ef9fbc
26 changed files with 1276 additions and 108 deletions
+37
View File
@@ -0,0 +1,37 @@
#ifndef JUTENUM_H
#define JUTENUM_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
enum EButtons {
MAINSTICK_UP = 0x8000000,
MAINSTICK_DOWN = 0x4000000,
MAINSTICK_RIGHT = 0x2000000,
MAINSTICK_LEFT = 0x1000000,
CSTICK_UP = 0x80000,
CSTICK_DOWN = 0x40000,
CSTICK_RIGHT = 0x20000,
CSTICK_LEFT = 0x10000,
START = 0x1000,
Y = 0x800,
X = 0x400,
B = 0x200,
A = 0x100,
L = 0x40,
R = 0x20,
Z = 0x10,
DPAD_UP = 0x8,
DPAD_DOWN = 0x4,
DPAD_RIGHT = 0x2,
DPAD_LEFT = 0x1
};
#ifdef __cplusplus
}
#endif
#endif
+19 -1
View File
@@ -2,7 +2,9 @@
#define W_MATH_H
#include "types.h"
inline float sqrtf(float x)
/* this is needed to keep $localstatic$ variables out of the rel */
#ifndef OPTIMIZED_SQRTF
extern inline float sqrtf(float x)
{
static const double _half=.5;
static const double _three=3.0;
@@ -18,6 +20,22 @@ inline float sqrtf(float x)
}
return x;
}
#else
extern inline float sqrtf(float x)
{
volatile float y;
if(x > 0.0f)
{
double guess = __frsqrte((double)x); // returns an approximation to
guess = .5*guess*(3.0 - guess*guess*x); // now have 12 sig bits
guess = .5*guess*(3.0 - guess*guess*x); // now have 24 sig bits
guess = .5*guess*(3.0 - guess*guess*x); // now have 32 sig bits
y=(float)(x*guess);
return y;
}
return x;
}
#endif
extern inline double fabs(double x)
{
+35
View File
@@ -0,0 +1,35 @@
#ifndef BOOTDATA_H
#define BOOTDATA_H
#include "types.h"
#include "PR/mbi.h"
#ifdef __cplusplus
extern "C" {
#endif
#define LOGO_COLOR_R 220
#define LOGO_COLOR_G 0
#define LOGO_COLOR_B 0
extern Gfx gam_win1_winT_model[];
extern Gfx gam_win2_winT_model[];
extern Gfx gam_win1_cursor_model[];
extern Gfx gam_win1_moji_model[];
extern Gfx gam_win1_moji2_model[];
extern Gfx gam_win1_moji3_model[];
extern Gfx gam_win2_moji_model[];
extern Gfx gam_win3_moji_model[];
extern u8 nintendo_376x104[];
extern Vtx logo_nin_v[];
extern Gfx logo_ninT_model[];
#ifdef __cplusplus
}
#endif
#endif
+19
View File
@@ -0,0 +1,19 @@
#ifndef OSFONT_H
#define OSFONT_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
#define OS_FONT_ANSI 0u
#define OS_FONT_SJIS 1u
u16 OSGetFontEncode();
#ifdef __cplusplus
}
#endif
#endif
+16
View File
@@ -0,0 +1,16 @@
#ifndef OSRESETSW_H
#define OSRESETSW_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
BOOL OSGetResetSwitchState();
#ifdef __cplusplus
}
#endif
#endif
+1
View File
@@ -11,6 +11,7 @@ void VISetBlack(BOOL);
void VIWaitForRetrace();
void VIConfigurePan(u16 x_origin, u16 y_origin, u16 width, u16 height);
u32 VIGetRetraceCount();
u32 VIGetDTVStatus();
#ifdef __cplusplus
};
+11
View File
@@ -2,11 +2,22 @@
#define INITIAL_MENU_H
#include "types.h"
#include "PR/mbi.h"
#ifdef __cplusplus
extern "C" {
#endif
#define INITIAL_MENU_STACK_SIZE 0x2800
#define INITIAL_MENU_LIMIT_TIME (OSMicrosecondsToTicks(10000000ull))
#define INITIAL_MENU_SELECT_WAIT_TIME (OSMicrosecondsToTicks(3000000ull))
#define INITIAL_MENU_OSMESG_INIT_DONE 0x1234
#define INITIAL_MENU_OSMESG_FADEOUT_STEP 0x8888
#define INITIAL_MENU_OSMESG_LOAD_GAME_DONE 0x9999
extern void make_dl_nintendo_logo(Gfx** gpp, u32 alpha);
extern void initial_menu_init();
extern void initial_menu_cleanup();
+8
View File
@@ -20,6 +20,8 @@ extern "C" {
#define G_FIRST_CMD G_SETTEXEDGEALPHA
#define G_CC_BLENDPRIMDECALA 0, 0, 0, PRIMITIVE, 0, 0, 0, TEXEL0
/* Triangle/Quad vertex bit size */
#define POLY_5b 0 /* 5 bits per vertex index (0 - 31) */
#define POLY_7b 1 /* 7 bits per vertex index (0 - 127) */
@@ -579,6 +581,12 @@ do { \
(u32)0 \
}}
#define G_DL_GXDL 2
/* Macro for calling GC formatted display lists from N64 lists */
#define gGXCallDisplayList(pkt, dl, nbytes) gDma1p(pkt, G_DL, dl, nbytes, G_DL_GXDL)
#define gsGXCallDisplayList(dl, nbytes) gsDma1p(pkt, G_DL, dl, nbytes, G_DL_GXDL)
#ifdef __cplusplus
}
#endif
+12
View File
@@ -3,6 +3,7 @@
#include "types.h"
#include "JSystem/JKernel/JKREnum.h"
#include "JSystem/JUtility/JUTEnum.h"
#ifdef __cplusplus
extern "C" {
@@ -22,12 +23,17 @@ extern void JW_SetProgressiveMode(BOOL enable);
extern u32 JW_GetAramAddress(int resource_no);
extern u8* _JW_GetResourceAram(u32 aram_addr, u8* dst, size_t size);
extern void JW_SetFamicomMode(int enabled);
extern void JW_SetLogoMode(int mode);
extern void JW_Cleanup();
extern void* JC_JFWSystem_getSystemConsole();
extern void* JC_JFWSystem_getRootHeap();
extern void* JC_JFWSystem_getSystemHeap();
extern void* JC_JFWDisplay_getManager();
extern void JC_JFWDisplay_startFadeOut(void* manager, int len);
extern void JC_JFWDisplay_startFadeIn(void* manager, int len);
extern int JC_JKRHeap_dump(void* heap);
extern s32 JC_JKRHeap_getTotalFreeSize(void* heap);
@@ -73,6 +79,12 @@ extern void JC_JUTException_setMapFile(const char* path);
extern void JC_JUTAssertion_changeDevice(int device);
extern void JC_JUTAssertion_changeDisplayTime(int displayTime);
extern void JC_JUTGamePad_read();
extern u32 JW_JUTGamepad_getButton();
extern u32 JW_JUTGamepad_getTrigger();
extern u32 JW_JUTGamepad_getErrorStatus();
#ifdef __cplusplus
}
#endif
+7
View File
@@ -5,6 +5,10 @@
#include "dolphin/os/OSTime.h"
#include "dolphin/os/OSCache.h"
#include "libultra/gu.h"
#include "libultra/osMesg.h"
#include "libultra/shutdown.h"
#include "libultra/os_timer.h"
#include "libultra/os_thread.h"
#define N64_SCREEN_HEIGHT 240
#define N64_SCREEN_WIDTH 320
@@ -14,6 +18,8 @@
extern "C" {
#endif
typedef u64 Z_OSTime;
int bcmp (void *v1, void *v2, u32 size);
void bcopy(void *src, void *dst, size_t n);
void bzero(void *ptr, size_t size);
@@ -24,6 +30,7 @@ OSTime osGetTime(void);
extern s32 osAppNMIBuffer[];
extern int osShutdown;
extern u8 __osResetSwitchPressed;
#ifdef __cplusplus
+1 -1
View File
@@ -18,6 +18,6 @@ typedef struct OSMesgQueue {
extern void osCreateMesgQueue(OSMessageQueue* mq ,OSMessage msg, int flags);
extern int osSendMesg(OSMessageQueue* mq, OSMessage msg, int flags);
extern int osRecvMesg(OSMessageQueue* mq, OSMessage msg, int flags);
extern int osRecvMesg(OSMessageQueue* mq, OSMessage* msg, int flags);
#endif
+1
View File
@@ -10,6 +10,7 @@ extern "C" {
extern void osCreateThread2(OSThread* t, int id, void(*entry)(void*), void* arg, void* stack_pointer, size_t stack_size, OSPriority priority);
extern void osStartThread(OSThread* t);
extern void osDestroyThread(OSThread* t);
#ifdef __cplusplus
}