I have been investigating the MS-DOS port of the C64's Maniac Mansion game. The original MS-DOS port used the C64-specific character map to draw the various backgrounds in the game. I noticed that each background (i.e. room) has 4 colours.
These four values appear to be read as colours within the ScummVM source code:
void GdiV1::roomChanged(byte *roomptr) {
for (int i = 0; i < 4; i++){
_V1.colors[i] = roomptr[6 + i];
}
For each room in the game, the first 3 colours always fall within the range of 0x00 and 0x15, corresponding to the original C64 colour palette. For most of the other rooms, the fourth colour almost always falls in this range with a few exceptions.
Originally I assumed the C64 game was running in Multicolor Character Mode. This matched other sources:
This is purely done in multicolor character graphics
If the game runs on the C64 in the Multicolor Character Mode I expect the first 3 colours to be used as the common colours across all characters.
I loaded up Maniac Mansion on the Vice emulator to check the memory settings via the built in monitor tool (ALT+M on Windows). I checked the memory at these addresses:
I was expecting these two addresses to show that the game is running in Multicolor Character Mode:
D011: $7C 0111 1100
D016: $51 0101 0001
Using the following source it looks like the following is enabled:
- Extended Background Color Mode (bit 6 set in D011)
- Standard Bitmap Mode (bit 5 set in D011)
- Multicolor Bitmap Mode (bit 4 set in D016)
Assuming the bit numbers are counted in this order:
7 6 5 4 3 2 1 0
In the same source this is known as Extended Background Color Multicolor Bitmap Mode. Refer to mode 7 in the table. The following is stated:
Modes 5-7 are technically feasible, but considered illegal. Although the features expected of modes 5-7 are present (such as collision detection), there is no visible screen output for the user. It is for this reason that they are not utilised.
I checked the addresses for the 3 common background colours:
D021: $16 0001 0110
D022: $26 0010 0110
D023: $FB 1111 1011
As you can see, these bytes do not fall within 0x00 to 0x15, nor do they actually correspond to the same values I am reading in the DOS port.
According to this article, the screen switches between 2 character sets to display text on screen:
Another thing of note is that the C64 supports two different character sets (2×256 Characters) and that the second character set consists of a common font, including the inventory arrows. This is one of the reasons that there is no text in the main game screen – they use the second (font) character set for the title line, switch to the primary set to draw the screen, then back to the secondary set for the menu at the bottom.
I want to know if I am using the correct method to determine the graphic mode for the game in question.
Ultimately I want to understand how the room's 4th colour is actually applied.
I have used additional sources to map the C64 memory as well as which addresses I need to check.
io $d000
. If it wouldn't help, it will at least show VIC config in more readable way than digging hex dumps.