Skip to content
Snippets Groups Projects
Commit a87ecd0f authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Implement FOSSIL function 0Dh (Keyboard read without wait)

As a work around for TradeWars 2 (v11.14 and v11.20) FOSSIL support:
This door game would never call the FOSSIL "get received character"
function (02h) . But I did notice that it was calling the "Keyboard
read" functions. I never implemented the "Keyboard read" functions
(figured the door game could read the keyboard itself if it wanted to),
but appparently TW2 won't ever read the COM port (using function 02h)
unless the Keyboard read function returns AX=0xFFFF (no keyboard data
available). So now, I just do that and TW2 works (with FOSSIL I/O).

Incremented the revision to 26.
Logging the Git branch/hash and other helpful FOSSIL-debug stuff now.
parent 5cf93814
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #2490 passed
...@@ -45,7 +45,10 @@ ...@@ -45,7 +45,10 @@
#include "execvxd.h" #include "execvxd.h"
#include "isvbop.h" /* ddk\inc */ #include "isvbop.h" /* ddk\inc */
#include "fossdefs.h" #include "fossdefs.h"
#include "../git_branch.h"
#include "../git_hash.h"
#define DOSXTRN_REVISION 26
#define VDD_FILENAME "sbbsexec.dll" #define VDD_FILENAME "sbbsexec.dll"
/****************************************************************************/ /****************************************************************************/
...@@ -63,7 +66,6 @@ static void truncsp(char *str) ...@@ -63,7 +66,6 @@ static void truncsp(char *str)
short vdd=0; short vdd=0;
BYTE node_num=0; BYTE node_num=0;
int mode=0; int mode=0;
int revision;
char id_string[128]; char id_string[128];
#ifdef DEBUG_INT_CALLS #ifdef DEBUG_INT_CALLS
ulong int14calls=0; ulong int14calls=0;
...@@ -215,6 +217,32 @@ WORD PortStatus() ...@@ -215,6 +217,32 @@ WORD PortStatus()
#ifdef DEBUG_FOSSIL_CALLS #ifdef DEBUG_FOSSIL_CALLS
DWORD fossil_calls[0x100]; DWORD fossil_calls[0x100];
const char* fossil_func(int func)
{
switch(func) {
case FOSSIL_FUNC_SET_RATE: return "set rate";
case FOSSIL_FUNC_PUT_CHAR: return "put char";
case FOSSIL_FUNC_GET_CHAR: return "get char";
case FOSSIL_FUNC_GET_STATUS: return "get status";
case FOSSIL_FUNC_INIT: return "init";
case FOSSIL_FUNC_UNINIT: return "uninit";
case FOSSIL_FUNC_DTR: return "dtr";
case FOSSIL_FUNC_GET_TIMER: return "get timer";
case FOSSIL_FUNC_FLUSH_OUT: return "flush out";
case FOSSIL_FUNC_PURGE_OUT: return "purge out";
case FOSSIL_FUNC_PURGE_IN: return "purge in";
case FOSSIL_FUNC_WRITE_CHAR: return "write char";
case FOSSIL_FUNC_PEEK: return "peek";
case FOSSIL_FUNC_GET_KB: return "get kb";
case FOSSIL_FUNC_GET_KB_WAIT: return "get kb wait";
case FOSSIL_FUNC_FLOW_CTRL: return "flow_ctrl";
case FOSSIL_FUNC_CTRL_C: return "ctrl_c";
case FOSSIL_FUNC_BREAK: return "break";
case FOSSIL_FUNC_GET_INFO: return "get info";
default: return "unknown";
}
}
#endif #endif
void interrupt winNTint14( void interrupt winNTint14(
...@@ -233,7 +261,7 @@ void interrupt winNTint14( ...@@ -233,7 +261,7 @@ void interrupt winNTint14(
fossil_info_t info = { fossil_info_t info = {
sizeof(info) sizeof(info)
,FOSSIL_REVISION ,FOSSIL_REVISION
,revision /* driver revision */ ,DOSXTRN_REVISION /* driver revision */
,0 /* ID string pointer */ ,0 /* ID string pointer */
,0,0 /* receive buffer size/free (overwritten later) */ ,0,0 /* receive buffer size/free (overwritten later) */
,0,0 /* transmit buffer size/free (overwritten later) */ ,0,0 /* transmit buffer size/free (overwritten later) */
...@@ -345,6 +373,9 @@ void interrupt winNTint14( ...@@ -345,6 +373,9 @@ void interrupt winNTint14(
_fmemcpy(p, &info, wr); _fmemcpy(p, &info, wr);
_ax=wr; _ax=wr;
break; break;
case FOSSIL_FUNC_GET_KB:
_ax=0xffff;
break;
} }
} }
...@@ -482,9 +513,7 @@ int main(int argc, char **argv) ...@@ -482,9 +513,7 @@ int main(int argc, char **argv)
WORD buf_seg; WORD buf_seg;
WORD w; WORD w;
sscanf("$Revision: 1.25 $", "%*s 1.%u", &revision); sprintf(id_string,"Synchronet FOSSIL Driver (DOSXTRN) revision %u %s/%s", DOSXTRN_REVISION, GIT_BRANCH, GIT_HASH);
sprintf(id_string,"Synchronet FOSSIL Driver (DOSXTRN) revision %u", revision);
if(argc<2) { if(argc<2) {
fprintf(stderr fprintf(stderr
,"%s - Copyright %s Rob Swindell\n" ,"%s - Copyright %s Rob Swindell\n"
...@@ -590,7 +619,7 @@ int main(int argc, char **argv) ...@@ -590,7 +619,7 @@ int main(int argc, char **argv)
vdd_str(VDD_LOAD_INI_SECTION, getfname(arg[0])); vdd_str(VDD_LOAD_INI_SECTION, getfname(arg[0]));
sprintf(str,"%s, rev %u, %s %s", __FILE__, revision, __DATE__, __TIME__); sprintf(str,"%s, rev %u, %s %s mode=%u", __FILE__, DOSXTRN_REVISION, __DATE__, __TIME__, mode);
vdd_str(VDD_DEBUG_OUTPUT, str); vdd_str(VDD_DEBUG_OUTPUT, str);
i=vdd_op(VDD_OPEN); i=vdd_op(VDD_OPEN);
...@@ -642,10 +671,10 @@ int main(int argc, char **argv) ...@@ -642,10 +671,10 @@ int main(int argc, char **argv)
vdd_str(VDD_DEBUG_OUTPUT, str); vdd_str(VDD_DEBUG_OUTPUT, str);
#ifdef DEBUG_INT_CALLS #ifdef DEBUG_INT_CALLS
sprintf(str,"int14h calls: %u", int14calls); vdd_str(VDD_DEBUG_OUTPUT, str); sprintf(str,"int14h calls: %lu", int14calls); vdd_str(VDD_DEBUG_OUTPUT, str);
sprintf(str,"int16h calls: %u", int16calls); vdd_str(VDD_DEBUG_OUTPUT, str); sprintf(str,"int16h calls: %lu", int16calls); vdd_str(VDD_DEBUG_OUTPUT, str);
sprintf(str,"int21h calls: %u", int21calls); vdd_str(VDD_DEBUG_OUTPUT, str); sprintf(str,"int21h calls: %lu", int21calls); vdd_str(VDD_DEBUG_OUTPUT, str);
sprintf(str,"int29h calls: %u", int29calls); vdd_str(VDD_DEBUG_OUTPUT, str); sprintf(str,"int29h calls: %lu", int29calls); vdd_str(VDD_DEBUG_OUTPUT, str);
#endif #endif
#ifdef DEBUG_DOS_CALLS #ifdef DEBUG_DOS_CALLS
for(i=0;i<0x100;i++) { for(i=0;i<0x100;i++) {
...@@ -659,9 +688,10 @@ int main(int argc, char **argv) ...@@ -659,9 +688,10 @@ int main(int argc, char **argv)
#ifdef DEBUG_FOSSIL_CALLS #ifdef DEBUG_FOSSIL_CALLS
for(i=0;i<0x100;i++) { for(i=0;i<0x100;i++) {
if(fossil_calls[i]>0) { if(fossil_calls[i]>0) {
sprintf(str,"int14h function %02X calls: %u" sprintf(str,"int14h function %02X (%-10s) calls: %lu"
,i, fossil_calls[i]); ,i, fossil_func(i), fossil_calls[i]);
vdd_str(VDD_DEBUG_OUTPUT, str); } vdd_str(VDD_DEBUG_OUTPUT, str);
}
} }
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment