annotate frbl/reconst/command.c @ 326:a4b6b4e389b9

frbl/reconst/command.c: second function reconstruction close to perfect
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 06 Mar 2020 04:04:53 +0000
parents 24d7d7875ee9
children b5b8df53aa51
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
321
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 #include "main/sys_types.h"
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 #include "command.h"
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 long
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 com_analyze_request(SYS_UWORD8 *request_received, t_com_request *request)
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 {
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 SYS_WORD32 sp8;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 long sp12 = COM_SUCCESS;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 SYS_UWORD32 sp16, sp20;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 SYS_UWORD8 sp24;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 SYS_UWORD16 *sp28;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 SYS_UWORD16 sp32, sp34, sp36, sp38, sp40, sp42, sp44, sp46;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 sp20 = *request_received++;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 COM_COMMAND_WORD(request) = *request_received++;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 sp16 = 1;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 switch (COM_COMMAND_WORD(request)) {
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 case COM_READ_PARAMETERS: /* 0x26 */
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 sp16 += 2;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 sp34 = *request_received++;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 sp32 = *request_received++;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 COM_READ_PARAMS_OFFSET(request) = (sp34 << 8) + sp32;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 sp16 += 1;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 sp24 = *request_received++;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 COM_NUMBER_OF_PARAMS_READ(request) = sp24;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 if (sp24 > COM_MAX_NUMBER_OF_16BITS_DATA)
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 sp12 = COM_PARAMETER_ERROR;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 break;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 case COM_WRITE_PARAMETERS: /* 0x7a */
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 sp16 += 2;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 sp34 = *request_received++;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 sp32 = *request_received++;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 COM_WRITTEN_PARAMS_OFFSET(request) = (sp34 << 8) + sp32;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 sp16 += 1;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 sp24 = *request_received++;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 COM_NUMBER_OF_PARAMS_WRITTEN(request) = sp24;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 if (sp24 > COM_MAX_NUMBER_OF_16BITS_DATA) {
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 sp12 = COM_PARAMETER_ERROR;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 break;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 }
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 sp28 = COM_WRITTEN_PARAMS_LIST_ADDRESS(request);
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 for (sp8 = 0; sp8 < sp24; sp8++) {
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 sp38 = *request_received++;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 sp36 = *request_received++;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 *sp28++ = (sp38 << 8) + sp36;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 sp16 += 2;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 }
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 break;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 case COM_SEND_RUN_ADDRESS: /* 0x11e */
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 sp16 += 2;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 sp40 = *request_received++;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 sp42 = *request_received++;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 COM_ADDRESS_MSB(request) = (sp40 << 8) + sp42;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 sp16 += 2;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 sp44 = *request_received++;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 sp46 = *request_received++;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 COM_ADDRESS_LSB(request) = (sp44 << 8) + sp46;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 break;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 case COM_GET_MONITOR_ID:
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 case COM_GET_FLASH_ID:
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 case COM_GET_CHIP_ID:
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 case COM_GET_BOARD_ID:
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 case COM_ERASE_FLASH:
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 case COM_WRITE_DATA:
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 case COM_START_APPLICATION:
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 case COM_LOAD_APPLICATION:
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 break;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 default:
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 sp12 = COM_COMMAND_UNKNOWN;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 }
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 if (sp20 != sp16)
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 sp12 = COM_PARAMETER_ERROR;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 return sp12;
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 }
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 long
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 com_build_confirmation(t_com_confirmation *confirmation,
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 SYS_UWORD8 *confirmation_to_send)
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 {
326
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
80 SYS_WORD32 sp8;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
81 long sp12 = COM_SUCCESS;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
82 SYS_UWORD8 sp16;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
83 SYS_UWORD8 *sp20;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
84 SYS_UWORD8 sp24;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
85 SYS_UWORD16 *sp28;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
86 SYS_UWORD16 sp32;
321
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87
326
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
88 sp20 = confirmation_to_send++;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
89 *confirmation_to_send++ = COM_COMMAND_WORD(confirmation);
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
90 sp16 = 1;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
91 *confirmation_to_send++ = COM_RESULT(confirmation);
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
92 sp16++;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
93 switch (COM_COMMAND_WORD(confirmation)) {
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
94 case COM_GET_MONITOR_ID: /* 0x202 */
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
95 if (COM_RESULT(confirmation))
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
96 break;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
97 *confirmation_to_send++ = COM_MONITOR_ID(confirmation);
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
98 *confirmation_to_send++ =
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
99 COM_MONITOR_VERSION_FIRST_NBR(confirmation);
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
100 *confirmation_to_send++ =
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
101 COM_MONITOR_VERSION_SECOND_NBR(confirmation);
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
102 sp16 += 3;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
103 break;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
104 case COM_GET_FLASH_ID: /* 0x23c */
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
105 if (COM_RESULT(confirmation))
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
106 break;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
107 *confirmation_to_send++ = COM_FLASH_ID(confirmation);
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
108 sp16++;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
109 break;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
110 case COM_GET_CHIP_ID: /* 0x25a */
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
111 if (COM_RESULT(confirmation))
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
112 break;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
113 *confirmation_to_send++ = COM_CHIP_ID(confirmation);
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
114 sp16++;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
115 break;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
116 case COM_GET_BOARD_ID: /* 0x266 */
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
117 if (COM_RESULT(confirmation))
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
118 break;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
119 *confirmation_to_send++ = COM_BOARD_ID(confirmation);
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
120 sp16++;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
121 break;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
122 case COM_ERASE_FLASH:
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
123 break;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
124 case COM_WRITE_DATA: /* 0x272 */
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
125 if (COM_RESULT(confirmation))
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
126 break;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
127 sp32 = COM_FILE_CHECKSUM(confirmation);
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
128 *confirmation_to_send++ = (sp32 & 0xFF00) >> 8;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
129 *confirmation_to_send++ = sp32 & 0xFF;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
130 sp32 = COM_FLASH_CHECKSUM(confirmation);
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
131 *confirmation_to_send++ = (sp32 & 0xFF00) >> 8;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
132 *confirmation_to_send++ = sp32 & 0xFF;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
133 sp16 += 4;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
134 break;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
135 case COM_START_APPLICATION: /* 0x2dc */
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
136 if (COM_RESULT(confirmation))
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
137 break;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
138 *confirmation_to_send++ = COM_STARTING_STATE(confirmation);
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
139 sp16++;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
140 break;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
141 case COM_READ_PARAMETERS: /* 0x2e8 */
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
142 if (COM_RESULT(confirmation))
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
143 break;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
144 sp16++;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
145 sp24 = COM_NUMBER_OF_PARAMS_READ(confirmation);
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
146 *confirmation_to_send++ = sp24;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
147 if (sp24 > COM_MAX_NUMBER_OF_16BITS_DATA) {
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
148 sp12 = COM_PARAMETER_ERROR;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
149 break;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
150 }
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
151 sp28 = COM_READ_PARAMS_LIST_ADDRESS(confirmation);
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
152 for (sp8 = 0; sp8 < sp24; sp8++) {
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
153 *confirmation_to_send++ = (*sp28 & 0xFF00) >> 8;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
154 *confirmation_to_send++ = *sp28++ & 0xFF;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
155 sp16 += 2;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
156 }
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
157 case COM_WRITE_PARAMETERS:
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
158 break;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
159 case COM_LOAD_APPLICATION: /* 0x374 */
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
160 if (COM_RESULT(confirmation))
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
161 break;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
162 sp32 = COM_FILE_RAM_CHECKSUM(confirmation);
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
163 *confirmation_to_send++ = (sp32 & 0xFF00) >> 8;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
164 *confirmation_to_send++ = sp32 & 0xFF;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
165 sp32 = COM_RAM_CHECKSUM(confirmation);
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
166 *confirmation_to_send++ = (sp32 & 0xFF00) >> 8;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
167 *confirmation_to_send++ = sp32 & 0xFF;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
168 sp16 += 4;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
169 break;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
170 case COM_SEND_RUN_ADDRESS:
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
171 break;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
172 default:
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
173 sp12 = COM_COMMAND_UNKNOWN;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
174 }
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
175 *sp20 = sp16;
a4b6b4e389b9 frbl/reconst/command.c: second function reconstruction close to perfect
Mychaela Falconia <falcon@freecalypso.org>
parents: 321
diff changeset
176 return sp12;
321
24d7d7875ee9 frbl/reconst/command.c: first function reconstructed
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177 }