I am programming a multiplayer application in DOS so I can get some experience with serial networking programming and I have run into an issue with sending commands to the modem. It is only supposed to send English alphabetical characters, but instead, it sends a group of weird characters, many of which are not even in the English language.
Here is some of my code:
void com_tx(int portnum, unsigned char c)
{
Uart *p= GetPort(portnum);
if (p->com_installed)
{
while (!com_tx_ready(portnum))
; /* Wait for non-full buffer */
disable(); // Interrupts off
p->tx_queue[p->tx_in++] = c; // Stuff character in queue
if (p->tx_in == TX_QUEUE_SIZE)
p->tx_in = 0; // Wrap index if needed
p->tx_chars++; // Number of char's in queue
// Enable UART tx interrupt
outp(p->uart_ier, inp(p->uart_ier) | THRE);
enable(); // Interrupts back on */
}
}
Yes, I know, some of you may find this issue on StackOverflow, but that is because I copied and pasted everything I put on there to gamedev.net because it is kind of early in the morning and I can't type well right now. But still, this is an error I can not quite find the source to…
Here is what the DosBox console window says when I try to send something to the modem:
Modem response:
ERROR Command sent to modem: ->♦(CAZ☻^♦ ♦-CAZ☻^♦♣♦2CAZ☻^♦☺♦7CAZ☻^♥ⁿ♦<CAZ☻^♥≈♦ACAZ☻^♥≥♦FCAZ☻^♥φ♦KCAZ☻^♥Φ♦PCAZ☻^♥π♦UCAZ☻^♥▐♦ZCAZ☻^♥C<-
Thank you all in advance!