VOGONS


First post, by SoUrcerer

User metadata
Rank Newbie
Rank
Newbie

Sup! There are bug in DosBox 0.74.

You can check bug with code like this:

STRING DB 5
LEN DB 0
ASCII DB '00000'

mov ah, 0Ah
mov dx, offset STRING
int 21h

This code should allow to enter up to 4 (!!!) symbols, but in DOSBox I can enter up to 5 symbols. When I enter 5th symbol and press "Enter", DOSBox hangs.
I checked compiled EXE in DosBox and in MS DOS 6, so this is real bug.

Reply 1 of 4, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

It works a bit different than DOS, but I don't see it (literally) hanging DOSBox. When you enter too many characters the carriage return is ignored; but you can still use backspace to reduce the number of characters until the carriage return is accepted.

The attached patch changes the input loop to behave more like DOS. The old textmode game "Snipes" uses the function when prompting for its two-character skill level, so there is at least one game that can benefit. 😉

Attachments

  • Filename
    int21_0a.diff
    File size
    532 Bytes
    Downloads
    504 downloads
    File license
    Fair use/fair dealing exception

Reply 3 of 4, by cfoesch

User metadata
Rank Newbie
Rank
Newbie
Qbix wrote:

got to look up the specs of that function again.

As a handy helper, I looked it up in my DOS reference files:

Byte 1: Maximum number of chars the buffer will take, including CR. Reading STDIN and filling the buffer co […]
Show full quote

Byte 1: Maximum number of chars the buffer will take, including CR.
Reading STDIN and filling the buffer continues until a carriage
return (<Enter> or 0Dh) is read. If the buffer fills to one less
than the maximum number the buffer can hold, each additional
number read is ignored and ASCII 7 (BEL) is output to the
display until a carriage return is read. (you must set this
value)

(reference is counting from 1, not 0) Looking at the patch, it looks like the code was an off-by-one error for a full-buffer... probably, because the standard seems odd by current design principles.

Reply 4 of 4, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

the patch looks like an improvement.

However, this function should oneday be rewritten to include the functionality that is now used when typing a command in the shell; then the shell should call this function, but tab completion makes things a little tricky.

Water flows down the stream
How to ask questions the smart way!