Debug notify about current video resolution from supported cores.

This commit is contained in:
sorgelig
2017-10-16 02:36:22 +08:00
parent f11432f06e
commit 57f1b732dd
2 changed files with 30 additions and 0 deletions

View File

@@ -1499,6 +1499,35 @@ void user_io_poll()
keyboard_leds = leds;
}
static uint32_t res_timer = 0;
if(!res_timer || CheckTimer(res_timer))
{
res_timer = GetTimer(2000); // every 2 sec
static uint8_t nres = 0;
spi_uio_cmd_cont(UIO_GET_VRES);
uint8_t res = spi_in();
if (nres != res)
{
nres = res;
uint32_t width = spi_w(0) | (spi_w(0) << 16);
uint32_t height = spi_w(0) | (spi_w(0) << 16);
uint32_t htime = spi_w(0) | (spi_w(0) << 16);
uint32_t vtime = spi_w(0) | (spi_w(0) << 16);
uint32_t ptime = spi_w(0) | (spi_w(0) << 16);
float vrate = 100000000;
vrate /= vtime;
float hrate = 100000;
hrate /= htime;
float prate = width*100;
prate /= ptime;
printf("\033[1;33mINFO: Video resolution: %u x %u, fHorz = %.1fKHz, fVert = %.1fHz, fPix = %.2fMHz\033[0m\n", width, height, hrate, vrate, prate);
}
DisableIO();
}
}
char user_io_dip_switch1()

View File

@@ -55,6 +55,7 @@
#define UIO_SET_VIDEO 0x20 // set HDMI video mode 0: 1280x720p60(TV), 1: 1280x1024p60(PC), 2-255: reserved
#define UIO_PS2_CTL 0x21 // get PS2 control from supported cores
#define UIO_RTC 0x22 // transmit RTC data to core
#define UIO_GET_VRES 0x23 // get video resolution
// codes as used by 8bit (atari 800, zx81) via SS2
#define UIO_GET_STATUS 0x50