Merge GabyPCgeeK's fork. Fix #1 and fix #2

This commit is contained in:
Lázaro Vieira 2017-08-29 01:59:21 -03:00
parent dc8259fa0d
commit eee64d3e1a
43 changed files with 4130 additions and 862 deletions

View File

@ -56,7 +56,7 @@ MAKEFLAGS += --no-print-directory
#---------------------------------------------------------------------------------
# any extra libraries we wish to link with the project
#---------------------------------------------------------------------------------
LIBS := -lfat -liosuhax -lxml2
LIBS := -lfat -liosuhax -lfreetype -lpng -lz -lm
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing

View File

@ -1,16 +1,19 @@
# savemii
# savemii (Original by Ryuzaki-MrL, modded by GabyPCgeeK)
WiiU/vWii Save Manager
**You need to run iosuhax/mocha cfw first in order for this homebrew to work.**
**You need to run haxchi/iosuhax/mocha cfw first in order for this homebrew to work.**
**Got it working with CBHC but not extensively tested. Not tested in normal haxchi.**
This homebrew allows you to backup your Wii U and vWii savegames to the SD card and also restore them.
Up to 256 backups can be made per title.
Backups are stored in sd:/wiiu/backups.
For sorting Titles press R to change sorting method and press L to change between descending and ascending.
Use it at your own risk and please report any issues that may occur.
Known issues:
- some games exhibit unexpected behaviour when the savefile is restored
**Needs freetype-2.8 library for compiling.**
TODO:
- installable package
@ -19,4 +22,4 @@ Credits:
- Bruno Vinicius, for the icon
- dimok, for libiosuhax and libfat for Wii U
- rw-r-r-0644, for lib_easy
- dimok again, because he's awesome :3
- dimok again, because he's awesome :3

22
TGAReader_LICENSE Normal file
View File

@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2014 Kenji Sasaki
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Binary file not shown.

View File

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<app version="1">
<name>SaveMii</name>
<coder>Ryuzaki_MrL</coder>
<version>1.2.0</version>
<release_date>20170404000000</release_date>
<name>SaveMii Mod</name>
<coder>Ryuzaki_MrL original (GabyPCgeeK mod)</coder>
<version>1.2.0.mod5</version>
<release_date>20170812000000</release_date>
<short_description>WiiU/vWii Save Manager</short_description>
<long_description>WiiU/vWii Save Manager
You need to run iosuhax/mocha cfw first in order for this homebrew to work.
You need to run haxchi/iosuhax/mocha cfw first in order for this homebrew to work.
This homebrew allows you to backup your Wii U and vWii savegames to the SD card and also restore them. Up to 256 backups can be made per title. Backups are stored in sd:/wiiu/backups.</long_description>
This homebrew allows you to backup your Wii U and vWii savegames to the SD card and also restore them. Can also copy saves from NAND<->USB if title is installed to both. Up to 256 backups can be made per title. Backups are stored in sd:/wiiu/backups.</long_description>
<category>tool</category>
<url>https://github.com/Ryuzaki-MrL/savemii/releases</url>
</app>
<url>https://github.com/GabyPCgeeK/savemii/releases</url>
</app>

View File

@ -26,7 +26,6 @@ extern "C" {
#define FS_SOURCETYPE_EXTERNAL 0
#define FS_SOURCETYPE_HFIO 1
#define FS_SOURCETYPE_HFIO 1
#define FS_MOUNT_SOURCE_SIZE 0x300
#define FS_CLIENT_SIZE 0x1700

519
src/draw.c Normal file
View File

@ -0,0 +1,519 @@
#include "draw.h"
unsigned char *scrBuffer;
int scr_buf0_size = 0;
int scr_buf1_size = 0;
bool cur_buf1;
u8 *ttfFont;
RGBAColor fcolor = {0xFFFFFFFF};
FT_Library library;
FT_Face face;
void initDraw(char* buf, int size0, int size1) {
scrBuffer = buf;
scr_buf0_size = size0;
scr_buf1_size = size1;
clearBuffers();
uint32_t *screen2 = scrBuffer + scr_buf0_size;
OSScreenPutPixelEx(1, 0, 0, 0xABCDEFFF);
if (screen2[0] == 0xABCDEFFF) cur_buf1 = false;
else cur_buf1 = true;
}
void flipBuffers() {
//Flush the cache
DCFlushRange(scrBuffer + scr_buf0_size, scr_buf1_size);
DCFlushRange(scrBuffer, scr_buf0_size);
//Flip the buffer
OSScreenFlipBuffersEx(0);
OSScreenFlipBuffersEx(1);
cur_buf1 = !cur_buf1;
}
void clearBuffers() {
for(int i = 0; i < 2; i++) {
OSScreenClearBufferEx(0, 0);
OSScreenClearBufferEx(1, 0);
flipBuffers();
}
}
void drawString(int x, int line, char* string) {
OSScreenPutFontEx(0, x, line, string);
OSScreenPutFontEx(1, x, line, string);
}
void fillScreen(u8 r, u8 g, u8 b, u8 a) {
RGBAColor color;
color.r = r; color.g = g; color.b = b; color.a = a;
//uint32_t num = (r << 24) | (g << 16) | (b << 8) | a;
OSScreenClearBufferEx(0, color.c);
OSScreenClearBufferEx(1, color.c);
}
void drawPixel32(int x, int y, RGBAColor color) {
drawPixel(x, y, color.r, color.g, color.b, color.a);
}
void drawPixel(int x, int y, u8 r, u8 g, u8 b, u8 a) {
/*uint32_t num = (r << 24) | (g << 16) | (b << 8) | a;
OSScreenPutPixelEx(0, x, y, num);
OSScreenPutPixelEx(1, x, y, num);*/
int width = 1280; //height = 1024 720?
char *screen = scrBuffer;
int otherBuff0 = scr_buf0_size / 2;
int otherBuff1 = scr_buf1_size / 2;
float opacity = a / 255.0;
for (int yy = (y * 1.5); yy < ((y * 1.5) + 1); yy++) {
for (int xx = (x * 1.5); xx < ((x * 1.5) + 1); xx++) {
u32 v = (xx + yy * width) * 4;
if (cur_buf1) v += otherBuff0;
screen[v ] = r * opacity + (1 - opacity) * screen[v];
screen[v + 1] = g * opacity + (1 - opacity) * screen[v + 1];
screen[v + 2] = b * opacity + (1 - opacity) * screen[v + 2];
screen[v + 3] = a;
}
}
/*u32 v = (x + y * width) * 4;
if (cur_buf1) v += otherBuff0;
screen[v ] = r * opacity + (1 - opacity) * screen[v];
screen[v + 1] = g * opacity + (1 - opacity) * screen[v + 1];
screen[v + 2] = b * opacity + (1 - opacity) * screen[v + 2];
screen[v + 3] = a;*/
width = 896; //height = 480;
char *screen2 = scrBuffer + scr_buf0_size;
u32 v = (x + y * width) * 4;
if (cur_buf1) v += otherBuff1;
screen2[v ] = r * opacity + (1 - opacity) * screen2[v];
screen2[v + 1] = g * opacity + (1 - opacity) * screen2[v + 1];
screen2[v + 2] = b * opacity + (1 - opacity) * screen2[v + 2];
screen2[v + 3] = a;
}
void drawLine(int x1, int y1, int x2, int y2, u8 r, u8 g, u8 b, u8 a) {
int x, y;
if (x1 == x2){
if (y1 < y2) for (y = y1; y <= y2; y++) drawPixel(x1, y, r, g, b, a);
else for (y = y2; y <= y1; y++) drawPixel(x1, y, r, g, b, a);
}
else {
if (x1 < x2) for (x = x1; x <= x2; x++) drawPixel(x, y1, r, g, b, a);
else for (x = x2; x <= x1; x++) drawPixel(x, y1, r, g, b, a);
}
}
void drawRect(int x1, int y1, int x2, int y2, u8 r, u8 g, u8 b, u8 a) {
drawLine(x1, y1, x2, y1, r, g, b, a);
drawLine(x2, y1, x2, y2, r, g, b, a);
drawLine(x1, y2, x2, y2, r, g, b, a);
drawLine(x1, y1, x1, y2, r, g, b, a);
}
void drawFillRect(int x1, int y1, int x2, int y2, u8 r, u8 g, u8 b, u8 a) {
int X1, X2, Y1, Y2, i, j;
if (x1 < x2){
X1 = x1;
X2 = x2;
}
else {
X1 = x2;
X2 = x1;
}
if (y1 < y2){
Y1 = y1;
Y2 = y2;
}
else {
Y1 = y2;
Y2 = y1;
}
for (i = X1; i <= X2; i++){
for (j = Y1; j <= Y2; j++){
drawPixel(i, j, r, g, b, a);
}
}
}
void drawCircle(int xCen, int yCen, int radius, u8 r, u8 g, u8 b, u8 a) {
int x = 0;
int y = radius;
int p = (5 - radius * 4) / 4;
drawCircleCircum(xCen, yCen, x, y, r, g, b, a);
while (x < y){
x++;
if (p < 0){
p += 2 * x + 1;
}
else{
y--;
p += 2 * (x - y) + 1;
}
drawCircleCircum(xCen, yCen, x, y, r, g, b, a);
}
}
void drawFillCircle(int xCen, int yCen, int radius, u8 r, u8 g, u8 b, u8 a) {
drawCircle(xCen, yCen, radius, r, g, b, a);
int x, y;
for (y = -radius; y <= radius; y++){
for (x = -radius; x <= radius; x++)
if (x*x + y*y <= radius*radius + radius * .8f)
drawPixel(xCen + x, yCen + y, r, g, b, a);
}
}
void drawCircleCircum(int cx, int cy, int x, int y, u8 r, u8 g, u8 b, u8 a) {
if (x == 0){
drawPixel(cx, cy + y, r, g, b, a);
drawPixel(cx, cy - y, r, g, b, a);
drawPixel(cx + y, cy, r, g, b, a);
drawPixel(cx - y, cy, r, g, b, a);
}
if (x == y){
drawPixel(cx + x, cy + y, r, g, b, a);
drawPixel(cx - x, cy + y, r, g, b, a);
drawPixel(cx + x, cy - y, r, g, b, a);
drawPixel(cx - x, cy - y, r, g, b, a);
}
if (x < y){
drawPixel(cx + x, cy + y, r, g, b, a);
drawPixel(cx - x, cy + y, r, g, b, a);
drawPixel(cx + x, cy - y, r, g, b, a);
drawPixel(cx - x, cy - y, r, g, b, a);
drawPixel(cx + y, cy + x, r, g, b, a);
drawPixel(cx - y, cy + x, r, g, b, a);
drawPixel(cx + y, cy - x, r, g, b, a);
drawPixel(cx - y, cy - x, r, g, b, a);
}
}
void drawPic(int x, int y, u32 w, u32 h, float scale, u32* pixels) {
u32 nw = w, nh = h;
RGBAColor color;
if (scale <= 0) scale = 1;
nw = w * scale; nh = h * scale;
for (u32 j = y; j < (y + nh); j++) {
for (u32 i = x; i < (x + nw); i++) {
color.c = pixels[((i - x) * w / nw) + ((j - y) * h / nh) * w];
drawPixel32(i, j, color);
}
}
}
void drawTGA(int x, int y, float scale, u8* fileContent) {
u32 w = tgaGetWidth(fileContent), h = tgaGetHeight(fileContent);
u32 nw = w, nh = h;
u32* out = tgaRead(fileContent, TGA_READER_RGBA);
if (scale <= 0) scale = 1;
nw = w * scale; nh = h * scale;
drawPic(x, y, w, h, scale, out);
if (scale > 0.5) {
if ((x > 0) && (y > 0)) drawRect(x - 1, y - 1, x + nw, y + nh, 255, 255, 255, 128);
if ((x > 1) && (y > 1)) drawRect(x - 2, y - 2, x + nw + 1, y + nh + 1, 255, 255, 255, 128);
if ((x > 2) && (y > 2)) drawRect(x - 3, y - 3, x + nw + 2, y + nh + 2, 255, 255, 255, 128);
}
free(out);
}
void drawRGB5A3(int x, int y, float scale, u8* fileContent) {
u32 w = 192, h = 64, num = 0;
u32 nw = w, nh = h;
if (scale <= 0) scale = 1;
nw = w * scale; nh = h * scale;
u32 pos = 0, npos = 0;
RGBAColor color;
u16* pixels = (u16*)fileContent;
u8 sum = (4 * scale);
for (u32 j = y; j < (y + nh); j += sum) {
for (u32 i = x; i < (x + nw); i += sum) {
for (u32 sj = j; sj < (j + sum); sj++, pos++) {
for (u32 si = i; si < (i + sum); si++) {
npos = ((si - i) / scale) + ((pos / scale) * 4);
if (pixels[npos] & 0x8000)
color.c = ((pixels[npos] & 0x7C00) << 17) | ((pixels[npos] & 0x3E0) << 14) | ((pixels[npos] & 0x1F) << 11) | 0xFF;
else
color.c = (((pixels[npos] & 0xF00) * 0x11) << 16) | (((pixels[npos] & 0xF0) * 0x11) << 12) | (((pixels[npos] & 0xF) * 0x11) << 8) | (((pixels[npos] & 0x7000) >> 12) * 0x24);
drawPixel32(si, sj, color);
}
}
}
}
if (scale > 0.5) {
if ((x > 0) && (y > 0)) drawRect(x - 1, y - 1, x + nw, y + nh, 255, 255, 255, 128);
if ((x > 1) && (y > 1)) drawRect(x - 2, y - 2, x + nw + 1, y + nh + 1, 255, 255, 255, 128);
if ((x > 2) && (y > 2)) drawRect(x - 3, y - 3, x + nw + 2, y + nh + 2, 255, 255, 255, 128);
}
}
void drawBackgroundDRC(u32 w, u32 h, u8* out) {
uint32_t *screen2 = NULL;
int otherBuff1 = scr_buf1_size / 2;
if (cur_buf1) screen2 = scrBuffer + scr_buf0_size + otherBuff1;
else screen2 = scrBuffer + scr_buf0_size;
memcpy(screen2, out, w * h * 4);
}
void drawBackgroundTV(u32 w, u32 h, u8* out) {
uint32_t *screen1 = scrBuffer;
int otherBuff0 = scr_buf0_size / 2;
if (cur_buf1) screen1 = scrBuffer + otherBuff0;
memcpy(screen1, out, w * h * 4);
}
bool initFont(void* fontBuf, FT_Long fsize) {
FT_Long size = fsize;
if (fontBuf) {
ttfFont = fontBuf;
} else {
OSGetSharedData(2, 0, &ttfFont, &size);
}
FT_Error error;
error = FT_Init_FreeType(&library);
if (error) return false;
error = FT_New_Memory_Face(library, ttfFont, size, 0, &face);
if (error) return false;
/*error = FT_Set_Char_Size(face, 8*64, 10*64, 158, 158);
if (error) return false;*/
error = FT_Set_Pixel_Sizes(face, 0, 22); //pixel width, height
if (error) return false;
return true;
}
void freeFont(void* fontBuf) {
FT_Done_Face(face);
FT_Done_FreeType(library);
//if (fontBuf) free(fontBuf);
}
void draw_bitmap(FT_Bitmap* bitmap, FT_Int x, FT_Int y) {
FT_Int i, j, p, q;
FT_Int x_max;
FT_Int y_max = y + bitmap->rows;
switch(bitmap->pixel_mode) {
case FT_PIXEL_MODE_GRAY:
x_max = x + bitmap->width;
for (i = x, p = 0; i < x_max; i++, p++) {
for (j = y, q = 0; j < y_max; j++, q++) {
if (i < 0 || j < 0 || i >= 854 || j >= 480) continue;
u8 col = bitmap->buffer[q * bitmap->pitch + p];
if (col == 0) continue;
float opacity = col / 255.0;
/*u8 cr = fcolor.r * opacity + (1 - opacity) * 0;
u8 cg = fcolor.g * opacity + (1 - opacity) * 0;
u8 cb = fcolor.b * opacity + (1 - opacity) * 0;
drawPixel(i, j, cr, cg, cb, fcolor.a);*/
drawPixel(i, j, fcolor.r, fcolor.g, fcolor.b, (u8)(fcolor.a * opacity));
}
}
break;
case FT_PIXEL_MODE_LCD:
x_max = x + bitmap->width / 3;
for (i = x, p = 0; i < x_max; i++, p++) {
for (j = y, q = 0; j < y_max; j++, q++) {
if (i < 0 || j < 0 || i >= 854 || j >= 480) continue;
u8 cr = bitmap->buffer[q * bitmap->pitch + p * 3];
u8 cg = bitmap->buffer[q * bitmap->pitch + p * 3 + 1];
u8 cb = bitmap->buffer[q * bitmap->pitch + p * 3 + 2];
if ((cr | cg | cb) == 0) continue;
drawPixel(i, j, cr, cg, cb, 255);
}
}
break;
case FT_PIXEL_MODE_BGRA:
x_max = x + bitmap->width/2;
for (i = x, p = 0; i < x_max; i++, p++) {
for (j = y, q = 0; j < y_max; j++, q++) {
if (i < 0 || j < 0 || i >= 854 || j >= 480) continue;
u8 cb = bitmap->buffer[q * bitmap->pitch + p * 4];
u8 cg = bitmap->buffer[q * bitmap->pitch + p * 4 + 1];
u8 cr = bitmap->buffer[q * bitmap->pitch + p * 4 + 2];
u8 ca = bitmap->buffer[q * bitmap->pitch + p * 4 + 3];
if ((cr | cg | cb) == 0) continue;
drawPixel(i, j, cr, cg, cb, ca);
}
}
break;
}
}
bool ttfFontSize(u8 w, u8 h) {
FT_Error error;
/*error = FT_Set_Char_Size(face, 8*64, 10*64, 158, 158);
if (error) return false;*/
error = FT_Set_Pixel_Sizes(face, w, h); //pixel width, height
if (error) return false;
return true;
}
void ttfFontColor32(u32 color) {
fcolor.c = color;
}
void ttfFontColor(u8 r, u8 g, u8 b, u8 a) {
RGBAColor color = {.r = r, .g = g, .b = b, .a = a};
ttfFontColor32(color.c);
}
int ttfPrintString(int x, int y, char *string, bool wWrap, bool ceroX) {
FT_GlyphSlot slot = face->glyph;
FT_Error error;
int pen_x = x, pen_y = y;
FT_UInt previous_glyph;
while(*string) {
uint32_t buf = *string++;
int dy = 0;
if ((buf >> 6) == 3) {
if ((buf & 0xF0) == 0xC0) {
uint8_t b1 = buf & 0xFF, b2 = *string++;
if ((b2 & 0xC0) == 0x80) b2 &= 0x3F;
buf = ((b1 & 0xF) << 6) | b2;
} else if ((buf & 0xF0) == 0xD0) {
uint8_t b1 = buf & 0xFF, b2 = *string++;
if ((b2 & 0xC0) == 0x80) b2 &= 0x3F;
buf = 0x400 | ((b1 & 0xF) << 6) | b2;
} else if ((buf & 0xF0) == 0xE0) {
uint8_t b1 = buf & 0xFF, b2 = *string++, b3 = *string++;
if ((b2 & 0xC0) == 0x80) b2 &= 0x3F;
if ((b3 & 0xC0) == 0x80) b3 &= 0x3F;
buf = ((b1 & 0xF) << 12) | (b2 << 6) | b3;
}
} else if (buf & 0x80) {
string++;
continue;
}
if (buf == '\n') {
pen_y += (face->size->metrics.height >> 6);
if (ceroX) pen_x = 0;
else pen_x = x;
continue;
}
//error = FT_Load_Char(face, buf, FT_LOAD_RENDER);
FT_UInt glyph_index;
glyph_index = FT_Get_Char_Index(face, buf);
if (FT_HAS_KERNING(face)) {
FT_Vector vector;
FT_Get_Kerning(face, previous_glyph, glyph_index, FT_KERNING_DEFAULT, &vector);
pen_x += (vector.x >> 6);
dy = vector.y >> 6;
}
error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);//FT_LOAD_COLOR);//
if (error)
continue;
error = FT_Render_Glyph(face->glyph, FT_RENDER_MODE_NORMAL);//FT_RENDER_MODE_LCD);//
if (error)
continue;
if ((pen_x + (slot->advance.x >> 6)) > 853) {
if (wWrap) {
pen_y += (face->size->metrics.height >> 6);
if (ceroX) pen_x = 0;
else pen_x = x;
} else {
return pen_x;
}
}
draw_bitmap(&slot->bitmap, pen_x + slot->bitmap_left, (face->height >> 6) + pen_y - slot->bitmap_top);
pen_x += (slot->advance.x >> 6);
previous_glyph = glyph_index;
}
return pen_x;
}
int ttfStringWidth(char *string, s8 part) {
FT_GlyphSlot slot = face->glyph;
FT_Error error;
int pen_x = 0, max_x = 0, spart = 1;
FT_UInt previous_glyph;
while(*string) {
uint32_t buf = *string++;
if ((buf >> 6) == 3) {
if ((buf & 0xF0) == 0xC0) {
uint8_t b1 = buf & 0xFF, b2 = *string++;
if ((b2 & 0xC0) == 0x80) b2 &= 0x3F;
buf = ((b1 & 0xF) << 6) | b2;
} else if ((buf & 0xF0) == 0xD0) {
uint8_t b1 = buf & 0xFF, b2 = *string++;
if ((b2 & 0xC0) == 0x80) b2 &= 0x3F;
buf = 0x400 | ((b1 & 0xF) << 6) | b2;
} else if ((buf & 0xF0) == 0xE0) {
uint8_t b1 = buf & 0xFF, b2 = *string++, b3 = *string++;
if ((b2 & 0xC0) == 0x80) b2 &= 0x3F;
if ((b3 & 0xC0) == 0x80) b3 &= 0x3F;
buf = ((b1 & 0xF) << 12) | (b2 << 6) | b3;
}
} else if (buf & 0x80) {
string++;
continue;
}
//error = FT_Load_Char(face, buf, FT_LOAD_RENDER);
FT_UInt glyph_index;
glyph_index = FT_Get_Char_Index(face, buf);
if (FT_HAS_KERNING(face)) {
FT_Vector vector;
FT_Get_Kerning(face, previous_glyph, glyph_index, FT_KERNING_DEFAULT, &vector);
pen_x += (vector.x >> 6);
}
if (buf == '\n') {
if (part != 0) {
if ((part > 0) && (spart == part)) return pen_x;
if (part == -2) max_x = max(pen_x, max_x);
pen_x = 0;
spart++;
}
continue;
}
error = FT_Load_Glyph(face, glyph_index, FT_LOAD_BITMAP_METRICS_ONLY);
if (error)
continue;
pen_x += (slot->advance.x >> 6);
previous_glyph = glyph_index;
}
if (spart < part) pen_x = 0;
return max(pen_x, max_x);
}

