Subject: Mysterious VDP mode...

From: "Marc H" <[email-masked]>
Date: Mon, 27 Sep 2010 23:48:14 -0000

Has anyone actually every used the so called half bit map mode of the VDP ?  I am trying to get an understanding of how to set it up and have scoured the July 96 issue of MP and it doesn't make sense to me.  It appears that Mr. Harrison is setting his VDP up for regular bit map mode with the only difference being where he is stashing some tables.  I find it hard to believe that table location would effect the mode so what am I missing here ?

Marcus..

---

From: "Ksarul" <[email-masked]>
Date: Mon, 27 Sep 2010 20:25:46 -0400

For a very good look at what half-bitmap will do for you, I seem to remember
that Boulder Dash (Rock Runner) used it to great effect when displaying the
gems and for several other in-game effects. . . 

Jim

  _____  

From: [email-masked] [mailto:[email-masked]] On Behalf Of
Marc H
Sent: Monday, September 27, 2010 7:48 PM
To: [email-masked]
Subject: [TI994A] Mysterious VDP mode...

Has anyone actually every used the so called half bit map mode of the VDP ?
I am trying to get an understanding of how to set it up and have scoured the
July 96 issue of MP and it doesn't make sense to me. It appears that Mr.
Harrison is setting his VDP up for regular bit map mode with the only
difference being where he is stashing some tables. I find it hard to believe
that table location would effect the mode so what am I missing here ?

Marcus..

---

From: "Tursi" <[email-masked]>
Date: Mon, 27 Sep 2010 17:36:42 -0700

> Has anyone actually every used the so called half bit map mode of the VDP 
> ?  I am trying to get an understanding of how to set it up and have 
> scoured the July 96 issue of MP and it doesn't make sense to me.  It 
> appears that Mr. Harrison is setting his VDP up for regular bit map mode 
> with the only difference being where he is stashing some tables.  I find 
> it hard to believe that table location would effect the mode so what am I 
> missing here ?
>

I used it for my ColecoVision Mario Bros game until the sprite artifacts 
started to cause problems. It's pretty easy to set it up.

Remember that there is nothing magical about it, and it's not an 
undocumented mode as many people have stated (that is, it's documented in 
the TMS9918A datasheet, but not in the E/A manual). All you are doing is 
setting up masks on the color and pattern tables that reduce their size 
and/or count.

Thierry (as always) has an excellent discussion of how this works on his 
page here: http://nouspikel.group.shef.ac.uk//ti99/tms9918a.htm#Bitmap

Read through the section "Hybrid Bitmap Modes".

The general usage of "half-bitmap" on the TI is to set up the system for 
just one pattern/color table, instead of 3, giving you 256 characters just 
like in graphics 0, but each character has the full color resolution of 
bitmap mode.

Be aware that when the pattern table masking is active, only the first eight 
(was it seven or eight?) sprites can be used freely, the others will mirror 
in the same locations as the pattern table does when they move around the 
screen. I published an example source to the original list six months or so 
ago demonstrating this artifact and asking if anyone knew about it, and got 
several articles in response.

---

From: "Matthew" <[email-masked]>
Date: Tue, 28 Sep 2010 07:03:30 -0000

> setting up masks on the color and pattern tables that reduce their size 

I would be very interested in knowing where in the 9918A datasheet the masks are documented.  I did not know about them until you mentioned it previously and I spent some time on Thierry's site.  As far as I know, there is no *official* documentation on the masks or the hybrid modes.

Matthew

---

From: "Tursi" <[email-masked]>
Date: Tue, 28 Sep 2010 13:25:12 -0700

> I would be very interested in knowing where in the 9918A datasheet the 
> masks are documented.  I did not know about them until you mentioned it 
> previously and I spent some time on Thierry's site.  As far as I know, 
> there is no *official* documentation on the masks or the hybrid modes.
>

Man, you guys LOVE to call me out. :(

You are correct that the official datasheet does not appear to mention 
this... instead it tells you to set all the 'unused' bits to '1' and doesn't 
say anything more about it. I checked all three versions of the datasheet 
that I have.

My last hope for avoiding the old folk's home for my corrupted memory was 
the Video Display Processors Programmer's Guide, SPPU004, published by TI in 
1984. And though extremely brief, it didn't let me down. In fact it 
describes exactly the standard "half-bitmap" mode we have commonly discussed 
in this community. Section 8.4.2, "Playing Games with VRAM Addressing", 
describes the register setup for half-bitmap mode (though it does not use 
that name), and warns about the sprite problems this mode causes. It's a 
horrible description the doesn't explain much about why it works, but it IS 
*official* documentation. ;)

"What this mode does is effectively shrink the Graphics II Mode Color and 
Pattern Tables down
from Hex 1800 bytes to Hex 800 bytes. This enables us to define up to 256 
8x8 pixel patterns
and 256 corresponding eight byte Color Table entries. Color is still mapped 
onto a pattern
exactly as in Graphics II Mode.

The 768 byte Name Table is not split up into three equal sections as in 
Graphics II Mode but
works as in Graphics I Mode. A byte of information written anywhere in the 
Name Table will
select the appropriate pattern and the corresponding eight byte color entry 
and place it on the
screen. In Appendix C can be found the Pattern Graphics Address Location 
Tables.

This mode is useful because it provides the memory savings of Graphics I 
Mode while allowing
the color detail available in Graphics II Mode. However, a unique pattern 
for each screen
position can no longer be defined, which is necessary for highly detailed 
pictures or for bitmapping
the screen. When in this mode 32 sprites can no longer be used. If you try 
to put
more than eight sprites on the screen at once, they will start to duplicate 
themselves on the
screen."

Appendix C of the same document describes exactly how the masks are used to 
calculate the final address for a table lookup.

I have uploaded this document here:
http://harmlesslion.com/temp/Video%20Display%20Processors%20-%20Programmer's%20Guide.pdf

(if hotlinking does not work, forbids or redirects, just use the temp folder 
and select from the list of files).

---

From: mark wills <[email-masked]>
Date: Tue, 28 Sep 2010 20:43:44 +0000 (GMT)

That's right, but I really didn't see what the fuss was about... Looked pretty 
normal to me...

>
>From: Ksarul <[email-masked]>
>Sent: Tue, 28 September, 2010 1:25:46
>Subject: RE: [TI994A] Mysterious VDP mode...
>
>   
>
>
>that Boulder Dash (Rock Runner) used it to great effect when displaying the gems 
>and for several other in-game effects. . . 
>
> 
>Jim
>

---

From: "Ksarul" <[email-masked]>
Date: Tue, 28 Sep 2010 17:31:04 -0400

I think the real fuss at the time was the fact that it was the first use of
that mode on a TI game (at least that anyone had heard of up until that
time, as the VDP Programmer's Guide wasn't readily available to the
community back then).

Jim

  _____  

From: [email-masked] [mailto:[email-masked]] On Behalf Of
mark wills
Sent: Tuesday, September 28, 2010 4:44 PM
To: [email-masked]
Subject: Re: [TI994A] Mysterious VDP mode...

That's right, but I really didn't see what the fuss was about... Looked
pretty normal to me...

Jim

---

From: "Matthew" <[email-masked]>
Date: Tue, 28 Sep 2010 21:26:40 -0000

> Man, you guys LOVE to call me out. :(

Well, you know I *am* trying to make the 9918A in a FPGA... ;-)  I've been through the 9918A datasheet some many times I could probably reproduce it from memory, which is why I was shocked when you asked me: "have you implemented the masking too?"  I was like "what masking?"

I do have that PDF, but only recently I think.  I have not had time to read through it and I did not think it added any information over the datasheet.  I think Thierry's site it still the most accurate source of information, and the 9918A used in the FPGA Aracade Colecovision also implements the masking, so I have a low-level reference as well.

Matthew

---

From: "Tursi" <[email-masked]>
Date: Tue, 28 Sep 2010 16:07:58 -0700

