                      Acetronic Technical Document
                      ============================

First Version : 28th June 2000

Authors :       Paul Robson             (Put it all together)
                Christian Windler       (Provided much info about 2636)
                Mike Coates             (Working on MAME Driver)

This document describes the internal workings of the Acetronic / Prinztronic / Radofin / Interton / Waddingtons series of computers.

1) Introduction
===============

The main components in the machine are a Signetics 2650 CPU, clocked at 4.43Mhz and a Signetics 2636 Display Generator. These provided most of the data memory, graphics and other features of the machine.

There are a few other chips : a Signetics 2621 (Generates the video signal ?), a "TEA 1002" (?), an LM324 (Audio Circuitry ?), a 74LS378, a 74LS258 and a 74LS156 which provide other features, including simple sound generation and connections of the controllers.

Program memory is available via plug in cartridges. The cartridges contain a 9316 (all found so far), which appears to be a 2716 compatible PROM. Each cartridge is 2k x 8.

The machine was only available in countries which had the PAL system, so is limited to Europe and Australia (AFAIK).

The approximate machine specifications are as follows :-

- 2650 running at 4.43Mhz Mhz
- 2k ROM Program Memory
- 43 bytes (yes really !) Data memory
- 4 Single Colour Sprites [it is possible that one is an 8 colour sprite]
- 1 Score Line, can display 4 BCD Digits
- Background consisting of a series of alternate lines, rather like the
  Odyssey 2's display.... very slightly.
- 2 x 12 button 2 axis analogue controllers

2) Cartridge Connector
======================

Cartridges are connected via a 16 x 2 way 0.156 inch connector. Unfortunately I cannot find a supplier for this part, and other parts are either too large or will not physically fit due to the cartridge design. So to build myself a proper cart reader I shall have to temporarily sacrifice one of my MPU1000s :(

The connections are as follows :-

(these are the centre/left pins at the top, so if you look at the front of the machine NC/0V is on the LEFT)

  ACETRONIC               9316 PROM

Front   Rear            Front   Rear
=====   ====            =====   ====
NC      0V              NC      VSS
DB0     2636            Q1      CS
DB1     Unknown         Q2      NC
DB2     WRP             Q3      NC
DB3     2636            Q4      VBB
DB4     NC              Q5      NC
DB5     5V              Q6      VCC
DB6     OPREQ           Q7      NC
DB7     NC              Q8      NC
NC      A0              NC      A0
A11     A1              PRGM    A1
A10     A2              VDD     A2
A9      A3              A9      A3
A8      A4              A8      A4
A12     A5              VBB     A5
A7      A6              A7      A6

ROM Dumping is done at present by getting an Atmel STK200 to fake the CPU. This is slightly awkward because the 2636 takes over the data bus on a regular basis.

3) Memory Map
=============

0000-07FF       2k x 8 PROM, containing program memory
0800-1E7F       Unused
1E80-1EFF       Cartridge/Keypad multiplexing
1F00-1F0D       Sprite #1
1F0E-1F0F       Program Memory (2 bytes)
1F10-1F1D       Sprite #2
1F1E-1F1F       Program Memory (2 bytes)
1F20-1F2D       Sprite #3
1F2E-1F2F       Program Memory (2 bytes)
1F30-1F3F       Unused (8 colour sprite data ?)
1F40-1F4D       Sprite #4
1F4E-1F6D       Program Memory (32 bytes)
1F6E-1F7F       Unused (check)
1F80-1FA7       Vertical Bar Bitmaps
1FA8-1FAC       Vertical Bar Controls
1FAE-1FAF       Program Memory (1 byte)
1FC0            Sprite Sizes
1FC1-1FC2       Sprite Colours
1FC3            Score Control
1FC4-5          Program Memory (2 bytes)
1FC6            Background Control Byte
1FC7            Sound Frequency
1FC8-9          BCD Display Digits
1FCA            Object/Background or Completion Collisions
1FCB            Object/Object Collisions
1FCC            Horizontal Read Controller Port (Port 1)
1FCD            Vertical Read Controller Port (Port 2)
1FCE-F          Program Memory (2 bytes)
1FD0-1FFF       Unused

