CRT Controller Emulation

Support and general discussion.
User avatar
TheMechanist
Posts: 36
Joined: Mon 03 Apr, 2017 6:59 pm

CRT Controller Emulation

Postby TheMechanist » Tue 04 Apr, 2017 8:59 am

Hi,

first, PCem is a great piece of software ! Thanks for your effort. First time booting the AMI 286er and installing MS DOS 5.0 felt like a time travel back to the 90ies to my children's room :geek:

I'm doing some DOS 16 Bit retro demo stuff targeting 286er machines and I've chosen PCem 'cause of it's known cycle accuracy .. some of the effects use direct CRTC programming, atm just documented functions that can be found in VGA reference manuals.

A smooth vertical scrolling in text mode 80x25, characters height 16 pixels/scanlines, is done by programming the CRTC Register with index 8 - "Preset Row Scan Register", and writing bits 0 - 4, to shift that amount of scanlines. It works flawlessly in DOSBox, but not with PCem v12 - neither with linux nor with windows builds -, no matter wich VGA Bios is used. Writing e.g. "Start Address High/Low Register" works; that's why the lines are shifted only by character height, which is not smooth ;)

http://www.osdever.net/FreeVGA/vga/crtcreg.htm

I'm not sure how far the development has come .. is it a bug or an atm not implemented function ?

Btw. the linux build doesn't recognize et4000.bin while windows build does :?

Greetz

TheMechanist
AmatCoder
Posts: 28
Joined: Thu 02 Mar, 2017 8:45 pm

Re: CRT Controller Emulation

Postby AmatCoder » Tue 04 Apr, 2017 3:06 pm

TheMechanist wrote:[...] Btw. the linux build doesn't recognize et4000.bin while windows build does :? [...]


Looking at the code, i think that you need to renamed it because on Linux filenames are case sensitive (and PCem is searching for et4000.BIN file).

On Windows it works because the case is ignored if file is open with a Win32 program (like Pcem).
User avatar
TheMechanist
Posts: 36
Joined: Mon 03 Apr, 2017 6:59 pm

Re: CRT Controller Emulation

Postby TheMechanist » Tue 04 Apr, 2017 6:39 pm

AmatCoder wrote: .. PCem is searching for et4000.BIN file ...


okay, that should be uniform for all required files .. I renamed all rom files to lowercase since it was recommended in that forum 'cause of case sensitivity, in most cases it works ..

Regarding the CRTC Bug - any idea ? I looked at the source code but I have no idea where to start and where the problem could be :(
SarahWalker
Site Admin
Posts: 1314
Joined: Thu 24 Apr, 2014 4:18 pm

Re: CRT Controller Emulation

Postby SarahWalker » Tue 04 Apr, 2017 8:16 pm

Register 8 isn't currently emulated I'm afraid. I can add it, but probably not until the weekend.
User avatar
TheMechanist
Posts: 36
Joined: Mon 03 Apr, 2017 6:59 pm

Re: CRT Controller Emulation

Postby TheMechanist » Wed 05 Apr, 2017 8:57 am

SarahWalker wrote:Register 8 isn't currently emulated I'm afraid. I can add it, but probably not until the weekend.


Hi Sarah, wow, thanks ! There's no rush .. do you have an overview which CRT / Sequencer Registers are not emulated ?

Btw. I tried some 199x PC Demos/intros

check it out: http://www.pouet.net/prodlist.php?platf ... &reverse=1

and a lot of them performed really well, which is the ultimate accolade for your emulator since the scene uses a lot of undocumented vga tweaks to enable graphic effects :ugeek: .. good job !

I guess PCem could be the perfect environment for demo parties with an oldschool pc demo compo !
User avatar
TheMechanist
Posts: 36
Joined: Mon 03 Apr, 2017 6:59 pm

Re: CRT Controller Emulation

Postby TheMechanist » Wed 19 Apr, 2017 8:44 am

Seems, that PCem doesn't atm support Mode 320x240x256 (called "Mode-X") ..

http://www.jagregory.com/abrash-black-b ... color-mode
see Listing 47.1

It's essentially changing some CRT registers, which you can see in the listing step by step .. when changing these registers, PCem stays with 200 scanlines ..

This Mode-X is reported to work on every piece of real VGA Hardware (Dosbox supports it), Software & Games used it, so it's not just a freaky tweak for some hardcore nerds :ugeek:. Not high priority but should be supported on a long term basis for perfect emulation.

btw. 320x200 unchained mode works.
SarahWalker
Site Admin
Posts: 1314
Joined: Thu 24 Apr, 2014 4:18 pm

Re: CRT Controller Emulation

Postby SarahWalker » Wed 19 Apr, 2017 11:40 am

Umm, pretty sure 320x240x256 works, and always has. Any examples of anything using it that doesn't work?
User avatar
TheMechanist
Posts: 36
Joined: Mon 03 Apr, 2017 6:59 pm

Re: CRT Controller Emulation

Postby TheMechanist » Wed 19 Apr, 2017 2:27 pm

oh, sorry, maybe my fault .. atm only my code, I initialized the mode like Michael Abrash did, in Dosbox it went fine .. I'll check it again and tell you if I find the bug, perhaps PCems emulation is simply more realistic than dosbox and doesn't forgive coders inaccuracies !
User avatar
TheMechanist
Posts: 36
Joined: Mon 03 Apr, 2017 6:59 pm

Re: CRT Controller Emulation

Postby TheMechanist » Wed 19 Apr, 2017 8:30 pm

After a lot of testing, I have to deeply apologise to you - yes, Mode-X works with PCem, and not just 320x240 but a lot of modes I even didn't know that they are available

http://www.pouet.net/prod.php?which=66241 - I tested 320x240, 256x240, 360x360 and even 376x564 :ugeek:

As guessed - since my code worked with Dosbox - PCem is much more accurate and even small differences in the register data matter - obviously dosbox just guesses, what the coder wanted to do .. one reason more for me, to test with PCem !

Return to “General”

Who is online

Users browsing this forum: No registered users and 3 guests