mirror of https://github.com/zeldaret/tp.git
NONMATCHING drawChar__14JUTDirectPrintFiii
This commit is contained in:
parent
a998dca498
commit
35631bf4ff
|
@ -22,8 +22,8 @@ public:
|
|||
/* 802E4798 */ void setCharColor(JUtility::TColor);
|
||||
|
||||
static u8 sAsciiTable[128];
|
||||
static void* sFontData[64];
|
||||
static void* sFontData2[77];
|
||||
static u32 sFontData[64];
|
||||
static u32 sFontData2[77];
|
||||
static JUTDirectPrint* sDirectPrint;
|
||||
static u8 sDirectPrint_padding[4 /* padding */];
|
||||
|
||||
|
|
|
@ -82,7 +82,7 @@ void JUTDirectPrint::erase(int x, int y, int width, int height) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (400 < mFrameBufferWidth) {
|
||||
if (400 < mFrameBufferWidth) {
|
||||
x = x << 1;
|
||||
width = width << 1;
|
||||
}
|
||||
|
@ -119,187 +119,163 @@ SECTION_DATA u8 JUTDirectPrint::sAsciiTable[128] = {
|
|||
/* 803CC738-803CC838 -00001 0100+00 0/1 0/0 0/0 .data sFontData__14JUTDirectPrint */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DATA void* JUTDirectPrint::sFontData[64] = {
|
||||
(void*)0x70871C30,
|
||||
(void*)0x8988A250,
|
||||
(void*)0x88808290,
|
||||
(void*)0x88830C90,
|
||||
(void*)0x888402F8,
|
||||
(void*)0x88882210,
|
||||
(void*)0x71CF9C10,
|
||||
(void*)0xF9CF9C70,
|
||||
(void*)0x8208A288,
|
||||
(void*)0xF200A288,
|
||||
(void*)0x0BC11C78,
|
||||
(void*)0x0A222208,
|
||||
(void*)0x8A222208,
|
||||
(void*)0x71C21C70,
|
||||
(void*)0x23C738F8,
|
||||
(void*)0x5228A480,
|
||||
(void*)0x8A282280,
|
||||
(void*)0x8BC822F0,
|
||||
(void*)0xFA282280,
|
||||
(void*)0x8A28A480,
|
||||
(void*)0x8BC738F8,
|
||||
(void*)0xF9C89C08,
|
||||
(void*)0x82288808,
|
||||
(void*)0x82088808,
|
||||
(void*)0xF2EF8808,
|
||||
(void*)0x82288888,
|
||||
(void*)0x82288888,
|
||||
(void*)0x81C89C70,
|
||||
(void*)0x8A08A270,
|
||||
(void*)0x920DA288,
|
||||
(void*)0xA20AB288,
|
||||
(void*)0xC20AAA88,
|
||||
(void*)0xA208A688,
|
||||
(void*)0x9208A288,
|
||||
(void*)0x8BE8A270,
|
||||
(void*)0xF1CF1CF8,
|
||||
(void*)0x8A28A220,
|
||||
(void*)0x8A28A020,
|
||||
(void*)0xF22F1C20,
|
||||
(void*)0x82AA0220,
|
||||
(void*)0x82492220,
|
||||
(void*)0x81A89C20,
|
||||
(void*)0x8A28A288,
|
||||
(void*)0x8A28A288,
|
||||
(void*)0x8A289488,
|
||||
(void*)0x8A2A8850,
|
||||
(void*)0x894A9420,
|
||||
(void*)0x894AA220,
|
||||
(void*)0x70852220,
|
||||
(void*)0xF8011000,
|
||||
(void*)0x08020800,
|
||||
(void*)0x10840400,
|
||||
(void*)0x20040470,
|
||||
(void*)0x40840400,
|
||||
(void*)(((char*)fpcBs_Delete__FP18base_process_class) + 0x44),
|
||||
(void*)0xF8011000,
|
||||
(void*)0x70800000,
|
||||
(void*)0x88822200,
|
||||
(void*)0x08820400,
|
||||
(void*)0x108F8800,
|
||||
(void*)0x20821000,
|
||||
(void*)0x00022200,
|
||||
(void*)0x20800020,
|
||||
(void*)NULL,
|
||||
SECTION_DATA u32 JUTDirectPrint::sFontData[64] = {
|
||||
0x70871C30, 0x8988A250, 0x88808290, 0x88830C90, 0x888402F8, 0x88882210, 0x71CF9C10, 0xF9CF9C70,
|
||||
0x8208A288, 0xF200A288, 0x0BC11C78, 0x0A222208, 0x8A222208, 0x71C21C70, 0x23C738F8, 0x5228A480,
|
||||
0x8A282280, 0x8BC822F0, 0xFA282280, 0x8A28A480, 0x8BC738F8, 0xF9C89C08, 0x82288808, 0x82088808,
|
||||
0xF2EF8808, 0x82288888, 0x82288888, 0x81C89C70, 0x8A08A270, 0x920DA288, 0xA20AB288, 0xC20AAA88,
|
||||
0xA208A688, 0x9208A288, 0x8BE8A270, 0xF1CF1CF8, 0x8A28A220, 0x8A28A020, 0xF22F1C20, 0x82AA0220,
|
||||
0x82492220, 0x81A89C20, 0x8A28A288, 0x8A28A288, 0x8A289488, 0x8A2A8850, 0x894A9420, 0x894AA220,
|
||||
0x70852220, 0xF8011000, 0x08020800, 0x10840400, 0x20040470, 0x40840400, 0x80020800, 0xF8011000,
|
||||
0x70800000, 0x88822200, 0x08820400, 0x108F8800, 0x20821000, 0x00022200, 0x20800020, 0x00000000,
|
||||
};
|
||||
#pragma pop
|
||||
|
||||
/* 803CC838-803CC96C -00001 0134+00 0/1 0/0 0/0 .data sFontData2__14JUTDirectPrint */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DATA void* JUTDirectPrint::sFontData2[77] = {
|
||||
(void*)0x51421820,
|
||||
(void*)0x53E7A420,
|
||||
(void*)0x014A2C40,
|
||||
(void*)0x01471000,
|
||||
(void*)0x0142AA00,
|
||||
(void*)0x03EAA400,
|
||||
(void*)0x01471A78,
|
||||
(void*)NULL,
|
||||
(void*)0x50008010,
|
||||
(void*)0x20010820,
|
||||
(void*)0xF8020040,
|
||||
(void*)0x20420820,
|
||||
(void*)0x50441010,
|
||||
(void*)0x00880000,
|
||||
(void*)0x00070E00,
|
||||
(void*)0x01088840,
|
||||
(void*)0x78898820,
|
||||
(void*)0x004A8810,
|
||||
(void*)0x788A8810,
|
||||
(void*)0x01098808,
|
||||
(void*)0x00040E04,
|
||||
(void*)0x70800620,
|
||||
(void*)0x11400820,
|
||||
(void*)0x12200820,
|
||||
(void*)0x10001020,
|
||||
(void*)0x10000820,
|
||||
(void*)0x100F8820,
|
||||
(void*)0x70000620,
|
||||
(void*)0x60070000,
|
||||
(void*)0x110F82A0,
|
||||
(void*)0x12AA8AE0,
|
||||
(void*)0x084F92A0,
|
||||
(void*)0x100FBE1C,
|
||||
(void*)0x10089008,
|
||||
(void*)0x60070808,
|
||||
(void*)NULL,
|
||||
(void*)0x02000200,
|
||||
(void*)0x7A078270,
|
||||
(void*)0x8BC81E88,
|
||||
(void*)0x8A2822F8,
|
||||
(void*)0x9A282280,
|
||||
(void*)0x6BC79E78,
|
||||
(void*)0x30000000,
|
||||
(void*)0x48080810,
|
||||
(void*)0x41E80000,
|
||||
(void*)0x422F1830,
|
||||
(void*)0xFBE88810,
|
||||
(void*)0x40288890,
|
||||
(void*)0x43C89C60,
|
||||
(void*)0x81000000,
|
||||
(void*)0x81000000,
|
||||
(void*)0x990F3C70,
|
||||
(void*)0xA10AA288,
|
||||
(void*)0xE10AA288,
|
||||
(void*)0xA10AA288,
|
||||
(void*)0x98CAA270,
|
||||
(void*)NULL,
|
||||
(void*)0x00000020,
|
||||
(void*)0xF1EF1E20,
|
||||
(void*)0x8A28A0F8,
|
||||
(void*)0x8A281C20,
|
||||
(void*)0xF1E80220,
|
||||
(void*)(((char*)__dt__Q27JStudio29TFunctionValue_list_parameterFv) + 0x14),
|
||||
(void*)NULL,
|
||||
(void*)NULL,
|
||||
(void*)0x8A28B688,
|
||||
(void*)0x8A2A8888,
|
||||
(void*)0x8A2A8878,
|
||||
(void*)0x894A8808,
|
||||
(void*)0x788536F0,
|
||||
(void*)NULL,
|
||||
(void*)NULL,
|
||||
(void*)0xF8000000,
|
||||
(void*)0x10000000,
|
||||
(void*)0x20000000,
|
||||
(void*)0x40000000,
|
||||
(void*)0xF8000000,
|
||||
SECTION_DATA u32 JUTDirectPrint::sFontData2[77] = {
|
||||
0x51421820, 0x53E7A420, 0x014A2C40, 0x01471000, 0x0142AA00, 0x03EAA400, 0x01471A78, 0x00000000,
|
||||
0x50008010, 0x20010820, 0xF8020040, 0x20420820, 0x50441010, 0x00880000, 0x00070E00, 0x01088840,
|
||||
0x78898820, 0x004A8810, 0x788A8810, 0x01098808, 0x00040E04, 0x70800620, 0x11400820, 0x12200820,
|
||||
0x10001020, 0x10000820, 0x100F8820, 0x70000620, 0x60070000, 0x110F82A0, 0x12AA8AE0, 0x084F92A0,
|
||||
0x100FBE1C, 0x10089008, 0x60070808, 0x00000000, 0x02000200, 0x7A078270, 0x8BC81E88, 0x8A2822F8,
|
||||
0x9A282280, 0x6BC79E78, 0x30000000, 0x48080810, 0x41E80000, 0x422F1830, 0xFBE88810, 0x40288890,
|
||||
0x43C89C60, 0x81000000, 0x81000000, 0x990F3C70, 0xA10AA288, 0xE10AA288, 0xA10AA288, 0x98CAA270,
|
||||
0x00000000, 0x00000020, 0xF1EF1E20, 0x8A28A0F8, 0x8A281C20, 0xF1E80220, 0x80283C38, 0x00000000,
|
||||
0x00000000, 0x8A28B688, 0x8A2A8888, 0x8A2A8878, 0x894A8808, 0x788536F0, 0x00000000, 0x00000000,
|
||||
0xF8000000, 0x10000000, 0x20000000, 0x40000000, 0xF8000000,
|
||||
};
|
||||
#pragma pop
|
||||
|
||||
/* 803CC96C-803CC980 029A8C 0010+04 0/1 0/0 0/0 .data twiceBit$371 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DATA static u8 twiceBit[16 + 4 /* padding */] = {
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x03,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x0C,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x0F,
|
||||
/* padding */
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
SECTION_DATA static u32 twiceBit[4] = {
|
||||
0x00000000,
|
||||
0x00000003,
|
||||
0x0000000C,
|
||||
0x0000000F,
|
||||
};
|
||||
#pragma pop
|
||||
|
||||
/* 802E431C-802E456C 2DEC5C 0250+00 1/1 0/0 0/0 .text drawChar__14JUTDirectPrintFiii */
|
||||
#if NONMATCHING
|
||||
void JUTDirectPrint::drawChar(int position_x, int position_y, int ch) {
|
||||
int codepoint;
|
||||
if (100 <= ch)
|
||||
codepoint = ch - 100;
|
||||
else
|
||||
codepoint = ch;
|
||||
|
||||
u32 col_index = (codepoint % 5) * 6;
|
||||
u32 row_index = (codepoint / 5) * 7;
|
||||
|
||||
u32* font_data;
|
||||
if (100 > ch)
|
||||
font_data = sFontData + row_index;
|
||||
else
|
||||
font_data = sFontData2 + row_index;
|
||||
|
||||
s32 scale_x;
|
||||
if (mFrameBufferWidth < 400)
|
||||
scale_x = 1;
|
||||
else
|
||||
scale_x = 2;
|
||||
|
||||
s32 scale_y;
|
||||
if (mFrameBufferHeight < 300)
|
||||
scale_y = 1;
|
||||
else
|
||||
scale_y = 2;
|
||||
|
||||
u16* pixel = mFrameBuffer + mWidthStride * position_y * scale_y + position_x * scale_x;
|
||||
for (int y = 0; y < 7; y++) {
|
||||
u32 data = *font_data << col_index;
|
||||
font_data += 1;
|
||||
|
||||
if (scale_x == 1) {
|
||||
data = data >> 1 & 0x7e000000;
|
||||
} else {
|
||||
u32 a = twiceBit[(data >> 26) & 3];
|
||||
u32 b = twiceBit[(data >> 28) & 3] << 4;
|
||||
u32 c = twiceBit[(data >> 30) & 3] << 8;
|
||||
data = (a | b | c) << 0x13;
|
||||
}
|
||||
|
||||
for (int x = 0; x < scale_x * 6; x += 2) {
|
||||
u16 u1;
|
||||
u16 u2;
|
||||
u16 u3;
|
||||
u16 u4;
|
||||
u16 value;
|
||||
|
||||
if (data & 0x40000000) {
|
||||
u1 = field_0x20;
|
||||
} else {
|
||||
u1 = 0x40;
|
||||
}
|
||||
|
||||
if (data & 0x80000000) {
|
||||
u2 = field_0x22;
|
||||
} else {
|
||||
u2 = 0x20;
|
||||
}
|
||||
|
||||
if (data & 0x20000000) {
|
||||
u3 = field_0x22;
|
||||
} else {
|
||||
u3 = 0x20;
|
||||
}
|
||||
|
||||
if (data & 0x40000000) {
|
||||
u4 = field_0x1C;
|
||||
} else {
|
||||
u4 = 0x00;
|
||||
}
|
||||
|
||||
value = u4 | (u2 + u1 + u3);
|
||||
pixel[0] = value;
|
||||
if (scale_y > 1)
|
||||
pixel[mWidthStride] = value;
|
||||
|
||||
if (data & 0x20000000) {
|
||||
u1 = field_0x26;
|
||||
} else {
|
||||
u1 = 0x40;
|
||||
}
|
||||
|
||||
if (data & 0x40000000) {
|
||||
u2 = field_0x28;
|
||||
} else {
|
||||
u2 = 0x20;
|
||||
}
|
||||
|
||||
if (data & 0x10000000) {
|
||||
u3 = field_0x28;
|
||||
} else {
|
||||
u3 = 0x20;
|
||||
}
|
||||
|
||||
if (data & 0x20000000) {
|
||||
u4 = field_0x1C;
|
||||
} else {
|
||||
u4 = 0x00;
|
||||
}
|
||||
|
||||
value = u4 | (u2 + u1 + u3);
|
||||
pixel[1] = value;
|
||||
if (scale_y > 1)
|
||||
pixel[1 + mWidthStride] = value;
|
||||
|
||||
data <<= 2;
|
||||
pixel += 2;
|
||||
}
|
||||
|
||||
pixel += mWidthStride * scale_y - scale_x * 6;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
|
@ -308,6 +284,7 @@ asm void JUTDirectPrint::drawChar(int param_0, int param_1, int param_2) {
|
|||
#include "asm/JSystem/JUtility/JUTDirectPrint/drawChar__14JUTDirectPrintFiii.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 802E456C-802E45A4 2DEEAC 0038+00 1/1 4/4 0/0 .text changeFrameBuffer__14JUTDirectPrintFPvUsUs
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue