TASEmulators / pcem

PCem (short for PC Emulator) is an IBM PC emulator. This version of PCem has multi-threading disabled in order to ensure determinism when running though libTAS.
http://tasvideos.org/EmulatorResources/PCem.html
GNU General Public License v2.0
5 stars 1 forks source link

Voodoo FIFO command broken #1

Closed clementgallet closed 4 years ago

clementgallet commented 4 years ago

I don't know how it was working before. The single-threaded patch broke the Voodoo FIFO command execution. In the patch, commands are immediately executed after being pushed in the FIFO, as long as the corresponding instruction is complete, but commands are actually not written sequentially in the FIFO.

Normal execution (second to last is value, last is address). Notice the written addresses are not sequential!

Write CMDFIFO 002001a4(001201a4) 800000c0  001201a4
Write CMDFIFO 002001a0(001201a0) 00012601  001201a0
Write CMDFIFO 002001a8(001201a8) 00012611  001201a8
Write CMDFIFO 002001ac(001201ac) 000040ff  001201ac
...
  CMDFIFO get 00012601
  CMDFIFO get 800000c0
  CMDFIFO get 00012611
  CMDFIFO get 000040ff

Current patched code execution:

Write CMDFIFO 002001a4(001201a4) 800000c0  001201a4
  CMDFIFO get 00000000
Write CMDFIFO 002001a0(001201a0) 00012601  001201a0
  CMDFIFO get 800000c0
Write CMDFIFO 002001a8(001201a8) 00012611  001201a8
  CMDFIFO get 00012611
Write CMDFIFO 002001ac(001201ac) 000040ff  001201ac
  CMDFIFO get 00012611
  CMDFIFO get 000040ff

The first pulled value is 0, because the FIFO was increased, but no value was written in that place.

The intended instructions are:

00012601 800000c0
00012611 000040ff

But instead it executes:

00000000
800000c0
00012611 000040ff
clementgallet commented 4 years ago

Fixed in 0df886af6e1df56f2f326f707eb02090f20e80a2