Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Manual RE of Terminal Data Systems (TDS) tablet firmware for Quantel devices
- uint8_t regs[0x100];
- uint8_t mem[0x80];
- label4e1:
- enable_interrupts();
- mem[0x1f] &= ~1;
- if (P2.6 == 0)
- mem[0x1f] |= 1;
- if (P2.5 == 0)
- {
- // 4f2
- if (mem[0x4f] & 1)
- {
- // 4f7
- P3.5 = 0;
- }
- else
- {
- // 4fc
- P3.5 = 1;
- }
- goto label052d;
- }
- else
- {
- // 501
- P3.5 = 1;
- mem[0x2d] = 0;
- if (mem[0x38] != 0x03)
- {
- // 50b
- mem[0x3b] = 0;
- mem[0x3c] = 0;
- mem[0x3d] = 0;
- mem[0x3e] = 0;
- mem[0x3f] = 0;
- goto label0615;
- }
- else
- {
- // 518
- if (mem[0x3a] == 0)
- {
- // 51e
- if (BIT(mem[0x4f], 0))
- {
- // 524
- if (!BIT(mem[0x4f], 7))
- {
- goto label05d5;
- }
- else
- {
- goto label0615;
- }
- }
- else
- {
- goto label0615;
- }
- }
- else
- {
- goto label0615;
- }
- }
- }
- label052d:
- regs[0x3e] = regs[0x3d];
- if (--mem[0x67])
- {
- // 537
- mem[0x67] = 0x40;
- disable_interrupts();
- regs[0x30] = *(uint8_t *)0x6005;
- regs[0x30] = ~((regs[0x30] >> 4) | (regs[0x30] << 4));
- if (BIT(mem[0x7e], 2))
- {
- // 548
- uint8_t regs[0x31] = regs[0x30];
- regs[0x30] &= 0x05;
- if (BIT(regs[0x31], 1))
- {
- regs[0x30] |= (1 << 3);
- }
- if (BIT(regs[0x31], 3))
- {
- regs[0x30] |= (1 << 1);
- }
- }
- regs[0x30] &= 0x0f;
- if (regs[0x30] == regs[0x3b] &&
- regs[0x30] == regs[0x3c])
- {
- regs[0x3d] = regs[0x30];
- }
- // 56a
- regs[0x3c] = regs[0x3b];
- regs[0x3b] = regs[0x30];
- enable_interrupts();
- }
- // 0571
RAW Paste Data