diff --git a/CMakeLists.txt b/CMakeLists.txt index ead759a6..4825965b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -170,6 +170,7 @@ add_executable(quaesar uae_src/scsi.cpp uae_src/scsiemul.cpp uae_src/scsitape.cpp + uae_src/serial.cpp uae_src/sndboard.cpp uae_src/statusline.cpp uae_src/tabletlibrary.cpp diff --git a/src/dummy.cpp b/src/dummy.cpp index 7f3b6f0e..5ede2b11 100644 --- a/src/dummy.cpp +++ b/src/dummy.cpp @@ -1374,42 +1374,25 @@ void scram5394_add_scsi_unit(int, uaedev_config_info*, romconfig*) { UNIMPLEMENTED(); } -uae_u16 SERDATR() { - UNIMPLEMENTED(); - return 0; -} - -void SERDAT(uae_u16) { - UNIMPLEMENTED(); -} - -void serial_dtr_off() { - UNIMPLEMENTED(); -} - -void serial_exit() { - UNIMPLEMENTED(); +void serial_uartbreak(int) { + // UNIMPLEMENTED(); } void serial_hsynchandler() { - UNIMPLEMENTED(); -} - -void serial_init() { - UNIMPLEMENTED(); + // UNIMPLEMENTED(); } void serial_rbf_clear() { UNIMPLEMENTED(); } -uae_u8 serial_readstatus(uae_u8, uae_u8) { - UNIMPLEMENTED(); - return 0; +uae_u8 serial_readstatus(uae_u8 v, uae_u8) { + // UNIMPLEMENTED(); + return v; } void serial_rethink() { - UNIMPLEMENTED(); + serial_flush_buffer(); } void setup_brkhandler() { @@ -1893,19 +1876,6 @@ uae_u8* save_cdtv(size_t*, uae_u8*) { return nullptr; } -void serial_uartbreak(int) { - UNIMPLEMENTED(); -} - -uae_u8 serial_writestatus(uae_u8, uae_u8) { - UNIMPLEMENTED(); - return 0; -} - -void SERPER(unsigned short) { - UNIMPLEMENTED(); -} - int set_cache_state(int) { UNIMPLEMENTED(); return 0; diff --git a/src/gfx.cpp b/src/gfx.cpp index 169183a5..38437ac6 100644 --- a/src/gfx.cpp +++ b/src/gfx.cpp @@ -16,7 +16,6 @@ int vsync_activeheight, vsync_totalheight; int max_uae_width = 8192, max_uae_height = 8192; int saveimageoriginalpath; float vsync_vblank, vsync_hblank; -uae_u16 serper, serdat, serdatr; // related to GSYNC/VSYNC int target_get_display_scanline2(int displayindex) { diff --git a/src/parse_options.h b/src/parse_options.h index 1bc31cd0..aa0a433d 100644 --- a/src/parse_options.h +++ b/src/parse_options.h @@ -7,6 +7,8 @@ struct Options { std::string input; // kickstart file such as kick.rom, kick31.rom, etc. std::string kickstart; + // serial port path ('/tmp/virtual-serial-port') + std::string serial_port; }; /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/quaesar.cpp b/src/quaesar.cpp index faf47648..f5005ddd 100644 --- a/src/quaesar.cpp +++ b/src/quaesar.cpp @@ -45,6 +45,7 @@ int main(int argc, char** argv) { app.add_option("input", options.input, "Executable or image file (adf, dms)")->check(CLI::ExistingFile); app.add_option("-k,--kickstart", options.kickstart, "Path to the kickstart ROM")->check(CLI::ExistingFile); + app.add_option("--serial_port", options.serial_port, "Serial port path"); CLI11_PARSE(app, argc, argv); keyboard_settrans(); @@ -61,6 +62,12 @@ int main(int argc, char** argv) { } } + if (!options.serial_port.empty()) + { + currprefs.use_serial = 1; + strcpy(currprefs.sername, options.serial_port.c_str()); + } + // Most compatible mode currprefs.cpu_cycle_exact = 1; currprefs.cpu_memory_cycle_exact = 1; diff --git a/src/sysconfig.h b/src/sysconfig.h index c227b167..464b5094 100644 --- a/src/sysconfig.h +++ b/src/sysconfig.h @@ -67,7 +67,7 @@ // #define D3D /* D3D display filter support */ #define PARALLEL_PORT /* parallel port emulation */ #define PARALLEL_DIRECT /* direct parallel port emulation */ -// #define SERIAL_PORT /* serial port emulation */ +#define SERIAL_PORT /* serial port emulation */ #define SERIAL_ENET /* serial port UDP transport */ // #define SCSIEMU /* uaescsi.device emulation */ // #define UAESERIAL /* uaeserial.device emulation */ diff --git a/uae_src/serial.cpp b/uae_src/serial.cpp index 4771ab9d..074afa3c 100644 --- a/uae_src/serial.cpp +++ b/uae_src/serial.cpp @@ -11,7 +11,7 @@ #include "sysconfig.h" #include "sysdeps.h" -#include "config.h" +// #include "config.h" #include "options.h" #include "uae.h" #include "memory.h" @@ -204,7 +204,7 @@ void SERDAT (uae_u16 w) uae_u16 SERDATR (void) { if (!currprefs.use_serial) - return 0; + return 0x3000; #if SERIALDEBUG > 2 write_log ("SERDATR: read 0x%04x\n", serdat); #endif