VOGONS


First post, by superfury

User metadata
Rank l33t++
Rank
l33t++

Exactly what effect does having the KEY(as it's documented using ports 3BF(value 3 or 1) and 3B8/3D8 setting bits 3&5 or not setting both bits to enable/disable the KEY have on writing and reading the extended CRTC registers?

It's documented that writes to extended CRTC registers other than 0x33(Implemented in Dosbox, which is half wrong) and 0x35(blocked in Dosbox, always allowed according to documentation, with only some bits write-protected bits by index 07h bit 7(the usual CRTC write protection)) are not done by the chips.

But what is the real effect of this KEY being not set(or being cleared, whatever you want to call it) on the reading of said registers? Will the reads of extended registers(past 0x18) succeed? Will they always read 0? Or will they float the bus and always read 0xFF?

I see different emulators doing different things on this:
PCem doesn't seem to protect or apply the KEY at all (all writes and reads, except to the VGA-documented register 07h bit 7 write-protected VGA(Not ET4000 ones) bits are just written to their respective registers! That's obviously against documentation?
Dosbox simply blocks any writes and reads to any extended register other than 0x33(so it's against documentation in blocking both writes and reads to register 0x35 completely for even the writable bits when the KEY isn't set). 0x35 is supposed to be writable, other than the protected bits by register 07h bit 7(CRTC Write-Protect bit).

I'm trying to get it correct in UniPCemu right now. Writes to other extended CRTC registers than 0x33/0x35 are blocked(0x35 has some bits write-protected by index 07h bit 7). Reads from extended CRTC registers are always allowed atm.

Anyone knows the exact behaviour on ET4000 and ET4000/W32, ET4000/W32i and ET4000/W32p chips?

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 1 of 4, by superfury

User metadata
Rank l33t++
Rank
l33t++

Does anyone have a ET4000 and/or ET4000/W32(or ET4000/W32i, but not ET4000/W32p) card and is willing to verify if those registers are readable when the KEY isn't set?

The emulators themselves seem to all go against documentation on that (Dosbox, 86box, PCem, PCem-X)? Of course, the PCem-X are the worst of all(no protection and KEY is implemented AT ALL!).

The most simple test would be to display any value read from one of the protected registers while they KEY isn't set and display it's value read in hex(store as variable #0), then set the KEY, backup the original value of such an register (store as variable #1), write a value with (partly if otherwise unsafe according to documentation) inversed bits to the register(new value stored as variable #2), disable the KEY, store the value now read from the register (store as variable #3), set the KEY again, write the variable #1 back to the register, disable the KEY.
Finally just print (in hex, in 2 hex digits for each variable) variables #0, #1, #2, #3 in that order.

I've placed a simple program(only run this on a ET4000 or compatible chip!) in the UniPCemu's repository, in the assembly folder to show how the 6845 compatiblity register is affected(non-destructive, just toggling bit 3 which should be safe on the Tseng chips).

Dosbox SVN Daum reports 00000800 on the ET4000 chipset (meaning that it's original 00h, 00h with KEY, 08h written with KEY(bit 3 has been toggled, which should be safe) and 00 read back without KEY after that).

I've compiled it using nasm into a working .com program.

Anyone willing to run this on their ET4000 or ET4000/W32i and report the results that it gives? And with that I mean actual barebones hardware, not an emulated one (unless confirmed exactly the same as actual hardware).

Although ideally, I would want it's results on all ET4000 chipsets(ET4000AX, ET4000/W32, ET4000/W32i and ET4000/W32p) for exact documentation and implementation of course (that would also benefit other emulators actually implementing those W32i/W32p chipsets).

It's source code can be found at the UniPCemu repository ( https://bitbucket.org/superfury/unipcemu/src/ … 0protection.asm ).

Filename
testET4000protection.zip
File size
417 Bytes
Downloads
69 downloads
File comment
Compiled version of the testET4000 program.
File license
Public domain

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 2 of 4, by superfury

User metadata
Rank l33t++
Rank
l33t++

A slight bugfix of the app:

Filename
testET4000protection_20210326_1731.zip
File size
417 Bytes
Downloads
69 downloads
File comment
The fixed output settings of the app.
File license
Fair use/fair dealing exception

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 3 of 4, by superfury

User metadata
Rank l33t++
Rank
l33t++

Eventually found a lot more bugs in the last version:

Filename
testET4000protection_20210326_2202.zip
File size
421 Bytes
Downloads
70 downloads
File comment
Latest ET4000 protection tests bugfixes.
File license
Fair use/fair dealing exception

It fixes quite a lot of little bugs:
- Code and data segment are the same.
- Put the graphics card in color mode always.
- Added a hex display of the data read back after writing the toggled bit to register 34h.
- Simplified CRTC register reading code.
- Properly write the register instead of reading it when requested to write it.
- Fixed clearing of the KEY to clear it correctly according to documentation (was reversed registers and wrong value to the mode control register).
- Fixed values A-F hex display to be calculating the character code correctly.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 4 of 4, by superfury

User metadata
Rank l33t++
Rank
l33t++

Another needed update with the bugfixes it needs:

Filename
testET4000protection_20210327_1217.zip
File size
431 Bytes
Downloads
75 downloads
File comment
ET4000 KEY test build 2021/03/27 12:17
File license
Fair use/fair dealing exception

- Save flags as well during program execution.
- Assume .COM CS=DS
- Properly restore the Tseng modifed CRTC register at the end of the tests.
- Newline after each outputted byte of the results for ease of readability.
- Fixed clearing of the Tseng KEY to properly setup it's registers to do so (instead of writing to wrong I/O ports in DX).
- Simplified 4-bit hex printing function.
- Seperated CRLF printing into a function.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io