Subject: ROMs for Mess

From: Jon Guidry <[email-masked]>
Date: Wed, 23 Dec 2009 22:21:55 -0600

Does anyone have these 8K ROMs that they could please e-mail me?

Typewriter 99 (Asgard)
FigForth v2.1
DOS

Thanks,
Jon

---

From: "Tursi" <[email-masked]>
Date: Thu, 24 Dec 2009 00:39:54 -0500

Jon and I recently spent some time going in circles tracking down a bug in 
the multicart menu I did for him whereby the character set and color sets 
were not getting initialized, but it otherwise worked fine. The worst part 
was that it worked fine on the emulators, making it difficult to track down.

The problem turned out to be that during the initialization of the character 
set and color sets, I zeroed VDP Register 1. This blanks the screen, but it 
also sets the VDP to 4k mode instead of 16k mode. Because the VDP is 
DRAM-based, it doesn't use a traditional address bus. Rather, it breaks the 
address bus into two updates - a "row" and a "column". In 16k mode, the row 
and column are each 7 bits wide, which gives 2^7 * 2^7 bits (2^7 = 128, 
128*128 = 16,384). (There are 8 chips to give that value in bytes).

In 4k mode, the row and column are only 6 bits wide, so 2^6 * 2^6 bits (2^6 
is 64, 64*64 = 4,096).

Now, if you are using 16k chips in 16k mode, then all is well - all 14 bits 
of address are relevant.
If you are using 4k chips in 4k mode, this is also peachy - all 12 bits are 
relevant.

But if you mix them, things are not well any more. I don't need to discuss 
using 16k mode on 4k chips - by the end you can work that out yourself if 
you like. But the TI has 16k chips, so if you set 4k mode, something 
interesting happens.

The RAM chips still collect 7 bits of row, and 7 bits of column. However, 
the VDP is only sending 6 bits for each part. It turns out those two unused 
bits get set to '1' when you calculate the actual address that data is 
written to.

I tried MESS and Win994A, and they both seem to ignore the bit. In order to 
help any emulator authors who haven't gone through it yet, I thought I'd 
share a calculation you can use to convert a VDP address into the 'real' 
address it would be written to in 16k DRAMs when the VDP is in 4k mode. 
(Note that only memory accesses are affected - reads and writes. The 
internal counter doesn't get truncated!)

RealVDP = (((VDPADD&0x0fc0)<<1)|(VDPADD&0x003f)) | 0x2040;

VDPADD is the internal VDP address, assumed that it's already trimmed to 14 
bits. In 16k mode, you can just use it directly.

This math first takes the "row" bits, that is, the most significant 6 bits 
of the 12 bit address. It then shifts them up one bit - this will make room 
for the unset column bit. Next we take the least significant 6 bits of the 
12 bit address, and merge that in. Finally, we set the 'unused' row and 
column bits to '1' to get the final address.

This has been verified on real hardware and appears to give the correct 
results.

---

From: "computerclassics2000" <[email-masked]>
Date: Thu, 24 Dec 2009 13:24:14 -0000

Wow! Impressive detective work Tursi, even if I don't really understand it all. :-)

It is a great reminder of why we in the community should be thankful we still have folks with your kind of skill set supporting us.

Thanks!

BillG