4) Sprite Objects
=================
The Acetronic supports up to 4 objects, each of which has a graphic build up out of 8 x 10 pixels. It is reported that their *may* be an 8 colour sprite available for use, but I can't test this until I've built a development kit.

The 4 sprite objects are located at $1F00,$1F10,$1F20 and $1F40. Each uses 14 bytes of the memory map.

The first ten bytes (1Fx0 - 1Fx9) define the graphic for that sprite in a classic "left to right,top to bottom" style.

1FxA (Horizontal) and 1FxC (Vertical) contain the position of the sprite as the number of clock pulses/lines that are counted before the sprite is drawn.

1FxB (Horizontal) and 1FxD (Vertical) contain the position of the duplicate sprite. Each sprite can have a duplicate drawn below it, and offset to the right. The 1FxB and 1FxD locations contain the horizontal and vertical offsets to these objects, minus 1 (e.g. add 1 to get the correct position !).  Once a duplicate has been displayed, it can be redrawn by resetting this register. Duplicates *cannot* appear on the same scanline as any other duplicate, or the original sprite. These are probably decremented on the fly.

Location 1FC0 sets the size of the sprite. This byte is split into 4 x 2 bit size records as follows :

        Sprite 4:Bits 7,6
        Sprite 3:Bits 5,4
        Sprite 2:Bits 3,2
        Sprite 1:Bits 1,0

The size is identified as follows :-

        00       8 x 10 pixels
        01      16 x 20 pixels
        10      32 x 40 pixels
        11      64 x 80 pixels

Locations 1FC1 and 1FC2 set the colour of the sprite.

        Sprite 1: Bits 3..5 of $1FC1
        Sprite 2: Bits 0..2 of $1FC1
        Sprite 3: Bits 3..5 of $1FC2
        Sprite 4: Bits 0..2 of $1FC2

The colours are encoded as follows :-

        Green   Blue    Red     Colour
        0       0       0       White
        0       0       1       Cyan
        0       1       0       Yellow
        0       1       1       Green
        1       0       0       Purple
        1       0       1       Blue
        1       1       0       Red
        1       1       1       Black

Sprite collisions with both the background and the other sprites are available, see the section on the collision bytes

5) The Background
=================

Now, this is the *really* wierd bit. If you've ever played any Odyssey^2 games, you'll have noticed that there is, superimposed on the graphics, a grid, and many games use it.

Well, there's a different system on the Acetronic, it is based around the concept of lines. It is a bit like a very simple memory mapped display of 16 pixels horizontal x 20 pixels vertical, a bit like a grid.

Each of those "cells" is either blank, or contains a "pattern", which is the same for every cell in the line. These cells are turned on and off using the 40 bytes between $1F80 and $1FA7, each consecutive two bytes representing a single row.

However, unlike most displays the "grid heights" vary from row to row, alternating 2 pixels and 18 pixels in height i.e.

Rows    0,2,4,6,8,10,12,14,16,18        are 2 pixels in height
Rows    1,3,5,7,9,11,13,15,17,19        are 18 pixels in height

If you look at the different backgrounds on "tank battle" you can see this very clearly.

Each row is 128 "clocks" (pixels) in width, and there are 16 cells in each row, 8 "clocks" wide. Thus the pixel resolution of the Acetronic is 128x200.

There are 5 further bytes, from $1FA8 to $1FAC, which each modify the rows for the four cells, working top to bottom, as follows

        Rows            Byte
        1-4             $1FA8
        5-8             $1FA9
        9-12            $1FAA
        13-16           $1FAB
        17-20           $1FAC

Each of these affects *ALL* the cells in the row, though not all modifiers effect each of the cells (some do not apply to 2 pixel high cells).

Bits 7 and 6 set the basic size of each cell. These can be used to change the bar widths from horizontal bars, to solid blocks for example. The width is from left to right ; so a width of '1' will put a single pixel line, a width of '4' will fill half the square, and so on.

        Bit 7   Bit 6   Width (Pixels)
        -----   -----   --------------
        0       0       1
        0       1       2
        1       0       1
        1       1       4

