[MZ-1200] Details

Post Reply
hlide
Posts: 681
Joined: Thu Jan 25, 2018 9:31 pm

[MZ-1200] Details

Post by hlide »

Memory mapping:

Code: Select all

[0000-0FFF] IPL/RAM
[1000-BFFF] RAM
[C000-CFFF] RAM/ROM
[D000-D7FF] VRAM 2KB
[D800-DFFF] -
[E000-E7FF] I/O
[E800-EFFF] EXT
[F000-F3FF] FDIF if any
[F400-FFFF] -
1st Font:
PCG[0000-03FF] = fixed characters $00-$7F
PCG[0400-07FF] = programmable characters $80-$FF (1st set)

2nd Font:
PCG[0800-03FF] = fixed characters $00-$7F (same as PCG[0000-03FF])
PCG[0C00-0FFF] = programmable characters $80-$FF (2nd set)

Writing byte:

$E000-$E003:
PIO

$E004-$E007:
CTC

$E008:
8253 gate0

$E010:
PCG_DATA (byte to describe 8-pixel row of a character)

$E011:
PCG_ADDR (offset in the PCG in 8-pixel row unit) -> up to 256/8 = 32 characters

$E012:
PCG_CTRL
bit 0-1: character selector -> (PCG_ADDR + 256*(PCG_CTRL&3)) -> address in the range of the upper 128 characters font
bit 2 : font selector -> PCG_CTRL&2 == 0 -> 1st font else 2nd font
bit 3 : select which font for display
bit 4 : use programmable font for display
bit 5 : set programmable upper font -> PCG_CTRL&20 == 0 -> fixed upper 128 characters else programmable upper 128 characters

So if you want to change a character pattern (only doable in the upper 128 characters of a font), you need to:
- set bit 5 to 1 : PCG_CTRL[5] = 1
- set the font to select : PCG_CTRL[2] = font_number
- set the first row address of the character: PCG_ADDR[0..7] = row[0..7] and PCG_CTRL[0..1] = row[8..9]
- set the 8 pixels of the row in PCG_DATA

'row' is between 0 and 1023; row[0..2] is the 8-pixel row index (0-7) of the character index coded in row[3..9] (0-127) being in the upper side of MZASCII.

Since a character has 8 rows, you need to do it 8 times by incrementing the row index.

When displaying characters on the screen, programmable font is used if PCG_CTRL[4] is set and PCG_CTRL[3] says which font is active (1st or 2nd font).

Reading byte:

$E000-$E003:
PIO

$E004-$E007:
CTC

$E008:
TEMPO and HBLANK like MZ-80 A

$E00C:
[0000-0FFF] becomes RAM (last physical 4KB RAM normally residing at $C000)
[C000-CFFF] becomes IPL

$E010:
[0000-0FFF] becomes IPL
[C000-CFFF] becomes RAM (last physical 4KB RAM)

$E014:
normal display (black background, green foreground)

$E015:
reverse display (green background, black foreground)
Last edited by hlide on Fri Feb 23, 2018 9:16 pm, edited 2 times in total.
hlide
Posts: 681
Joined: Thu Jan 25, 2018 9:31 pm

Re: [MZ-1200] Details

Post by hlide »

Regarding the 2-font feature, I can see one interesting usage.

Supposedly you want smooth animation, that is pixel-by-pixel, of a sprite. Let's suppose you have 2x2 characters for the player ship, so you need 3x3 characters to program according to the pixel position of the left-upper corner. The display will use your PCG to display them. So you'd better use a double-buffer so the display can retrieve pixels from one buffer and you can redraw pixels in the other buffer. Having two fonts allows to use them as a double-buffer, so the screen will display one font while the CPU will redraw pixels in the other font.
hlide
Posts: 681
Joined: Thu Jan 25, 2018 9:31 pm

Re: [MZ-1200] Details

Post by hlide »

As far as I can see, the main differences between MZ-1200 and MZ-80 A are:
- two PCGs for MZ-1200
- no hardware scrolling for MZ-1200

It might be even possible to switch between PCGs every HBLANK to make special effects (like redrawing several sprites per line) or to have a true graphics effect (line of a movie frame for instance) per line. Well, maybe not as it may depend upon the number of cycles for the screen to draw a line and the number of cycles you need to reprogram 40 8-pixel rows in a line through $E010-12 registers.
User avatar
mz-80a
Posts: 403
Joined: Thu Jan 25, 2018 10:46 am
Location: Devon, UK
Contact:

Re: [MZ-1200] Details

Post by mz-80a »

Very interesting. Although, PCG is not standard in the 1200, is it?
MZ-80A Secrets
https://mz-80a.com/

Sharpworks (Sharp MZ homebrew)
https: //mz-sharpworks.co.uk/
hlide
Posts: 681
Joined: Thu Jan 25, 2018 9:31 pm

Re: [MZ-1200] Details

Post by hlide »

PCGs are not standard for MZ-80 K/C/K2/K2E/A, MZ-1200 and MZ-700. You need an external PCG-1200 box for MZ-1200.
Post Reply