2022-04-21 02:12:38 +02:00
|
|
|
/*-------------------------------------------------------------
|
2022-04-21 03:38:39 +02:00
|
|
|
|
2022-04-21 02:12:38 +02:00
|
|
|
wiibasics.h -- basic Wii initialization and functions
|
2022-04-21 03:38:39 +02:00
|
|
|
|
2022-04-21 02:12:38 +02:00
|
|
|
Copyright (C) 2008 tona
|
|
|
|
Unless other credit specified
|
2022-04-21 03:38:39 +02:00
|
|
|
|
2022-04-21 02:12:38 +02:00
|
|
|
This software is provided 'as-is', without any express or implied
|
|
|
|
warranty. In no event will the authors be held liable for any
|
|
|
|
damages arising from the use of this software.
|
2022-04-21 03:38:39 +02:00
|
|
|
|
2022-04-21 02:12:38 +02:00
|
|
|
Permission is granted to anyone to use this software for any
|
|
|
|
purpose, including commercial applications, and to alter it and
|
|
|
|
redistribute it freely, subject to the following restrictions:
|
2022-04-21 03:38:39 +02:00
|
|
|
|
2022-04-21 02:12:38 +02:00
|
|
|
1.The origin of this software must not be misrepresented; you
|
|
|
|
must not claim that you wrote the original software. If you use
|
|
|
|
this software in a product, an acknowledgment in the product
|
|
|
|
documentation would be appreciated but is not required.
|
2022-04-21 03:38:39 +02:00
|
|
|
|
2022-04-21 02:12:38 +02:00
|
|
|
2.Altered source versions must be plainly marked as such, and
|
|
|
|
must not be misrepresented as being the original software.
|
2022-04-21 03:38:39 +02:00
|
|
|
|
2022-04-21 02:12:38 +02:00
|
|
|
3.This notice may not be removed or altered from any source
|
|
|
|
distribution.
|
2022-04-21 03:38:39 +02:00
|
|
|
|
2022-04-21 02:12:38 +02:00
|
|
|
-------------------------------------------------------------*/
|
|
|
|
|
|
|
|
#ifndef _WII_BASICS_H_
|
|
|
|
#define _WII_BASICS_H_
|
|
|
|
|
|
|
|
// Turn upper and lower into a full title ID
|
2022-04-21 03:38:39 +02:00
|
|
|
#define TITLE_ID(x, y) (((u64)(x) << 32) | (y))
|
2022-04-21 02:12:38 +02:00
|
|
|
// Get upper or lower half of a title ID
|
2022-04-21 03:38:39 +02:00
|
|
|
#define TITLE_UPPER(x) ((u32)((x) >> 32))
|
2022-04-21 02:12:38 +02:00
|
|
|
// Turn upper and lower into a full title ID
|
2022-04-21 03:38:39 +02:00
|
|
|
#define TITLE_LOWER(x) ((u32)(x))
|
|
|
|
#define BLACK 0
|
|
|
|
#define RED 1
|
|
|
|
#define GREEN 2
|
|
|
|
#define YELLOW 3
|
|
|
|
#define BLUE 4
|
2022-04-21 02:12:38 +02:00
|
|
|
#define MAGENTA 5
|
2022-04-21 03:38:39 +02:00
|
|
|
#define CYAN 6
|
|
|
|
#define WHITE 7
|
2022-04-21 02:12:38 +02:00
|
|
|
|
2022-04-21 03:38:39 +02:00
|
|
|
#define BOLD_NONE 0
|
2022-04-21 02:12:38 +02:00
|
|
|
#define BOLD_NORMAL 1
|
2022-04-21 03:38:39 +02:00
|
|
|
#define BOLD_FAINT 2
|
2022-04-21 02:12:38 +02:00
|
|
|
|
2022-04-21 03:38:39 +02:00
|
|
|
#define UP_ARROW "\x1E"
|
|
|
|
#define DOWN_ARROW "\x1F"
|
|
|
|
#define LEFT_ARROW "\x11"
|
2022-04-21 02:12:38 +02:00
|
|
|
#define RIGHT_ARROW "\x10"
|
|
|
|
|
|
|
|
#define ARCME_VERSION 1.0
|
2022-04-21 03:38:39 +02:00
|
|
|
#define ARCME_REV 6
|
2022-04-21 02:12:38 +02:00
|
|
|
|
|
|
|
// be functions from segher's wii.git
|
|
|
|
u16 be16(const u8 *p);
|
|
|
|
u32 be32(const u8 *p);
|
|
|
|
u64 be64(const u8 *p);
|
|
|
|
u64 be34(const u8 *p);
|
|
|
|
|
|
|
|
// Do basic Wii init: Video, console, WPAD
|
|
|
|
void basicInit(void);
|
|
|
|
|
|
|
|
// Do our custom init: Identify and initialized ISFS driver
|
|
|
|
void miscInit(void);
|
|
|
|
|
|
|
|
void IdentSysMenu(void);
|
|
|
|
|
|
|
|
// Clean up after ourselves (Deinit ISFS)
|
|
|
|
void miscDeInit(void);
|
|
|
|
|
|
|
|
// Scan the pads and return buttons
|
|
|
|
u32 getButtons(void);
|
|
|
|
|
|
|
|
u32 wait_anyKey(void);
|
|
|
|
|
|
|
|
u32 wait_key(u32 button);
|
|
|
|
|
|
|
|
void hex_print_array16(const u8 *array, u32 size);
|
|
|
|
|
|
|
|
/* Reads a file from ISFS to an array in memory */
|
2022-04-21 03:38:39 +02:00
|
|
|
s32 ISFS_ReadFileToArray(const char *filepath, u8 *filearray, u32 max_size, u32 *file_size);
|
2022-04-21 02:12:38 +02:00
|
|
|
|
|
|
|
/* Writes from an array in memory to a file with ISFS */
|
2022-04-21 03:38:39 +02:00
|
|
|
s32 ISFS_WriteFileFromArray(const char *filepath, const u8 *filearray, u32 array_size, u32 ownerID, u16 groupID, u8 attr, u8 own_perm, u8 group_perm, u8 other_perm);
|
2022-04-21 02:12:38 +02:00
|
|
|
|
|
|
|
bool yes_or_no();
|
|
|
|
void ClearScreen();
|
|
|
|
void ClearLine();
|
|
|
|
void PrintCenter(char *, int);
|
|
|
|
void Console_SetFgColor(u8, u8);
|
|
|
|
void Console_SetBgColor(u8, u8);
|
|
|
|
void Console_SetColors(u8, u8, u8, u8);
|
|
|
|
void Console_SetPosition(u8, u8);
|
|
|
|
void PrintBanner();
|
|
|
|
|
|
|
|
#endif
|