CE-Programming / CEmu

Third-party TI-84 Plus CE / TI-83 Premium CE emulator, focused on developer features
https://ce-programming.github.io/CEmu/
Other
1.1k stars 78 forks source link

Text programmatically printed to the console doesn't appear on Windows #224

Closed runer112 closed 6 years ago

runer112 commented 6 years ago

Worked in v1.0, so this is a regression. Likely caused by the console buffering work done in late February (2018).

runer112 commented 6 years ago

Probably a duplicate of #204.

adriweb commented 6 years ago

Actually this is even worse than previously thought.

While #204 is basically broken because of missing types (at least?), the console really is 99% broken on Windows as it will simply stop filling up after a bit.

For instance, I cannot get anything further than this when loading:

[CEmu] Initialized Server [Calculator | cemu-7668]
[CEmu] Initialized Debugger...
[CEmu] Loading Emulator Image...
[CEmu] Initialized Memory...
[CEmu] Initialized CPU...
[CEmu] Initialized Control Ports...
[CEmu] Initialized Flash...
[CEmu] Initialized SHA256 Chip...
[CEmu] Initialized Universal Serial Bus...
[CEmu] Initialized LCD...
[CEmu] Initialized Interrupt Controller...
[CEmu] Initialized Watchdog Timer...
[CEmu] Initialized General Purpose Timers...
[CEmu] Initialized Real Time Clock...
[CEmu] Initialized Protected Ports...
[CEmu] Memory reset.

I'm re-opening this because it's apparently a windows-only issue...

adriweb commented 6 years ago

Good news, I found the issue!

In EmuThread::writeConsoleBuffer, the first vsnprintf returns -1, and perror gives: Result too large. At this point, we have: remaining and space are both 25.

This behaviour is different than on macOS/linux, where vsnprintf returns 29. And at this point, remaining and space are both also 25.

Now to see how to fix that...