Reply 640 of 698, by superfury
Just improved the modem emulation to perform ATD* and ATA asynchronously (only one of those two at a time though).
So when the modem receives an command for one of those two, the command is performed in the background and other commands can be given in the meanwhile, at least until the connection gives it's result (so ATH can abort the call for example).
Edit: Although Telemate won't start properly (due to some CPU bugs afaik), running MODEMD70(Modem Doctor 7.0?), I could test the new functionality a bit.
Although SDL3 still seems to have issues detecting a disconnect, trying to connect to it while it's 'ringing' (SDL3 reporting the connection even though it already disconnected) properly makes it (SDL3) report the disconnect, causing the modem to drop the connection properly.
Another new thing that can be done now, is when dialing out or answering a connection, you can use ATH before it completes (or any other command for that matter). So triggering ATD*/ATA to dial/answer, then immediately sending ATH(or low DTR if enabled) it will immediately drop the connection attempt as soon as possible (causing a disconnect on the request before it finishes connecting if possible). Other commands will work as well, but the effect of ATD*/ATA will take it's documented effect once it succeeds connecting (causing the new data mode to be applied if enabled). So you can get:
ATDTgoogle.com:80
ATH
NO CARRIER
OK
or:
ATDTgoogle.com:80
ATS0=1
OK
CONNECT 57600
or combined even (if you're really fast enough to send those commands before it finishes):
ATDTDgoogle.com:80
ATS0=1
OK
ATH
NO CARRIER
OK
Of course one way to do that is make it perform a really slow failing connect to some weird address (I remember SDL on Dosbox running Windows 95 for example literally hanging for a second or 10 trying to connect).
One nice thing is that UniPCemu now no longer hangs in those cases, as it performs the connect using multithreaded resolution and connecting now. So the main thread isn't blocked and keeps being responsive, while the parallel threads grind away at trying to make the connection in 2 steps (1 thread started for IP resolution(in parallel with emulation, which closes itself when it's ready), main thread starting another thread for connecting using that (in parallel with emulation, which closes itself when it's ready), finally the main thread parses the connection and makes it ready for use.
The receiver otoh is working much like before, although SDL3 has some extra functionality which should (excluding above error) make the receiving of a dial be more accurate using TCP. But too bad, the SDL3 library messes up a bit there (reporting ready to read when it isn't connected anymore).
Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io