mirror of
https://github.com/UzixLS/TSConf_MiST.git
synced 2025-07-18 23:01:37 +03:00
Update sys. Support for custom AR.
This commit is contained in:
115
TSConf.sv
115
TSConf.sv
@ -29,7 +29,7 @@ module emu
|
||||
input RESET,
|
||||
|
||||
//Must be passed to hps_io module
|
||||
inout [45:0] HPS_BUS,
|
||||
inout [45:0] HPS_BUS,
|
||||
|
||||
//Base video clock. Usually equals to CLK_SYS.
|
||||
output CLK_VIDEO,
|
||||
@ -39,8 +39,8 @@ module emu
|
||||
output CE_PIXEL,
|
||||
|
||||
//Video aspect ratio for HDMI. Most retro systems have ratio 4:3.
|
||||
output [7:0] VIDEO_ARX,
|
||||
output [7:0] VIDEO_ARY,
|
||||
output [11:0] VIDEO_ARX,
|
||||
output [11:0] VIDEO_ARY,
|
||||
|
||||
output [7:0] VGA_R,
|
||||
output [7:0] VGA_G,
|
||||
@ -48,8 +48,36 @@ module emu
|
||||
output VGA_HS,
|
||||
output VGA_VS,
|
||||
output VGA_DE, // = ~(VBlank | HBlank)
|
||||
output VGA_F1,
|
||||
output [1:0] VGA_SL,
|
||||
output VGA_F1,
|
||||
output [1:0] VGA_SL,
|
||||
output VGA_SCALER, // Force VGA scaler
|
||||
|
||||
`ifdef USE_FB
|
||||
// Use framebuffer in DDRAM (USE_FB=1 in qsf)
|
||||
// FB_FORMAT:
|
||||
// [2:0] : 011=8bpp(palette) 100=16bpp 101=24bpp 110=32bpp
|
||||
// [3] : 0=16bits 565 1=16bits 1555
|
||||
// [4] : 0=RGB 1=BGR (for 16/24/32 modes)
|
||||
//
|
||||
// FB_STRIDE either 0 (rounded to 256 bytes) or multiple of pixel size (in bytes)
|
||||
output FB_EN,
|
||||
output [4:0] FB_FORMAT,
|
||||
output [11:0] FB_WIDTH,
|
||||
output [11:0] FB_HEIGHT,
|
||||
output [31:0] FB_BASE,
|
||||
output [13:0] FB_STRIDE,
|
||||
input FB_VBL,
|
||||
input FB_LL,
|
||||
output FB_FORCE_BLANK,
|
||||
|
||||
// Palette control for 8bit modes.
|
||||
// Ignored for other video modes.
|
||||
output FB_PAL_CLK,
|
||||
output [7:0] FB_PAL_ADDR,
|
||||
output [23:0] FB_PAL_DOUT,
|
||||
input [23:0] FB_PAL_DIN,
|
||||
output FB_PAL_WR,
|
||||
`endif
|
||||
|
||||
output LED_USER, // 1 - ON, 0 - OFF.
|
||||
|
||||
@ -58,19 +86,20 @@ module emu
|
||||
// hint: supply 2'b00 to let the system control the LED.
|
||||
output [1:0] LED_POWER,
|
||||
output [1:0] LED_DISK,
|
||||
|
||||
// I/O board button press simulation (active high)
|
||||
// b[1]: user button
|
||||
// b[0]: osd button
|
||||
output [1:0] BUTTONS,
|
||||
|
||||
// I/O board button press simulation (active high)
|
||||
// b[1]: user button
|
||||
// b[0]: osd button
|
||||
output [1:0] BUTTONS,
|
||||
|
||||
input CLK_AUDIO, // 24.576 MHz
|
||||
output [15:0] AUDIO_L,
|
||||
output [15:0] AUDIO_R,
|
||||
output AUDIO_S, // 1 - signed audio samples, 0 - unsigned
|
||||
output AUDIO_S, // 1 - signed audio samples, 0 - unsigned
|
||||
output [1:0] AUDIO_MIX, // 0 - no mix, 1 - 25%, 2 - 50%, 3 - 100% (mono)
|
||||
|
||||
//ADC
|
||||
inout [3:0] ADC_BUS,
|
||||
|
||||
//ADC
|
||||
inout [3:0] ADC_BUS,
|
||||
|
||||
//SD-SPI
|
||||
output SD_SCK,
|
||||
@ -79,6 +108,7 @@ module emu
|
||||
output SD_CS,
|
||||
input SD_CD,
|
||||
|
||||
`ifdef USE_DDRAM
|
||||
//High latency DDR3 RAM interface
|
||||
//Use for non-critical time purposes
|
||||
output DDRAM_CLK,
|
||||
@ -91,7 +121,9 @@ module emu
|
||||
output [63:0] DDRAM_DIN,
|
||||
output [7:0] DDRAM_BE,
|
||||
output DDRAM_WE,
|
||||
`endif
|
||||
|
||||
`ifdef USE_SDRAM
|
||||
//SDRAM interface with lower latency
|
||||
output SDRAM_CLK,
|
||||
output SDRAM_CKE,
|
||||
@ -103,24 +135,38 @@ module emu
|
||||
output SDRAM_nCS,
|
||||
output SDRAM_nCAS,
|
||||
output SDRAM_nRAS,
|
||||
output SDRAM_nWE,
|
||||
|
||||
input UART_CTS,
|
||||
output UART_RTS,
|
||||
input UART_RXD,
|
||||
output UART_TXD,
|
||||
output UART_DTR,
|
||||
input UART_DSR,
|
||||
|
||||
// Open-drain User port.
|
||||
// 0 - D+/RX
|
||||
// 1 - D-/TX
|
||||
output SDRAM_nWE,
|
||||
`endif
|
||||
|
||||
`ifdef DUAL_SDRAM
|
||||
//Secondary SDRAM
|
||||
input SDRAM2_EN,
|
||||
output SDRAM2_CLK,
|
||||
output [12:0] SDRAM2_A,
|
||||
output [1:0] SDRAM2_BA,
|
||||
inout [15:0] SDRAM2_DQ,
|
||||
output SDRAM2_nCS,
|
||||
output SDRAM2_nCAS,
|
||||
output SDRAM2_nRAS,
|
||||
output SDRAM2_nWE,
|
||||
`endif
|
||||
|
||||
input UART_CTS,
|
||||
output UART_RTS,
|
||||
input UART_RXD,
|
||||
output UART_TXD,
|
||||
output UART_DTR,
|
||||
input UART_DSR,
|
||||
|
||||
// Open-drain User port.
|
||||
// 0 - D+/RX
|
||||
// 1 - D-/TX
|
||||
// 2..6 - USR2..USR6
|
||||
// Set USER_OUT to 1 to read from USER_IN.
|
||||
// Set USER_OUT to 1 to read from USER_IN.
|
||||
input [6:0] USER_IN,
|
||||
output [6:0] USER_OUT,
|
||||
|
||||
input OSD_STATUS
|
||||
|
||||
input OSD_STATUS
|
||||
);
|
||||
|
||||
assign ADC_BUS = 'Z;
|
||||
@ -132,16 +178,19 @@ assign LED_USER = (vsd_sel & sd_act) | ioctl_download;
|
||||
assign LED_DISK = {1'b1, ~vsd_sel & sd_act};
|
||||
assign LED_POWER = 0;
|
||||
assign BUTTONS = 0;
|
||||
assign VGA_SCALER= 0;
|
||||
|
||||
assign VIDEO_ARX = status[5] ? 8'd16 : 8'd4;
|
||||
assign VIDEO_ARY = status[5] ? 8'd9 : 8'd3;
|
||||
wire [1:0] ar = status[33:32];
|
||||
|
||||
assign VIDEO_ARX = (!ar) ? 12'd4 : (ar - 1'd1);
|
||||
assign VIDEO_ARY = (!ar) ? 12'd3 : 12'd0;
|
||||
|
||||
`include "build_id.v"
|
||||
localparam CONF_STR = {
|
||||
"TSConf;;",
|
||||
"S,VHD,Mount virtual SD;",
|
||||
"-;",
|
||||
"O5,Aspect ratio,4:3,16:9;",
|
||||
"o01,Aspect ratio,Original,Full Screen,[ARC1],[ARC2];",
|
||||
"O12,Scandoubler Fx,None,HQ2x,CRT 25%,CRT 50%;",
|
||||
"-;",
|
||||
"O34,Stereo mix,None,25%,50%,100%;",
|
||||
@ -207,7 +256,7 @@ wire [5:0] joy_1;
|
||||
wire [15:0] joya_0;
|
||||
wire [15:0] joya_1;
|
||||
wire [1:0] buttons;
|
||||
wire [31:0] status;
|
||||
wire [63:0] status;
|
||||
wire [24:0] ps2_mouse;
|
||||
wire [10:0] ps2_key;
|
||||
|
||||
|
Reference in New Issue
Block a user