# HG changeset patch # User Mychaela Falconia # Date 1583478538 0 # Node ID 0029db63254773af28dd43f14daaf4ad1032ffd7 # Parent b5b8df53aa5190918d28dc1f812c54638d5e0063 frbl/reconst/serial.c: first static function reconstructed diff -r b5b8df53aa51 -r 0029db632547 frbl/reconst/Makefile --- a/frbl/reconst/Makefile Fri Mar 06 04:10:21 2020 +0000 +++ b/frbl/reconst/Makefile Fri Mar 06 07:08:58 2020 +0000 @@ -1,7 +1,7 @@ CFLAGS= -mn -mt -mw -me -pw2 CPPFLAGS=-DTOOL_CHOICE=0 -D_TMS470 -I. -Iinc -OBJS= boot.obj command.obj convert.obj -DISASM= boot.disasm command.disasm convert.disasm +OBJS= boot.obj command.obj convert.obj serial.obj +DISASM= boot.disasm command.disasm convert.disasm serial.disasm all: ${OBJS} ${DISASM} diff -r b5b8df53aa51 -r 0029db632547 frbl/reconst/serial.c --- /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; +}