From: ljsebald <ljs...@us...> - 2023-08-17 20:25:37
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A serial program loader for the Dreamcast.". The branch, master has been updated via 910f91df523a433891efc3ffd7c95853a45d08e2 (commit) from 4d28558a2c09c7abb2678c12e9957aa4dad53ca3 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 910f91df523a433891efc3ffd7c95853a45d08e2 Author: Tchan0 <617...@us...> Date: Thu Aug 17 22:24:56 2023 +0200 Add baudrate 230400 and its speedhack. (#16) * Add baudrate 230400 and its speedhack. * Update dc-tool.c cleaned up explanation about speedhack ----------------------------------------------------------------------- Summary of changes: Makefile.cfg | 2 +- host-src/tool/Makefile | 2 +- host-src/tool/dc-tool.c | 16 ++++++++++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Makefile.cfg b/Makefile.cfg index 56bc457..01da995 100644 --- a/Makefile.cfg +++ b/Makefile.cfg @@ -98,7 +98,7 @@ endif # default speed for dc-tool - after initial connection is established, connection # speed will change to this value, same as using the -b argument -# value must be one of 9600, 19200, 38400, 57600, 115200, 500000, or 1500000 +# value must be one of 9600, 19200, 38400, 57600, 115200, 230400, 500000, or 1500000 TOOL_DEFAULT_SPEED = 57600 # USB-based serial devices can potentially achieve speeds of 500000 or 1500000 baud #TOOL_DEFAULT_SPEED = 500000 diff --git a/host-src/tool/Makefile b/host-src/tool/Makefile index 75eb877..5a206e8 100644 --- a/host-src/tool/Makefile +++ b/host-src/tool/Makefile @@ -3,7 +3,7 @@ include ../../Makefile.cfg LZOPATH = ../../minilzo-2.10 CC = $(HOSTCC) -CFLAGS = $(HOSTCFLAGS) -DDCLOAD_VERSION=\"$(VERSION)\" -DDEFAULT_SPEED=$(TOOL_DEFAULT_SPEED) -DSERIALDEVICE="\"$(SERIALDEVICE)\"" -DHAVE_GETOPT -DB1500000 -DB500000 +CFLAGS = $(HOSTCFLAGS) -DDCLOAD_VERSION=\"$(VERSION)\" -DDEFAULT_SPEED=$(TOOL_DEFAULT_SPEED) -DSERIALDEVICE="\"$(SERIALDEVICE)\"" -DHAVE_GETOPT -DB1500000 -DB500000 -DB230400 LDFLAGS = $(HOSTLDFLAGS) INCLUDE = -I$(LZOPATH) -I/usr/local/include diff --git a/host-src/tool/dc-tool.c b/host-src/tool/dc-tool.c index ff3e047..fbface1 100644 --- a/host-src/tool/dc-tool.c +++ b/host-src/tool/dc-tool.c @@ -546,6 +546,11 @@ int open_serial(char *devicename, unsigned int speed, unsigned int *speedtest) { case 500000: speedsel = B500000; break; +#endif +#ifdef B230400 + case 230400: + speedsel = B230400; + break; #endif case 115200: speedsel = B115200; @@ -660,8 +665,9 @@ void close_serial(void) { } int speedhack = 0; -/* speedhack controls whether dcload will use N=12 (normal, 4.3% error) or - * N=13 (alternate, -3.1% error) for 115200 +/* speedhack controls whether dcload will use + * - N=13 (alternate, -3.0% error) instead of N=12 (normal, 4.3% error) for 115200 + * - N=6 (alternate, -2.8% error) instead of N=5 (normal, 11.5% error) for 230400 */ /* use_extclk controls whether the DC's serial port will use an external clock */ @@ -677,6 +683,8 @@ int change_speed(char *device_name, unsigned int speed) { if(speedhack && (speed == 115200)) send_uint(111600); /* get dcload to pick N=13 rather than N=12 */ + else if(speedhack && (speed == 230400)) + send_uint(223214); /* get dcload to pick N=6 rather than N=5 */ else if(use_extclk) send_uint(0); else @@ -744,7 +752,7 @@ void usage(void) { printf("-s <size> Set size to <size>\n"); printf("-t <device> Use <device> to communicate with dc (default: %s)\n", SERIALDEVICE); printf("-b <baudrate> Use <baudrate> (default: %d)\n", DEFAULT_SPEED); - printf("-e Try alternate 115200 (must also use -b 115200)\n"); + printf("-e Try alternate 115200/230400 (must also use -b 115200 or -b 230400)\n"); printf("-E Use an external clock for the DC's serial port\n"); printf("-n Do not attach console and fileserver\n"); printf("-p Use dumb terminal rather than console/fileserver\n"); @@ -1279,7 +1287,7 @@ int main(int argc, char *argv[]) { printf("Cdfs redirection enabled\n"); if(speedhack) - printf("Alternate 115200 enabled\n"); + printf("Alternate 115200/230400 enabled\n"); if(use_extclk) printf("External clock usage enabled\n"); hooks/post-receive -- A serial program loader for the Dreamcast. |