53
src/draw.h Normal file
View File

@ -0,0 +1,53 @@
#ifndef DRAW_H
#define DRAW_H
#include <gctypes.h>
//#include <math.h>
#include "lib_easy.h"
#include "tga_reader.h"
#include <ft2build.h>
#include FT_FREETYPE_H
typedef union _RGBAColor {
u32 c;
struct {
u8 r;
u8 g;
u8 b;
u8 a;
};
} RGBAColor;
#ifndef max
#define max(a, b) (((a) > (b)) ? (a) : (b))
#endif
//Function declarations for my graphics library
void initDraw(char* buf, int size0, int size1);
void flipBuffers();
void clearBuffers();
void fillScreen(u8 r, u8 g, u8 b, u8 a);
void drawString(int x, int line, char * string);
void drawPixel32(int x, int y, RGBAColor color);
void drawPixel(int x, int y, u8 r, u8 g, u8 b, u8 a);
void drawLine(int x1, int y1, int x2, int y2, u8 r, u8 g, u8 b, u8 a);
void drawRect(int x1, int y1, int x2, int y2, u8 r, u8 g, u8 b, u8 a);
void drawFillRect(int x1, int y1, int x2, int y2, u8 r, u8 g, u8 b, u8 a);
void drawCircle(int xCen, int yCen, int radius, u8 r, u8 g, u8 b, u8 a);
void drawFillCircle(int xCen, int yCen, int radius, u8 r, u8 g, u8 b, u8 a);
void drawCircleCircum(int cx, int cy, int x, int y, u8 r, u8 g, u8 b, u8 a);
void drawPic(int x, int y, u32 w, u32 h, float scale, u32* pixels);
void drawTGA(int x, int y, float scale, u8* fileContent);
void drawRGB5A3(int x, int y, float scale, u8* pixels);
void drawBackgroundDRC(u32 w, u32 h, u8* out);
void drawBackgroundTV(u32 w, u32 h, u8* out);
bool initFont();
void freeFont();
bool ttfFontSize(u8 w, u8 h);
void ttfFontColor32(u32 color);
void ttfFontColor(u8 r, u8 g, u8 b, u8 a);
int ttfPrintString(int x, int y, char *string, bool wWrap, bool ceroX);
int ttfStringWidth(char *string, s8 part);
#endif /* DRAW_H */

View File

@ -24,7 +24,7 @@
#include "os_functions.h"
#include "acp_functions.h"
unsigned int acp_handle __attribute__((section(".data"))) = 0;
u32 acp_handle __attribute__((section(".data"))) = 0;
EXPORT_DECL(void, GetMetaXml, void * _ACPMetaXml);

View File

