This commit is contained in:
sorgelig
2018-01-03 19:18:44 +08:00
parent a2ef5eb88d
commit 1006842d3d
3 changed files with 10 additions and 134 deletions

68
debug.h
View File

@@ -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

View File

@@ -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();

View File

@@ -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