> Well, you know I *am* trying to make the 9918A in a FPGA... ;-)  I've been 
> through the 9918A datasheet some many times I could probably reproduce it 
> from memory, which is why I was shocked when you asked me: "have you 
> implemented the masking too?"  I was like "what masking?"
> I do have that PDF, but only recently I think.  I have not had time to 
> read through it and I did not think it added any information over the 
> datasheet.  I think Thierry's site it still the most accurate source of 
> information, and the 9918A used in the FPGA Aracade Colecovision also 
> implements the masking, so I have a low-level reference as well.
>

hehe.. fair enough. Actually Appendix C in that document /does/ have more 
information than the datasheet, in that it tells you exactly, at the bit 
level, how addresses are calculated from the VDP registers, screen position, 
and character. I think it would be useful for your FPGA approach - if only 
to validate what you already did. Rather than statements like "multiply by 
 >400", it shows you where the bits line up.

---

From: "kabldb" <[email-masked]>
Date: Wed, 29 Sep 2010 07:34:47 -0000

Thanks for the insight/info. ;-)

A great graphic mode only let down a bit by this quirk. Guess you went full bitmap with your Mario Bros. Are there any plans for a TI version ? :-)

---

From: tursi <[email-masked]>
Date: Wed, 29 Sep 2010 18:15:03 -0700 (PDT)

> Thanks for the insight/info. ;-) A great graphic mode only let down a 
> bit by this quirk. Guess you went full bitmap with your Mario Bros. Are 
> there any plans for a TI version ? :-)

Yes, and yes, as soon as I get time to test the GCC port that was recently 
done (or do my own C compiler if that doesn't fit my
needs).

---

From: "kabldb" <[email-masked]>
Date: Thu, 30 Sep 2010 08:00:25 -0000

> done (or do my own C compiler if that doesn't fit my

Sure will be the coolest game for the TI when that happens.

Where can I find more information about your Mario Bros. Mostly interested in specs, hows, whys and bins for giving it a spin.

:-)

---

From: "Tursi" <[email-masked]>
Date: Thu, 30 Sep 2010 01:34:29 -0700

> Where can I find more information about your Mario Bros. Mostly interested 
> in specs, hows, whys and bins for giving it a spin.
>

Specs are: 64k cartridge, about 48k of that is code, 12k graphics, 4k audio. 
Runs in bitmap mode. Sprites are dynamically updated both for position and 
pattern every frame, giving animation through dynamic loads to VDP and 
flicker effects by rotating the sprite table. Players are 3 colors each, 
enemies are single color. Contains all intermissions, all enemies except the 
icicles on the higher stages, single and double player simultaneous mode. 
Simulates an arcade experience by taking 'credits' and tracking high scores 
(volatile).

Written using SDCC and a set of ColecoVision libs.. although since that 
project I've written my own interface code for the 9918. Since ROM was 
plentiful some parts of the code are not very efficient, like entire screen 
tables for collision detection and uncompressed audio sound effects. Dynamic 
VDP sprite loading allowed an automatic animation engine to be written that 
keep VRAM usage down (or down as much as possible). Originally I used 
half-bitmap mode to simplify the backgrounds, but switched to full bitmap 
mode when the sprites started 'ghosting' - except for a couple of extra copy 
loops during setup, there was no real impact since VRAM wasn't full of 
graphics anyway.

Why is because I was asked to and had the time and interest to spare. ;) It 
took approximately a year. I was given permission to port if it the means 
come around.

I can't help you much with the bin, it was a commission and is not mine to 
do with as I please. Technically I am /trying/ to keep a low profile as the 
coder. ;) Although you can keep an eye on this thread: 
http://www.atariage.com/forums/topic/169372-colecovision-mario-bros-revisiona-rom-release/

There are some videos on YouTube, including glitches people found:
http://www.youtube.com/watch?v=JAwNWHv0Ipc
http://www.youtube.com/watch?v=lQqpjrnXLR8
http://www.youtube.com/watch?v=eSq6W4f6PB0
http://www.youtube.com/watch?v=Al1HKOt6ja0