diff --git a/.gitignore b/.gitignore index a0e63280..6a5e49bd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,9 @@ *.bin -*.c~ +*~ *.cas *.d88 -*.h~ *.swp +*.err .vscode/ .vscode/c_cpp_properties.json .vscode/settings.json @@ -13,6 +13,8 @@ autorun autorun.atr autorun.rmm build +_cache +r2r config config.com config.com.lbl diff --git a/src/adam/screen.h b/src/adam/screen.h index 3297616b..1a039df3 100644 --- a/src/adam/screen.h +++ b/src/adam/screen.h @@ -38,18 +38,18 @@ void screen_hosts_and_devices_edit_host_slot(unsigned char i); void screen_hosts_and_devices_eject(unsigned char ds); void screen_hosts_and_devices_host_slot_empty(unsigned char hs); -void screen_hosts_and_devices_long_filename(char *f); +void screen_hosts_and_devices_long_filename(const char *f); void screen_show_info(bool printerEnabled,AdapterConfig* ac); void screen_select_file(void); void screen_select_file_display(char *p, char *f); -void screen_select_file_display_long_filename(char *e); +void screen_select_file_display_long_filename(const char *e); void screen_select_file_clear_long_filename(void); void screen_select_file_filter(void); void screen_select_file_next(void); void screen_select_file_prev(void); -void screen_select_file_display_entry(unsigned char y, char* e, unsigned entryType); +void screen_select_file_display_entry(unsigned char y, const char* e, unsigned entryType); void screen_select_file_choose(char visibleEntries); void screen_select_file_new_type(void); void screen_select_file_new_size(unsigned char k); diff --git a/src/apple2/screen.c b/src/apple2/screen.c index 5b6e2de7..dacf3eaa 100644 --- a/src/apple2/screen.c +++ b/src/apple2/screen.c @@ -344,7 +344,7 @@ const char* screen_hosts_and_devices_device_slot(unsigned char hs, bool e, char return &empty[0]; } -char* screen_hosts_and_devices_slot(char *c) +const char* screen_hosts_and_devices_slot(const char *c) { return c[0]==0x00 ? empty : c; } @@ -561,7 +561,7 @@ void screen_select_file_prev(void) } #pragma warn (unused-param, push, off) -void screen_select_file_display_long_filename(char *e) +void screen_select_file_display_long_filename(const char *e) { // it wasn't this. /* gotoxy(0,19); */ @@ -575,7 +575,7 @@ void screen_select_file_next(void) } #pragma warn (unused-param, push, off) -void screen_select_file_display_entry(unsigned char y, char* e, unsigned entryType) +void screen_select_file_display_entry(unsigned char y, const char* e, unsigned entryType) { gotoxy(0,y+3); cprintf("%-40s",&e[2]); // skip the first two chars from FN (hold over from Adam) @@ -693,7 +693,7 @@ void screen_select_file_new_name(void) screen_print_menu(" New media: Enter filename \r\n",""); } -void screen_hosts_and_devices_long_filename(char *f) +void screen_hosts_and_devices_long_filename(const char *f) { // TODO: implement if (strlen(f)>31) diff --git a/src/apple2/screen.h b/src/apple2/screen.h index e14cb770..1bd496f0 100644 --- a/src/apple2/screen.h +++ b/src/apple2/screen.h @@ -54,14 +54,14 @@ void screen_select_file_filter(void); void screen_select_file_next(void); void screen_select_file_new_type(void); void screen_select_file_prev(void); -void screen_select_file_display_long_filename(char *e); -void screen_select_file_display_entry(unsigned char y, char* e, unsigned entryType); +void screen_select_file_display_long_filename(const char *e); +void screen_select_file_display_entry(unsigned char y, const char* e, unsigned entryType); void screen_select_file_clear_long_filename(void); void screen_select_file_choose(char visibleEntries); void screen_select_file_new_size(unsigned char k); void screen_select_file_new_custom(void); void screen_select_file_new_name(void); -void screen_hosts_and_devices_long_filename(char *f); +void screen_hosts_and_devices_long_filename(const char *f); void screen_hosts_and_devices_devices_clear_all(void); void screen_select_file_new_creating(void); diff --git a/src/atari/bar.c b/src/atari/bar.c index 41080aae..1e43e2d2 100644 --- a/src/atari/bar.c +++ b/src/atari/bar.c @@ -15,7 +15,7 @@ static unsigned char bar_y=1; /** * Clear bar from screen */ -void bar_clear(bool old) +void bar_clear(bool) { memset(bar_pmbase,0,1024); } @@ -100,4 +100,4 @@ void fastcall bar_show(unsigned char y) } -#endif \ No newline at end of file +#endif diff --git a/src/atari/input.c b/src/atari/input.c index b70e673d..707d3849 100644 --- a/src/atari/input.c +++ b/src/atari/input.c @@ -84,7 +84,7 @@ unsigned char input_handle_joystick(void) return 0; } -void input_line(unsigned char x, unsigned char y, unsigned char o, char *c, unsigned char l, bool password) +void input_line(unsigned char, unsigned char, unsigned char, char *, unsigned char, bool) { } @@ -107,7 +107,7 @@ void input_line_set_wifi_password(char *c) edit_line(0, 21, c, 64, true); } -void input_line_hosts_and_devices_host_slot(unsigned char i, unsigned char o, char *c) +void input_line_hosts_and_devices_host_slot(unsigned char i, unsigned char, char *c) { edit_line(5, i + HOSTS_START_Y, c, 32, false); } @@ -123,7 +123,7 @@ unsigned char input_select_file_new_type(void) return 1; } -unsigned long input_select_file_new_size(unsigned char t) +unsigned long input_select_file_new_size(unsigned char) { char temp[8]; memset(temp, 0, sizeof(temp)); @@ -198,9 +198,10 @@ void input_select_file_new_name(char *c) bool input_select_slot_build_eos_directory(void) { + return false; } -void input_select_slot_build_eos_directory_label(char *c) +void input_select_slot_build_eos_directory_label(char *) { } @@ -345,13 +346,13 @@ HDSubState input_hosts_and_devices_hosts(void) return HD_HOSTS; case KCODE_RETURN: selected_host_slot = bar_get() - HOSTS_START_Y; - if ( !wifiEnabled && strcmp(hostSlots[selected_host_slot],"SD") != 0) // Don't go in a TNFS host if wifi is disabled. + if ( !wifiEnabled && strcmp((char *) hostSlots[selected_host_slot],"SD") != 0) // Don't go in a TNFS host if wifi is disabled. { return HD_HOSTS; } if (hostSlots[selected_host_slot][0] != 0) { - strcpy(selected_host_name, hostSlots[selected_host_slot]); + strcpy(selected_host_name, (char *) hostSlots[selected_host_slot]); state = SELECT_FILE; return HD_DONE; } @@ -433,13 +434,13 @@ HDSubState input_hosts_and_devices_devices(void) // set device mode to read selected_device_slot = bar_get() - DEVICES_START_Y; hosts_and_devices_devices_set_mode(MODE_READ); - screen_hosts_and_devices_device_slots(DEVICES_START_Y, &deviceSlots[0], ""); + screen_hosts_and_devices_device_slots(DEVICES_START_Y, &deviceSlots[0], (bool *) ""); return HD_DEVICES; case 'W': // set device mode to write selected_device_slot = bar_get() - DEVICES_START_Y; hosts_and_devices_devices_set_mode(MODE_WRITE); - screen_hosts_and_devices_device_slots(DEVICES_START_Y, &deviceSlots[0], ""); + screen_hosts_and_devices_device_slots(DEVICES_START_Y, &deviceSlots[0], (bool *) ""); return HD_DEVICES; case 'C': state = SHOW_INFO; diff --git a/src/atari/io.c b/src/atari/io.c index b63e4034..b2837125 100644 --- a/src/atari/io.c +++ b/src/atari/io.c @@ -37,6 +37,7 @@ bool io_error(void) unsigned char io_status(void) { + return 0; } void io_init(void) @@ -156,7 +157,7 @@ void io_open_directory(unsigned char hs, char *p, char *f) memset(response, 0, 256); strcpy(response, p); strcpy(&response[strlen(response) + 1], f); - _p = &response; + _p = response; } fuji_open_directory(hs, _p); } @@ -164,8 +165,8 @@ void io_open_directory(unsigned char hs, char *p, char *f) char *io_read_directory(unsigned char maxlen, unsigned char a) { memset(response, 0, maxlen); - fuji_read_directory(maxlen, a, &response); - return &response; + fuji_read_directory(maxlen, a, response); + return response; } void io_close_directory(void) @@ -185,8 +186,8 @@ void io_set_device_filename(unsigned char ds, unsigned char hs, unsigned char mo char *io_get_device_filename(unsigned char slot) { - fuji_get_device_filename(slot, &response); - return &response; + fuji_get_device_filename(slot, response); + return response; } void io_set_boot_config(unsigned char toggle) @@ -260,11 +261,11 @@ void io_create_new(unsigned char selected_host_slot, unsigned char selected_devi } -void io_build_directory(unsigned char ds, unsigned long numBlocks, char *v) +void io_build_directory(unsigned char, unsigned long, char *) { } -bool io_get_device_enabled_status(unsigned char d) +bool io_get_device_enabled_status(unsigned char) { // adam calls $D1, which doesn't exist in atari. return false; @@ -281,11 +282,11 @@ void io_update_devices_enabled(bool *e) } } -void io_enable_device(unsigned char d) +void io_enable_device(unsigned char) { } -void io_disable_device(unsigned char d) +void io_disable_device(unsigned char) { } @@ -296,11 +297,12 @@ void io_disable_device(unsigned char d) void io_copy_file(unsigned char source_slot, unsigned char destination_slot) { // incrementing is handled in function, we keep everything 0 based - fuji_copy_file(source_slot, destination_slot, ©Spec); + fuji_copy_file(source_slot, destination_slot, copySpec); } -unsigned char io_device_slot_to_device(unsigned char ds) +unsigned char io_device_slot_to_device(unsigned char) { + return 0; } /** diff --git a/src/atari/screen.c b/src/atari/screen.c index 9432045b..d36e2c33 100644 --- a/src/atari/screen.c +++ b/src/atari/screen.c @@ -115,7 +115,7 @@ void put_char(char c) POKE(cursor_ptr++, c + offset); // Insert into the locaiton in memory for next bit in cursor_ptr the ATASCI character. c+offset is the ATASCI character desired to be displayed. } -void screen_append(char *s) +void screen_append(const char *s) { while (*s != 0) { @@ -124,7 +124,7 @@ void screen_append(char *s) } } -void screen_puts(unsigned char x, unsigned char y, char *s) +void screen_puts(unsigned char x, unsigned char y, const char *s) { set_cursor(x, y); screen_append(s); @@ -193,7 +193,7 @@ void screen_set_wifi_display_ssid(char n, SSIDInfo *s) screen_set_wifi_print_rssi(s, n); } -void screen_set_wifi_select_network(unsigned char nn) +void screen_set_wifi_select_network(unsigned char) { screen_clear_line(numNetworks + NETWORKS_START_Y); screen_puts(2, NETWORKS_START_Y + numNetworks, ""); @@ -222,7 +222,7 @@ void screen_set_wifi_password(void) /* * Display the 'info' screen */ -void screen_show_info(int printerEnabled, AdapterConfigExtended *ac) +void screen_show_info(int, AdapterConfigExtended *ac) { screen_dlist_show_info(); set_active_screen(SCREEN_SHOW_INFO); @@ -290,7 +290,7 @@ void screen_select_slot(char *e) screen_puts(9, DEVICES_END_MOUNT_Y + 2, e); } - screen_hosts_and_devices_device_slots(DEVICES_START_MOUNT_Y, &deviceSlots, &deviceEnabled); + screen_hosts_and_devices_device_slots(DEVICES_START_MOUNT_Y, deviceSlots, deviceEnabled); bar_show(DEVICES_START_MOUNT_Y); } @@ -306,7 +306,7 @@ void screen_select_slot_choose(void) { } -void screen_select_slot_eject(unsigned char ds) +void screen_select_slot_eject(unsigned char) { } @@ -417,7 +417,7 @@ void screen_select_file_prev(void) } } -void screen_select_file_display_entry(unsigned char y, const char *e, unsigned entryType) +void screen_select_file_display_entry(unsigned char y, const char *e, unsigned) { /* @@ -452,7 +452,7 @@ void screen_select_file_new_type(void) // Not used on Atari } -void screen_select_file_new_size(unsigned char k) +void screen_select_file_new_size(unsigned char) { screen_clear_line(20); screen_clear_line(21); @@ -496,7 +496,7 @@ void screen_error(const char *msg) screen_puts(0, 24, msg); } -void screen_hosts_and_devices(HostSlot *h, DeviceSlot *d, unsigned char *e) +void screen_hosts_and_devices(HostSlot *, DeviceSlot *, unsigned char *) { screen_dlist_hosts_and_devices(); set_active_screen(SCREEN_HOSTS_AND_DEVICES); @@ -510,7 +510,7 @@ void screen_hosts_and_devices(HostSlot *h, DeviceSlot *d, unsigned char *e) screen_hosts_and_devices_host_slots(&hostSlots[0]); - screen_hosts_and_devices_device_slots(DEVICES_START_Y, &deviceSlots[0], ""); + screen_hosts_and_devices_device_slots(DEVICES_START_Y, &deviceSlots[0], (bool *) ""); } void screen_clear() @@ -549,7 +549,7 @@ void screen_hosts_and_devices_devices(void) bar_show(selected_device_slot + DEVICES_START_Y); } -void screen_hosts_and_devices_host_slots(HostSlot *h) +void screen_hosts_and_devices_host_slots(HostSlot *) { unsigned char slotNum; @@ -565,7 +565,7 @@ void screen_hosts_and_devices_host_slots(HostSlot *h) // Since 'deviceSlots' is a global, do we need to access the input parameter at all? // Maybe globals.h wasn't supposed in be part of screen? I needed it for something.. -void screen_hosts_and_devices_device_slots(unsigned char y, DeviceSlot *dslot, unsigned char *e) +void screen_hosts_and_devices_device_slots(unsigned char y, DeviceSlot *, const unsigned char *) { unsigned char slotNum; unsigned char dinfo[6]; @@ -593,7 +593,7 @@ void screen_hosts_and_devices_device_slots(unsigned char y, DeviceSlot *dslot, u dinfo[3] = 0x20; } - screen_puts(0, slotNum + y, dinfo); + screen_puts(0, slotNum + y, (char *) dinfo); screen_append(deviceSlots[slotNum].file[0] != 0x00 ? (char *)deviceSlots[slotNum].file : text_empty); } @@ -605,12 +605,12 @@ void screen_hosts_and_devices_devices_clear_all(void) screen_puts(0, 11, "EJECTING ALL.. WAIT"); } -void screen_hosts_and_devices_clear_host_slot(unsigned char i) +void screen_hosts_and_devices_clear_host_slot(unsigned char) { // nothing to do, edit_line handles clearing correct space on screen, and doesn't touch the list numbers } -void screen_hosts_and_devices_edit_host_slot(unsigned char i) +void screen_hosts_and_devices_edit_host_slot(unsigned char) { // nothing to do, edit_line handles clearing correct space on screen, and doesn't touch the list numbers } @@ -636,14 +636,14 @@ void screen_hosts_and_devices_eject(unsigned char ds) screen_puts(5, y + ds, text_empty); } -void screen_hosts_and_devices_host_slot_empty(unsigned char hs) +void screen_hosts_and_devices_host_slot_empty(unsigned char) { // When this gets called it seems like the cursor is right where we want it to be. // so no need to move to a position first. screen_append(text_empty); } -void screen_hosts_and_devices_long_filename(const char *f) +void screen_hosts_and_devices_long_filename(const char *) { // show_line_nums(); } @@ -680,7 +680,7 @@ void screen_destination_host_slot_choose(void) // show_line_nums(); } -void screen_perform_copy(char *sh, char *p, char *dh, char *dp) +void screen_perform_copy(char *, char *, char *, char *) { // show_line_nums(); screen_clear(); diff --git a/src/atari/screen.h b/src/atari/screen.h index 633defef..4f4571ab 100644 --- a/src/atari/screen.h +++ b/src/atari/screen.h @@ -45,7 +45,7 @@ void set_wifi_print_rssi(SSIDInfo *s, unsigned char i); void screen_select_slot_mode(void); void font_init(); extern void bar_setup_regs(); -void screen_puts(unsigned char x, unsigned char y, char *s); +void screen_puts(unsigned char x, unsigned char y, const char *s); void screen_clear_line(unsigned char y); void screen_error(const char *msg); @@ -64,7 +64,7 @@ void screen_hosts_and_devices(HostSlot *h, DeviceSlot *d, unsigned char *e); void screen_hosts_and_devices_hosts(void); void screen_hosts_and_devices_devices(void); void screen_hosts_and_devices_host_slots(HostSlot *h); -void screen_hosts_and_devices_device_slots(unsigned char y, DeviceSlot *d, unsigned char *e); +void screen_hosts_and_devices_device_slots(unsigned char y, DeviceSlot *d, const bool *e); void screen_hosts_and_devices_devices_clear_all(void); void screen_hosts_and_devices_clear_host_slot(unsigned char i); diff --git a/src/c64/input.c b/src/c64/input.c index c7a9c7d2..ff4eeda6 100644 --- a/src/c64/input.c +++ b/src/c64/input.c @@ -66,7 +66,7 @@ unsigned char input_ucase(void) * @param l Length * @param password echoes characters. */ -void input_line(unsigned char x, unsigned char y, unsigned char o, char *c, unsigned char len, bool password) +void input_line(unsigned char x, unsigned char y, unsigned char, char *c, unsigned char len, bool password) { // currently not using o, not many places used it, but may need to change edit_string if it proves to be required edit_string(c, len, x, y, 36, password); diff --git a/src/c64/io.c b/src/c64/io.c index ed04e20f..11414887 100644 --- a/src/c64/io.c +++ b/src/c64/io.c @@ -86,7 +86,7 @@ char *io_get_device_filename(uint8_t slot) return (char *) &response[0]; } -void io_create_new(uint8_t selected_host_slot, uint8_t selected_device_slot, unsigned long selected_size, char *path) +void io_create_new(uint8_t, uint8_t, unsigned long, char *) { // TODO implement } @@ -172,13 +172,13 @@ void io_umount_disk_image(uint8_t ds) fuji_unmount_disk_image(ds); } -void io_update_devices_enabled(bool *e) {} +void io_update_devices_enabled(bool *) {} -void io_enable_device(unsigned char d) {} +void io_enable_device(unsigned char) {} -void io_disable_device(unsigned char d) {} +void io_disable_device(unsigned char) {} -bool io_get_device_enabled_status(unsigned char d) +bool io_get_device_enabled_status(unsigned char) { return false; } diff --git a/src/c64/pause.c b/src/c64/pause.c index a9bab5f2..d139a967 100644 --- a/src/c64/pause.c +++ b/src/c64/pause.c @@ -1,8 +1,8 @@ #ifdef BUILD_C64 -void pause(unsigned char delay) +void pause(unsigned char) { // TODO implement } -#endif \ No newline at end of file +#endif diff --git a/src/c64/screen.c b/src/c64/screen.c index 1afb490d..f1ad0172 100644 --- a/src/c64/screen.c +++ b/src/c64/screen.c @@ -75,7 +75,7 @@ void screen_error(const char *c) screen_inverse_line(STATUS_BAR + 1); } -void screen_putlcc(char c) +void screen_putlcc(char) { // REMOVE } @@ -353,7 +353,7 @@ void screen_select_file_prev(void) cprintf("%-40s", "[...]"); } -void screen_select_file_display_long_filename(char *e) +void screen_select_file_display_long_filename(const char *) { // it wasn't this. /* gotoxy(0,19); */ @@ -366,7 +366,7 @@ void screen_select_file_next(void) cprintf("%-40s", "[...]"); } -void screen_select_file_display_entry(unsigned char y, char *e, unsigned entryType) +void screen_select_file_display_entry(unsigned char y, const char *e, unsigned) { gotoxy(0, y + 3); cprintf("%-40s", &e[0]); @@ -468,7 +468,7 @@ void screen_select_file_new_name(void) screen_print_menu(" NEW MEDIA: ENTER FILENAME \r\n", ""); } -void screen_hosts_and_devices_long_filename(char *f) +void screen_hosts_and_devices_long_filename(const char *f) { // TODO: implement if (strlen(f) > 31) diff --git a/src/c64/screen.h b/src/c64/screen.h index 1fc8548f..0eb4390e 100644 --- a/src/c64/screen.h +++ b/src/c64/screen.h @@ -54,14 +54,14 @@ void screen_select_file_filter(void); void screen_select_file_next(void); void screen_select_file_new_type(void); void screen_select_file_prev(void); -void screen_select_file_display_long_filename(char *e); -void screen_select_file_display_entry(unsigned char y, char *e, unsigned entryType); +void screen_select_file_display_long_filename(const char *e); +void screen_select_file_display_entry(unsigned char y, const char *e, unsigned entryType); void screen_select_file_clear_long_filename(void); void screen_select_file_choose(char visibleEntries); void screen_select_file_new_size(unsigned char k); void screen_select_file_new_custom(void); void screen_select_file_new_name(void); -void screen_hosts_and_devices_long_filename(char *f); +void screen_hosts_and_devices_long_filename(const char *f); void screen_hosts_and_devices_devices_clear_all(void); void screen_select_file_new_creating(void); diff --git a/src/connect_wifi.c b/src/connect_wifi.c index 4ad9830a..dbe97d5d 100644 --- a/src/connect_wifi.c +++ b/src/connect_wifi.c @@ -80,7 +80,7 @@ void connect_wifi(void) { unsigned char retries = 20; NetConfig nc; - unsigned char s, key; + unsigned char s; memcpy(&nc, io_get_ssid(), sizeof(NetConfig)); diff --git a/src/hosts_and_devices.c b/src/hosts_and_devices.c index 01b36b0a..da7024ba 100644 --- a/src/hosts_and_devices.c +++ b/src/hosts_and_devices.c @@ -150,7 +150,7 @@ void hosts_and_devices_edit_host_slot(unsigned char i) { if ( deviceSlots[o].hostSlot == i ) { - hosts_and_devices_eject(o); + hosts_and_devices_eject((unsigned char) o); } } } @@ -216,7 +216,6 @@ void hosts_and_devices_devices(void) void hosts_and_devices_devices_set_mode(unsigned char m) { - int i; #if defined(BUILD_ATARI) bool mnt; char err_msg[64]; @@ -255,6 +254,7 @@ void hosts_and_devices_devices_set_mode(unsigned char m) // Check for error if (!mnt) { + unsigned int i; // Display error for a moment then redraw menu after strcpy(err_msg, "ERROR SETTING DISK MODE: "); screen_error(err_msg); @@ -274,6 +274,7 @@ void hosts_and_devices_devices_set_mode(unsigned char m) // Check for error if (!mnt) { + unsigned int i; // Display error for a moment then redraw menu after screen_error("Error setting disk mode"); for (i = 0; i < 4000; i++)