Skip to content

Commit

Permalink
basic serial-out support
Browse files Browse the repository at this point in the history
  • Loading branch information
erique committed Mar 29, 2024
1 parent 847225d commit ed49fad
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 41 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
44 changes: 7 additions & 37 deletions src/dummy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/gfx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions src/parse_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Expand Down
7 changes: 7 additions & 0 deletions src/quaesar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/sysconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions uae_src/serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ed49fad

Please sign in to comment.