From 1006842d3d7256c6ec8e99a9d2d87051a252ee2b Mon Sep 17 00:00:00 2001 From: sorgelig Date: Wed, 3 Jan 2018 19:18:44 +0800 Subject: [PATCH] Cleanup. --- debug.h | 68 +++++++--------------------------------------------- user_io.c | 71 ------------------------------------------------------- user_io.h | 5 +--- 3 files changed, 10 insertions(+), 134 deletions(-) diff --git a/debug.h b/debug.h index a93bf3c..78b8d76 100644 --- a/debug.h +++ b/debug.h @@ -4,14 +4,21 @@ #include "hardware.h" -// ------------ generic debugging ----------- +// ------------ generic debugging ----------- #if 0 #define menu_debugf(...) printf(__VA_ARGS__) #else #define menu_debugf(...) #endif +#if 1 +// ini_parser debug output +#define ini_parser_debugf(a, ...) printf("\033[1;34mINI_PARSER : " a "\033[0m\n",## __VA_ARGS__) +#else +#define ini_parser_debugf(...) +#endif + // ----------- minimig debugging ------------- #if 0 @@ -26,8 +33,8 @@ #define fdd_debugf(...) #endif -// -------------- TOS debugging -------------- +// -------------- TOS debugging -------------- #if 1 #define tos_debugf(a, ...) printf("\033[1;32mTOS: " a "\033[0m\n", ##__VA_ARGS__) #else @@ -42,61 +49,4 @@ #define ikbd_debugf(...) #endif -#if 1 -// 8bit debug output in blue -#define bit8_debugf(a, ...) printf("\033[1;34m8BIT: " a "\033[0m\n", ##__VA_ARGS__) -#else -#define bit8_debugf(...) -#endif - -// ------------ usb debugging ----------- - -#if 0 -#define hidp_debugf(a, ...) printf("\033[1;34mHIDP: " a "\033[0m\n", ##__VA_ARGS__) -#else -#define hidp_debugf(...) -#endif - -#if 0 -// usb asix debug output in blue -#define asix_debugf(a, ...) printf("\033[1;34mASIX: " a "\033[0m\n", ##__VA_ARGS__) -#else -#define asix_debugf(...) -#endif - -#if 1 -// usb hid debug output in green -#define hid_debugf(a, ...) printf("\033[1;32mHID: " a "\033[0m\n", ##__VA_ARGS__) -#else -#define hid_debugf(...) -#endif - -#if 1 -// usb mass storage debug output in purple -#define storage_debugf(a, ...) printf("\033[1;35mSTORAGE: " a "\033[0m\n", ##__VA_ARGS__) -#else -#define storage_debugf(...) -#endif - -#if 0 -// usb rts debug output in blue -#define usbrtc_debugf(a, ...) printf("\033[1;34mUSBRTC: " a "\033[0m\n", ##__VA_ARGS__) -#else -#define usbrtc_debugf(...) -#endif - -#if 1 -// usb rts debug output in blue -#define pl2303_debugf(a, ...) printf("\033[1;34mPL2303: " a "\033[0m\n", ##__VA_ARGS__) -#else -#define pl2303_debugf(...) -#endif - -#if 1 -// ini_parser debug output -#define ini_parser_debugf(a, ...) printf("\033[1;34mINI_PARSER : " a "\033[0m\n",## __VA_ARGS__) -#else -#define ini_parser_debugf(...) -#endif - #endif // DEBUG_H diff --git a/user_io.c b/user_io.c index 5e011e9..8ce13a6 100644 --- a/user_io.c +++ b/user_io.c @@ -1285,77 +1285,6 @@ void user_io_poll() mouse_pos[X] = mouse_pos[Y] = 0; } } - - // --------------- THE FOLLOWING IS DEPRECATED AND WILL BE REMOVED ------------ - // ------------------------ USE SD CARD EMULATION INSTEAD --------------------- - - // raw sector io for the atari800 core which include a full - // file system driver usually implemented using a second cpu - static unsigned long bit8_status = 0; - unsigned long status; - - /* read status byte */ - EnableFpga(); - spi8(UIO_GET_STATUS); - status = spi_in(); - status = (status << 8) | spi_in(); - status = (status << 8) | spi_in(); - status = (status << 8) | spi_in(); - DisableFpga(); - /* - if (status != bit8_status) - { - unsigned long sector = (status >> 8) & 0xffffff; - char buffer[512]; - - bit8_status = status; - - // sector read testing - DISKLED_ON; - - // sector read - if (((status & 0xff) == 0xa5) || ((status & 0x3f) == 0x29)) - { - - // extended command with 26 bits (for 32GB SDHC) - if ((status & 0x3f) == 0x29) sector = (status >> 6) & 0x3ffffff; - - bit8_debugf("SECIO rd %ld", sector); - - if (MMC_Read(sector, buffer)) - { - // data is now stored in buffer. send it to fpga - EnableFpga(); - spi8(UIO_SECTOR_SND); // send sector data IO->FPGA - spi_block_write(buffer); - DisableFpga(); - } - else - { - bit8_debugf("rd %ld fail", sector); - } - } - - // sector write - if (((status & 0xff) == 0xa6) || ((status & 0x3f) == 0x2a)) - { - // extended command with 26 bits (for 32GB SDHC) - if ((status & 0x3f) == 0x2a) sector = (status >> 6) & 0x3ffffff; - - bit8_debugf("SECIO wr %ld", sector); - - // read sector from FPGA - EnableFpga(); - spi8(UIO_SECTOR_RCV); // receive sector data FPGA->IO - spi_block_read(buffer); - DisableFpga(); - - if (!MMC_Write(sector, buffer)) bit8_debugf("wr %ld fail", sector); - } - - DISKLED_OFF; - } - */ } if (core_type == CORE_TYPE_ARCHIE) archie_poll(); diff --git a/user_io.h b/user_io.h index ff1e9e3..ec2b632 100644 --- a/user_io.h +++ b/user_io.h @@ -58,10 +58,7 @@ #define UIO_GET_VRES 0x23 // get video resolution #define UIO_TIMESTAMP 0x24 // transmit seconds since Unix epoch -// codes as used by 8bit (atari 800, zx81) via SS2 -#define UIO_GET_STATUS 0x50 -#define UIO_SECTOR_SND 0x51 -#define UIO_SECTOR_RCV 0x52 +// codes as used by 8bit for file loading from OSD #define UIO_FILE_TX 0x53 #define UIO_FILE_TX_DAT 0x54 #define UIO_FILE_INDEX 0x55