Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // MCU i2c reg 0x20 handler
- sub_4140()
- {
- int a = *(reg_0x20);
- *(reg_0x20) = 0;
- if (a & 16)
- *(0xffe23) |= 0x80;
- if (a & 15)
- {
- if (a & 1)
- {
- *(0xff922) = 0;
- }
- else
- {
- if (a & 2)
- {
- sub_3e8(1, 3, 132); // 1 and 3 on stack. all vals technically have 0x02 as high byte (0x0201, 0x0203, 0x0284)
- *(0xfff00) &= 0xFD;
- *(0xfff20) &= 0xFD;
- *(0xfff03) &= 0xFE;
- }
- if (a & 4)
- {
- *(0xfff00) &= 0xFD;
- *(0xfff20) &= 0xFD;
- if (*0xffc39 == 0)
- *(0xfff03) &= 0xFE;
- sub_38ae();
- }
- if (a & 8)
- {
- *(0xfff03) &= 0xFE;
- }
- sub_2be(5);
- *(0xfff03) |= 1;
- sub_3e8(3, 3, 132);
- *(0xfff20) |= 1;
- sub_2d09();
- }
- }
- return;
- }
- // Wait loop/Watchdog timer setter?
- sub_2be(u8 n)
- {
- *0xfffab = 0xAC;
- for(u8 i = n ; i > 0; i--)
- {
- for(u16 j = 0x35C; j > 0; j--);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement