#include "sci.h"
#include "vend.h"
#include "xmodem.h"
-#include "sha1.h"
+//#include "sha1.h"
u8 last_standalone;
u8 last_switch_input;
send_string("Writing to serial port (maybe). Size is 0x");
send_string(u82hex(_rom_src_len >> 8));
send_string(u82hex(_rom_src_len & 0xff));
+ send_string("@0x");
+ send_string(u82hex((u16)(&_rom_src_data) >> 8));
+ send_string(u82hex((u16)(&_rom_src_data) & 0xff));
send_string(" with signature ");
s[0] = _rom_src_data[0];
s[1] = _rom_src_data[1];
send_string(CRLF " Type YES to download rom.tar.bz2 via XMODEM: ");
msg_clr();
while (!sci_have_packet); /* spin */
- if (!my_strncmp("YES", (char*)sci_rx_buf, 3)) return;
+ if (!my_strncmp("YES", (char*)sci_rx_buf, 3)) {
+ send_string(CRLF "Transfer cancelled." CRLF);
+ return;
+ }
sci_init();
sci_doing_xmodem = 1;
char *end = (char*)_rom_src_data+_rom_src_len;
bool aborted = 0;
while (1) {
- if (!xmodem_send_packet((char*)p, 128)) {
- aborted = 1;
- break;
- }
- p += 128;
if (p + 128 > end) {
/* send partial packet */
if (!xmodem_send_packet((char*)p, end-p)) aborted = 1;
break;
+ } if ((u16)p == 0xb600) {
+ /* we have an eeprom here. skip it. */
+ p += 0x0200;
+ continue;
+ } else if (!xmodem_send_packet((char*)p, 128)) {
+ aborted = 1;
+ break;
}
+ p += 128;
}
xmodem_finish_xfer();
set_msg(" CRUEL ");
- //comm_init();
//coinmech_init();
sci_init();
keypad_init();
last_door_open = door_open();
send_door_msg(last_door_open);
chime_start();
- set_msg(last_door_open?"DOOR OPEN ":"DOOR CLOSE");
+ if (is_standalone())
+ set_msg(last_door_open?"DOOR OPEN ":"DOOR CLOSE");
}
if (last_standalone != is_standalone()) {