WIP: Vermont Microsystems Image Manager 1024

Post Reply
User avatar
JohnElliott
Posts: 113
Joined: Sun 31 Jan, 2016 7:29 pm

WIP: Vermont Microsystems Image Manager 1024

Post by JohnElliott »

This is very much not ready for prime time - I'm posting what I've written so far just in case I get hit by a meteorite or something.

It's a patch implementing not quite enough of the Vermont Microsystems Image Manager 1024 to run Windows 1.03 in 256-colour mode. It's inclined to hang from time to time (usually when blitting from screen to memory) and since I haven't implemented filled polygons the calculator buttons are all wrong. But here it is anyway.

Image
Attachments
im1024.patch
(114.19 KiB) Downloaded 777 times
User avatar
JohnElliott
Posts: 113
Joined: Sun 31 Jan, 2016 7:29 pm

Re: WIP: Vermont Microsystems Image Manager 1024

Post by JohnElliott »

OK, I think this is about as good as it gets, at least as far as running Windows 1 in 256 colours is concerned.

Image

What the patch gives you isn't anything like a complete IM1024, or even a complete PGC. But it does seem to cover those features used by IM1024.DRV, which was my aim in writing it.

Implementing all the functions not used by IM1024.DRV is left as an exercise for the interested reader :)
Attachments
im1024_final.patch
(128.52 KiB) Downloaded 771 times
User avatar
JohnElliott
Posts: 113
Joined: Sun 31 Jan, 2016 7:29 pm

Re: WIP: Vermont Microsystems Image Manager 1024

Post by JohnElliott »

... Actually, the above patch may not be so final, because some of the graphics in Micrografx In*a*Vision don't render properly. Back to the coding mill for me...
User avatar
JohnElliott
Posts: 113
Joined: Sun 31 Jan, 2016 7:29 pm

Re: WIP: Vermont Microsystems Image Manager 1024

Post by JohnElliott »

This version of the patch seems to sort out the issues I was experiencing with In*a*Vision - mainly to do with bugs and overflows in the polygon fill.

Image
Attachments
im1024_3.patch
(131.62 KiB) Downloaded 732 times
User avatar
JohnElliott
Posts: 113
Joined: Sun 31 Jan, 2016 7:29 pm

Re: WIP: Vermont Microsystems Image Manager 1024

Post by JohnElliott »

Updated again to fix bits of Write:
  • TDEFIN was losing sync on non-square fonts, because I had 'rows' and 'columns'' round the wrong way
  • TSIZE was not implemented
  • There's a variant of the text draw command that Write uses when drawing page numbers. For now I've aliased it to the normal one, so the text will at least render.
Attachments
im1024_4.patch
(133.89 KiB) Downloaded 772 times
User avatar
JohnElliott
Posts: 113
Joined: Sun 31 Jan, 2016 7:29 pm

Re: WIP: Vermont Microsystems Image Manager 1024

Post by JohnElliott »

This patch (on top of the previous v4 patch) fixes character rendering when VMILO.FON is used as the system font.

It was a bit awkward to make because it also depends on the changes to the font loader in my PC200 / PPC512 patches. I've replicated enough of those changes in this patch to get the result to compile, but if you're trying to apply both patchsets you'll run into conflicts.

I haven't uploaded the font (im1024font.bin) though my understanding is that it should be out of copyright by now, since it's (c) 1986 and font copyright in the UK lasts 25 years.

Image

ETA: Here's how to generate the font ROM with psftools-1.0.12:

Code: Select all

fon2fnts vmilo.fon
fnt2psf Terminal_12.fnt | psf2raw > im1024font.bin
Attachments
im1024_4_to_5.patch
(8.24 KiB) Downloaded 745 times
User avatar
SarahWalker
Site Admin
Posts: 2055
Joined: Thu 24 Apr, 2014 4:18 pm

Re: WIP: Vermont Microsystems Image Manager 1024

Post by SarahWalker »

Couple of questions about the IM1024 FIFO. Are you sure it's not just writing into the ordinary PGC FIFO at C6000 rather than being a separate thing?

Also I'm guessing that if the drivers aren't checking for FIFO full, then it's entirely possible that the write will just stall the CPU until there is room. It may be more elegant to wait for the pgc_thread to read something rather than increasing the FIFO size every time the CPU gets ahead; that's what the Voodoo code is currently doing.
User avatar
JohnElliott
Posts: 113
Joined: Sun 31 Jan, 2016 7:29 pm

Re: WIP: Vermont Microsystems Image Manager 1024

Post by JohnElliott »

It's entirely possible that the processor gets stalled either when the FIFO is written, or when the driver asks how many bytes are in it - though without real hardware or documentation I can't be sure. And if it does stall when the FIFO is full, it may be implemented using the same 256-byte area of memory as a normal PGC. The algorithm used to write is rather different, though, always sending commands to C6000 rather than using the write pointer at [C6300], and checking [C6331] for the FIFO status.

The actual write code in IM1024.DRV is like this:

Code: Select all


;
; SI -> command to write
; CX =  bytes to write
; ES =  C600
;
X40D9:	mov	cs:W3F96,0	;Bytes to write
	call	X4101		;Get number of bytes that can be written
	cmp	ax,cx		;Room for the entire command?
	jnc	X40EE
	xchg	ax,cx		;No, write only what there's space for
	sub	ax,cx		;
	mov	cs:W3F96,ax	;Bytes outstanding
X40EE:	xor	di,di		;Write the command at C600:0000
	rep	movsb
	mov	cx,cs:W3F96	;Any bytes left?
	or	cx,cx
	jnz	X40D9
;
; ...
;
X4101:	push	di
	mov	di, 331h
	mov	al, es:[di]	;Get FIFO status from C600:0331
	not	al
	xor	ah, ah		;AX = free space in FIFO
	pop	di
	retn

User avatar
SarahWalker
Site Admin
Posts: 2055
Joined: Thu 24 Apr, 2014 4:18 pm

Re: WIP: Vermont Microsystems Image Manager 1024

Post by SarahWalker »

Merged at rev 1223. I also added some sane pixel clocks.
Post Reply