aboutsummaryrefslogtreecommitdiff
path: root/src/libui_sdl/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libui_sdl/main.cpp')
-rw-r--r--src/libui_sdl/main.cpp57
1 files changed, 1 insertions, 56 deletions
diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp
index f65b9d1..fcc0dd3 100644
--- a/src/libui_sdl/main.cpp
+++ b/src/libui_sdl/main.cpp
@@ -1683,7 +1683,7 @@ void ApplyNewSettings(int type)
EmuRunning = prevstatus;
}
-u16 zogg(u16 val) { return (val>>8)|(val<<8);}
+
int main(int argc, char** argv)
{
srand(time(NULL));
@@ -1691,61 +1691,6 @@ int main(int argc, char** argv)
printf("melonDS " MELONDS_VERSION "\n");
printf(MELONDS_URL "\n");
- {
- /*u8 shit[] =
- {
- 0x84, 0x7A, 0x88, 0x1E, 0x8D, 0x1E, 0x34, 0x02, 0x86, 0xC5, 0x45, 0x2C, 0x08, 0x00, 0x45, 0x00,
- 0x00, 0x28, 0x12, 0x00, 0x00, 0x00, 0x80, 0x06, 0x37, 0x8D, 0xC0, 0xA8, 0x06, 0x5E, 0xA3, 0xAC,
- 0x86, 0x90, 0x9D, 0xC5, 0x14, 0x46, 0xF9, 0xE0, 0x5B, 0x65, 0x00, 0x00, 0x00, 0x00, 0x50, 0x02,
- 0x05, 0x78, 0x00, 0x00, 0x00, 0x00, 0x03, 0x69, 0x72, 0x63, 0x07, 0x67, 0x62, 0x61, 0x74, 0x65,
- 0x6D, 0x70, 0x03, 0x6E
- };*/
- u8 shit[] =
- {
- 0x00, 0xAB, 0x33, 0x28, 0x99, 0x44, 0x00, 0x09, 0xBF, 0x53, 0xC4, 0x49, 0x08, 0x00, 0x45, 0x00,
- 0x00, 0x28, 0x7E, 0x00, 0x00, 0x00, 0x80, 0x06, 0x48, 0x43, 0x0A, 0x40, 0x40, 0x10, 0xA3, 0xAC,
- 0x86, 0x90, 0x9C, 0x99, 0x14, 0x46, 0x31, 0x2F, 0x08, 0x59, 0x00, 0x00, 0x00, 0x00, 0x50, 0x02,
- 0x05, 0x78, 0x00, 0x00, 0x00, 0x00, 0x03, 0x69, 0x72, 0x63, 0x07, 0x67, 0x62, 0x61, 0x74, 0x65,
- 0x6D, 0x70, 0x03, 0x6E
- };
- // 4B76 (B489)
- u32 len=0x44;
- u8* ipheader = &shit[0xE];
- u8* protoheader = &shit[0x22];
- u32 tcplen = 0x14;//len-0x22;
-
- // TCP checksum
- u32 tmp = 0;
- *(u16*)&protoheader[16] = 0;
- tmp += zogg(*(u16*)&ipheader[12]);
- printf("%04X %04X\n", zogg(*(u16*)&ipheader[12]), tmp);
- tmp += zogg(*(u16*)&ipheader[14]);
- printf("%04X %04X\n", zogg(*(u16*)&ipheader[14]), tmp);
- tmp += zogg(*(u16*)&ipheader[16]);
- printf("%04X %04X\n", zogg(*(u16*)&ipheader[16]), tmp);
- tmp += zogg(*(u16*)&ipheader[18]);
- printf("%04X %04X\n", zogg(*(u16*)&ipheader[18]), tmp);
- tmp += zogg(0x0600);
- printf("%04X %04X\n", zogg(0x600), tmp);
- tmp += tcplen;
- printf("%04X %04X\n", tcplen, tmp);
- for (u8* i = protoheader; i < &protoheader[tcplen-1]; i += 2)
- {
- tmp += zogg(*(u16*)i);
- printf("plarff: %d (%d) -> %04X %04X\n",
- (u32)(i-protoheader), (u32)(i-&shit[0]),
- zogg(*(u16*)i), tmp);
- }
- if (tcplen & 1) tmp += (protoheader[tcplen-1] << 8);
- printf("tmp1=%04X\n", tmp);
- while (tmp >> 16)
- tmp = (tmp & 0xFFFF) + (tmp >> 16);
- printf("tmp2=%04X\n", tmp);
- tmp ^= 0xFFFF;
- printf("chk = %04X\n", (tmp));
- printf("expected = B1D5, bad = 2E8C\n");
- }
-
if (argc > 0 && strlen(argv[0]) > 0)
{
int len = strlen(argv[0]);