Bits 5 to 0 modify these widths, extending certain of them to 8. For this byte, each group of four bars is split into six by halving each of the "fat" bars. This diagram shows it (the bars are NOT to scale !)

        Display Bars    Split Bars
        ============    ==========
        -----------     -----------
        0               0
        -----------     -----------
                        1a
        1               -----------
                        1b
        -----------     -----------
        2               2
        -----------     -----------
                        3a
        3               -----------
                        3b
        -----------     -----------

Bars 0 and 2 are 2 pixels in height, and Bars 1a,1b,3a and 3b are all 9 pixels in height (half of eighteen). The modifiers work by extending the width of these bars to 8 as follows (if the given bit is logic '1') :-

        Bit 0 : Bar 0
        Bit 1 : Bar 1a
        Bit 2 : Bar 1b
        Bit 3 : Bar 2
        Bit 4 : Bar 3a
        Bit 5 : Bar 3b

These modifiers operate across the whole line : different parts of the same horizontal bar *ALL* have the same width in that bar.

The background is controlled by the byte at $1FC6 as follows :-

        Bits 4-6 : Background Colour
        Bit  3   : Background Enable ('1' to display it)
        Bit  0-2 : Screen Colour

The colours are as follows :-

        000     Black
        001     Blue
        010     Green
        011     Cyan
        100     Red
        101     Purple
        110     Yellow
        111     White

Sprites can collide with the background, see the section on collision bits which follows.

6) Collision Bits
=================

The collision is done using the bytes at $1FCA and $1FCB.

Collisions are enabled [TODO:Check this] by bit 6 of $1FCB. When this is set to logic '1' the bytes at $1FCA/B can be checked for the various collisions *until* vertical sync, when they are reset. This occurs AFTER the vertical blank interrupt (see TANK.BIN)

Each bit goes to logic '1' on a collision. The bits are assigned as follows :-

        $1FCA   Bit 7 : Sprite 1 & Background
                Bit 6 : Sprite 2 & Background
                Bit 5 : Sprite 3 & Background
                Bit 4 : Sprite 4 & Background
                Bit 3 : Finished drawing Sprite 1
                Bit 2 : Finished drawing Sprite 2
                Bit 1 : Finished drawing Sprite 3
                Bit 0 : Finished drawing Sprite 4

        $1FCB   Bit 7 : Not used (returns 0 ?)
                Bit 6 : Enable bit
                Bit 5 : Sprite 1 & Sprite 2
                Bit 4 : Sprite 1 & Sprite 2
                Bit 3 : Sprite 2 & Sprite 3
                Bit 2 : Sprite 1 & Sprite 4
                Bit 1 : Sprite 2 & Sprite 4
                Bit 0 : Sprite 3 & Sprite 4

7) Score Counter
================

The 2636 supports a 4 digit BCD Score counter. The score data is stored at $1FC8 (MSByte) and $1FC9 (LSByte). It is drawn using a 12 pixels x 20 rows font, in (I think !) the inverse colour to the background. The font is a very simple "square blocky" one. The digits can be drawn at the top or bottom of the screen, and can either be 1 x 4 digit display (0000) or 2 x 2 digit display (00  00).

The position is controlled by location $1FC3.

        Bit 0 : Vertical        0 = Lines 0..19, 1 = Lines 180..199
        Bit 1 : Gap             0 = No Gap,1 = 20 clock gap between digits

The digits are horizontally centred. If a value is an illegal BCD value (A-F) it is not displayed.

8) Game Controllers
===================
[TODO]

9) Sound
========

The sound frequency is kept at location $1FC7. The output sound frequency is calculated as F = 7874/(n+1), if n = 00 then there is no sound.

The tone generator is controlled by writing to $E80-$EFF, this selects the sound controller. It appears that line D2 (TODO:Needs checking !) turns on the white noise generator.

10) Other Control Locations
===========================

There are none that have not been covered in other sections.

11) Interrupts
==============

Interrupts appear to be generated on a regular basis. How regular...
working on it :)

12) Frame Generation
====================

[TODO:Probably the same as the Arcadia]
