FreeCalypso > hg > freecalypso-reveng
diff frbl/reconst/serial.c @ 328:0029db632547
frbl/reconst/serial.c: first static function reconstructed
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Fri, 06 Mar 2020 07:08:58 +0000 |
parents | |
children | 63d3afd14523 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/frbl/reconst/serial.c Fri Mar 06 07:08:58 2020 +0000 @@ -0,0 +1,42 @@ +#include "main/sys_types.h" +#include "serial.h" +#include "convert.h" + +static const SYS_UWORD32 S0_expect[7] = {6, 0, 0, 'H', 'D', 'R', 0x1B}; +static const SYS_UWORD32 S7_expect[6] = {5, 0, 0, 0, 0, 0xFA}; + +static const SYS_UWORD32 uart_base[2] = {0xFFFF5800, 0xFFFF5000}; + +static SYS_UWORD32 bss_0; +static SYS_UWORD8 bss_4; +static SYS_UWORD8 bss_5; +static SYS_UWORD8 bss_6; +static SYS_UWORD8 bss_7; +static SYS_UWORD8 bss_8; +static SYS_UWORD32 bss_0xc; +static SYS_UWORD8 bss_0x10; +static SYS_UWORD16 bss_0x12; + +static SYS_UWORD32 +static_func_0x0(SYS_UWORD8 arg1, SYS_UWORD32 *arg2, SYS_UWORD32 *arg3, + SYS_UWORD16 *arg4) +{ + SYS_UWORD32 retval; + + bss_5 += arg1; + if (bss_6) { + bss_0x12 += arg1; + *arg4 = bss_0x12; + *arg2 = 0; + retval = 0; + } else { + *arg3 += 2; + bss_0x12 = arg1 << 8; + retval = 1; + } + bss_6 = ~bss_6 & 1; + bss_0x10--; + if (bss_0x10 == 0) + bss_0xc = 6; + return retval; +}