mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-18 12:05:14 -04:00
GBA: Main menu loads
This commit is contained in:
parent
ab47f1f5f6
commit
acdcb0a793
@ -38,7 +38,7 @@ GRAPHICS := graphics
|
|||||||
#---------------------------------------------------------------------------------
|
#---------------------------------------------------------------------------------
|
||||||
ARCH := -mthumb -mthumb-interwork
|
ARCH := -mthumb -mthumb-interwork
|
||||||
|
|
||||||
CFLAGS := -g -Wall -O2 -DPLAT_GBA \
|
CFLAGS := -g -Wall -O2 -DPLAT_GBA -ffunction-sections -fdata-sections\
|
||||||
-mcpu=arm7tdmi -mtune=arm7tdmi\
|
-mcpu=arm7tdmi -mtune=arm7tdmi\
|
||||||
$(ARCH)
|
$(ARCH)
|
||||||
|
|
||||||
|
@ -422,7 +422,7 @@ static void Block_UpdateCulling(BlockID block) {
|
|||||||
*---------------------------------------------------------Block-----------------------------------------------------------*
|
*---------------------------------------------------------Block-----------------------------------------------------------*
|
||||||
*#########################################################################################################################*/
|
*#########################################################################################################################*/
|
||||||
static cc_uint32 definedCustomBlocks[BLOCK_COUNT >> 5];
|
static cc_uint32 definedCustomBlocks[BLOCK_COUNT >> 5];
|
||||||
static char Block_NamesBuffer[STRING_SIZE * BLOCK_COUNT];
|
static CC_BIG_VAR char Block_NamesBuffer[STRING_SIZE * BLOCK_COUNT];
|
||||||
#define Block_NamePtr(i) &Block_NamesBuffer[STRING_SIZE * i]
|
#define Block_NamePtr(i) &Block_NamesBuffer[STRING_SIZE * i]
|
||||||
|
|
||||||
cc_bool Block_IsCustomDefined(BlockID block) {
|
cc_bool Block_IsCustomDefined(BlockID block) {
|
||||||
|
@ -49,7 +49,7 @@ struct Builder1DPart {
|
|||||||
|
|
||||||
/* Part builder data, for both normal and translucent parts.
|
/* Part builder data, for both normal and translucent parts.
|
||||||
The first ATLAS1D_MAX_ATLASES parts are for normal parts, remainder are for translucent parts. */
|
The first ATLAS1D_MAX_ATLASES parts are for normal parts, remainder are for translucent parts. */
|
||||||
static struct Builder1DPart Builder_Parts[ATLAS1D_MAX_ATLASES * 2];
|
static CC_BIG_VAR struct Builder1DPart Builder_Parts[ATLAS1D_MAX_ATLASES * 2];
|
||||||
static struct VertexTextured* Builder_Vertices;
|
static struct VertexTextured* Builder_Vertices;
|
||||||
|
|
||||||
static int Builder1DPart_VerticesCount(struct Builder1DPart* part) {
|
static int Builder1DPart_VerticesCount(struct Builder1DPart* part) {
|
||||||
|
@ -31,7 +31,7 @@ double Chat_AnnouncementReceived;
|
|||||||
double Chat_BigAnnouncementReceived;
|
double Chat_BigAnnouncementReceived;
|
||||||
double Chat_SmallAnnouncementReceived;
|
double Chat_SmallAnnouncementReceived;
|
||||||
|
|
||||||
struct StringsBuffer Chat_Log, Chat_InputLog;
|
CC_BIG_VAR struct StringsBuffer Chat_Log, Chat_InputLog;
|
||||||
cc_bool Chat_Logging;
|
cc_bool Chat_Logging;
|
||||||
|
|
||||||
/*########################################################################################################################*
|
/*########################################################################################################################*
|
||||||
|
@ -84,6 +84,9 @@ Copyright 2014-2025 ClassiCube | Licensed under BSD-3
|
|||||||
#define CC_BIG_ENDIAN
|
#define CC_BIG_ENDIAN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* Only used on GBA to store some variables in EWRAM instead of IWRAM */
|
||||||
|
#define CC_BIG_VAR
|
||||||
|
|
||||||
/* Unrecognised compiler, so just go with some sensible default typdefs */
|
/* Unrecognised compiler, so just go with some sensible default typdefs */
|
||||||
/* Don't use <stdint.h>, as good chance such a compiler doesn't support it */
|
/* Don't use <stdint.h>, as good chance such a compiler doesn't support it */
|
||||||
#ifndef CC_HAS_TYPES
|
#ifndef CC_HAS_TYPES
|
||||||
@ -436,6 +439,8 @@ typedef cc_uint8 cc_bool;
|
|||||||
#define CC_BUILD_NOSOUNDS
|
#define CC_BUILD_NOSOUNDS
|
||||||
#define CC_BUILD_SMALLSTACK
|
#define CC_BUILD_SMALLSTACK
|
||||||
#define CC_BUILD_NOFPU
|
#define CC_BUILD_NOFPU
|
||||||
|
#undef CC_BUILD_RESOURCES
|
||||||
|
#undef CC_BUILD_NETWORKING
|
||||||
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_BUILTIN
|
#define DEFAULT_NET_BACKEND CC_NET_BACKEND_BUILTIN
|
||||||
#define CC_DISABLE_ANIMATIONS /* Very costly in FPU less system */
|
#define CC_DISABLE_ANIMATIONS /* Very costly in FPU less system */
|
||||||
#define CC_DISABLE_HELDBLOCK /* Very costly in FPU less system */
|
#define CC_DISABLE_HELDBLOCK /* Very costly in FPU less system */
|
||||||
@ -444,6 +449,10 @@ typedef cc_uint8 cc_bool;
|
|||||||
#define CC_GFX_BACKEND CC_GFX_BACKEND_SOFTGPU
|
#define CC_GFX_BACKEND CC_GFX_BACKEND_SOFTGPU
|
||||||
#define CC_DISABLE_EXTRA_MODELS
|
#define CC_DISABLE_EXTRA_MODELS
|
||||||
#define SOFTGPU_DISABLE_ZBUFFER
|
#define SOFTGPU_DISABLE_ZBUFFER
|
||||||
|
#undef CC_VAR
|
||||||
|
#define CC_VAR __attribute__((visibility("default"), section(".ewram")))
|
||||||
|
#undef CC_BIG_VAR
|
||||||
|
#define CC_BIG_VAR __attribute__((section(".ewram")))
|
||||||
#elif defined PLAT_NDS
|
#elif defined PLAT_NDS
|
||||||
#define CC_BUILD_NDS
|
#define CC_BUILD_NDS
|
||||||
#define CC_BUILD_CONSOLE
|
#define CC_BUILD_CONSOLE
|
||||||
|
@ -88,8 +88,8 @@ const cc_uint8 Hotkeys_LWJGL[256] = {
|
|||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
|
||||||
};
|
};
|
||||||
struct HotkeyData HotkeysList[HOTKEYS_MAX_COUNT];
|
struct HotkeyData CC_BIG_VAR HotkeysList[HOTKEYS_MAX_COUNT];
|
||||||
struct StringsBuffer HotkeysText;
|
struct StringsBuffer CC_BIG_VAR HotkeysText;
|
||||||
|
|
||||||
static void Hotkeys_QuickSort(int left, int right) {
|
static void Hotkeys_QuickSort(int left, int right) {
|
||||||
struct HotkeyData* keys = HotkeysList; struct HotkeyData key;
|
struct HotkeyData* keys = HotkeysList; struct HotkeyData key;
|
||||||
|
@ -182,7 +182,7 @@ static struct ChooseModeScreen {
|
|||||||
struct LButton btnEnhanced, btnClassicHax, btnClassic, btnBack;
|
struct LButton btnEnhanced, btnClassicHax, btnClassic, btnBack;
|
||||||
struct LLabel lblHelp, lblEnhanced[2], lblClassicHax[2], lblClassic[2];
|
struct LLabel lblHelp, lblEnhanced[2], lblClassicHax[2], lblClassic[2];
|
||||||
cc_bool firstTime;
|
cc_bool firstTime;
|
||||||
} ChooseModeScreen;
|
} ChooseModeScreen CC_BIG_VAR;
|
||||||
|
|
||||||
#define CHOOSEMODE_SCREEN_MAX_WIDGETS 12
|
#define CHOOSEMODE_SCREEN_MAX_WIDGETS 12
|
||||||
static struct LWidget* chooseMode_widgets[CHOOSEMODE_SCREEN_MAX_WIDGETS];
|
static struct LWidget* chooseMode_widgets[CHOOSEMODE_SCREEN_MAX_WIDGETS];
|
||||||
@ -285,7 +285,7 @@ static struct ColoursScreen {
|
|||||||
struct LLabel lblRGB[COLOURS_NUM_COLS];
|
struct LLabel lblRGB[COLOURS_NUM_COLS];
|
||||||
struct LInput iptColours[COLOURS_NUM_ENTRIES];
|
struct LInput iptColours[COLOURS_NUM_ENTRIES];
|
||||||
struct LCheckbox cbClassic;
|
struct LCheckbox cbClassic;
|
||||||
} ColoursScreen;
|
} ColoursScreen CC_BIG_VAR;
|
||||||
|
|
||||||
#define COLOURSSCREEN_MAX_WIDGETS 25
|
#define COLOURSSCREEN_MAX_WIDGETS 25
|
||||||
static struct LWidget* colours_widgets[COLOURSSCREEN_MAX_WIDGETS];
|
static struct LWidget* colours_widgets[COLOURSSCREEN_MAX_WIDGETS];
|
||||||
@ -450,7 +450,7 @@ static struct DirectConnectScreen {
|
|||||||
struct LButton btnConnect, btnBack;
|
struct LButton btnConnect, btnBack;
|
||||||
struct LInput iptUsername, iptAddress, iptMppass;
|
struct LInput iptUsername, iptAddress, iptMppass;
|
||||||
struct LLabel lblStatus;
|
struct LLabel lblStatus;
|
||||||
} DirectConnectScreen;
|
} DirectConnectScreen CC_BIG_VAR;
|
||||||
|
|
||||||
#define DIRECTCONNECT_SCREEN_MAXWIDGETS 6
|
#define DIRECTCONNECT_SCREEN_MAXWIDGETS 6
|
||||||
static struct LWidget* directConnect_widgets[DIRECTCONNECT_SCREEN_MAXWIDGETS];
|
static struct LWidget* directConnect_widgets[DIRECTCONNECT_SCREEN_MAXWIDGETS];
|
||||||
@ -585,7 +585,7 @@ static struct MFAScreen {
|
|||||||
struct LInput iptCode;
|
struct LInput iptCode;
|
||||||
struct LButton btnSignIn, btnCancel;
|
struct LButton btnSignIn, btnCancel;
|
||||||
struct LLabel lblTitle;
|
struct LLabel lblTitle;
|
||||||
} MFAScreen;
|
} MFAScreen CC_BIG_VAR;
|
||||||
|
|
||||||
#define MFA_SCREEN_MAX_WIDGETS 4
|
#define MFA_SCREEN_MAX_WIDGETS 4
|
||||||
static struct LWidget* mfa_widgets[MFA_SCREEN_MAX_WIDGETS];
|
static struct LWidget* mfa_widgets[MFA_SCREEN_MAX_WIDGETS];
|
||||||
@ -645,7 +645,7 @@ static struct SplitScreen {
|
|||||||
LScreen_Layout
|
LScreen_Layout
|
||||||
struct LButton btnPlayers[3], btnBack;
|
struct LButton btnPlayers[3], btnBack;
|
||||||
cc_bool signingIn;
|
cc_bool signingIn;
|
||||||
} SplitScreen;
|
} SplitScreen CC_BIG_VAR;
|
||||||
|
|
||||||
#define SPLITSCREEN_MAX_WIDGETS 4
|
#define SPLITSCREEN_MAX_WIDGETS 4
|
||||||
static struct LWidget* split_widgets[SPLITSCREEN_MAX_WIDGETS];
|
static struct LWidget* split_widgets[SPLITSCREEN_MAX_WIDGETS];
|
||||||
@ -705,7 +705,7 @@ static struct MainScreen {
|
|||||||
struct LInput iptUsername, iptPassword;
|
struct LInput iptUsername, iptPassword;
|
||||||
struct LLabel lblStatus, lblUpdate;
|
struct LLabel lblStatus, lblUpdate;
|
||||||
cc_bool signingIn;
|
cc_bool signingIn;
|
||||||
} MainScreen;
|
} MainScreen CC_BIG_VAR;
|
||||||
|
|
||||||
#define MAINSCREEN_MAX_WIDGETS 12
|
#define MAINSCREEN_MAX_WIDGETS 12
|
||||||
static struct LWidget* main_widgets[MAINSCREEN_MAX_WIDGETS];
|
static struct LWidget* main_widgets[MAINSCREEN_MAX_WIDGETS];
|
||||||
@ -1034,7 +1034,7 @@ static struct CheckResourcesScreen {
|
|||||||
LScreen_Layout
|
LScreen_Layout
|
||||||
struct LLabel lblLine1, lblLine2, lblStatus;
|
struct LLabel lblLine1, lblLine2, lblStatus;
|
||||||
struct LButton btnYes, btnNo;
|
struct LButton btnYes, btnNo;
|
||||||
} CheckResourcesScreen;
|
} CheckResourcesScreen CC_BIG_VAR;
|
||||||
|
|
||||||
#define CHECKRESOURCES_SCREEN_MAX_WIDGET 5
|
#define CHECKRESOURCES_SCREEN_MAX_WIDGET 5
|
||||||
static struct LWidget* checkResources_widgets[CHECKRESOURCES_SCREEN_MAX_WIDGET];
|
static struct LWidget* checkResources_widgets[CHECKRESOURCES_SCREEN_MAX_WIDGET];
|
||||||
@ -1128,7 +1128,7 @@ static struct FetchResourcesScreen {
|
|||||||
struct LLabel lblStatus;
|
struct LLabel lblStatus;
|
||||||
struct LButton btnCancel;
|
struct LButton btnCancel;
|
||||||
struct LSlider sdrProgress;
|
struct LSlider sdrProgress;
|
||||||
} FetchResourcesScreen;
|
} FetchResourcesScreen CC_BIG_VAR;
|
||||||
|
|
||||||
#define FETCHRESOURCES_SCREEN_MAX_WIDGETS 3
|
#define FETCHRESOURCES_SCREEN_MAX_WIDGETS 3
|
||||||
static struct LWidget* fetchResources_widgets[FETCHRESOURCES_SCREEN_MAX_WIDGETS];
|
static struct LWidget* fetchResources_widgets[FETCHRESOURCES_SCREEN_MAX_WIDGETS];
|
||||||
@ -1227,7 +1227,7 @@ static struct ServersScreen {
|
|||||||
struct LTable table;
|
struct LTable table;
|
||||||
struct FontDesc rowFont;
|
struct FontDesc rowFont;
|
||||||
float tableAcc;
|
float tableAcc;
|
||||||
} ServersScreen;
|
} ServersScreen CC_BIG_VAR;
|
||||||
|
|
||||||
static struct LWidget* servers_widgets[6];
|
static struct LWidget* servers_widgets[6];
|
||||||
|
|
||||||
@ -1416,7 +1416,7 @@ static struct SettingsScreen {
|
|||||||
struct LLabel lblMode, lblColours;
|
struct LLabel lblMode, lblColours;
|
||||||
struct LCheckbox cbExtra, cbEmpty, cbScale;
|
struct LCheckbox cbExtra, cbEmpty, cbScale;
|
||||||
struct LLine sep;
|
struct LLine sep;
|
||||||
} SettingsScreen;
|
} SettingsScreen CC_BIG_VAR;
|
||||||
|
|
||||||
#define SETTINGS_SCREEN_MAX_WIDGETS 9
|
#define SETTINGS_SCREEN_MAX_WIDGETS 9
|
||||||
static struct LWidget* settings_widgets[SETTINGS_SCREEN_MAX_WIDGETS];
|
static struct LWidget* settings_widgets[SETTINGS_SCREEN_MAX_WIDGETS];
|
||||||
@ -1523,7 +1523,7 @@ static struct ThemesScreen {
|
|||||||
LScreen_Layout
|
LScreen_Layout
|
||||||
struct LButton btnModern, btnClassic, btnNordic;
|
struct LButton btnModern, btnClassic, btnNordic;
|
||||||
struct LButton btnCustom, btnBack;
|
struct LButton btnCustom, btnBack;
|
||||||
} ThemesScreen;
|
} ThemesScreen CC_BIG_VAR;
|
||||||
|
|
||||||
#define THEME_SCREEN_MAX_WIDGETS 5
|
#define THEME_SCREEN_MAX_WIDGETS 5
|
||||||
static struct LWidget* themes_widgets[THEME_SCREEN_MAX_WIDGETS];
|
static struct LWidget* themes_widgets[THEME_SCREEN_MAX_WIDGETS];
|
||||||
@ -1591,7 +1591,7 @@ static struct UpdatesScreen {
|
|||||||
struct LLabel lblYour, lblRel, lblDev, lblInfo, lblStatus;
|
struct LLabel lblYour, lblRel, lblDev, lblInfo, lblStatus;
|
||||||
int buildProgress, buildIndex;
|
int buildProgress, buildIndex;
|
||||||
cc_bool pendingFetch, release;
|
cc_bool pendingFetch, release;
|
||||||
} UpdatesScreen;
|
} UpdatesScreen CC_BIG_VAR;
|
||||||
|
|
||||||
#define UPDATESSCREEN_MAX_WIDGETS 12
|
#define UPDATESSCREEN_MAX_WIDGETS 12
|
||||||
static struct LWidget* updates_widgets[UPDATESSCREEN_MAX_WIDGETS];
|
static struct LWidget* updates_widgets[UPDATESSCREEN_MAX_WIDGETS];
|
||||||
|
28
src/Menus.c
28
src/Menus.c
@ -242,7 +242,7 @@ static struct ListScreen {
|
|||||||
const char* titleText;
|
const char* titleText;
|
||||||
struct TextWidget title;
|
struct TextWidget title;
|
||||||
struct StringsBuffer entries;
|
struct StringsBuffer entries;
|
||||||
} ListScreen;
|
} ListScreen CC_BIG_VAR;
|
||||||
|
|
||||||
static struct Widget* list_widgets[LIST_SCREEN_ITEMS + 4 + 1];
|
static struct Widget* list_widgets[LIST_SCREEN_ITEMS + 4 + 1];
|
||||||
#define LISTSCREEN_EMPTY "-"
|
#define LISTSCREEN_EMPTY "-"
|
||||||
@ -472,7 +472,7 @@ static struct PauseScreen {
|
|||||||
const struct SimpleButtonDesc* descs;
|
const struct SimpleButtonDesc* descs;
|
||||||
struct ButtonWidget btns[PAUSE_MAX_BTNS], quit, back;
|
struct ButtonWidget btns[PAUSE_MAX_BTNS], quit, back;
|
||||||
struct TextWidget title;
|
struct TextWidget title;
|
||||||
} PauseScreen;
|
} PauseScreen CC_BIG_VAR;
|
||||||
|
|
||||||
static void PauseScreenBase_Quit(void* a, void* b) {
|
static void PauseScreenBase_Quit(void* a, void* b) {
|
||||||
Window_RequestClose();
|
Window_RequestClose();
|
||||||
@ -645,7 +645,7 @@ static struct OptionsGroupScreen {
|
|||||||
struct ButtonWidget btns[8];
|
struct ButtonWidget btns[8];
|
||||||
struct TextWidget desc;
|
struct TextWidget desc;
|
||||||
struct ButtonWidget done;
|
struct ButtonWidget done;
|
||||||
} OptionsGroupScreen;
|
} OptionsGroupScreen CC_BIG_VAR;
|
||||||
|
|
||||||
static struct Widget* optGroups_widgets[8 + 2];
|
static struct Widget* optGroups_widgets[8 + 2];
|
||||||
|
|
||||||
@ -769,7 +769,7 @@ static struct EditHotkeyScreen {
|
|||||||
struct FontDesc titleFont, textFont;
|
struct FontDesc titleFont, textFont;
|
||||||
struct TextInputWidget input;
|
struct TextInputWidget input;
|
||||||
struct ButtonWidget btns[5], cancel;
|
struct ButtonWidget btns[5], cancel;
|
||||||
} EditHotkeyScreen;
|
} EditHotkeyScreen CC_BIG_VAR;
|
||||||
|
|
||||||
static struct Widget* edithotkey_widgets[1 + 5 + 1];
|
static struct Widget* edithotkey_widgets[1 + 5 + 1];
|
||||||
|
|
||||||
@ -1028,7 +1028,7 @@ static struct GenLevelScreen {
|
|||||||
struct ButtonWidget flatgrass, vanilla, cancel;
|
struct ButtonWidget flatgrass, vanilla, cancel;
|
||||||
struct TextInputWidget inputs[4];
|
struct TextInputWidget inputs[4];
|
||||||
struct TextWidget labels[4], title;
|
struct TextWidget labels[4], title;
|
||||||
} GenLevelScreen;
|
} GenLevelScreen CC_BIG_VAR;
|
||||||
#define GENLEVEL_NUM_INPUTS 4
|
#define GENLEVEL_NUM_INPUTS 4
|
||||||
|
|
||||||
static struct Widget* gen_widgets[2 * GENLEVEL_NUM_INPUTS + 4];
|
static struct Widget* gen_widgets[2 * GENLEVEL_NUM_INPUTS + 4];
|
||||||
@ -1234,7 +1234,7 @@ static struct ClassicGenScreen {
|
|||||||
Screen_Body
|
Screen_Body
|
||||||
struct ButtonWidget btns[3], cancel;
|
struct ButtonWidget btns[3], cancel;
|
||||||
struct TextWidget title;
|
struct TextWidget title;
|
||||||
} ClassicGenScreen;
|
} ClassicGenScreen CC_BIG_VAR;
|
||||||
|
|
||||||
static struct Widget* classicgen_widgets[1 + 3 + 1];
|
static struct Widget* classicgen_widgets[1 + 3 + 1];
|
||||||
|
|
||||||
@ -1315,7 +1315,7 @@ static struct SaveLevelScreen {
|
|||||||
struct ButtonWidget save, file, cancel;
|
struct ButtonWidget save, file, cancel;
|
||||||
struct TextInputWidget input;
|
struct TextInputWidget input;
|
||||||
struct TextWidget desc;
|
struct TextWidget desc;
|
||||||
} SaveLevelScreen;
|
} SaveLevelScreen CC_BIG_VAR;
|
||||||
|
|
||||||
static struct Widget* save_widgets[3 + 1 + 1];
|
static struct Widget* save_widgets[3 + 1 + 1];
|
||||||
|
|
||||||
@ -1860,7 +1860,7 @@ void LoadLevelScreen_Show(void) {
|
|||||||
static struct BindsSourceScreen {
|
static struct BindsSourceScreen {
|
||||||
Screen_Body
|
Screen_Body
|
||||||
struct ButtonWidget btns[2], cancel;
|
struct ButtonWidget btns[2], cancel;
|
||||||
} BindsSourceScreen;
|
} BindsSourceScreen CC_BIG_VAR;
|
||||||
static struct InputDevice* bind_device;
|
static struct InputDevice* bind_device;
|
||||||
|
|
||||||
static struct Widget* bindsSource_widgets[3];
|
static struct Widget* bindsSource_widgets[3];
|
||||||
@ -1958,7 +1958,7 @@ static struct KeyBindsScreen {
|
|||||||
struct TextWidget title, msg;
|
struct TextWidget title, msg;
|
||||||
struct ButtonWidget back, left, right;
|
struct ButtonWidget back, left, right;
|
||||||
struct ButtonWidget buttons[KEYBINDS_MAX_BTNS];
|
struct ButtonWidget buttons[KEYBINDS_MAX_BTNS];
|
||||||
} KeyBindsScreen;
|
} KeyBindsScreen CC_BIG_VAR;
|
||||||
|
|
||||||
static struct Widget* key_widgets[KEYBINDS_MAX_BTNS + 5];
|
static struct Widget* key_widgets[KEYBINDS_MAX_BTNS + 5];
|
||||||
|
|
||||||
@ -2248,7 +2248,7 @@ static struct MenuInputOverlay {
|
|||||||
struct MenuInputDesc* desc;
|
struct MenuInputDesc* desc;
|
||||||
MenuInputDone onDone;
|
MenuInputDone onDone;
|
||||||
cc_string value; char valueBuffer[STRING_SIZE];
|
cc_string value; char valueBuffer[STRING_SIZE];
|
||||||
} MenuInputOverlay;
|
} MenuInputOverlay CC_BIG_VAR;
|
||||||
|
|
||||||
static struct Widget* menuInput_widgets[2 + 1];
|
static struct Widget* menuInput_widgets[2 + 1];
|
||||||
|
|
||||||
@ -2441,7 +2441,7 @@ static struct TexIdsOverlay {
|
|||||||
int xOffset, yOffset, tileSize, textVertices;
|
int xOffset, yOffset, tileSize, textVertices;
|
||||||
struct TextAtlas idAtlas;
|
struct TextAtlas idAtlas;
|
||||||
struct TextWidget title;
|
struct TextWidget title;
|
||||||
} TexIdsOverlay;
|
} TexIdsOverlay CC_BIG_VAR;
|
||||||
static struct Widget* texids_widgets[1];
|
static struct Widget* texids_widgets[1];
|
||||||
|
|
||||||
#define TEXIDS_MAX_ROWS_PER_PAGE 16
|
#define TEXIDS_MAX_ROWS_PER_PAGE 16
|
||||||
@ -2639,7 +2639,7 @@ static struct UrlWarningOverlay {
|
|||||||
struct ButtonWidget btns[2];
|
struct ButtonWidget btns[2];
|
||||||
struct TextWidget lbls[4];
|
struct TextWidget lbls[4];
|
||||||
char _urlBuffer[STRING_SIZE * 4];
|
char _urlBuffer[STRING_SIZE * 4];
|
||||||
} UrlWarningOverlay;
|
} UrlWarningOverlay CC_BIG_VAR;
|
||||||
|
|
||||||
static struct Widget* urlwarning_widgets[4 + 2];
|
static struct Widget* urlwarning_widgets[4 + 2];
|
||||||
|
|
||||||
@ -2726,7 +2726,7 @@ static struct TexPackOverlay {
|
|||||||
struct ButtonWidget btns[4];
|
struct ButtonWidget btns[4];
|
||||||
struct TextWidget lbls[4];
|
struct TextWidget lbls[4];
|
||||||
char _urlBuffer[URL_MAX_SIZE];
|
char _urlBuffer[URL_MAX_SIZE];
|
||||||
} TexPackOverlay;
|
} TexPackOverlay CC_BIG_VAR;
|
||||||
|
|
||||||
static struct Widget* texpack_widgets[4 + 4];
|
static struct Widget* texpack_widgets[4 + 4];
|
||||||
|
|
||||||
@ -2910,7 +2910,7 @@ static struct NostalgiaMenuScreen {
|
|||||||
Screen_Body
|
Screen_Body
|
||||||
struct ButtonWidget btnA, btnF, done;
|
struct ButtonWidget btnA, btnF, done;
|
||||||
struct TextWidget title;
|
struct TextWidget title;
|
||||||
} NostalgiaMenuScreen;
|
} NostalgiaMenuScreen CC_BIG_VAR;
|
||||||
|
|
||||||
static struct Widget* nostalgiaMenu_widgets[4];
|
static struct Widget* nostalgiaMenu_widgets[4];
|
||||||
|
|
||||||
|
@ -1155,7 +1155,7 @@ static float HumanModel_GetEyeY(struct Entity* e) { return 26.0f/16.0f; }
|
|||||||
static void HumanModel_GetSize(struct Entity* e) { Model_RetSize(8.6f,28.1f,8.6f); }
|
static void HumanModel_GetSize(struct Entity* e) { Model_RetSize(8.6f,28.1f,8.6f); }
|
||||||
static void HumanModel_GetBounds(struct Entity* e) { Model_RetAABB(-8,0,-4, 8,32,4); }
|
static void HumanModel_GetBounds(struct Entity* e) { Model_RetAABB(-8,0,-4, 8,32,4); }
|
||||||
|
|
||||||
static struct ModelVertex human_vertices[MODEL_BOX_VERTICES * (7 + 7 + 4)];
|
static CC_BIG_VAR struct ModelVertex human_vertices[MODEL_BOX_VERTICES * (7 + 7 + 4)];
|
||||||
static struct ModelTex human_tex = { "char.png" };
|
static struct ModelTex human_tex = { "char.png" };
|
||||||
static struct Model human_model = {
|
static struct Model human_model = {
|
||||||
"humanoid", human_vertices, &human_tex,
|
"humanoid", human_vertices, &human_tex,
|
||||||
|
@ -8,10 +8,11 @@
|
|||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
#include "PackedCol.h"
|
#include "PackedCol.h"
|
||||||
|
|
||||||
struct StringsBuffer Options;
|
CC_BIG_VAR struct StringsBuffer Options;
|
||||||
static struct StringsBuffer changedOpts;
|
static CC_BIG_VAR struct StringsBuffer changedOpts;
|
||||||
cc_result Options_LoadResult;
|
cc_result Options_LoadResult;
|
||||||
static cc_bool savingPaused;
|
static cc_bool savingPaused;
|
||||||
|
|
||||||
#if defined CC_BUILD_WEB || defined CC_BUILD_MOBILE || defined CC_BUILD_CONSOLE
|
#if defined CC_BUILD_WEB || defined CC_BUILD_MOBILE || defined CC_BUILD_CONSOLE
|
||||||
#define OPTIONS_SAVE_IMMEDIATELY
|
#define OPTIONS_SAVE_IMMEDIATELY
|
||||||
#endif
|
#endif
|
||||||
|
@ -18,7 +18,10 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include "_PlatformConsole.h"
|
#include "_PlatformConsole.h"
|
||||||
extern int nocash_puts(const char *str);
|
|
||||||
|
typedef volatile uint8_t vu8;
|
||||||
|
typedef volatile uint16_t vu16;
|
||||||
|
typedef volatile uint32_t vu32;
|
||||||
|
|
||||||
const cc_result ReturnCode_FileShareViolation = 1000000000; // not used
|
const cc_result ReturnCode_FileShareViolation = 1000000000; // not used
|
||||||
const cc_result ReturnCode_FileNotFound = ENOENT;
|
const cc_result ReturnCode_FileNotFound = ENOENT;
|
||||||
@ -44,6 +47,25 @@ cc_uint64 Stopwatch_Measure(void) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern int nocash_puts(const char *str);
|
||||||
|
static void Log_Nocash(char* buffer) {
|
||||||
|
nocash_puts(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define MGBA_LOG_DEBUG 4
|
||||||
|
#define REG_DEBUG_ENABLE (vu16*) 0x4FFF780
|
||||||
|
#define REG_DEBUG_FLAGS (vu16*) 0x4FFF700
|
||||||
|
#define REG_DEBUG_STRING (char*) 0x4FFF600
|
||||||
|
|
||||||
|
static void Log_mgba(char* buffer, int len) {
|
||||||
|
*REG_DEBUG_ENABLE = 0xC0DE;
|
||||||
|
// Check if actually emulated or not
|
||||||
|
if (*REG_DEBUG_ENABLE != 0x1DEA) return;
|
||||||
|
|
||||||
|
Mem_Copy(REG_DEBUG_STRING, buffer, len);
|
||||||
|
*REG_DEBUG_FLAGS = MGBA_LOG_DEBUG | 0x100;
|
||||||
|
}
|
||||||
|
|
||||||
void Platform_Log(const char* msg, int len) {
|
void Platform_Log(const char* msg, int len) {
|
||||||
// Can only be up to 120 bytes total
|
// Can only be up to 120 bytes total
|
||||||
char buffer[120];
|
char buffer[120];
|
||||||
@ -52,7 +74,8 @@ void Platform_Log(const char* msg, int len) {
|
|||||||
Mem_Copy(buffer, msg, len);
|
Mem_Copy(buffer, msg, len);
|
||||||
buffer[len + 0] = '\n';
|
buffer[len + 0] = '\n';
|
||||||
buffer[len + 1] = '\0';
|
buffer[len + 1] = '\0';
|
||||||
nocash_puts(buffer);
|
Log_Nocash(buffer);
|
||||||
|
Log_mgba(buffer, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeMS DateTime_CurrentUTC(void) {
|
TimeMS DateTime_CurrentUTC(void) {
|
||||||
|
@ -79,7 +79,7 @@ static struct HUDScreen {
|
|||||||
int lastFov;
|
int lastFov;
|
||||||
int lastX, lastY, lastZ;
|
int lastX, lastY, lastZ;
|
||||||
struct HotbarWidget hotbar;
|
struct HotbarWidget hotbar;
|
||||||
} HUDScreen_Instance;
|
} HUDScreen_Instance CC_BIG_VAR;
|
||||||
|
|
||||||
/* Each integer can be at most 10 digits + minus prefix */
|
/* Each integer can be at most 10 digits + minus prefix */
|
||||||
#define POSITION_VAL_CHARS 11
|
#define POSITION_VAL_CHARS 11
|
||||||
@ -453,7 +453,7 @@ static struct TabListOverlay {
|
|||||||
TabListEntryCompare compare;
|
TabListEntryCompare compare;
|
||||||
cc_uint16 ids[TABLIST_MAX_ENTRIES];
|
cc_uint16 ids[TABLIST_MAX_ENTRIES];
|
||||||
struct Texture textures[TABLIST_MAX_ENTRIES];
|
struct Texture textures[TABLIST_MAX_ENTRIES];
|
||||||
} TabListOverlay_Instance;
|
} TabListOverlay_Instance CC_BIG_VAR;
|
||||||
#define TABLIST_MAX_VERTICES (TEXTWIDGET_MAX + 4 * TABLIST_MAX_ENTRIES)
|
#define TABLIST_MAX_VERTICES (TEXTWIDGET_MAX + 4 * TABLIST_MAX_ENTRIES)
|
||||||
|
|
||||||
static void TabListOverlay_DrawText(struct Texture* tex, struct TabListOverlay* s, const cc_string* name) {
|
static void TabListOverlay_DrawText(struct Texture* tex, struct TabListOverlay* s, const cc_string* name) {
|
||||||
@ -912,7 +912,7 @@ static struct ChatScreen {
|
|||||||
struct Texture bottomRightTextures[CHAT_MAX_BOTTOMRIGHT];
|
struct Texture bottomRightTextures[CHAT_MAX_BOTTOMRIGHT];
|
||||||
struct Texture clientStatusTextures[CHAT_MAX_CLIENTSTATUS];
|
struct Texture clientStatusTextures[CHAT_MAX_CLIENTSTATUS];
|
||||||
struct Texture chatTextures[GUI_MAX_CHATLINES];
|
struct Texture chatTextures[GUI_MAX_CHATLINES];
|
||||||
} ChatScreen_Instance;
|
} ChatScreen_Instance CC_BIG_VAR;
|
||||||
|
|
||||||
static void ChatScreen_UpdateChatYOffsets(struct ChatScreen* s) {
|
static void ChatScreen_UpdateChatYOffsets(struct ChatScreen* s) {
|
||||||
int pad, y;
|
int pad, y;
|
||||||
@ -1591,7 +1591,7 @@ static struct InventoryScreen {
|
|||||||
struct TableWidget table;
|
struct TableWidget table;
|
||||||
struct TextWidget title;
|
struct TextWidget title;
|
||||||
cc_bool releasedInv, deferredSelect;
|
cc_bool releasedInv, deferredSelect;
|
||||||
} InventoryScreen;
|
} InventoryScreen CC_BIG_VAR;
|
||||||
|
|
||||||
static struct Widget* inventory_widgets[2];
|
static struct Widget* inventory_widgets[2];
|
||||||
|
|
||||||
@ -1834,7 +1834,7 @@ static struct LoadingScreen {
|
|||||||
|
|
||||||
char _titleBuffer[STRING_SIZE];
|
char _titleBuffer[STRING_SIZE];
|
||||||
char _messageBuffer[STRING_SIZE];
|
char _messageBuffer[STRING_SIZE];
|
||||||
} LoadingScreen;
|
} LoadingScreen CC_BIG_VAR;
|
||||||
|
|
||||||
static struct Widget* loading_widgets[2];
|
static struct Widget* loading_widgets[2];
|
||||||
#define LOADING_TILE_SIZE 64
|
#define LOADING_TILE_SIZE 64
|
||||||
@ -2073,7 +2073,7 @@ static struct DisconnectScreen {
|
|||||||
char _titleBuffer[STRING_SIZE * 2];
|
char _titleBuffer[STRING_SIZE * 2];
|
||||||
char _messageBuffer[STRING_SIZE];
|
char _messageBuffer[STRING_SIZE];
|
||||||
cc_string titleStr, messageStr;
|
cc_string titleStr, messageStr;
|
||||||
} DisconnectScreen;
|
} DisconnectScreen CC_BIG_VAR;
|
||||||
|
|
||||||
static struct Widget* disconnect_widgets[4];
|
static struct Widget* disconnect_widgets[4];
|
||||||
#define DISCONNECT_DELAY_SECS 5
|
#define DISCONNECT_DELAY_SECS 5
|
||||||
|
@ -303,6 +303,7 @@ int TextureUrls_ClearDenied(void) { return 0; }
|
|||||||
/*########################################################################################################################*
|
/*########################################################################################################################*
|
||||||
*------------------------------------------------------TextureCache-------------------------------------------------------*
|
*------------------------------------------------------TextureCache-------------------------------------------------------*
|
||||||
*#########################################################################################################################*/
|
*#########################################################################################################################*/
|
||||||
|
#ifdef CC_BUILD_NETWORKING
|
||||||
static struct StringsBuffer etagCache, lastModCache;
|
static struct StringsBuffer etagCache, lastModCache;
|
||||||
#define ETAGS_TXT "texturecache/etags.txt"
|
#define ETAGS_TXT "texturecache/etags.txt"
|
||||||
#define LASTMOD_TXT "texturecache/lastmodified.txt"
|
#define LASTMOD_TXT "texturecache/lastmodified.txt"
|
||||||
@ -446,6 +447,31 @@ static void UpdateCache(struct HttpRequest* req) {
|
|||||||
res = Stream_WriteAllTo(&path, req->data, req->size);
|
res = Stream_WriteAllTo(&path, req->data, req->size);
|
||||||
if (res) { Logger_SysWarn2(res, "caching", &url); }
|
if (res) { Logger_SysWarn2(res, "caching", &url); }
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
static void TextureCache_Init(void) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Returns non-zero if given URL has been cached */
|
||||||
|
static int IsCached(const cc_string* url) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Attempts to open the cached data stream for the given url */
|
||||||
|
static cc_bool OpenCachedData(const cc_string* url, struct Stream* stream) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cc_string GetCachedLastModified(const cc_string* url) {
|
||||||
|
return String_Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
static cc_string GetCachedETag(const cc_string* url) {
|
||||||
|
return String_Empty;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Updates cached data, ETag, and Last-Modified for the given URL */
|
||||||
|
static void UpdateCache(struct HttpRequest* req) { }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*########################################################################################################################*
|
/*########################################################################################################################*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user