I don't mean the command number or data itself. I mean the way data is transported. So things like Status port input being the same as keyboard, input data method using the same output buffer as the keyboard, sending command data(write to port 0x64) using the same input buffer as the keyboard, while data parameters(write to port 0x60) essentially works the same as for the keyboard.
Although you can replace keyboard above with connected device #1(First PS/2 port).
So it would probably increase compatibility to modify the 8042 to send commands/data and receive results in the same way as the keyboard data(although 8042 would have priority over keyboard)? That would probably fix the remaining problems with the 8042 chip emulation?
The data for keyboard and mouse devices are already timed in a roughly cycle-accurate way. I would simply have to add an alternative route for port 1(8042 having priority) input/output, while port 0x64 writes would be handled like some kind of Output this byte to the 8042(in much the same way a data byte is sent to the second PS/2(mouse) that's connected using one 0xDX(don't remember which one atm) command followed by a write to port 0x60 to send it to the second port. Although in this case, it's redirected to the 8042, with the data written to port 0x64 placed in the input buffer.
Btw, I'm using input/output buffers from the hardware perspective.
Would that fix those remaining I/O bugs?
So, essentially, the 8042 commands and data/results would be much like the keyboard and mouse, although it's using a third(invisible, acting like the keyboard) channel with highest priority and a seperate port(0x64) to send special data bytes using an override on the keyboard, which receives, acting as the keyboard(except different result bytes etc.) to act the same as a real chip.
Would that work?