@ -30,7 +30,7 @@ extern "C" {
#include <gctypes.h>
extern unsigned int acp_handle;
extern u32 acp_handle;
void InitACPFunctionPointers(void);
void InitAcquireACP(void);

View File

@ -24,7 +24,7 @@
#include "os_functions.h"
#include "aoc_functions.h"
unsigned int aoc_handle __attribute__((section(".data"))) = 0;
u32 aoc_handle __attribute__((section(".data"))) = 0;
EXPORT_DECL(s32, AOC_Initialize, void);
EXPORT_DECL(s32, AOC_Finalize, void);

View File

@ -28,7 +28,9 @@
extern "C" {
#endif
extern unsigned int aoc_handle;
#include <gctypes.h>
extern u32 aoc_handle;
#define AOC_TITLE_SIZE 104

View File

@ -25,7 +25,7 @@
#include "os_functions.h"
#include "ax_functions.h"
unsigned int sound_handle __attribute__((section(".data"))) = 0;
u32 sound_handle __attribute__((section(".data"))) = 0;
EXPORT_DECL(void, AXInitWithParams, u32 * params);
EXPORT_DECL(void, AXInit, void);
@ -51,7 +51,7 @@ EXPORT_DECL(void, AXSetVoiceLoopOffset, void *v, u32 offset);
void InitAcquireAX(void)
{
unsigned int *funcPointer = 0;
u32 *funcPointer = 0;
if(OS_FIRMWARE >= 400)
{
@ -73,7 +73,7 @@ void InitAcquireAX(void)
void InitAXFunctionPointers(void)
{
unsigned int *funcPointer = 0;
u32 *funcPointer = 0;
InitAcquireAX();
@ -102,8 +102,8 @@ void ProperlyEndTransitionAudio(void)
void (* AXInit_old)(void);
void (* AXQuit_old)(void);
unsigned int *funcPointer = 0;
unsigned int sound_handle;
u32 *funcPointer = 0;
u32 sound_handle;
OSDynLoad_Acquire("snd_core.rpl", &sound_handle);
OS_FIND_EXPORT_EX(sound_handle, check_os_audio_transition_flag, check_os_audio_transition_flag_old);

View File

@ -30,7 +30,7 @@ extern "C" {
#include <gctypes.h>
extern unsigned int sound_handle;
extern u32 sound_handle;
void InitAXFunctionPointers(void);
void InitAcquireAX(void);

View File

@ -41,7 +41,7 @@ void InitAcquireCurl(void)
void InitCurlFunctionPointers(void)
{
InitAcquireCurl();
unsigned int *funcPointer = 0;
u32 *funcPointer = 0;
OS_FIND_EXPORT_EX(libcurl_handle, curl_global_init, n_curl_global_init);
OS_FIND_EXPORT_EX(libcurl_handle, curl_easy_init, n_curl_easy_init);

View File

@ -1,5 +1,5 @@
#ifndef FS_DEFS_H
#define FS_DEFS_H
#define FS_DEFS_H
#include <gctypes.h>
@ -17,7 +17,7 @@ extern "C" {
#define FS_STATUS_OK 0
#define FS_RET_UNSUPPORTED_CMD 0x0400
#define FS_RET_NO_ERROR 0x0000
#define FS_RET_ALL_ERROR (unsigned int)(-1)
#define FS_RET_ALL_ERROR (u32)(-1)
#define FS_STAT_FLAG_IS_DIRECTORY 0x80000000
@ -31,6 +31,13 @@ extern "C" {
#define FS_CLIENT_SIZE 0x1700
#define FS_CMD_BLOCK_SIZE 0xA80
#define FSA_STATUS_OK 0
#define FSA_STATUS_END_OF_DIRECTORY -4
#define FSA_STATUS_END_OF_FILE -5
#define FSA_STATUS_ALREADY_EXISTS -22
#define FSA_STATUS_NOT_FOUND -23
#define FSA_STATUS_NOT_EMPTY -24
typedef struct
{
uint32_t flag;
@ -43,7 +50,7 @@ typedef struct
uint32_t ent_id;
uint64_t ctime;
uint64_t mtime;
uint8_t attributes[48];
uint8_t attributes[48];
} __attribute__((packed)) FSStat;
typedef struct
@ -52,10 +59,17 @@ typedef struct
char name[FS_MAX_ENTNAME_SIZE];
} FSDirEntry;
typedef void (*FSAsyncCallback)(void *pClient, void *pCmd, int result, void *context);
typedef struct
{
FSAsyncCallback userCallback;
void *userContext;
void *ioMsgQueue;
} FSAsyncParams;
#ifdef __cplusplus
}
#endif
#endif /* FS_DEFS_H */
#endif /* FS_DEFS_H */

View File

@ -24,65 +24,69 @@
#include "fs_functions.h"
#include "os_functions.h"
EXPORT_DECL(int, FSInit, void);
EXPORT_DECL(int, FSShutdown, void);
EXPORT_DECL(int, FSAddClientEx, void *pClient, int unk_zero_param, int errHandling);
EXPORT_DECL(int, FSDelClient, void *pClient);
EXPORT_DECL(s32, FSInit, void);
EXPORT_DECL(s32, FSShutdown, void);
EXPORT_DECL(s32, FSAddClient, void *pClient, s32 errHandling);
EXPORT_DECL(s32, FSAddClientEx, void *pClient, s32 unk_zero_param, s32 errHandling);
EXPORT_DECL(s32, FSDelClient, void *pClient);
EXPORT_DECL(void, FSInitCmdBlock, void *pCmd);
EXPORT_DECL(int, FSGetMountSource, void *pClient, void *pCmd, int type, void *source, int errHandling);
EXPORT_DECL(void *, FSGetCurrentCmdBlock, void *pClient);
EXPORT_DECL(s32, FSGetMountSource, void *pClient, void *pCmd, s32 type, void *source, s32 errHandling);
EXPORT_DECL(int, FSMount, void *pClient, void *pCmd, void *source, char *target, uint32_t bytes, int errHandling);
EXPORT_DECL(int, FSUnmount, void *pClient, void *pCmd, const char *target, int errHandling);
EXPORT_DECL(s32, FSMount, void *pClient, void *pCmd, void *source, char *target, u32 bytes, s32 errHandling);
EXPORT_DECL(s32, FSUnmount, void *pClient, void *pCmd, const char *target, s32 errHandling);
EXPORT_DECL(int, FSGetStat, void *pClient, void *pCmd, const char *path, FSStat *stats, int errHandling);
EXPORT_DECL(int, FSGetStatAsync, void *pClient, void *pCmd, const char *path, void *stats, int error, void *asyncParams);
EXPORT_DECL(int, FSRename, void *pClient, void *pCmd, const char *oldPath, const char *newPath, int error);
EXPORT_DECL(int, FSRenameAsync, void *pClient, void *pCmd, const char *oldPath, const char *newPath, int error, void *asyncParams);
EXPORT_DECL(int, FSRemove, void *pClient, void *pCmd, const char *path, int error);
EXPORT_DECL(int, FSRemoveAsync, void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
EXPORT_DECL(int, FSFlushQuota, void *pClient, void *pCmd, const char* path, int error);
EXPORT_DECL(int, FSFlushQuotaAsync, void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
EXPORT_DECL(int, FSGetFreeSpaceSize, void *pClient, void *pCmd, const char *path, uint64_t *returnedFreeSize, int error);
EXPORT_DECL(int, FSGetFreeSpaceSizeAsync, void *pClient, void *pCmd, const char *path, uint64_t *returnedFreeSize, int error, void *asyncParams);
EXPORT_DECL(int, FSRollbackQuota, void *pClient, void *pCmd, const char *path, int error);
EXPORT_DECL(int, FSRollbackQuotaAsync, void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
EXPORT_DECL(s32, FSGetStat, void *pClient, void *pCmd, const char *path, FSStat *stats, s32 errHandling);
EXPORT_DECL(s32, FSGetStatAsync, void *pClient, void *pCmd, const char *path, void *stats, s32 error, void *asyncParams);
EXPORT_DECL(s32, FSRename, void *pClient, void *pCmd, const char *oldPath, const char *newPath, s32 error);
EXPORT_DECL(s32, FSRenameAsync, void *pClient, void *pCmd, const char *oldPath, const char *newPath, s32 error, void *asyncParams);
EXPORT_DECL(s32, FSRemove, void *pClient, void *pCmd, const char *path, s32 error);
EXPORT_DECL(s32, FSRemoveAsync, void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
EXPORT_DECL(s32, FSFlushQuota, void *pClient, void *pCmd, const char* path, s32 error);
EXPORT_DECL(s32, FSFlushQuotaAsync, void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
EXPORT_DECL(s32, FSGetFreeSpaceSize, void *pClient, void *pCmd, const char *path, uint64_t *returnedFreeSize, s32 error);
EXPORT_DECL(s32, FSGetFreeSpaceSizeAsync, void *pClient, void *pCmd, const char *path, uint64_t *returnedFreeSize, s32 error, void *asyncParams);
EXPORT_DECL(s32, FSRollbackQuota, void *pClient, void *pCmd, const char *path, s32 error);
EXPORT_DECL(s32, FSRollbackQuotaAsync, void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
EXPORT_DECL(int, FSOpenDir, void *pClient, void *pCmd, const char *path, int *dh, int errHandling);
EXPORT_DECL(int, FSOpenDirAsync, void *pClient, void* pCmd, const char *path, int *handle, int error, void *asyncParams);
EXPORT_DECL(int, FSReadDir, void *pClient, void *pCmd, int dh, FSDirEntry *dir_entry, int errHandling);
EXPORT_DECL(int, FSRewindDir, void *pClient, void *pCmd, int dh, int errHandling);
EXPORT_DECL(int, FSCloseDir, void *pClient, void *pCmd, int dh, int errHandling);
EXPORT_DECL(int, FSChangeDir, void *pClient, void *pCmd, const char *path, int errHandling);
EXPORT_DECL(int, FSChangeDirAsync, void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
EXPORT_DECL(int, FSMakeDir, void *pClient, void *pCmd, const char *path, int errHandling);
EXPORT_DECL(int, FSMakeDirAsync, void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
EXPORT_DECL(s32, FSOpenDir, void *pClient, void *pCmd, const char *path, s32 *dh, s32 errHandling);
EXPORT_DECL(s32, FSOpenDirAsync, void *pClient, void* pCmd, const char *path, s32 *handle, s32 error, void *asyncParams);
EXPORT_DECL(s32, FSReadDir, void *pClient, void *pCmd, s32 dh, FSDirEntry *dir_entry, s32 errHandling);
EXPORT_DECL(s32, FSRewindDir, void *pClient, void *pCmd, s32 dh, s32 errHandling);
EXPORT_DECL(s32, FSCloseDir, void *pClient, void *pCmd, s32 dh, s32 errHandling);
EXPORT_DECL(s32, FSChangeDir, void *pClient, void *pCmd, const char *path, s32 errHandling);
EXPORT_DECL(s32, FSChangeDirAsync, void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
EXPORT_DECL(s32, FSMakeDir, void *pClient, void *pCmd, const char *path, s32 errHandling);
EXPORT_DECL(s32, FSMakeDirAsync, void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
EXPORT_DECL(int, FSOpenFile, void *pClient, void *pCmd, const char *path, const char *mode, int *fd, int errHandling);
EXPORT_DECL(int, FSOpenFileAsync, void *pClient, void *pCmd, const char *path, const char *mode, int *handle, int error, const void *asyncParams);
EXPORT_DECL(int, FSReadFile, void *pClient, void *pCmd, void *buffer, int size, int count, int fd, int flag, int errHandling);
EXPORT_DECL(int, FSCloseFile, void *pClient, void *pCmd, int fd, int errHandling);
EXPORT_DECL(s32, FSOpenFile, void *pClient, void *pCmd, const char *path, const char *mode, s32 *fd, s32 errHandling);
EXPORT_DECL(s32, FSOpenFileAsync, void *pClient, void *pCmd, const char *path, const char *mode, s32 *handle, s32 error, const void *asyncParams);
EXPORT_DECL(s32, FSReadFile, void *pClient, void *pCmd, void *buffer, s32 size, s32 count, s32 fd, s32 flag, s32 errHandling);
EXPORT_DECL(s32, FSCloseFile, void *pClient, void *pCmd, s32 fd, s32 errHandling);
EXPORT_DECL(int, FSFlushFile, void *pClient, void *pCmd, int fd, int error);
EXPORT_DECL(int, FSTruncateFile, void *pClient, void *pCmd, int fd, int error);
EXPORT_DECL(int, FSGetStatFile, void *pClient, void *pCmd, int fd, void *buffer, int error);
EXPORT_DECL(int, FSSetPosFile, void *pClient, void *pCmd, int fd, int pos, int error);
EXPORT_DECL(int, FSWriteFile, void *pClient, void *pCmd, const void *source, int block_size, int block_count, int fd, int flag, int error);
EXPORT_DECL(s32, FSFlushFile, void *pClient, void *pCmd, s32 fd, s32 error);
EXPORT_DECL(s32, FSTruncateFile, void *pClient, void *pCmd, s32 fd, s32 error);
EXPORT_DECL(s32, FSGetStatFile, void *pClient, void *pCmd, s32 fd, void *buffer, s32 error);
EXPORT_DECL(s32, FSSetPosFile, void *pClient, void *pCmd, s32 fd, s32 pos, s32 error);
EXPORT_DECL(s32, FSWriteFile, void *pClient, void *pCmd, const void *source, s32 block_size, s32 block_count, s32 fd, s32 flag, s32 error);
EXPORT_DECL(int, FSBindMount, void *pClient, void *pCmd, char *source, char *target, int error);
EXPORT_DECL(int, FSBindUnmount, void *pClient, void *pCmd, char *target, int error);
EXPORT_DECL(s32, FSBindMount, void *pClient, void *pCmd, char *source, char *target, s32 error);
EXPORT_DECL(s32, FSBindUnmount, void *pClient, void *pCmd, char *target, s32 error);
EXPORT_DECL(int, FSMakeQuota, void *pClient, void *pCmd, const char *path,u32 mode, u64 size, int errHandling);
EXPORT_DECL(int, FSMakeQuotaAsync ,void *pClient, void *pCmd, const char *path,u32 mode, u64 size, int errHandling,const void *asyncParams);
EXPORT_DECL(s32, FSMakeQuota, void *pClient, void *pCmd, const char *path,u32 mode, u64 size, s32 errHandling);
EXPORT_DECL(s32, FSMakeQuotaAsync ,void *pClient, void *pCmd, const char *path,u32 mode, u64 size, s32 errHandling,const void *asyncParams);
void InitFSFunctionPointers(void)
{
unsigned int *funcPointer = 0;
u32 *funcPointer = 0;
OS_FIND_EXPORT(coreinit_handle, FSInit);
OS_FIND_EXPORT(coreinit_handle, FSShutdown);
OS_FIND_EXPORT(coreinit_handle, FSAddClient);
OS_FIND_EXPORT(coreinit_handle, FSAddClientEx);
OS_FIND_EXPORT(coreinit_handle, FSDelClient);
OS_FIND_EXPORT(coreinit_handle, FSInitCmdBlock);
OS_FIND_EXPORT(coreinit_handle, FSGetCurrentCmdBlock);
OS_FIND_EXPORT(coreinit_handle, FSGetMountSource);
OS_FIND_EXPORT(coreinit_handle, FSMount);

View File

@ -33,59 +33,61 @@ extern "C" {
void InitFSFunctionPointers(void);
extern int (* FSInit)(void);
extern int (* FSShutdown)(void);
extern int (* FSAddClientEx)(void *pClient, int unk_zero_param, int errHandling);
extern int (* FSDelClient)(void *pClient);
extern s32 (* FSInit)(void);
extern s32 (* FSShutdown)(void);
extern s32 (* FSAddClient)(void *pClient, s32 errHandling);
extern s32 (* FSAddClientEx)(void *pClient, s32 unk_zero_param, s32 errHandling);
extern s32 (* FSDelClient)(void *pClient);
extern void (* FSInitCmdBlock)(void *pCmd);
extern int (* FSGetMountSource)(void *pClient, void *pCmd, int type, void *source, int errHandling);
extern void *(* FSGetCurrentCmdBlock)(void *pClient);
extern s32 (* FSGetMountSource)(void *pClient, void *pCmd, s32 type, void *source, s32 errHandling);
extern int (* FSMount)(void *pClient, void *pCmd, void *source, char *target, uint32_t bytes, int errHandling);
extern int (* FSUnmount)(void *pClient, void *pCmd, const char *target, int errHandling);
extern int (* FSRename)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, int error);
extern int (* FSRenameAsync)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, int error, void *asyncParams);
extern int (* FSRemove)(void *pClient, void *pCmd, const char *path, int error);
extern int (* FSRemoveAsync)(void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
extern s32 (* FSMount)(void *pClient, void *pCmd, void *source, char *target, u32 bytes, s32 errHandling);
extern s32 (* FSUnmount)(void *pClient, void *pCmd, const char *target, s32 errHandling);
extern s32 (* FSRename)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, s32 error);
extern s32 (* FSRenameAsync)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, s32 error, void *asyncParams);
extern s32 (* FSRemove)(void *pClient, void *pCmd, const char *path, s32 error);
extern s32 (* FSRemoveAsync)(void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
extern int (* FSGetStat)(void *pClient, void *pCmd, const char *path, FSStat *stats, int errHandling);
extern int (* FSGetStatAsync)(void *pClient, void *pCmd, const char *path, void *stats, int error, void *asyncParams);
extern int (* FSRename)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, int error);
extern int (* FSRenameAsync)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, int error, void *asyncParams);
extern int (* FSRemove)(void *pClient, void *pCmd, const char *path, int error);
extern int (* FSRemoveAsync)(void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
extern int (* FSFlushQuota)(void *pClient, void *pCmd, const char* path, int error);
extern int (* FSFlushQuotaAsync)(void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
extern int (* FSGetFreeSpaceSize)(void *pClient, void *pCmd, const char *path, uint64_t *returnedFreeSize, int error);
extern int (* FSGetFreeSpaceSizeAsync)(void *pClient, void *pCmd, const char *path, uint64_t *returnedFreeSize, int error, void *asyncParams);
extern int (* FSRollbackQuota)(void *pClient, void *pCmd, const char *path, int error);
extern int (* FSRollbackQuotaAsync)(void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
extern s32 (* FSGetStat)(void *pClient, void *pCmd, const char *path, FSStat *stats, s32 errHandling);
extern s32 (* FSGetStatAsync)(void *pClient, void *pCmd, const char *path, void *stats, s32 error, void *asyncParams);
extern s32 (* FSRename)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, s32 error);
extern s32 (* FSRenameAsync)(void *pClient, void *pCmd, const char *oldPath, const char *newPath, s32 error, void *asyncParams);
extern s32 (* FSRemove)(void *pClient, void *pCmd, const char *path, s32 error);
extern s32 (* FSRemoveAsync)(void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
extern s32 (* FSFlushQuota)(void *pClient, void *pCmd, const char* path, s32 error);
extern s32 (* FSFlushQuotaAsync)(void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
extern s32 (* FSGetFreeSpaceSize)(void *pClient, void *pCmd, const char *path, uint64_t *returnedFreeSize, s32 error);
extern s32 (* FSGetFreeSpaceSizeAsync)(void *pClient, void *pCmd, const char *path, uint64_t *returnedFreeSize, s32 error, void *asyncParams);
extern s32 (* FSRollbackQuota)(void *pClient, void *pCmd, const char *path, s32 error);
extern s32 (* FSRollbackQuotaAsync)(void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
extern int (* FSOpenDir)(void *pClient, void *pCmd, const char *path, int *dh, int errHandling);
extern int (* FSOpenDirAsync)(void *pClient, void* pCmd, const char *path, int *handle, int error, void *asyncParams);
extern int (* FSReadDir)(void *pClient, void *pCmd, int dh, FSDirEntry *dir_entry, int errHandling);
extern int (* FSRewindDir)(void *pClient, void *pCmd, int dh, int errHandling);
extern int (* FSCloseDir)(void *pClient, void *pCmd, int dh, int errHandling);
extern int (* FSChangeDir)(void *pClient, void *pCmd, const char *path, int errHandling);
extern int (* FSChangeDirAsync)(void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
extern int (* FSMakeDir)(void *pClient, void *pCmd, const char *path, int errHandling);
extern int (* FSMakeDirAsync)(void *pClient, void *pCmd, const char *path, int error, void *asyncParams);
extern s32 (* FSOpenDir)(void *pClient, void *pCmd, const char *path, s32 *dh, s32 errHandling);
extern s32 (* FSOpenDirAsync)(void *pClient, void* pCmd, const char *path, s32 *handle, s32 error, void *asyncParams);
extern s32 (* FSReadDir)(void *pClient, void *pCmd, s32 dh, FSDirEntry *dir_entry, s32 errHandling);
extern s32 (* FSRewindDir)(void *pClient, void *pCmd, s32 dh, s32 errHandling);
extern s32 (* FSCloseDir)(void *pClient, void *pCmd, s32 dh, s32 errHandling);
extern s32 (* FSChangeDir)(void *pClient, void *pCmd, const char *path, s32 errHandling);
extern s32 (* FSChangeDirAsync)(void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
extern s32 (* FSMakeDir)(void *pClient, void *pCmd, const char *path, s32 errHandling);
extern s32 (* FSMakeDirAsync)(void *pClient, void *pCmd, const char *path, s32 error, void *asyncParams);
extern int (* FSOpenFile)(void *pClient, void *pCmd, const char *path, const char *mode, int *fd, int errHandling);
extern int (* FSOpenFileAsync)(void *pClient, void *pCmd, const char *path, const char *mode, int *handle, int error, const void *asyncParams);
extern int (* FSReadFile)(void *pClient, void *pCmd, void *buffer, int size, int count, int fd, int flag, int errHandling);
extern int (* FSCloseFile)(void *pClient, void *pCmd, int fd, int errHandling);
extern s32 (* FSOpenFile)(void *pClient, void *pCmd, const char *path, const char *mode, s32 *fd, s32 errHandling);
extern s32 (* FSOpenFileAsync)(void *pClient, void *pCmd, const char *path, const char *mode, s32 *handle, s32 error, const void *asyncParams);
extern s32 (* FSReadFile)(void *pClient, void *pCmd, void *buffer, s32 size, s32 count, s32 fd, s32 flag, s32 errHandling);
extern s32 (* FSCloseFile)(void *pClient, void *pCmd, s32 fd, s32 errHandling);
extern int (* FSFlushFile)(void *pClient, void *pCmd, int fd, int error);
extern int (* FSTruncateFile)(void *pClient, void *pCmd, int fd, int error);
extern int (* FSGetStatFile)(void *pClient, void *pCmd, int fd, void *buffer, int error);
extern int (* FSSetPosFile)(void *pClient, void *pCmd, int fd, int pos, int error);
extern int (* FSWriteFile)(void *pClient, void *pCmd, const void *source, int block_size, int block_count, int fd, int flag, int error);
extern s32 (* FSFlushFile)(void *pClient, void *pCmd, s32 fd, s32 error);
extern s32 (* FSTruncateFile)(void *pClient, void *pCmd, s32 fd, s32 error);
extern s32 (* FSGetStatFile)(void *pClient, void *pCmd, s32 fd, void *buffer, s32 error);
extern s32 (* FSSetPosFile)(void *pClient, void *pCmd, s32 fd, s32 pos, s32 error);
extern s32 (* FSWriteFile)(void *pClient, void *pCmd, const void *source, s32 block_size, s32 block_count, s32 fd, s32 flag, s32 error);
extern int (* FSBindMount)(void *pClient, void *pCmd, char *source, char *target, int error);
extern int (* FSBindUnmount)(void *pClient, void *pCmd, char *target, int error);
extern s32 (* FSBindMount)(void *pClient, void *pCmd, char *source, char *target, s32 error);
extern s32 (* FSBindUnmount)(void *pClient, void *pCmd, char *target, s32 error);
extern int (* FSMakeQuota)( void *pClient, void *pCmd, const char *path,u32 mode, u64 size, int errHandling);
extern int (* FSMakeQuotaAsync)(void *pClient, void *pCmd, const char *path,u32 mode, u64 size, int errHandling,const void *asyncParams);
extern s32 (* FSMakeQuota)( void *pClient, void *pCmd, const char *path,u32 mode, u64 size, s32 errHandling);
extern s32 (* FSMakeQuotaAsync)(void *pClient, void *pCmd, const char *path,u32 mode, u64 size, s32 errHandling,const void *asyncParams);
#ifdef __cplusplus

View File

@ -24,7 +24,7 @@
#include "os_functions.h"
#include "gx2_types.h"
unsigned int gx2_handle __attribute__((section(".data"))) = 0;
u32 gx2_handle __attribute__((section(".data"))) = 0;
EXPORT_DECL(void, GX2Init, u32 * init_attribs);
EXPORT_DECL(void, GX2Shutdown, void);
@ -93,7 +93,7 @@ EXPORT_DECL(s32, GX2GetSystemDRCScanMode, void);
EXPORT_DECL(void, GX2RSetAllocator, void * (* allocFunc)(u32, u32, u32), void (* freeFunc)(u32, void*));
EXPORT_DECL(void, GX2CopySurface, GX2Surface * srcSurface,u32 srcMip,u32 srcSlice,GX2Surface * dstSurface,u32 dstMip,u32 dstSlice );
EXPORT_DECL(void, GX2ClearBuffersEx, GX2ColorBuffer * colorBuffer,GX2DepthBuffer * depthBuffer,f32 r, f32 g, f32 b, f32 a,f32 depthValue,u8 stencilValue,int clearFlags);
EXPORT_DECL(void, GX2ClearBuffersEx, GX2ColorBuffer * colorBuffer,GX2DepthBuffer * depthBuffer,f32 r, f32 g, f32 b, f32 a,f32 depthValue,u8 stencilValue,s32 clearFlags);
void InitAcquireGX2(void)
{
@ -102,7 +102,7 @@ void InitAcquireGX2(void)
void InitGX2FunctionPointers(void)
{
unsigned int *funcPointer = 0;
u32 *funcPointer = 0;
InitAcquireGX2();
OS_FIND_EXPORT(gx2_handle, GX2Init);

View File

@ -28,9 +28,10 @@
extern "C" {
#endif
#include <gctypes.h>
#include "gx2_types.h"
extern unsigned int gx2_handle;
extern u32 gx2_handle;
void InitGX2FunctionPointers(void);
void InitAcquireGX2(void);
@ -101,7 +102,7 @@ extern s32 (* GX2GetSystemTVScanMode)(void);
extern s32 (* GX2GetSystemDRCScanMode)(void);
extern void (* GX2RSetAllocator)(void * (*allocFunc)(u32, u32, u32), void (*freeFunc)(u32, void*));
extern void (* GX2CopySurface)(GX2Surface * srcSurface,u32 srcMip,u32 srcSlice,GX2Surface * dstSurface,u32 dstMip,u32 dstSlice );
extern void (* GX2ClearBuffersEx)(GX2ColorBuffer * colorBuffer,GX2DepthBuffer * depthBuffer,f32 r, f32 g, f32 b, f32 a,f32 depthValue,u8 stencilValue,int clearFlags);
extern void (* GX2ClearBuffersEx)(GX2ColorBuffer * colorBuffer,GX2DepthBuffer * depthBuffer,f32 r, f32 g, f32 b, f32 a,f32 depthValue,u8 stencilValue,s32 clearFlags);
static inline void GX2InitDepthBuffer(GX2DepthBuffer *depthBuffer, s32 dimension, u32 width, u32 height, u32 depth, s32 format, s32 aa)
{

View File

@ -24,50 +24,55 @@
#include "common/common.h"
#include "os_functions.h"
unsigned int coreinit_handle __attribute__((section(".data"))) = 0;
u32 coreinit_handle __attribute__((section(".data"))) = 0;
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Lib handle functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_DECL(int, OSDynLoad_Acquire, const char* rpl, u32 *handle);
EXPORT_DECL(int, OSDynLoad_FindExport, u32 handle, int isdata, const char *symbol, void *address);
EXPORT_DECL(s32, OSDynLoad_Acquire, const char* rpl, u32 *handle);
EXPORT_DECL(s32, OSDynLoad_FindExport, u32 handle, s32 isdata, const char *symbol, void *address);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Security functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_DECL(int, OSGetSecurityLevel, void);
EXPORT_DECL(int, OSForceFullRelaunch, void);
EXPORT_DECL(s32, OSGetSecurityLevel, void);
EXPORT_DECL(s32, OSForceFullRelaunch, void);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Thread functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_DECL(int, OSCreateThread, void *thread, s32 (*callback)(s32, void*), s32 argc, void *args, u32 stack, u32 stack_size, s32 priority, u32 attr);
EXPORT_DECL(int, OSResumeThread, void *thread);
EXPORT_DECL(int, OSSuspendThread, void *thread);
EXPORT_DECL(int, OSIsThreadTerminated, void *thread);
EXPORT_DECL(int, OSIsThreadSuspended, void *thread);
EXPORT_DECL(int, OSSetThreadPriority, void * thread, int priority);
EXPORT_DECL(int, OSJoinThread, void * thread, int * ret_val);
EXPORT_DECL(s32, OSCreateThread, void *thread, s32 (*callback)(s32, void*), s32 argc, void *args, u32 stack, u32 stack_size, s32 priority, u32 attr);
EXPORT_DECL(s32, OSResumeThread, void *thread);
EXPORT_DECL(s32, OSSuspendThread, void *thread);
EXPORT_DECL(void, OSExitThread, u32 result);
EXPORT_DECL(s32, OSIsThreadTerminated, void *thread);
EXPORT_DECL(s32, OSIsThreadSuspended, void *thread);
EXPORT_DECL(s32, OSSetThreadPriority, void * thread, s32 priority);
EXPORT_DECL(s32, OSJoinThread, void * thread, s32 * ret_val);
EXPORT_DECL(void, OSDetachThread, void * thread);
EXPORT_DECL(void, OSSleepTicks, u64 ticks);
EXPORT_DECL(u64, OSGetTick, void);
EXPORT_DECL(u64, OSGetTime, void);
EXPORT_DECL(void, OSTicksToCalendarTime, u64 time, OSCalendarTime * calendarTime);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Mutex functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_DECL(void, OSInitMutex, void* mutex);
EXPORT_DECL(void, OSLockMutex, void* mutex);
EXPORT_DECL(void, OSUnlockMutex, void* mutex);
EXPORT_DECL(int, OSTryLockMutex, void* mutex);
EXPORT_DECL(s32, OSTryLockMutex, void* mutex);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Shared Data functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_DECL(bool, OSGetSharedData, u32 type, u32 unk_r4, u8 *addr, u32 *size);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! System functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_DECL(u64, OSGetTitleID, void);
EXPORT_DECL(void, OSGetArgcArgv, int* argc, char*** argv);
EXPORT_DECL(void, OSGetArgcArgv, s32* argc, char*** argv);
EXPORT_DECL(void, __Exit, void);
EXPORT_DECL(void, OSFatal, const char* msg);
EXPORT_DECL(void, OSSetExceptionCallback, u8 exceptionType, exception_callback newCallback);
@ -75,47 +80,51 @@ EXPORT_DECL(void, DCFlushRange, const void *addr, u32 length);
EXPORT_DECL(void, DCStoreRange, const void *addr, u32 length);
EXPORT_DECL(void, ICInvalidateRange, const void *addr, u32 length);
EXPORT_DECL(void*, OSEffectiveToPhysical, const void*);
EXPORT_DECL(int, __os_snprintf, char* s, int n, const char * format, ...);
EXPORT_DECL(int *, __gh_errno_ptr, void);
EXPORT_DECL(s32, __os_snprintf, char* s, s32 n, const char * format, ...);
EXPORT_DECL(s32 *, __gh_errno_ptr, void);
EXPORT_DECL(void, OSScreenInit, void);
EXPORT_DECL(unsigned int, OSScreenGetBufferSizeEx, unsigned int bufferNum);
EXPORT_DECL(int, OSScreenSetBufferEx, unsigned int bufferNum, void * addr);
EXPORT_DECL(int, OSScreenClearBufferEx, unsigned int bufferNum, unsigned int temp);
EXPORT_DECL(int, OSScreenFlipBuffersEx, unsigned int bufferNum);
EXPORT_DECL(int, OSScreenPutFontEx, unsigned int bufferNum, unsigned int posX, unsigned int posY, const char * buffer);
EXPORT_DECL(int, OSScreenEnableEx, unsigned int bufferNum, int enable);
EXPORT_DECL(u32, OSScreenGetBufferSizeEx, u32 bufferNum);
EXPORT_DECL(s32, OSScreenSetBufferEx, u32 bufferNum, void * addr);
EXPORT_DECL(s32, OSScreenClearBufferEx, u32 bufferNum, u32 temp);
EXPORT_DECL(s32, OSScreenFlipBuffersEx, u32 bufferNum);
EXPORT_DECL(s32, OSScreenPutFontEx, u32 bufferNum, u32 posX, u32 posY, const char * buffer);
EXPORT_DECL(s32, OSScreenEnableEx, u32 bufferNum, s32 enable);
EXPORT_DECL(u32, OSScreenPutPixelEx, u32 bufferNum, u32 posX, u32 posY, u32 color);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Memory functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_VAR(unsigned int *, pMEMAllocFromDefaultHeapEx);
EXPORT_VAR(unsigned int *, pMEMAllocFromDefaultHeap);
EXPORT_VAR(unsigned int *, pMEMFreeToDefaultHeap);
EXPORT_VAR(u32 *, pMEMAllocFromDefaultHeapEx);
EXPORT_VAR(u32 *, pMEMAllocFromDefaultHeap);
EXPORT_VAR(u32 *, pMEMFreeToDefaultHeap);
EXPORT_DECL(int, MEMGetBaseHeapHandle, int mem_arena);
EXPORT_DECL(unsigned int, MEMGetAllocatableSizeForFrmHeapEx, int heap, int align);
EXPORT_DECL(void *, MEMAllocFromFrmHeapEx, int heap, unsigned int size, int align);
EXPORT_DECL(void, MEMFreeToFrmHeap, int heap, int mode);
EXPORT_DECL(void *, MEMAllocFromExpHeapEx, int heap, unsigned int size, int align);
EXPORT_DECL(int , MEMCreateExpHeapEx, void* address, unsigned int size, unsigned short flags);
EXPORT_DECL(void *, MEMDestroyExpHeap, int heap);
EXPORT_DECL(void, MEMFreeToExpHeap, int heap, void* ptr);
EXPORT_DECL(s32, MEMGetBaseHeapHandle, s32 mem_arena);
EXPORT_DECL(u32, MEMGetAllocatableSizeForFrmHeapEx, s32 heap, s32 align);
EXPORT_DECL(void *, MEMAllocFromFrmHeapEx, s32 heap, u32 size, s32 align);
EXPORT_DECL(void, MEMFreeToFrmHeap, s32 heap, s32 mode);
EXPORT_DECL(void *, MEMAllocFromExpHeapEx, s32 heap, u32 size, s32 align);
EXPORT_DECL(s32 , MEMCreateExpHeapEx, void* address, u32 size, unsigned short flags);
EXPORT_DECL(void *, MEMDestroyExpHeap, s32 heap);
EXPORT_DECL(void, MEMFreeToExpHeap, s32 heap, void* ptr);
EXPORT_DECL(void *, OSAllocFromSystem, int size, int alignment);
EXPORT_DECL(void, OSFreeToSystem, void *addr);
EXPORT_DECL(int, OSIsAddressValid, void *ptr);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! MCP functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_DECL(int, MCP_Open, void);
EXPORT_DECL(int, MCP_Close, int handle);
EXPORT_DECL(int, MCP_TitleCount, int handle);
EXPORT_DECL(int, MCP_TitleList, int handle, int *res, void *data, int count);
EXPORT_DECL(int, MCP_GetOwnTitleInfo, int handle, void * data);
EXPORT_DECL(s32, MCP_Open, void);
EXPORT_DECL(s32, MCP_Close, s32 handle);
EXPORT_DECL(s32, MCP_TitleCount, s32 handle);
EXPORT_DECL(s32, MCP_TitleList, s32 handle, s32 *res, void *data, s32 count);
EXPORT_DECL(s32, MCP_GetOwnTitleInfo, s32 handle, void * data);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Loader functions (not real rpl)
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_DECL(int, LiWaitIopComplete, int unknown_syscall_arg_r3, int * remaining_bytes);
EXPORT_DECL(int, LiWaitIopCompleteWithInterrupts, int unknown_syscall_arg_r3, int * remaining_bytes);
EXPORT_DECL(s32, LiWaitIopComplete, s32 unknown_syscall_arg_r3, s32 * remaining_bytes);
EXPORT_DECL(s32, LiWaitIopCompleteWithInterrupts, s32 unknown_syscall_arg_r3, s32 * remaining_bytes);
EXPORT_DECL(void, addr_LiWaitOneChunk, void);
EXPORT_DECL(void, addr_sgIsLoadingBuffer, void);
EXPORT_DECL(void, addr_gDynloadInitialized, void);
@ -128,40 +137,77 @@ EXPORT_DECL(void, addr_PrepareTitle_hook, void);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Other function addresses
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_DECL(void, DCInvalidateRange, void *buffer, uint32_t length);
EXPORT_DECL(void, DCInvalidateRange, void *buffer, u32 length);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Energy Saver functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//Burn-in Reduction
EXPORT_DECL(int, IMEnableDim,void);
EXPORT_DECL(int, IMDisableDim,void);
EXPORT_DECL(int, IMIsDimEnabled,int * result);
EXPORT_DECL(s32, IMEnableDim,void);
EXPORT_DECL(s32, IMDisableDim,void);
EXPORT_DECL(s32, IMIsDimEnabled,s32 * result);
//Auto power down
EXPORT_DECL(int, IMEnableAPD,void);
EXPORT_DECL(int, IMDisableAPD,void);
EXPORT_DECL(int, IMIsAPDEnabled,int * result);
EXPORT_DECL(int, IMIsAPDEnabledBySysSettings,int * result);
EXPORT_DECL(s32, IMEnableAPD,void);
EXPORT_DECL(s32, IMDisableAPD,void);
EXPORT_DECL(s32, IMIsAPDEnabled,s32 * result);
EXPORT_DECL(s32, IMIsAPDEnabledBySysSettings,s32 * result);
EXPORT_DECL(s32, OSSendAppSwitchRequest,s32 param,void* unknown1,void* unknown2);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! IOS functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_DECL(s32, IOS_Ioctl,s32 fd, u32 request, void *input_buffer,u32 input_buffer_len, void *output_buffer, u32 output_buffer_len);
EXPORT_DECL(s32, IOS_IoctlAsync,s32 fd, u32 request, void *input_buffer,u32 input_buffer_len, void *output_buffer, u32 output_buffer_len, void *cb, void *cbarg);
EXPORT_DECL(s32, IOS_Open,char *path, u32 mode);
EXPORT_DECL(s32, IOS_Close,s32 fd);
void _os_find_export(u32 handle, const char *funcName, void *funcPointer)
{
OSDynLoad_FindExport(handle, 0, funcName, funcPointer);
if(!*(u32 *)funcPointer) {
/*
* This is effectively OSFatal("Function %s is NULL", funcName),
* but we can't rely on any library functions like snprintf or
* strcpy at this point.
*
* Buffer bounds are not checked. Beware!
*/
char buf[256], *bufp = buf;
const char a[] = "Function ", b[] = " is NULL", *p;
unsigned int i;
for (i = 0; i < sizeof(a) - 1; i++)
*bufp++ = a[i];
for (p = funcName; *p; p++)
*bufp++ = *p;
for (i = 0; i < sizeof(b) - 1; i++)
*bufp++ = b[i];
*bufp++ = '\0';
OSFatal(buf);
}
}
EXPORT_DECL(int, IOS_Ioctl,int fd, unsigned int request, void *input_buffer,unsigned int input_buffer_len, void *output_buffer, unsigned int output_buffer_len);
EXPORT_DECL(int, IOS_IoctlAsync,int fd, unsigned int request, void *input_buffer,unsigned int input_buffer_len, void *output_buffer, unsigned int output_buffer_len, void *cb, void *cbarg);
EXPORT_DECL(int, IOS_Open,char *path, unsigned int mode);
EXPORT_DECL(int, IOS_Close,int fd);
void InitAcquireOS(void)
{
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Lib handle functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
EXPORT_FUNC_WRITE(OSDynLoad_Acquire, (int (*)(const char*, unsigned *))OS_SPECIFICS->addr_OSDynLoad_Acquire);
EXPORT_FUNC_WRITE(OSDynLoad_FindExport, (int (*)(u32, int, const char *, void *))OS_SPECIFICS->addr_OSDynLoad_FindExport);
EXPORT_FUNC_WRITE(OSDynLoad_Acquire, (s32 (*)(const char*, unsigned *))OS_SPECIFICS->addr_OSDynLoad_Acquire);
EXPORT_FUNC_WRITE(OSDynLoad_FindExport, (s32 (*)(u32, s32, const char *, void *))OS_SPECIFICS->addr_OSDynLoad_FindExport);
OSDynLoad_Acquire("coreinit.rpl", &coreinit_handle);
}
void InitOSFunctionPointers(void)
{
unsigned int *funcPointer = 0;
u32 *funcPointer = 0;
InitAcquireOS();
@ -171,6 +217,10 @@ void InitOSFunctionPointers(void)
OS_FIND_EXPORT(coreinit_handle, OSGetSecurityLevel);
OS_FIND_EXPORT(coreinit_handle, OSForceFullRelaunch);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Shared Data functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
OS_FIND_EXPORT(coreinit_handle, OSGetSharedData);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! System functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
OS_FIND_EXPORT(coreinit_handle, OSFatal);
@ -193,12 +243,14 @@ void InitOSFunctionPointers(void)
OS_FIND_EXPORT(coreinit_handle, OSScreenFlipBuffersEx);
OS_FIND_EXPORT(coreinit_handle, OSScreenPutFontEx);
OS_FIND_EXPORT(coreinit_handle, OSScreenEnableEx);
OS_FIND_EXPORT(coreinit_handle, OSScreenPutPixelEx);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Thread functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
OS_FIND_EXPORT(coreinit_handle, OSCreateThread);
OS_FIND_EXPORT(coreinit_handle, OSResumeThread);
OS_FIND_EXPORT(coreinit_handle, OSSuspendThread);
OS_FIND_EXPORT(coreinit_handle, OSExitThread);
OS_FIND_EXPORT(coreinit_handle, OSIsThreadTerminated);
OS_FIND_EXPORT(coreinit_handle, OSIsThreadSuspended);
OS_FIND_EXPORT(coreinit_handle, OSJoinThread);
@ -240,6 +292,9 @@ void InitOSFunctionPointers(void)
OS_FIND_EXPORT(coreinit_handle, MEMCreateExpHeapEx);
OS_FIND_EXPORT(coreinit_handle, MEMDestroyExpHeap);
OS_FIND_EXPORT(coreinit_handle, MEMFreeToExpHeap);
OS_FIND_EXPORT(coreinit_handle, OSAllocFromSystem);
OS_FIND_EXPORT(coreinit_handle, OSFreeToSystem);
OS_FIND_EXPORT(coreinit_handle, OSIsAddressValid);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Other function addresses
@ -259,6 +314,11 @@ void InitOSFunctionPointers(void)
OS_FIND_EXPORT(coreinit_handle, IMIsAPDEnabled);
OS_FIND_EXPORT(coreinit_handle, IMIsAPDEnabledBySysSettings);
OS_FIND_EXPORT(coreinit_handle, OSSendAppSwitchRequest);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! IOS functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
OS_FIND_EXPORT(coreinit_handle, IOS_Ioctl);
OS_FIND_EXPORT(coreinit_handle, IOS_IoctlAsync);
OS_FIND_EXPORT(coreinit_handle, IOS_Open);
@ -267,75 +327,75 @@ void InitOSFunctionPointers(void)
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Special non library functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if(OS_FIRMWARE == 532 || OS_FIRMWARE == 540)
if(OS_FIRMWARE == 550)
{
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x0100FFA4); // loader.elf
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0100FE90); // loader.elf
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x010007EC); // loader.elf
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF18558); // kernel.elf
EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x01010180);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0101006C);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x0100080C);
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (s32 (*)(s32, s32 *))0xFFF184E4);
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19D00); // loader.elf
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))0xEFE13C3C); // loader.elf
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19E80);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE13DBC);
}
else if(OS_FIRMWARE == 532 || OS_FIRMWARE == 540)
{
EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100FFA4); // loader.elf
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100FE90); // loader.elf
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010007EC); // loader.elf
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (s32 (*)(s32, s32 *))0xFFF18558); // kernel.elf
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19D00); // loader.elf
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE13C3C); // loader.elf
}
else if(OS_FIRMWARE == 500 || OS_FIRMWARE == 510)
{
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x0100FBC4);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0100FAB0);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x010007EC);
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF18534);
EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100FBC4);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100FAB0);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010007EC);
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (s32 (*)(s32, s32 *))0xFFF18534);
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19D00);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))0xEFE13C3C);
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19D00);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE13C3C);
}
else if(OS_FIRMWARE == 410)
{
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x0100F78C);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0100F678);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x010007F8);
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF166DC);
EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100F78C);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100F678);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010007F8);
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (s32 (*)(s32, s32 *))0xFFF166DC);
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19CC0);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))0xEFE13BFC);
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19CC0);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE13BFC);
}
else if(OS_FIRMWARE == 400) //same for 402 and 403
{
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x0100F78C);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0100F678);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x010007F8);
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF15E70);
EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100F78C);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100F678);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010007F8);
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (s32 (*)(s32, s32 *))0xFFF15E70);
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19CC0);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))0xEFE13BFC);
}
else if(OS_FIRMWARE == 550)
{
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x01010180);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0101006C);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x0100080C);
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF184E4);
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19E80);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))0xEFE13DBC);
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19CC0);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE13BFC);
}
else if(OS_FIRMWARE == 310)
{
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x0100C4E4);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0100C3D4);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x010004D8);
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF15A0C);
EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100C4E4);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100C3D4);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010004D8);
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (s32 (*)(s32, s32 *))0xFFF15A0C);
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19340);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))0xEFE1329C);
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19340);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE1329C);
}
else if(OS_FIRMWARE == 300)
{
EXPORT_FUNC_WRITE(LiWaitIopComplete, (int (*)(int, int *))0x0100C4E4);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (int (*)(int, int *))0x0100C3D4);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (int (*)(int, int *))0x010004D8);
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (int (*)(int, int *))0xFFF15974);
EXPORT_FUNC_WRITE(LiWaitIopComplete, (s32 (*)(s32, s32 *))0x0100C4E4);
EXPORT_FUNC_WRITE(LiWaitIopCompleteWithInterrupts, (s32 (*)(s32, s32 *))0x0100C3D4);
EXPORT_FUNC_WRITE(addr_LiWaitOneChunk, (s32 (*)(s32, s32 *))0x010004D8);
EXPORT_FUNC_WRITE(addr_PrepareTitle_hook, (s32 (*)(s32, s32 *))0xFFF15974);
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (int (*)(int, int *))0xEFE19340);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (int (*)(int, int *))0xEFE1329C);
EXPORT_FUNC_WRITE(addr_sgIsLoadingBuffer, (s32 (*)(s32, s32 *))0xEFE19340);
EXPORT_FUNC_WRITE(addr_gDynloadInitialized, (s32 (*)(s32, s32 *))0xEFE1329C);
}
else
{

View File

@ -37,8 +37,9 @@ extern "C" {
#define MILLISECS_TO_TICKS(msec) (SECS_TO_TICKS(msec) / 1000)
#define MICROSECS_TO_TICKS(usec) (SECS_TO_TICKS(usec) / 1000000)
#define usleep(usecs) OSSleepTicks(MICROSECS_TO_TICKS(usecs))
#define sleep(secs) OSSleepTicks(SECS_TO_TICKS(secs))
//To avoid conflicts with the unistd.h
#define os_usleep(usecs) OSSleepTicks(MICROSECS_TO_TICKS(usecs))
#define os_sleep(secs) OSSleepTicks(SECS_TO_TICKS(secs))
#define FLUSH_DATA_BLOCK(addr) asm volatile("dcbf 0, %0; sync" : : "r"(((addr) & ~31)))
#define INVAL_DATA_BLOCK(addr) asm volatile("dcbi 0, %0; sync" : : "r"(((addr) & ~31)))
@ -49,48 +50,44 @@ extern "C" {
#define EXPORT_FUNC_WRITE(func, val) *(u32*)(((u32)&func) + 0) = (u32)val
#define OS_FIND_EXPORT(handle, func) funcPointer = 0; \
OSDynLoad_FindExport(handle, 0, # func, &funcPointer); \
if(!funcPointer) \
OSFatal("Function " # func " is NULL"); \
#define OS_FIND_EXPORT(handle, func) _os_find_export(handle, # func, &funcPointer); \
EXPORT_FUNC_WRITE(func, funcPointer);
#define OS_FIND_EXPORT_EX(handle, func, func_p) \
funcPointer = 0; \
OSDynLoad_FindExport(handle, 0, # func, &funcPointer); \
if(!funcPointer) \
OSFatal("Function " # func " is NULL"); \
_os_find_export(handle, # func, &funcPointer); \
EXPORT_FUNC_WRITE(func_p, funcPointer);
#define OS_MUTEX_SIZE 44
/* Handle for coreinit */
extern unsigned int coreinit_handle;
void InitOSFunctionPointers(void);
void InitAcquireOS(void);
extern u32 coreinit_handle;
extern void _os_find_export(u32 handle, const char *funcName, void *funcPointer);
extern void InitAcquireOS(void);
extern void InitOSFunctionPointers(void);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Lib handle functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern int (* OSDynLoad_Acquire)(const char* rpl, u32 *handle);
extern int (* OSDynLoad_FindExport)(u32 handle, int isdata, const char *symbol, void *address);
extern s32 (* OSDynLoad_Acquire)(const char* rpl, u32 *handle);
extern s32 (* OSDynLoad_FindExport)(u32 handle, s32 isdata, const char *symbol, void *address);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Security functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern int (* OSGetSecurityLevel)(void);
extern int (* OSForceFullRelaunch)(void);
extern s32 (* OSGetSecurityLevel)(void);
extern s32 (* OSForceFullRelaunch)(void);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Thread functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern int (* OSCreateThread)(void *thread, s32 (*callback)(s32, void*), s32 argc, void *args, u32 stack, u32 stack_size, s32 priority, u32 attr);
extern int (* OSResumeThread)(void *thread);
extern int (* OSSuspendThread)(void *thread);
extern int (* OSIsThreadTerminated)(void *thread);
extern int (* OSIsThreadSuspended)(void *thread);
extern int (* OSJoinThread)(void * thread, int * ret_val);
extern int (* OSSetThreadPriority)(void * thread, int priority);
extern s32 (* OSCreateThread)(void *thread, s32 (*callback)(s32, void*), s32 argc, void *args, u32 stack, u32 stack_size, s32 priority, u32 attr);
extern s32 (* OSResumeThread)(void *thread);
extern s32 (* OSSuspendThread)(void *thread);
extern void (*OSExitThread)(u32 result);
extern s32 (* OSIsThreadTerminated)(void *thread);
extern s32 (* OSIsThreadSuspended)(void *thread);
extern s32 (* OSJoinThread)(void * thread, s32 * ret_val);
extern s32 (* OSSetThreadPriority)(void * thread, s32 priority);
extern void (* OSDetachThread)(void * thread);
extern void (* OSSleepTicks)(u64 ticks);
extern u64 (* OSGetTick)(void);
@ -103,47 +100,72 @@ extern void (*OSTicksToCalendarTime)(u64 time, OSCalendarTime *calendarTime);
extern void (* OSInitMutex)(void* mutex);
extern void (* OSLockMutex)(void* mutex);
extern void (* OSUnlockMutex)(void* mutex);
extern int (* OSTryLockMutex)(void* mutex);
extern s32 (* OSTryLockMutex)(void* mutex);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Shared Data functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern bool (* OSGetSharedData)(u32 type, u32 unk_r4, u8 *addr, u32 *size);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! System functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern u64 (* OSGetTitleID)(void);
extern void (* OSGetArgcArgv)(int* argc, char*** argv);
extern void (* OSGetArgcArgv)(s32* argc, char*** argv);
extern void (* __Exit)(void);
extern void (* OSFatal)(const char* msg);
extern void (* DCFlushRange)(const void *addr, u32 length);
extern void (* DCStoreRange)(const void *addr, u32 length);
extern void (* ICInvalidateRange)(const void *addr, u32 length);
extern void* (* OSEffectiveToPhysical)(const void*);
extern int (* __os_snprintf)(char* s, int n, const char * format, ...);
extern int * (* __gh_errno_ptr)(void);
extern s32 (* __os_snprintf)(char* s, s32 n, const char * format, ...);
extern s32 * (* __gh_errno_ptr)(void);
extern void (*OSScreenInit)(void);
extern unsigned int (*OSScreenGetBufferSizeEx)(unsigned int bufferNum);
extern int (*OSScreenSetBufferEx)(unsigned int bufferNum, void * addr);
extern int (*OSScreenClearBufferEx)(unsigned int bufferNum, unsigned int temp);
extern int (*OSScreenFlipBuffersEx)(unsigned int bufferNum);
extern int (*OSScreenPutFontEx)(unsigned int bufferNum, unsigned int posX, unsigned int posY, const char * buffer);
extern int (*OSScreenEnableEx)(unsigned int bufferNum, int enable);
extern u32 (*OSScreenGetBufferSizeEx)(u32 bufferNum);
extern s32 (*OSScreenSetBufferEx)(u32 bufferNum, void * addr);
extern s32 (*OSScreenClearBufferEx)(u32 bufferNum, u32 temp);
extern s32 (*OSScreenFlipBuffersEx)(u32 bufferNum);
extern s32 (*OSScreenPutFontEx)(u32 bufferNum, u32 posX, u32 posY, const char * buffer);
extern s32 (*OSScreenEnableEx)(u32 bufferNum, s32 enable);
extern u32 (*OSScreenPutPixelEx)(u32 bufferNum, u32 posX, u32 posY, u32 color);
typedef unsigned char (*exception_callback)(void * interruptedContext);
extern void (* OSSetExceptionCallback)(u8 exceptionType, exception_callback newCallback);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Memory functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern u32 *pMEMAllocFromDefaultHeapEx;
extern u32 *pMEMAllocFromDefaultHeap;
extern u32 *pMEMFreeToDefaultHeap;
extern s32 (* MEMGetBaseHeapHandle)(s32 mem_arena);
extern u32 (* MEMGetAllocatableSizeForFrmHeapEx)(s32 heap, s32 align);
extern void* (* MEMAllocFromFrmHeapEx)(s32 heap, u32 size, s32 align);
extern void (* MEMFreeToFrmHeap)(s32 heap, s32 mode);
extern void *(* MEMAllocFromExpHeapEx)(s32 heap, u32 size, s32 align);
extern s32 (* MEMCreateExpHeapEx)(void* address, u32 size, unsigned short flags);
extern void *(* MEMDestroyExpHeap)(s32 heap);
extern void (* MEMFreeToExpHeap)(s32 heap, void* ptr);
extern void* (* OSAllocFromSystem)(int size, int alignment);
extern void (* OSFreeToSystem)(void *addr);
extern int (* OSIsAddressValid)(void *ptr);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! MCP functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern int (* MCP_Open)(void);
extern int (* MCP_Close)(int handle);
extern int (* MCP_TitleCount)(int handle);
extern int (* MCP_TitleList)(int handle, int *res, void *data, int count);
extern int (* MCP_GetOwnTitleInfo)(int handle, void * data);
extern s32 (* MCP_Open)(void);
extern s32 (* MCP_Close)(s32 handle);
extern s32 (* MCP_TitleCount)(s32 handle);
extern s32 (* MCP_TitleList)(s32 handle, s32 *res, void *data, s32 count);
extern s32 (* MCP_GetOwnTitleInfo)(s32 handle, void * data);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! LOADER functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern int (* LiWaitIopComplete)(int unknown_syscall_arg_r3, int * remaining_bytes);
extern int (* LiWaitIopCompleteWithInterrupts)(int unknown_syscall_arg_r3, int * remaining_bytes);
extern s32 (* LiWaitIopComplete)(s32 unknown_syscall_arg_r3, s32 * remaining_bytes);
extern s32 (* LiWaitIopCompleteWithInterrupts)(s32 unknown_syscall_arg_r3, s32 * remaining_bytes);
extern void (* addr_LiWaitOneChunk)(void);
extern void (* addr_sgIsLoadingBuffer)(void);
extern void (* addr_gDynloadInitialized)(void);
@ -156,25 +178,32 @@ extern void (* addr_PrepareTitle_hook)(void);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Other function addresses
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern void (*DCInvalidateRange)(void *buffer, uint32_t length);
extern void (*DCInvalidateRange)(void *buffer, u32 length);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! Energy Saver functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
////Burn-in Reduction
extern int (*IMEnableDim)(void);
extern int (*IMDisableDim)(void);
extern int (*IMIsDimEnabled)(int * result);
extern s32 (*IMEnableDim)(void);
extern s32 (*IMDisableDim)(void);
extern s32 (*IMIsDimEnabled)(s32 * result);
//Auto power down
extern int (*IMEnableAPD)(void);
extern int (*IMDisableAPD)(void);
extern int (*IMIsAPDEnabled)(int * result);
extern int (*IMIsAPDEnabledBySysSettings)(int * result);
extern s32 (*IMEnableAPD)(void);
extern s32 (*IMDisableAPD)(void);
extern s32 (*IMIsAPDEnabled)(s32 * result);
extern s32 (*IMIsAPDEnabledBySysSettings)(s32 * result);
extern s32 (*OSSendAppSwitchRequest)(s32 param,void* unknown1,void* unknown2);
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
//! IOS functions
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern s32 (*IOS_Ioctl)(s32 fd, u32 request, void *input_buffer,u32 input_buffer_len, void *output_buffer, u32 output_buffer_len);
extern s32 (*IOS_IoctlAsync)(s32 fd, u32 request, void *input_buffer,u32 input_buffer_len, void *output_buffer, u32 output_buffer_len, void *cb, void *cbarg);
extern s32 (*IOS_Open)(char *path, u32 mode);
extern s32 (*IOS_Close)(s32 fd);
extern int (*IOS_Ioctl)(int fd, unsigned int request, void *input_buffer,unsigned int input_buffer_len, void *output_buffer, unsigned int output_buffer_len);
extern int (*IOS_IoctlAsync)(int fd, unsigned int request, void *input_buffer,unsigned int input_buffer_len, void *output_buffer, unsigned int output_buffer_len, void *cb, void *cbarg);
extern int (*IOS_Open)(char *path, unsigned int mode);
extern int (*IOS_Close)(int fd);
#ifdef __cplusplus
}
#endif

View File

@ -24,7 +24,7 @@
#include "os_functions.h"
#include "padscore_functions.h"
unsigned int padscore_handle __attribute__((section(".data"))) = 0;
u32 padscore_handle __attribute__((section(".data"))) = 0;
EXPORT_DECL(void, KPADInit, void);
EXPORT_DECL(void, WPADInit, void);
@ -43,7 +43,7 @@ void InitAcquirePadScore(void)
void InitPadScoreFunctionPointers(void)
{
unsigned int *funcPointer = 0;
u32 *funcPointer = 0;
InitAcquirePadScore();
OS_FIND_EXPORT(padscore_handle, WPADInit);

View File

@ -30,10 +30,20 @@ extern "C" {
#include "dynamic_libs/vpad_functions.h"
extern unsigned int padscore_handle;
extern u32 padscore_handle;
#include <gctypes.h>
#define WPAD_EXT_CORE 0
#define WPAD_EXT_NUNCHUK 1
#define WPAD_EXT_CLASSIC 2
#define WPAD_EXT_MPLUS 5
#define WPAD_EXT_MPLUS_NUNCHUK 6
#define WPAD_EXT_MPLUS_CLASSIC 7
#define WPAD_EXT_PRO_CONTROLLER 31
#define WPAD_FMT_PRO_CONTROLLER 22
#define WPAD_BUTTON_LEFT 0x0001
#define WPAD_BUTTON_RIGHT 0x0002
#define WPAD_BUTTON_DOWN 0x0004
@ -140,17 +150,36 @@ typedef struct _KPADData
f32 lstick_y;
f32 rstick_x;
f32 rstick_y;
int charging;
int wired;
s32 charging;
s32 wired;
} pro;
u32 unused_6[20];
};
u32 unused_7[16];
} KPADData;
typedef struct WPADReadData_ {
u8 unknown[40];
u8 dev;
u8 err;
u8 unknown1[2];
u32 buttons;
s16 l_stick_x;
s16 l_stick_y;
s16 r_stick_x;
s16 r_stick_y;
u8 unknown2[8];
u8 fmt;
}WPADReadData;
typedef WPADReadData KPADUnifiedWpadData;
void InitPadScoreFunctionPointers(void);
void InitAcquirePadScore(void);
typedef void (* wpad_sampling_callback_t)(s32 chan);
typedef void (* wpad_extension_callback_t)(s32 chan, s32 status);
typedef void (* wpad_connect_callback_t)(s32 chan, s32 status);
extern void (* KPADInit)(void);

View File

@ -26,26 +26,26 @@
u32 hostIpAddress = 0;
unsigned int nsysnet_handle __attribute__((section(".data"))) = 0;
u32 nsysnet_handle __attribute__((section(".data"))) = 0;
EXPORT_DECL(void, socket_lib_init, void);
EXPORT_DECL(int, socket, int domain, int type, int protocol);
EXPORT_DECL(int, socketclose, int s);
EXPORT_DECL(int, connect, int s, void *addr, int addrlen);
EXPORT_DECL(int, bind, s32 s,struct sockaddr *name,s32 namelen);
EXPORT_DECL(int, listen, s32 s,u32 backlog);
EXPORT_DECL(int, accept, s32 s,struct sockaddr *addr,s32 *addrlen);
EXPORT_DECL(int, send, int s, const void *buffer, int size, int flags);
EXPORT_DECL(int, recv, int s, void *buffer, int size, int flags);
EXPORT_DECL(int, recvfrom,int sockfd, void *buf, int len, int flags,struct sockaddr *src_addr, int *addrlen);
EXPORT_DECL(int, sendto, int s, const void *buffer, int size, int flags, const struct sockaddr *dest, int dest_len);
EXPORT_DECL(int, setsockopt, int s, int level, int optname, void *optval, int optlen);
EXPORT_DECL(s32, socket, s32 domain, s32 type, s32 protocol);
EXPORT_DECL(s32, socketclose, s32 s);
EXPORT_DECL(s32, connect, s32 s, void *addr, s32 addrlen);
EXPORT_DECL(s32, bind, s32 s,struct sockaddr *name,s32 namelen);
EXPORT_DECL(s32, listen, s32 s,u32 backlog);
EXPORT_DECL(s32, accept, s32 s,struct sockaddr *addr,s32 *addrlen);
EXPORT_DECL(s32, send, s32 s, const void *buffer, s32 size, s32 flags);
EXPORT_DECL(s32, recv, s32 s, void *buffer, s32 size, s32 flags);
EXPORT_DECL(s32, recvfrom,s32 sockfd, void *buf, s32 len, s32 flags,struct sockaddr *src_addr, s32 *addrlen);
EXPORT_DECL(s32, sendto, s32 s, const void *buffer, s32 size, s32 flags, const struct sockaddr *dest, s32 dest_len);
EXPORT_DECL(s32, setsockopt, s32 s, s32 level, s32 optname, void *optval, s32 optlen);
EXPORT_DECL(char *, inet_ntoa, struct in_addr in);
EXPORT_DECL(int, inet_aton, const char *cp, struct in_addr *inp);
EXPORT_DECL(s32, inet_aton, const char *cp, struct in_addr *inp);
EXPORT_DECL(int, NSSLWrite, int connection, const void* buf, int len,int * written);
EXPORT_DECL(int, NSSLRead, int connection, const void* buf, int len,int * read);
EXPORT_DECL(int, NSSLCreateConnection, int context, const char* host, int hotlen,int options,int sock,int block);
EXPORT_DECL(s32, NSSLWrite, s32 connection, const void* buf, s32 len,s32 * written);
EXPORT_DECL(s32, NSSLRead, s32 connection, const void* buf, s32 len,s32 * read);
EXPORT_DECL(s32, NSSLCreateConnection, s32 context, const char* host, s32 hotlen,s32 options,s32 sock,s32 block);
void InitAcquireSocket(void)
{
@ -54,10 +54,21 @@ void InitAcquireSocket(void)
void InitSocketFunctionPointers(void)
{
unsigned int *funcPointer = 0;
u32 *funcPointer = 0;
InitAcquireSocket();
u32 nn_ac_handle;
s32(*ACInitialize)();
s32(*ACGetStartupId) (u32 *id);
s32(*ACConnectWithConfigId) (u32 id);
s32(*ACGetAssignedAddress) (u32 * ip);
OSDynLoad_Acquire("nn_ac.rpl", &nn_ac_handle);
OSDynLoad_FindExport(nn_ac_handle, 0, "ACInitialize", &ACInitialize);
OSDynLoad_FindExport(nn_ac_handle, 0, "ACGetStartupId", &ACGetStartupId);
OSDynLoad_FindExport(nn_ac_handle, 0, "ACConnectWithConfigId",&ACConnectWithConfigId);
OSDynLoad_FindExport(nn_ac_handle, 0, "ACGetAssignedAddress",&ACGetAssignedAddress);
OS_FIND_EXPORT(nsysnet_handle, socket_lib_init);
OS_FIND_EXPORT(nsysnet_handle, socket);
OS_FIND_EXPORT(nsysnet_handle, socketclose);
@ -77,5 +88,11 @@ void InitSocketFunctionPointers(void)
OS_FIND_EXPORT(nsysnet_handle, NSSLRead);
OS_FIND_EXPORT(nsysnet_handle, NSSLCreateConnection);
u32 nn_startupid;
ACInitialize();
ACGetStartupId(&nn_startupid);
ACConnectWithConfigId(nn_startupid);
ACGetAssignedAddress(&hostIpAddress);
socket_lib_init();
}

View File

@ -28,7 +28,7 @@
extern "C" {
#endif
extern unsigned int nsysnet_handle;
extern u32 nsysnet_handle;
#include <gctypes.h>
@ -61,7 +61,7 @@ extern unsigned int nsysnet_handle;
struct in_addr {
unsigned int s_addr;
u32 s_addr;
};
struct sockaddr_in {
short sin_family;
@ -81,25 +81,25 @@ void InitSocketFunctionPointers(void);
void InitAcquireSocket(void);
extern void (*socket_lib_init)(void);
extern int (*socket)(int domain, int type, int protocol);
extern int (*socketclose)(int s);
extern int (*connect)(int s, void *addr, int addrlen);
extern int (*bind)(s32 s,struct sockaddr *name,s32 namelen);
extern int (*listen)(s32 s,u32 backlog);
extern int (*accept)(s32 s,struct sockaddr *addr,s32 *addrlen);
extern int (*send)(int s, const void *buffer, int size, int flags);
extern int (*recv)(int s, void *buffer, int size, int flags);
extern int (*recvfrom)(int sockfd, void *buf, int len, int flags,struct sockaddr *src_addr, int *addrlen);
extern s32 (*socket)(s32 domain, s32 type, s32 protocol);
extern s32 (*socketclose)(s32 s);
extern s32 (*connect)(s32 s, void *addr, s32 addrlen);
extern s32 (*bind)(s32 s,struct sockaddr *name,s32 namelen);
extern s32 (*listen)(s32 s,u32 backlog);
extern s32 (*accept)(s32 s,struct sockaddr *addr,s32 *addrlen);
extern s32 (*send)(s32 s, const void *buffer, s32 size, s32 flags);
extern s32 (*recv)(s32 s, void *buffer, s32 size, s32 flags);
extern s32 (*recvfrom)(s32 sockfd, void *buf, s32 len, s32 flags,struct sockaddr *src_addr, s32 *addrlen);
extern int (*sendto)(int s, const void *buffer, int size, int flags, const struct sockaddr *dest, int dest_len);
extern int (*setsockopt)(int s, int level, int optname, void *optval, int optlen);
extern s32 (*sendto)(s32 s, const void *buffer, s32 size, s32 flags, const struct sockaddr *dest, s32 dest_len);
extern s32 (*setsockopt)(s32 s, s32 level, s32 optname, void *optval, s32 optlen);
extern int (* NSSLWrite)(int connection, const void* buf, int len,int * written);
extern int (* NSSLRead)(int connection, const void* buf, int len,int * read);
extern int (* NSSLCreateConnection)(int context, const char* host, int hotlen,int options,int sock,int block);
extern s32 (* NSSLWrite)(s32 connection, const void* buf, s32 len,s32 * written);
extern s32 (* NSSLRead)(s32 connection, const void* buf, s32 len,s32 * read);
extern s32 (* NSSLCreateConnection)(s32 context, const char* host, s32 hotlen,s32 options,s32 sock,s32 block);
extern char * (*inet_ntoa)(struct in_addr in);
extern int (*inet_aton)(const char *cp, struct in_addr *inp);
extern s32 (*inet_aton)(const char *cp, struct in_addr *inp);
#ifdef __cplusplus
}

View File

@ -23,14 +23,14 @@
***************************************************************************/
#include "os_functions.h"
unsigned int sysapp_handle __attribute__((section(".data"))) = 0;
u32 sysapp_handle __attribute__((section(".data"))) = 0;
EXPORT_DECL(int, _SYSLaunchTitleByPathFromLauncher, const char* path, int len, int zero);
EXPORT_DECL(int, SYSRelaunchTitle, int argc, char** argv);
EXPORT_DECL(int, SYSLaunchMenu, void);
EXPORT_DECL(int, SYSCheckTitleExists, u64 titleId);
EXPORT_DECL(int, SYSLaunchTitle, u64 titleId);
EXPORT_DECL(int, SYSLaunchSettings, int unk);
EXPORT_DECL(s32, _SYSLaunchTitleByPathFromLauncher, const char* path, s32 len, s32 zero);
EXPORT_DECL(s32, SYSRelaunchTitle, s32 argc, char** argv);
EXPORT_DECL(s32, SYSLaunchMenu, void);
EXPORT_DECL(s32, SYSCheckTitleExists, u64 titleId);
EXPORT_DECL(s32, SYSLaunchTitle, u64 titleId);
EXPORT_DECL(s32, SYSLaunchSettings, s32 unk);
void InitAcquireSys(void)
{
@ -39,7 +39,7 @@ void InitAcquireSys(void)
void InitSysFunctionPointers(void)
{
unsigned int *funcPointer = 0;
u32 *funcPointer = 0;
InitAcquireSys();
OS_FIND_EXPORT(sysapp_handle, _SYSLaunchTitleByPathFromLauncher);

View File

@ -28,17 +28,19 @@
extern "C" {
#endif
extern unsigned int sysapp_handle;
#include <gctypes.h>
extern u32 sysapp_handle;
void InitSysFunctionPointers(void);
void InitAcquireSys(void);
extern int(*_SYSLaunchTitleByPathFromLauncher)(const char* path, int len, int zero);
extern int (* SYSRelaunchTitle)(int argc, char** argv);
extern int(*_SYSLaunchTitleByPathFromLauncher)(const char* path, s32 len, s32 zero);
extern int (* SYSRelaunchTitle)(s32 argc, char** argv);
extern int (* SYSLaunchMenu)(void);
extern int (* SYSCheckTitleExists)(u64 titleId);
extern int (* SYSLaunchTitle)(u64 titleId);
extern int (* SYSLaunchSettings)(int unk);
extern int (* SYSLaunchSettings)(s32 unk);
#ifdef __cplusplus

View File

@ -24,27 +24,27 @@
#include "os_functions.h"
#include "syshid_functions.h"
unsigned int syshid_handle __attribute__((section(".data"))) = 0;
u32 syshid_handle __attribute__((section(".data"))) = 0;
EXPORT_DECL(int, HIDSetup,void);
EXPORT_DECL(int, HIDTeardown,void);
EXPORT_DECL(s32, HIDSetup,void);
EXPORT_DECL(s32, HIDTeardown,void);
EXPORT_DECL(int, HIDAddClient,HIDClient *p_client, HIDAttachCallback attach_callback);
EXPORT_DECL(int, HIDDelClient,HIDClient *p_client);
EXPORT_DECL(s32, HIDAddClient,HIDClient *p_client, HIDAttachCallback attach_callback);
EXPORT_DECL(s32, HIDDelClient,HIDClient *p_client);
EXPORT_DECL(int, HIDGetDescriptor,unsigned int handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user);
EXPORT_DECL(int, HIDSetDescriptor,unsigned int handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user);
EXPORT_DECL(s32, HIDGetDescriptor,u32 handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, unsigned char *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
EXPORT_DECL(s32, HIDSetDescriptor,u32 handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, unsigned char *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
EXPORT_DECL(int, HIDSetProtocol,unsigned int handle,u8 interface_index,u8 protocol, HIDCallback hc, void *p_user);
EXPORT_DECL(int, HIDGetProtocol,unsigned int handle,u8 interface_index,u8 * protocol, HIDCallback hc, void *p_user);
EXPORT_DECL(s32, HIDSetProtocol,u32 handle,u8 s32erface_index,u8 protocol, HIDCallback hc, void *p_user);
EXPORT_DECL(s32, HIDGetProtocol,u32 handle,u8 s32erface_index,u8 * protocol, HIDCallback hc, void *p_user);
EXPORT_DECL(int, HIDGetReport,u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
EXPORT_DECL(int, HIDSetReport,u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
EXPORT_DECL(s32, HIDGetReport,u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
EXPORT_DECL(s32, HIDSetReport,u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
EXPORT_DECL(int, HIDSetIdle,unsigned int handle, u8 interface_index,u8 duration, HIDCallback hc, void *p_user);
EXPORT_DECL(s32, HIDSetIdle,u32 handle, u8 s32erface_index,u8 duration, HIDCallback hc, void *p_user);
EXPORT_DECL(int, HIDRead,unsigned int handle, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user);
EXPORT_DECL(int, HIDWrite,unsigned int handle, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user);
EXPORT_DECL(s32, HIDRead,u32 handle, unsigned char *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
EXPORT_DECL(s32, HIDWrite,u32 handle, unsigned char *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
void InitAcquireSysHID(void)
{
@ -59,7 +59,7 @@ void InitSysHIDFunctionPointers(void)
return;
}
unsigned int funcPointer = 0;
u32 funcPointer = 0;
//! assigning those is not mandatory and it does not always work to load them
OS_FIND_EXPORT(syshid_handle, HIDSetup);

View File

@ -28,60 +28,62 @@
extern "C" {
#endif
extern unsigned int syshid_handle;
#include <gctypes.h>
extern u32 syshid_handle;
typedef struct
{
unsigned int handle;
unsigned int physical_device_inst;
unsigned short vid;
unsigned short pid;
unsigned char interface_index;
unsigned char sub_class;
unsigned char protocol;
u32 handle;
u32 physical_device_inst;
u16 vid;
u16 pid;
u8 interface_index;
u8 sub_class;
u8 protocol;
unsigned short max_packet_size_rx;
unsigned short max_packet_size_tx;
u16 max_packet_size_rx;
u16 max_packet_size_tx;
} HIDDevice;
typedef struct _HIDClient HIDClient;
#define HID_DEVICE_DETACH 0
#define HID_DEVICE_ATTACH 1
#define HID_DEVICE_DETACH 0
#define HID_DEVICE_ATTACH 1
typedef int (*HIDAttachCallback)(HIDClient *p_hc,HIDDevice *p_hd,unsigned int attach);
typedef s32 (*HIDAttachCallback)(HIDClient *p_hc,HIDDevice *p_hd,u32 attach);
struct _HIDClient
{
HIDClient *next;
HIDAttachCallback attach_cb;
HIDClient *next;
HIDAttachCallback attach_cb;
};
typedef void (*HIDCallback)(unsigned int handle,int error,unsigned char *p_buffer,unsigned int bytes_transferred,void *p_user);
typedef void (*HIDCallback)(u32 handle,s32 error,u8 *p_buffer,u32 bytes_transferred,void *p_user);
void InitSysHIDFunctionPointers(void);
void InitAcquireSysHID(void);
extern int(*HIDSetup)(void);
extern int(*HIDTeardown)(void);
extern s32(*HIDSetup)(void);
extern s32(*HIDTeardown)(void);
extern int(*HIDAddClient)(HIDClient *p_client, HIDAttachCallback attach_callback);
extern int(*HIDDelClient)(HIDClient *p_client);
extern s32(*HIDAddClient)(HIDClient *p_client, HIDAttachCallback attach_callback);
extern s32(*HIDDelClient)(HIDClient *p_client);
extern int(*HIDGetDescriptor)(unsigned int handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user);
extern int(*HIDSetDescriptor)(unsigned int handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user);
extern s32(*HIDGetDescriptor)(u32 handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
extern s32(*HIDSetDescriptor)(u32 handle,u8 descriptor_type,u8 descriptor_index, u16 language_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
extern int(*HIDGetReport)(u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
extern int(*HIDSetReport)(u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
extern s32(*HIDGetReport)(u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
extern s32(*HIDSetReport)(u32 handle, u8 report_type, u8 report_id, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
extern int(*HIDSetIdle)(unsigned int handle, u8 interface_index,u8 duration, HIDCallback hc, void *p_user);
extern s32(*HIDSetIdle)(u32 handle, u8 s32erface_index,u8 duration, HIDCallback hc, void *p_user);
extern int(* HIDSetProtocol)(unsigned int handle,u8 interface_index,u8 protocol, HIDCallback hc, void *p_user);
extern int(* HIDGetProtocol)(unsigned int handle,u8 interface_index,u8 * protocol, HIDCallback hc, void *p_user);
extern s32(* HIDSetProtocol)(u32 handle,u8 s32erface_index,u8 protocol, HIDCallback hc, void *p_user);
extern s32(* HIDGetProtocol)(u32 handle,u8 s32erface_index,u8 * protocol, HIDCallback hc, void *p_user);
extern int(*HIDRead)(unsigned int handle, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user);
extern int(*HIDWrite)(unsigned int handle, unsigned char *p_buffer, unsigned int buffer_length, HIDCallback hc, void *p_user);
extern s32(*HIDRead)(u32 handle, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
extern s32(*HIDWrite)(u32 handle, u8 *p_buffer, u32 buffer_length, HIDCallback hc, void *p_user);
#ifdef __cplusplus
}

View File

@ -24,15 +24,15 @@
#include "os_functions.h"
#include "vpad_functions.h"
unsigned int vpad_handle __attribute__((section(".data"))) = 0;
unsigned int vpadbase_handle __attribute__((section(".data"))) = 0;
u32 vpad_handle __attribute__((section(".data"))) = 0;
u32 vpadbase_handle __attribute__((section(".data"))) = 0;
EXPORT_DECL(void, VPADInit, void);
EXPORT_DECL(int, VPADRead, int chan, VPADData *buffer, u32 buffer_size, s32 *error);
EXPORT_DECL(int, VPADGetLcdMode, int padnum, int *lcdmode);
EXPORT_DECL(int, VPADSetLcdMode, int padnum, int lcdmode);
EXPORT_DECL(int, VPADBASEGetMotorOnRemainingCount, int padnum);
EXPORT_DECL(int, VPADBASESetMotorOnRemainingCount, int padnum, int counter);
EXPORT_DECL(s32, VPADRead, s32 chan, VPADData *buffer, u32 buffer_size, s32 *error);
EXPORT_DECL(s32, VPADGetLcdMode, s32 padnum, s32 *lcdmode);
EXPORT_DECL(s32, VPADSetLcdMode, s32 padnum, s32 lcdmode);
EXPORT_DECL(s32, VPADBASEGetMotorOnRemainingCount, s32 padnum);
EXPORT_DECL(s32, VPADBASESetMotorOnRemainingCount, s32 padnum, s32 counter);
void InitAcquireVPad(void)
{
@ -42,7 +42,7 @@ void InitAcquireVPad(void)
void InitVPadFunctionPointers(void)
{
unsigned int *funcPointer = 0;
u32 *funcPointer = 0;
InitAcquireVPad();

View File

@ -28,11 +28,11 @@
extern "C" {
#endif
extern unsigned int vpad_handle;
extern unsigned int vpadbase_handle;
#include <gctypes.h>
extern u32 vpad_handle;
extern u32 vpadbase_handle;
#define VPAD_BUTTON_A 0x8000
#define VPAD_BUTTON_B 0x4000
#define VPAD_BUTTON_X 0x2000
@ -73,6 +73,11 @@ typedef struct
f32 x,y;
} Vec2D;
typedef struct
{
f32 x,y,z;
} Vec3D;
typedef struct
{
u16 x, y; /* Touch coordinates */
@ -86,26 +91,29 @@ typedef struct
u32 btns_d; /* Buttons that are pressed at that instant */
u32 btns_r; /* Released buttons */
Vec2D lstick, rstick; /* Each contains 4-byte X and Y components */
char unknown1c[0x52 - 0x1c]; /* Contains accelerometer and gyroscope data somewhere */
char unknown1c[0x38 - 0x1c]; /* Contains accelerometer data somewhere */
Vec3D gyro; /* Gyro data */
Vec3D angle; /* Angle data */
char unknown50[0x52 - 0x50]; /* Two bytes of unknown data */
VPADTPData tpdata; /* Normal touchscreen data */
VPADTPData tpdata1; /* Modified touchscreen data 1 */
VPADTPData tpdata2; /* Modified touchscreen data 2 */
char unknown6a[0xa0 - 0x6a];
uint8_t volume;
uint8_t battery; /* 0 to 6 */
uint8_t unk_volume; /* One less than volume */
u8 volume;
u8 battery; /* 0 to 6 */
u8 unk_volume; /* One less than volume */
char unknowna4[0xac - 0xa4];
} VPADData;
void InitVPadFunctionPointers(void);
void InitAcquireVPad(void);
extern int (* VPADRead)(int chan, VPADData *buffer, u32 buffer_size, s32 *error);
extern int (* VPADGetLcdMode)(int padnum, int *lcdmode);
extern int (* VPADSetLcdMode)(int padnum, int lcdmode);
extern s32 (* VPADRead)(s32 chan, VPADData *buffer, u32 buffer_size, s32 *error);
extern s32 (* VPADGetLcdMode)(s32 padnum, s32 *lcdmode);
extern s32 (* VPADSetLcdMode)(s32 padnum, s32 lcdmode);
extern void (* VPADInit)(void);
extern int (* VPADBASEGetMotorOnRemainingCount)(int lcdmode);
extern int (* VPADBASESetMotorOnRemainingCount)(int lcdmode,int counter);
extern s32 (* VPADBASEGetMotorOnRemainingCount)(s32 lcdmode);
extern s32 (* VPADBASESetMotorOnRemainingCount)(s32 lcdmode,s32 counter);
#ifdef __cplusplus
}

View File

@ -5,6 +5,7 @@
#include "utils/utils.h"
#include "main.h"
#include "lib_easy.h"
#include "draw.h"
int __entry_menu(int argc, char **argv)
{

View File

@ -173,7 +173,7 @@ int CreateSubfolder(const char * fullpath)
if(!result)
return 0;
if (mkdir(dirnoslash, 0777) == -1)
if (mkdir(dirnoslash, 0x777) == -1)
{
return 0;
}

640
src/icon.h Normal file
View File

@ -0,0 +1,640 @@
#ifndef _ICON_H_
#define _ICON_H_
#ifdef __cplusplus
extern "C" {
#endif
unsigned char icon_tga[] = {
0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x01, 0x60, 0x00, 0x20, 0x08, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff,
0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8,
0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff,
0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8,
0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8,
0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff,
0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8,
0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff,
0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8,
0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8,
0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0xbb,
0x00, 0x00, 0x00, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xb7, 0xd8, 0xd8,
0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0xbb, 0x00, 0x00, 0x00, 0xff,
0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xb7, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8,
0xd8, 0xd8, 0xff, 0xbb, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd8, 0xd8, 0xd8,
0xff, 0xb7, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0xbb,
0x00, 0x00, 0x00, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xb7, 0xd8, 0xd8,
0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x9b, 0x7f,
0x7f, 0x7f, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xb3,
0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x9b, 0x7f, 0x7f, 0x7f, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce,
0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd8, 0xd8, 0xd8,
0xff, 0xb3, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x9b, 0x7f, 0x7f, 0x7f, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd8,
0xd8, 0xd8, 0xff, 0xb3, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x9b, 0x7f, 0x7f, 0x7f, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xb3, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8,
0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8f, 0x7f, 0x7f, 0x7f, 0xff, 0x87,
0xff, 0xff, 0xff, 0xff, 0x83, 0x7f, 0x7f, 0x7f, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xaf, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8,
0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8f, 0x7f, 0x7f, 0x7f, 0xff, 0x87,
0xff, 0xff, 0xff, 0xff, 0x83, 0x7f, 0x7f, 0x7f, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xaf, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8,
0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8f, 0x7f, 0x7f, 0x7f, 0xff, 0x87,
0xff, 0xff, 0xff, 0xff, 0x83, 0x7f, 0x7f, 0x7f, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xaf, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8,
0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8f, 0x7f, 0x7f, 0x7f, 0xff, 0x87,
0xff, 0xff, 0xff, 0xff, 0x83, 0x7f, 0x7f, 0x7f, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xaf, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8,
0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8f, 0x7f, 0x7f, 0x7f, 0xff, 0x87,
0xff, 0xff, 0xff, 0xff, 0x83, 0x7f, 0x7f, 0x7f, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0xd3, 0xd8, 0xd8, 0xd8, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x93, 0xd8,
0xd8, 0xd8, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8,
0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x87,
0x00, 0x00, 0x00, 0xff, 0x8f, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8,
0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x8f, 0x7f, 0x7f, 0x7f, 0xff, 0x87, 0xff,
0xff, 0xff, 0xff, 0x83, 0x7f, 0x7f, 0x7f, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xd3,
0xd8, 0xd8, 0xd8, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x93, 0xd8, 0xd8,
0xd8, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff,
0x87, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x87, 0x00,
0x00, 0x00, 0xff, 0x8f, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x8f, 0x7f, 0x7f, 0x7f, 0xff, 0x87, 0xff, 0xff,
0xff, 0xff, 0x83, 0x7f, 0x7f, 0x7f, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xd3, 0xd8,
0xd8, 0xd8, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x93, 0xd8, 0xd8, 0xd8,
0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x87,
0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x87, 0x00, 0x00,
0x00, 0xff, 0x8f, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x8f, 0x7f, 0x7f, 0x7f, 0xff, 0x87, 0xff, 0xff, 0xff,
0xff, 0x83, 0x7f, 0x7f, 0x7f, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b,
0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xd3, 0xd8, 0xd8,
0xd8, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x93, 0xd8, 0xd8, 0xd8, 0xff,
0x87, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x87, 0x00,
0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x87, 0x00, 0x00, 0x00,
0xff, 0x8f, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x8f, 0x7f, 0x7f, 0x7f, 0xff, 0x87, 0xff, 0xff, 0xff, 0xff,
0x83, 0x7f, 0x7f, 0x7f, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xce,
0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xd8, 0xd8, 0xd8,
0xff, 0xc3, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8,
0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x8f, 0x7f, 0x7f, 0x7f, 0xff, 0x87, 0xff, 0xff, 0xff,
0xff, 0x83, 0x7f, 0x7f, 0x7f, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b,
0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xd8, 0xd8,
0xd8, 0xff, 0xc3, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83,
0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd,
0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x8f, 0x7f, 0x7f, 0x7f, 0xff, 0x87, 0xff, 0xff,
0xff, 0xff, 0x83, 0x7f, 0x7f, 0x7f, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xd8,
0xd8, 0xd8, 0xff, 0xc3, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17,
0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8,
0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x8f, 0x7f, 0x7f, 0x7f, 0xff, 0x87, 0xff,
0xff, 0xff, 0xff, 0x83, 0x7f, 0x7f, 0x7f, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87,
0xd8, 0xd8, 0xd8, 0xff, 0xc3, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8,
0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87,
0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8,
0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8,
0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d,
0xff, 0xa3, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x8b, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff,
0xff, 0xff, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff,
0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xff, 0xff, 0xff, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17,
0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff, 0xa3, 0x00, 0x00, 0x00,
0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87,
0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xff, 0xff,
0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x87, 0x00,
0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x87, 0x00, 0x00, 0x00,
0xff, 0x8b, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83,
0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd,
0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83,
0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd,
0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff,
0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xce,
0x56, 0x4d, 0xff, 0xa3, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x8b, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x83, 0xff, 0xff, 0xff, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff,
0xff, 0xff, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xff, 0xff, 0xff,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8,
0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff, 0xa3, 0x00,
0x00, 0x00, 0xff, 0x8b, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x87, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b,
0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff,
0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff,
0x87, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x87, 0x00,
0x00, 0x00, 0xff, 0x8b, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87,
0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8,
0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87,
0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8,
0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0xbb, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xd8,
0xd8, 0xd8, 0xff, 0x8b, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff,
0xff, 0xff, 0xff, 0x8b, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17,
0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8,
0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xbb, 0xce, 0x56, 0x4d, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0x00,
0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83,
0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff,
0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x8b, 0x00,
0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b,
0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd,
0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b,
0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0xbb, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x87, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff,
0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x83, 0xff, 0xff, 0xff, 0xff, 0x8b, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8,
0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8,
0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b,
0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xbb, 0xce, 0x56,
0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xd8, 0xd8, 0xd8, 0xff,
0x8b, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83,
0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff,
0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff,
0x8b, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87,
0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8,
0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0xbb, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x87, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x8b, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xff,
0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x8b, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8,
0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17,
0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8,
0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xbb,
0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xd8, 0xd8,
0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xff, 0xff, 0xff, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b,
0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8,
0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83,
0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd,
0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xbb, 0xce, 0x56, 0x4d, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x8b, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x8b, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff,
0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xff, 0xff, 0xff, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8,
0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8,
0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0xbb, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87,
0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xff, 0xff,
0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xff, 0xff, 0xff, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x8b, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83,
0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd,
0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87,
0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8,
0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8,
0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d,
0xff, 0xab, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x8b, 0x00, 0x00, 0x00, 0xff,
0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff,
0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x8b, 0x00, 0x00,
0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x87, 0x17, 0xdd, 0x8e, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x83, 0x17,
0xdd, 0x8e, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8,
0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0xab, 0x00, 0x00, 0x00, 0xff, 0x87,
0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xd8, 0xd8,
0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff,
0x8b, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83,
0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff,
0xff, 0xff, 0x8b, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x87, 0x00,
0x00, 0x00, 0xff, 0x83, 0x17, 0xdd, 0x8e, 0xff, 0x87, 0x00, 0x00, 0x00,
0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83,
0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd,
0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0xab,
0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x87, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x83, 0xff, 0xff, 0xff, 0xff, 0x8b, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff,
0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x8b, 0x00, 0x00, 0x00, 0xff,
0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17,
0xdd, 0x8e, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x83, 0x17, 0xdd, 0x8e,
0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17,
0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8,
0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87,
0xce, 0x56, 0x4d, 0xff, 0xab, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56,
0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xd8, 0xd8, 0xd8, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x8b, 0x00,
0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83,
0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff,
0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff,
0x8b, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x87, 0x00, 0x00, 0x00,
0xff, 0x83, 0x17, 0xdd, 0x8e, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x87,
0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8,
0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0xa3, 0xb0, 0xe4, 0xef, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xd8,
0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xff, 0xff, 0xff,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xff, 0xff, 0xff, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x8b, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8,
0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0x17, 0xdd, 0x8e, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x87, 0xd8, 0xd8, 0xd8, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff,
0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x8f, 0xd8,
0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xa3,
0xb0, 0xe4, 0xef, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56,
0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xd8, 0xd8, 0xd8, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x8b, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83,
0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xff, 0xff,
0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x8b, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87,
0xd8, 0xd8, 0xd8, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8,
0xd8, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x8f, 0xd8, 0xd8, 0xd8, 0xff,
0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce,
0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xa3, 0xb0, 0xe4, 0xef,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x8b, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x8b, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff,
0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xff, 0xff, 0xff, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x8b, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17,
0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xd8, 0xd8, 0xd8,
0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x87,
0x00, 0x00, 0x00, 0xff, 0x8f, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8,
0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0xa3, 0xb0, 0xe4, 0xef, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x87, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b,
0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xff, 0xff,
0xff, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x8b, 0xff, 0xff, 0xff, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87,
0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0x17, 0xdd,
0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xd8, 0xd8, 0xd8, 0xff, 0x87, 0x00,
0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x87, 0x00, 0x00, 0x00,
0xff, 0x8f, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x87, 0x00, 0x00,
0x00, 0xff, 0x83, 0xb0, 0xe4, 0xef, 0xff, 0x97, 0x00, 0x00, 0x00, 0xff,
0x83, 0xb0, 0xe4, 0xef, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce,
0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xd8, 0xd8, 0xd8,
0xff, 0xc3, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0xa3, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8,
0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b,
0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56,
0x4d, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x83, 0xb0, 0xe4, 0xef, 0xff,
0x97, 0x00, 0x00, 0x00, 0xff, 0x83, 0xb0, 0xe4, 0xef, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x87, 0xd8, 0xd8, 0xd8, 0xff, 0xc3, 0x00, 0x00, 0x00, 0xff, 0x83,
0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xa3, 0x17, 0xdd,
0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b,
0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff,
0x83, 0xb0, 0xe4, 0xef, 0xff, 0x97, 0x00, 0x00, 0x00, 0xff, 0x83, 0xb0,
0xe4, 0xef, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xd8, 0xd8, 0xd8, 0xff, 0xc3,
0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0xa3, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17,
0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8,
0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff,
0x87, 0x00, 0x00, 0x00, 0xff, 0x83, 0xb0, 0xe4, 0xef, 0xff, 0x97, 0x00,
0x00, 0x00, 0xff, 0x83, 0xb0, 0xe4, 0xef, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87,
0xd8, 0xd8, 0xd8, 0xff, 0xc3, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8,
0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xa3, 0x17, 0xdd, 0x8e, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87,
0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8,
0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xa3, 0xb0,
0xe4, 0xef, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xcf, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x8f, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x8f, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17,
0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8,
0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0xa3, 0xb0, 0xe4, 0xef, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0xcf, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8f,
0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8f, 0x17, 0xdd,
0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b,
0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0xa3, 0xb0, 0xe4, 0xef, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce,
0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xcf, 0xd8, 0xd8, 0xd8,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8f, 0x17, 0xdd, 0x8e, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x8f, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8,
0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b,
0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56,
0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xa3, 0xb0, 0xe4, 0xef, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0xcf, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x8f, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8f,
0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8,
0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x87, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x87, 0x00, 0x00,
0x00, 0xff, 0x83, 0xb0, 0xe4, 0xef, 0xff, 0x97, 0x00, 0x00, 0x00, 0xff,
0x83, 0xb0, 0xe4, 0xef, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce,
0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xcf, 0xd8, 0xd8, 0xd8,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0x17, 0xdd, 0x8e, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x8b, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x87, 0xd8, 0xd8, 0xd8, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8,
0xd8, 0xd8, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x8f, 0xd8, 0xd8, 0xd8,
0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87,
0xce, 0x56, 0x4d, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x83, 0xb0, 0xe4,
0xef, 0xff, 0x97, 0x00, 0x00, 0x00, 0xff, 0x83, 0xb0, 0xe4, 0xef, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0xcf, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x8b, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83,
0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0x17, 0xdd,
0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xd8, 0xd8, 0xd8, 0xff,
0x87, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x87, 0x00,
0x00, 0x00, 0xff, 0x8f, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x87,
0x00, 0x00, 0x00, 0xff, 0x83, 0xb0, 0xe4, 0xef, 0xff, 0x97, 0x00, 0x00,
0x00, 0xff, 0x83, 0xb0, 0xe4, 0xef, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xcf, 0xd8,
0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b, 0x17, 0xdd, 0x8e,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x8b, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x87, 0xd8, 0xd8, 0xd8, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff,
0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x8f, 0xd8,
0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x83,
0xb0, 0xe4, 0xef, 0xff, 0x97, 0x00, 0x00, 0x00, 0xff, 0x83, 0xb0, 0xe4,
0xef, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0xcf, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00,
0x00, 0x00, 0xff, 0x8b, 0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x83, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x8b,
0x17, 0xdd, 0x8e, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xd8, 0xd8,
0xd8, 0xff, 0x87, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff,
0x87, 0x00, 0x00, 0x00, 0xff, 0x8f, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8,
0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xa3, 0xb0, 0xe4, 0xef, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0xd3, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0x00, 0x00, 0x00, 0xff,
0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0x00, 0x00, 0x00, 0xff, 0xb7, 0xd8,
0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00,
0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xa3,
0xb0, 0xe4, 0xef, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56,
0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xd3, 0xd8, 0xd8, 0xd8, 0xff,
0x8b, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0x00,
0x00, 0x00, 0xff, 0xb7, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0xa3, 0xb0, 0xe4, 0xef, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0xd3, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0x00, 0x00, 0x00, 0xff, 0x8b, 0xd8,
0xd8, 0xd8, 0xff, 0x8b, 0x00, 0x00, 0x00, 0xff, 0xb7, 0xd8, 0xd8, 0xd8,
0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87,
0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xa3, 0xb0, 0xe4,
0xef, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff,
0x83, 0x00, 0x00, 0x00, 0xff, 0xd3, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0x00,
0x00, 0x00, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0x00, 0x00, 0x00,
0xff, 0xb7, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x87, 0x00, 0x00,
0x00, 0xff, 0x83, 0xb0, 0xe4, 0xef, 0xff, 0x97, 0x00, 0x00, 0x00, 0xff,
0x83, 0xb0, 0xe4, 0xef, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce,
0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd8, 0xd8, 0xd8,
0xff, 0xaf, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x87, 0x00, 0x00,
0x00, 0xff, 0x83, 0xb0, 0xe4, 0xef, 0xff, 0x97, 0x00, 0x00, 0x00, 0xff,
0x83, 0xb0, 0xe4, 0xef, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce,
0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd8, 0xd8, 0xd8,
0xff, 0xaf, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x87, 0x00, 0x00,
0x00, 0xff, 0x83, 0xb0, 0xe4, 0xef, 0xff, 0x97, 0x00, 0x00, 0x00, 0xff,
0x83, 0xb0, 0xe4, 0xef, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce,
0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd8, 0xd8, 0xd8,
0xff, 0xaf, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x87, 0x00, 0x00,
0x00, 0xff, 0x83, 0xb0, 0xe4, 0xef, 0xff, 0x97, 0x00, 0x00, 0x00, 0xff,
0x83, 0xb0, 0xe4, 0xef, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce,
0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd8, 0xd8, 0xd8,
0xff, 0xaf, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0xa3, 0xb0, 0xe4, 0xef, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd8,
0xd8, 0xd8, 0xff, 0xaf, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0xa3, 0xb0, 0xe4, 0xef, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff,
0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xaf, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8,
0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xa3, 0xb0, 0xe4, 0xef, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83, 0x00, 0x00,
0x00, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xaf, 0xd8, 0xd8, 0xd8, 0xff,
0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce,
0x56, 0x4d, 0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0xa3, 0xb0, 0xe4, 0xef,
0xff, 0x83, 0x00, 0x00, 0x00, 0xff, 0x87, 0xce, 0x56, 0x4d, 0xff, 0x83,
0x00, 0x00, 0x00, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xaf, 0xd8, 0xd8,
0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0xc3, 0x00, 0x00, 0x00, 0xff,
0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xaf, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8,
0xd8, 0xd8, 0xff, 0xc3, 0x00, 0x00, 0x00, 0xff, 0xff, 0xd8, 0xd8, 0xd8,
0xff, 0xaf, 0xd8, 0xd8, 0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0xc3,
0x00, 0x00, 0x00, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xaf, 0xd8, 0xd8,
0xd8, 0xff, 0x8b, 0xd8, 0xd8, 0xd8, 0xff, 0xc3, 0x00, 0x00, 0x00, 0xff,
0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xaf, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8,
0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8,
0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff,
0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8,
0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff,
0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8,
0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8,
0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff,
0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8,
0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff,
0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8,
0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8,
0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff,
0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8, 0xd8, 0xff, 0xff, 0xd8, 0xd8,
0xd8, 0xff
};
unsigned int icon_tga_len = 7478;
#ifdef __cplusplus
}
#endif
#endif

View File

@ -6,34 +6,18 @@ VPADData vpad;
int screen_buf0_size = 0;
int screen_buf1_size = 0;
void flipBuffers() {
// Flush the cache
DCFlushRange(screenBuffer, screen_buf0_size);
DCFlushRange((screenBuffer + screen_buf0_size), screen_buf1_size);
// Flip buffers
OSScreenFlipBuffersEx(0);
OSScreenFlipBuffersEx(1);
}
void ucls() {
for(int i=0;i<2;i++) {
OSScreenClearBufferEx(0, 0);
OSScreenClearBufferEx(1, 0);
flipBuffers();
}
}
void ScreenInit() {
//Init screen and screen buffers
OSScreenInit();
screen_buf0_size = OSScreenGetBufferSizeEx(0);
screen_buf1_size = OSScreenGetBufferSizeEx(1);
screenBuffer = MEM1_alloc(screen_buf0_size + screen_buf1_size, 0x40);
OSScreenSetBufferEx(0, screenBuffer);
OSScreenSetBufferEx(1, (screenBuffer + screen_buf0_size));
OSScreenEnableEx(0, 1);
OSScreenEnableEx(1, 1);
ucls(); //Clear screens
//Init screen and screen buffers
OSScreenInit();
screen_buf0_size = OSScreenGetBufferSizeEx(0);
screen_buf1_size = OSScreenGetBufferSizeEx(1);
screenBuffer = MEM1_alloc(screen_buf0_size + screen_buf1_size, 0x100);
OSScreenSetBufferEx(0, screenBuffer);
OSScreenSetBufferEx(1, (screenBuffer + screen_buf0_size));
OSScreenEnableEx(0, 1);
OSScreenEnableEx(1, 1);
clearBuffers(); //Clear screens
initDraw(screenBuffer, screen_buf0_size, screen_buf1_size);
}
void updatePressedButtons() {
@ -51,6 +35,27 @@ void updateReleasedButtons() {
buttons_released = vpad.btns_r;
}
bool stickPos(u8 stick, f32 value) {
switch(stick) {
case 0 :
return (value > 0) ? (vpad.lstick.x > value): (vpad.lstick.x < value);
case 1 :
return (value > 0) ? (vpad.lstick.y > value): (vpad.lstick.y < value);
case 2 :
return (value > 0) ? (vpad.rstick.x > value): (vpad.rstick.x < value);
case 3 :
return (value > 0) ? (vpad.rstick.y > value): (vpad.rstick.y < value);
case 4 :
return ((vpad.lstick.x > value) || (vpad.lstick.x < -value)) || \
((vpad.lstick.y > value) || (vpad.lstick.y < -value)) || \
((vpad.rstick.x > value) || (vpad.rstick.x < -value)) || \
((vpad.rstick.y > value) || (vpad.rstick.y < -value));
default :
return 0;
}
}
int isPressed(int button) {
return (buttons_pressed&button);
}
@ -64,27 +69,27 @@ int isReleased(int button) {
}
void uInit() {
//--Initialize every function pointer-- (byebye FindExport :D)
InitOSFunctionPointers();
InitSocketFunctionPointers();
InitACPFunctionPointers();
InitAocFunctionPointers();
InitAXFunctionPointers();
InitCurlFunctionPointers();
InitFSFunctionPointers();
InitGX2FunctionPointers();
InitPadScoreFunctionPointers();
InitSysFunctionPointers();
InitSysHIDFunctionPointers();
InitVPadFunctionPointers();
//--Initialize every function pointer-- (byebye FindExport :D)
InitOSFunctionPointers();
InitSocketFunctionPointers();
InitACPFunctionPointers();
InitAocFunctionPointers();
InitAXFunctionPointers();
InitCurlFunctionPointers();
InitFSFunctionPointers();
InitGX2FunctionPointers();
InitPadScoreFunctionPointers();
InitSysFunctionPointers();
InitSysHIDFunctionPointers();
InitVPadFunctionPointers();
memoryInitialize(); //You probably shouldn't care about this for now :P
VPADInit(); //Init GamePad input library (needed for getting gamepad input)
ScreenInit(); //Init OSScreen (all the complex stuff is in easyfunctions.h :P )
memoryInitialize(); //You probably shouldn't care about this for now :P
VPADInit(); //Init GamePad input library (needed for getting gamepad input)
ScreenInit(); //Init OSScreen (all the complex stuff is in easyfunctions.h :P )
}
void uDeInit() {
MEM1_free(screenBuffer);
screenBuffer = NULL;
memoryRelease();
MEM1_free(screenBuffer);
screenBuffer = NULL;
memoryRelease();
}

View File

@ -43,12 +43,11 @@ uint32_t buttons_hold; //Held buttons
uint32_t buttons_pressed; //Pressed buttons
uint32_t buttons_released; //Released buttons
void ucls();
void ScreenInit();
void flipBuffers();
void updatePressedButtons();
void updateHeldButtons();
void updateReleasedButtons();
bool stickPos(u8 stick, f32 value);
int isPressed(int button);
int isHeld(int button);
int isReleased(int button);

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -9,6 +9,7 @@
#include <iosuhax_disc_interface.h>
#include "lib_easy.h"
#include "draw.h"
#define PATH_SIZE 0x200
@ -19,27 +20,77 @@ extern "C" {
typedef struct {
u32 highID;
u32 lowID;
u16 listID;
char shortName[256];
char productCode[32];
char longName[512];
char productCode[5];
bool saveInit;
bool isTitleOnUSB;
bool isTitleDupe;
u16 dupeID;
u8* iconBuf;
} Title;
typedef struct {
u32 highID;
u32 lowID;
u8 dev;
bool found;
} Saves;
typedef struct {
char persistentID[9];
u32 pID;
char miiName[50];
u8 slot;
} Account;
typedef enum {
ST_YES_NO = 1,
ST_CONFIRM_CANCEL = 2,
ST_MULTILINE = 16,
ST_WARNING = 32,
ST_ERROR = 64
} Style;
extern Account* wiiuacc;
extern Account* sdacc;
extern u8 wiiuaccn, sdaccn;
void console_print_pos(int x, int y, const char* format, ...);
bool promptConfirm(const char* question);
void promptError(const char* message);
bool promptConfirm(Style st, const char* question);
void promptError(const char* message, ...);
void getUserID(char* out);
void getAccountsWiiU();
int getLoadiineGameSaveDir(char* out, const char* productCode);
int getLoadiineSaveVersionList(int* out, const char* gamePath);
int getLoadiineUserDir(char* out, const char* fullSavePath, const char* userID);
void backupSavedata(Title* title, u8 slot, bool allusers, bool common);
void restoreSavedata(Title* title, u8 slot, bool allusers, bool common);
void wipeSavedata(Title* title, bool allusers, bool common);
u64 getSlotDate(u32 highID, u32 lowID, u8 slot);
bool isSlotEmpty(u32 highID, u32 lowID, u8 slot);
bool hasCommonSave(Title* title, bool inSD, bool iine, u8 slot, int version);
void copySavedata(Title* title, Title* titled, s8 allusers, s8 allusers_d, bool common);
void backupAllSave(Title* titles, int count, OSCalendarTime* date);
void backupSavedata(Title* title, u8 slot, s8 allusers, bool common);
void restoreSavedata(Title* title, u8 slot, s8 sdusers, s8 allusers, bool common);
void wipeSavedata(Title* title, s8 allusers, bool common);
void importFromLoadiine(Title* title, bool common, int version);
void exportToLoadiine(Title* title, bool common, int version);
void setFSAFD(int fd);
int checkEntry(const char * fPath);
int folderEmpty(const char * fPath);
s32 loadFile(const char * fPath, u8 **buf);
s32 loadFilePart(const char * fPath, u32 start, u32 size, u8 **buf);
s32 loadTitleIcon(Title* title);
void show_file_operation(char* file_name, char* file_src, char* file_dest);
void console_print_pos_multiline(int x, int y, char cdiv,const char* format, ...);
#ifdef __cplusplus
}
#endif
#endif
#endif

View File

@ -34,18 +34,18 @@
//! Memory functions
//! This is the only place where those are needed so lets keep them more or less private
//!----------------------------------------------------------------------------------------------------------------------------------------------------------------------------
extern unsigned int * pMEMAllocFromDefaultHeapEx;
extern unsigned int * pMEMAllocFromDefaultHeap;
extern unsigned int * pMEMFreeToDefaultHeap;
extern u32 * pMEMAllocFromDefaultHeapEx;
extern u32 * pMEMAllocFromDefaultHeap;
extern u32 * pMEMFreeToDefaultHeap;
extern int (* MEMGetBaseHeapHandle)(int mem_arena);
extern unsigned int (* MEMGetAllocatableSizeForFrmHeapEx)(int heap, int align);
extern void *(* MEMAllocFromFrmHeapEx)(int heap, unsigned int size, int align);
extern void (* MEMFreeToFrmHeap)(int heap, int mode);
extern void *(* MEMAllocFromExpHeapEx)(int heap, unsigned int size, int align);
extern int (* MEMCreateExpHeapEx)(void* address, unsigned int size, unsigned short flags);
extern void *(* MEMDestroyExpHeap)(int heap);
extern void (* MEMFreeToExpHeap)(int heap, void* ptr);
extern s32 (* MEMGetBaseHeapHandle)(s32 mem_arena);
extern u32 (* MEMGetAllocatableSizeForFrmHeapEx)(s32 heap, s32 align);
extern void *(* MEMAllocFromFrmHeapEx)(s32 heap, u32 size, s32 align);
extern void (* MEMFreeToFrmHeap)(s32 heap, s32 mode);
extern void *(* MEMAllocFromExpHeapEx)(s32 heap, u32 size, s32 align);
extern s32 (* MEMCreateExpHeapEx)(void* address, u32 size, unsigned short flags);
extern void *(* MEMDestroyExpHeap)(s32 heap);
extern void (* MEMFreeToExpHeap)(s32 heap, void* ptr);
static int mem1_heap = -1;
static int bucket_heap = -1;

576
src/tga_reader.c Normal file
View File

@ -0,0 +1,576 @@
/**
* tga_reader.c
*
* Copyright (c) 2014 Kenji Sasaki
* Released under the MIT license.
* https://github.com/npedotnet/TGAReader/blob/master/LICENSE
*
* English document
* https://github.com/npedotnet/TGAReader/blob/master/README.md
*
* Japanese document
* http://3dtech.jp/wiki/index.php?TGAReader
*
*/
#include "tga_reader.h"
static const TGA_ORDER _TGA_READER_ARGB = {16, 8, 0, 24};
const TGA_ORDER *TGA_READER_ARGB = &_TGA_READER_ARGB;
static const TGA_ORDER _TGA_READER_ABGR = {0, 8, 16, 24};
const TGA_ORDER *TGA_READER_ABGR = &_TGA_READER_ABGR;
static const TGA_ORDER _TGA_READER_RGBA = {24, 16, 8, 0};
const TGA_ORDER *TGA_READER_RGBA = &_TGA_READER_RGBA;
void *tgaMalloc(size_t size) {
return malloc(size);
}
void tgaFree(void *memory) {
free(memory);
}
int tgaGetWidth(const unsigned char *buffer) {
return (buffer[12] & 0xFF) | (buffer[13] & 0xFF) << 8;
}
int tgaGetHeight(const unsigned char *buffer) {
return (buffer[14] & 0xFF) | (buffer[15] & 0xFF) << 8;
}
#define COLORMAP 1
#define RGB 2
#define GRAYSCALE 3
#define COLORMAP_RLE 9
#define RGB_RLE 10
#define GRAYSCALE_RLE 11
#define RIGHT_ORIGIN 0x10
#define UPPER_ORIGIN 0x20
static unsigned char *decodeRLE(int width, int height, int depth, const unsigned char *buffer, int offset);
static int *createPixelsFromColormap(int width, int height, int depth, const unsigned char *bytes, int offset, const unsigned char *palette, int colormapOrigin, int descriptor, const TGA_ORDER *order);
static int *createPixelsFromRGB(int width, int height, int depth, const unsigned char *bytes, int offset, int descriptor, const TGA_ORDER *order);
static int *createPixelsFromGrayscale(int width, int height, int depth, const unsigned char *bytes, int offset, int descriptor, const TGA_ORDER *order);
int *tgaRead(const unsigned char *buffer, const TGA_ORDER *order) {
// header
// int idFieldLength = buffer[0] & 0xFF;
// int colormapType = buffer[1] & 0xFF;
int type = buffer[2] & 0xFF;
int colormapOrigin = (buffer[3] & 0xFF) | (buffer[4] & 0xFF) << 8;
int colormapLength = (buffer[5] & 0xFF) | (buffer[6] & 0xFF) << 8;
int colormapDepth = buffer[7] & 0xFF;
// int originX = (buffer[8] & 0xFF) | (buffer[9] & 0xFF) << 8; // unsupported
// int originY = (buffer[10] & 0xFF) | (buffer[11] & 0xFF) << 8; // unsupported
int width = tgaGetWidth(buffer);
int height = tgaGetHeight(buffer);
int depth = buffer[16] & 0xFF;
int descriptor = buffer[17] & 0xFF;
int *pixels = NULL;
// data
switch(type) {
case COLORMAP: {
int imageDataOffset = 18 + (colormapDepth / 8) * colormapLength;
pixels = createPixelsFromColormap(width, height, colormapDepth, buffer, imageDataOffset, buffer, colormapOrigin, descriptor, order);
} break;
case RGB:
pixels = createPixelsFromRGB(width, height, depth, buffer, 18, descriptor, order);
break;
case GRAYSCALE:
pixels = createPixelsFromGrayscale(width, height, depth, buffer, 18, descriptor, order);
break;
case COLORMAP_RLE: {
int imageDataOffset = 18 + (colormapDepth / 8) * colormapLength;
unsigned char *decodeBuffer = decodeRLE(width, height, depth, buffer, imageDataOffset);
pixels = createPixelsFromColormap(width, height, colormapDepth, decodeBuffer, 0, buffer, colormapOrigin, descriptor, order);
tgaFree(decodeBuffer);
} break;
case RGB_RLE: {
unsigned char *decodeBuffer = decodeRLE(width, height, depth, buffer, 18);
pixels = createPixelsFromRGB(width, height, depth, decodeBuffer, 0, descriptor, order);
tgaFree(decodeBuffer);
} break;
case GRAYSCALE_RLE: {
unsigned char *decodeBuffer = decodeRLE(width, height, depth, buffer, 18);
pixels = createPixelsFromGrayscale(width, height, depth, decodeBuffer, 0, descriptor, order);
tgaFree(decodeBuffer);
} break;
default:
break;
}
return pixels;
}
static unsigned char *decodeRLE(int width, int height, int depth, const unsigned char *buffer, int offset) {
int elementCount = depth/8;
unsigned char elements[4];
int decodeBufferLength = elementCount * width * height;
unsigned char *decodeBuffer = (unsigned char *)tgaMalloc(decodeBufferLength);
int decoded = 0;
while(decoded < decodeBufferLength) {
int packet = buffer[offset++] & 0xFF;
if((packet & 0x80) != 0) { // RLE
int i, j, count;
for(i=0; i<elementCount; i++) {
elements[i] = buffer[offset++];
}
count = (packet&0x7F)+1;
for(i=0; i<count; i++) {
for(j=0; j<elementCount; j++) {
decodeBuffer[decoded++] = elements[j];
}
}
}
else { // RAW
int count = (packet+1) * elementCount;
int i;
for(i=0; i<count; i++) {
decodeBuffer[decoded++] = buffer[offset++];
}
}
}
return decodeBuffer;
}
static int *createPixelsFromColormap(int width, int height, int depth, const unsigned char *bytes, int offset, const unsigned char *palette, int colormapOrigin, int descriptor, const TGA_ORDER *order) {
int *pixels = NULL;
int rs = order->redShift;
int gs = order->greenShift;
int bs = order->blueShift;
int as = order->alphaShift;
switch(depth) {
case 24:
pixels = (int *)tgaMalloc(4*width*height);
if((descriptor & RIGHT_ORIGIN) != 0) {
if((descriptor & UPPER_ORIGIN) != 0) {
// UpperRight
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int colormapIndex = bytes[offset+width*i+j] & 0xFF - colormapOrigin;
int color = 0xFFFFFFFF;
if(colormapIndex >= 0) {
int index = 3*colormapIndex+18;
int b = palette[index+0] & 0xFF;
int g = palette[index+1] & 0xFF;
int r = palette[index+2] & 0xFF;
int a = 0xFF;
color = (r<<rs) | (g<<gs) | (b<<bs) | (a<<as);
}
pixels[width*i+(width-j-1)] = color;
}
}
}
else {
// LowerRight
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int colormapIndex = bytes[offset+width*i+j] & 0xFF - colormapOrigin;
int color = 0xFFFFFFFF;
if(colormapIndex >= 0) {
int index = 3*colormapIndex+18;
int b = palette[index+0] & 0xFF;
int g = palette[index+1] & 0xFF;
int r = palette[index+2] & 0xFF;
int a = 0xFF;
color = (r<<rs) | (g<<gs) | (b<<bs) | (a<<as);
}
pixels[width*(height-i-1)+(width-j-1)] = color;
}
}
}
}
else {
if((descriptor & UPPER_ORIGIN) != 0) {
// UpperLeft
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int colormapIndex = bytes[offset+width*i+j] & 0xFF - colormapOrigin;
int color = 0xFFFFFFFF;
if(colormapIndex >= 0) {
int index = 3*colormapIndex+18;
int b = palette[index+0] & 0xFF;
int g = palette[index+1] & 0xFF;
int r = palette[index+2] & 0xFF;
int a = 0xFF;
color = (r<<rs) | (g<<gs) | (b<<bs) | (a<<as);
}
pixels[width*i+j] = color;
}
}
}
else {
// LowerLeft
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int colormapIndex = bytes[offset+width*i+j] & 0xFF - colormapOrigin;
int color = 0xFFFFFFFF;
if(colormapIndex >= 0) {
int index = 3*colormapIndex+18;
int b = palette[index+0] & 0xFF;
int g = palette[index+1] & 0xFF;
int r = palette[index+2] & 0xFF;
int a = 0xFF;
color = (r<<rs) | (g<<gs) | (b<<bs) | (a<<as);
}
pixels[width*(height-i-1)+j] = color;
}
}
}
}
break;
case 32:
pixels = (int *)tgaMalloc(4*width*height);
if((descriptor & RIGHT_ORIGIN) != 0) {
if((descriptor & UPPER_ORIGIN) != 0) {
// UpperRight
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int colormapIndex = bytes[offset+width*i+j] & 0xFF - colormapOrigin;
int color = 0xFFFFFFFF;
if(colormapIndex >= 0) {
int index = 4*colormapIndex+18;
int b = palette[index+0] & 0xFF;
int g = palette[index+1] & 0xFF;
int r = palette[index+2] & 0xFF;
int a = palette[index+3] & 0xFF;
color = (r<<rs) | (g<<gs) | (b<<bs) | (a<<as);
}
pixels[width*i+(width-j-1)] = color;
}
}
}
else {
// LowerRight
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int colormapIndex = bytes[offset+width*i+j] & 0xFF - colormapOrigin;
int color = 0xFFFFFFFF;
if(colormapIndex >= 0) {
int index = 4*colormapIndex+18;
int b = palette[index+0] & 0xFF;
int g = palette[index+1] & 0xFF;
int r = palette[index+2] & 0xFF;
int a = palette[index+3] & 0xFF;
color = (r<<rs) | (g<<gs) | (b<<bs) | (a<<as);
}
pixels[width*(height-i-1)+(width-j-1)] = color;
}
}
}
}
else {
if((descriptor & UPPER_ORIGIN) != 0) {
// UpperLeft
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int colormapIndex = bytes[offset+width*i+j] & 0xFF - colormapOrigin;
int color = 0xFFFFFFFF;
if(colormapIndex >= 0) {
int index = 4*colormapIndex+18;
int b = palette[index+0] & 0xFF;
int g = palette[index+1] & 0xFF;
int r = palette[index+2] & 0xFF;
int a = palette[index+3] & 0xFF;
color = (r<<rs) | (g<<gs) | (b<<bs) | (a<<as);
}
pixels[width*i+j] = color;
}
}
}
else {
// LowerLeft
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int colormapIndex = bytes[offset+width*i+j] & 0xFF - colormapOrigin;
int color = 0xFFFFFFFF;
if(colormapIndex >= 0) {
int index = 4*colormapIndex+18;
int b = palette[index+0] & 0xFF;
int g = palette[index+1] & 0xFF;
int r = palette[index+2] & 0xFF;
int a = palette[index+3] & 0xFF;
color = (r<<rs) | (g<<gs) | (b<<bs) | (a<<as);
}
pixels[width*(height-i-1)+j] = color;
}
}
}
}
break;
default:
break;
}
return pixels;
}
static int *createPixelsFromRGB(int width, int height, int depth, const unsigned char *bytes, int offset, int descriptor, const TGA_ORDER *order) {
int *pixels = NULL;
int rs = order->redShift;
int gs = order->greenShift;
int bs = order->blueShift;
int as = order->alphaShift;
switch(depth) {
case 24:
pixels = (int *)tgaMalloc(4*width*height);
if((descriptor & RIGHT_ORIGIN) != 0) {
if((descriptor & UPPER_ORIGIN) != 0) {
// UpperRight
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int index = offset+3*width*i+3*j;
int b = bytes[index+0] & 0xFF;
int g = bytes[index+1] & 0xFF;
int r = bytes[index+2] & 0xFF;
int a = 0xFF;
pixels[width*i+(width-j-1)] = (r<<rs) | (g<<gs) | (b<<bs) | (a<<as);
}
}
}
else {
// LowerRight
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int index = offset+3*width*i+3*j;
int b = bytes[index+0] & 0xFF;
int g = bytes[index+1] & 0xFF;
int r = bytes[index+2] & 0xFF;
int a = 0xFF;
pixels[width*(height-i-1)+(width-j-1)] = (r<<rs) | (g<<gs) | (b<<bs) | (a<<as);
}
}
}
}
else {
if((descriptor & UPPER_ORIGIN) != 0) {
// UpperLeft
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int index = offset+3*width*i+3*j;
int b = bytes[index+0] & 0xFF;
int g = bytes[index+1] & 0xFF;
int r = bytes[index+2] & 0xFF;
int a = 0xFF;
pixels[width*i+j] = (r<<rs) | (g<<gs) | (b<<bs) | (a<<as);
}
}
}
else {
// LowerLeft
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int index = offset+3*width*i+3*j;
int b = bytes[index+0] & 0xFF;
int g = bytes[index+1] & 0xFF;
int r = bytes[index+2] & 0xFF;
int a = 0xFF;
pixels[width*(height-i-1)+j] = (r<<rs) | (g<<gs) | (b<<bs) | (a<<as);
}
}
}
}
break;
case 32:
pixels = (int *)tgaMalloc(4*width*height);
if((descriptor & RIGHT_ORIGIN) != 0) {
if((descriptor & UPPER_ORIGIN) != 0) {
// UpperRight
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int index = offset+4*width*i+4*j;
int b = bytes[index+0] & 0xFF;
int g = bytes[index+1] & 0xFF;
int r = bytes[index+2] & 0xFF;
int a = bytes[index+3] & 0xFF;
pixels[width*i+(width-j-1)] = (r<<rs) | (g<<gs) | (b<<bs) | (a<<as);
}
}
}
else {
// LowerRight
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int index = offset+4*width*i+4*j;
int b = bytes[index+0] & 0xFF;
int g = bytes[index+1] & 0xFF;
int r = bytes[index+2] & 0xFF;
int a = bytes[index+3] & 0xFF;
pixels[width*(height-i-1)+(width-j-1)] = (r<<rs) | (g<<gs) | (b<<bs) | (a<<as);
}
}
}
}
else {
if((descriptor & UPPER_ORIGIN) != 0) {
// UpperLeft
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int index = offset+4*width*i+4*j;
int b = bytes[index+0] & 0xFF;
int g = bytes[index+1] & 0xFF;
int r = bytes[index+2] & 0xFF;
int a = bytes[index+3] & 0xFF;
pixels[width*i+j] = (r<<rs) | (g<<gs) | (b<<bs) | (a<<as);
}
}
}
else {
// LowerLeft
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int index = offset+4*width*i+4*j;
int b = bytes[index+0] & 0xFF;
int g = bytes[index+1] & 0xFF;
int r = bytes[index+2] & 0xFF;
int a = bytes[index+3] & 0xFF;
pixels[width*(height-i-1)+j] = (r<<rs) | (g<<gs) | (b<<bs) | (a<<as);
}
}
}
}
break;
default:
break;
}
return pixels;
}
static int *createPixelsFromGrayscale(int width, int height, int depth, const unsigned char *bytes, int offset, int descriptor, const TGA_ORDER *order) {
int *pixels = NULL;
int rs = order->redShift;
int gs = order->greenShift;
int bs = order->blueShift;
int as = order->alphaShift;
switch(depth) {
case 8:
pixels = (int *)tgaMalloc(4*width*height);
if((descriptor & RIGHT_ORIGIN) != 0) {
if((descriptor & UPPER_ORIGIN) != 0) {
// UpperRight
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int e = bytes[offset+width*i+j] & 0xFF;
int a = 0xFF;
pixels[width*i+(width-j-1)] = (e<<rs) | (e<<gs) | (e<<bs) | (a<<as);
}
}
}
else {
// LowerRight
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int e = bytes[offset+width*i+j] & 0xFF;
int a = 0xFF;
pixels[width*(height-i-1)+(width-j-1)] = (e<<rs) | (e<<gs) | (e<<bs) | (a<<as);
}
}
}
}
else {
if((descriptor & UPPER_ORIGIN) != 0) {
// UpperLeft
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int e = bytes[offset+width*i+j] & 0xFF;
int a = 0xFF;
pixels[width*i+j] = (e<<rs) | (e<<gs) | (e<<bs) | (a<<as);
}
}
}
else {
// LowerLeft
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int e = bytes[offset+width*i+j] & 0xFF;
int a = 0xFF;
pixels[width*(height-i-1)+j] = (e<<rs) | (e<<gs) | (e<<bs) | (a<<as);
}
}
}
}
break;
case 16:
pixels = (int *)tgaMalloc(4*width*height);
if((descriptor & RIGHT_ORIGIN) != 0) {
if((descriptor & UPPER_ORIGIN) != 0) {
// UpperRight
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int e = bytes[offset+2*width*i+2*j+0] & 0xFF;
int a = bytes[offset+2*width*i+2*j+1] & 0xFF;
pixels[width*i+(width-j-1)] = (e<<rs) | (e<<gs) | (e<<bs) | (a<<as);
}
}
}
else {
// LowerRight
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int e = bytes[offset+2*width*i+2*j+0] & 0xFF;
int a = bytes[offset+2*width*i+2*j+1] & 0xFF;
pixels[width*(height-i-1)+(width-j-1)] = (e<<rs) | (e<<gs) | (e<<bs) | (a<<as);
}
}
}
}
else {
if((descriptor & UPPER_ORIGIN) != 0) {
// UpperLeft
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int e = bytes[offset+2*width*i+2*j+0] & 0xFF;
int a = bytes[offset+2*width*i+2*j+1] & 0xFF;
pixels[width*i+j] = (e<<rs) | (e<<gs) | (e<<bs) | (a<<as);
}
}
}
else {
// LowerLeft
int i, j;
for(i=0; i<height; i++) {
for(j=0; j<width; j++) {
int e = bytes[offset+2*width*i+2*j+0] & 0xFF;
int a = bytes[offset+2*width*i+2*j+1] & 0xFF;
pixels[width*(height-i-1)+j] = (e<<rs) | (e<<gs) | (e<<bs) | (a<<as);
}
}
}
}
break;
default:
break;
}
return pixels;
}
/* EOF */

48
src/tga_reader.h Normal file
View File

@ -0,0 +1,48 @@
/**
* tga_reader.h
*
* Copyright (c) 2014 Kenji Sasaki
* Released under the MIT license.
* https://github.com/npedotnet/TGAReader/blob/master/LICENSE
*
* English document
* https://github.com/npedotnet/TGAReader/blob/master/README.md
*
* Japanese document
* http://3dtech.jp/wiki/index.php?TGAReader
*
*/
#ifndef __TGA_READER_H__
#define __TGA_READER_H__
#include <stdio.h>
#include <stdlib.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _TGA_ORDER {
int redShift;
int greenShift;
int blueShift;
int alphaShift;
} TGA_ORDER;
const TGA_ORDER *TGA_READER_ARGB;
const TGA_ORDER *TGA_READER_ABGR;
const TGA_ORDER *TGA_READER_RGBA;
void *tgaMalloc(size_t size);
void tgaFree(void *memory);
int tgaGetWidth(const unsigned char *buffer);
int tgaGetHeight(const unsigned char *buffer);
int *tgaRead(const unsigned char *buffer, const TGA_ORDER *order);
#ifdef __cplusplus
}
#endif
#endif /* __TGA_READER_H__ */