Register      Description
--------      -----------


$ff00- $ff01: Counter #01. It always starts to decrement from the last
              written value into it.
              


$ff02- $ff03: Counter #02. It runs freely from $ffff.



$ff04- $ff05: Counter #03. Same as above.


$ff06       : Mostly the same as VIC's $d011.
              Bit 0,1,2 : Vertical smooth-scrolling
              Bit 3     : 24/25 rows screen
              Bit 4     : Blank screen
              Bit 5     : Bitplane mode
              Bit 6     : Enhanced color mode
              Bit 7     : TED's internal test, it should be 0.
              

$ff07       : Most similar VIC-reg is $d016.
              Bit 0,1,2 : Horizontal smooth-scrolling
              Bit 3     : 40/38 columns screen
              Bit 4     : Multicolor mode
              Bit 5     : TED stop. If set, the TED stops it's counters and
                          screen-generating, only single clock and refresh
                          cycles remain.
              Bit 6     : PAL/NTSC. 0:PAL, 1:NTSC
              Bit 7     : Disable reverse mode. If 0, we got 128 characters
                          and highmost bit tells if the character should
                          appear in inverse. If set, no inverse mode but
                          256 characters.
                          

$ff08       : Keyboard input latch. Giving a strobe - writing to the register,
              the latch stores the values of the input-lines. Then, we
              can read them from this register.
              

$ff09       : Interrupt request register. When a counter sends want to send
              an IRQ, it's bit will appear as a 0; then, if the IRQ was
              caused then highmost bit is set.
              Bit 0     : Unused
              Bit 1     : Raster-counter
              Bit 2     : Lightpen. Not implemented.
              Bit 3     : Counter #1
              Bit 4     : Counter #2
              Bit 5     : Unused
              Bit 6     : Counter #3
              Bit 7     : Interrupt occured. This bit is set when an IRQ
                          was enabled and therefore, the IRQ was sent to the
                          processor. Physically, this is the negated level of
                          the TED's IRQ output. The IRQ should be deleted
                          with writing the register-value back after
                          accepting an interrupt.
                          

$ff0a       : Interrupt mask register. These bits could be used to disable and
              enable interrupt-sources. When a place is set to 1, that will
              be able to cause an interrupt to the processor. If not, the sign
              of the interrupt request will only be appear in the above
              register.
              Bit 0     : 9th bit of $ff0b (see there)
              Bit 1     : Raster-counter
              Bit 2     : Lightpen. Not implemented.
              Bit 3     : Counter #1
              Bit 4     : Counter #2
              Bit 5     : Unused
              Bit 6     : Counter #3
              Bit 7     : Unused
              

$ff0b       : Raster interrupt register. Same as $d012 when writing; it stores
              the position of occuring raster interrupt. highmost bit is in
              $ff0a's 0. bit.
              


$ff0c,$ff0d : Hardware-cursor position (10 bits). Lower bits: $ff0d, higher
              2 bits in $ff0c's 0. and 1. places. Beyond 1000 the cursor is
              not visible.
              

$ff0e       : This reg is the first sound-source's frq-value's lowmost 8 bit.
              More 2 bits are in $ff10's 0. and 1. places.
              

$ff0f       : 2nd. source, lowmost 8 bits. More 2 bits in $ff12, 0. and 1.
              places.
              The soundregister-value can be calculated as
                reg=1024-(111860.781/frq[Hz]) (NTSC)
                reg=1024-(111840.45 /frq[Hz]) (PAL)
                

$ff10       : 1st. sound-source, highmost 2 bits. 2-7 bits are unused.


$ff11       : Sound control register.
              Bit 0-3   : Volume. Maximum value is 8.
              Bit 4     : Sound #1 on/off.
              Bit 5     : Sound #2 squarewave on/off.
              Bit 6     : Sound #2 noise on/off. If you set both, the square
                          will sound.
              Bit 7     : D/A mode. See above for more.
              

$ff12       : Bit 0,1   : 2nd sound-source, highmost bits.
              Bit 2     : Character generator in ROM or RAM. When set, TED
                          will enable ROM when trying to get data from the
                          charactergenerator to build screen. Else, it will
                          give out control-signals to the DRAM's.
              Bit 3,4,5 : These bits tell, where to find bitplane in the
                          memory when using bitplane-mode. TED assumes them
                          as A15,A14 and A13 bits. So, the bitplanes can be
                          switched as 8K pages, anywhere in the 64K.
              Bit 6-7   : Unused.
              

$ff13         Bit 0     : A sign to having control about memory paging. This
                          bit always sets to 1 when ROM is active over $8000.
                          Else, it will be 0. READ ONLY.
              Bit 1     : Force single clock mode. Then, TED will disable to
                          generate twiee clock.
              Bit 2-7   : Charactergenerator. Bit 7 corresponds to A15, 6 to
                          A14 and so on. This value shows and sets the start
                          of the charactergenerator. It can be paged as $400
                          bytes. Use with addition of $ff12-2.bit.
                          

$ff14         Bit 0-2   : Unused
              Bit 3-7   : Start of the video-ram. Bit 7 also corresponds to
                          the A15 line as above. So, video-ram is mappable
                          as $800 bytes - 2K. The above $ff12-2.bit doesn't
                          affect this, but the actual RAM/ROM mapping (see at
                          $ff3e/$ff3f and $ff13/0) does.
                          

$ff15       : Background. Lower bits contain color-code, higher 3 luminance
              and highmost is ignored.
              
              Color-codes:
              00 : Black
              01 : White  
              02 : Red
              03 : Cyan
              04 : Purple
              05 : Green
              06 : Blue
              07 : Yellow
              08 : Orange
              09 : Brown
              0A : Yellow-Green
              0B : Pink
              0C : Blue-Green
              0D : Light Blue
              0E : Dark Blue
              0F : Light Green



$ff16       : Color-reg 1


$ff17       : Color-reg 2


$ff18       : Color reg 3. This and the above are used in ECM and MCM modes.


$ff19       : Border. All color registers use codes as described in $ff15.


$ff1a       : Bit 0-1   : Highmost bits of the next $ff1b
              Bit 2-7   : Unused
              

$ff1b       : Actual character-position. Highmost bits in the above register.
              TED counts the characters that it had fetched and put out to
              the screen. The number is increasing by 40 after every
              characterline (8 rasterline).
              

$ff1c       : Bit 0     : Highmost bit of $ff1d
              Bit 1-7   : Unused
              

$ff1d       : Actual position of vertical scanning. Highmost
              bit is in $ff1c. Read/Writeable!
              

$ff1e       : Actual position of horizontal scanning. R/W!. Lowmost bit is
              unused. It contains the TED's internal counter's highmost 8
              bits. So, it increases 4 with every character. When writing,
              it seems to put the value to a functionally different register
              (writing back a reading value in right time affects the screen).
              

$ff1f       : Bit 0,1,2 : Actual vertical scanning-line in a character-row.
                          R/W!.
              Bit 3-6   : Flashing counter. It's value increases with every
                          frame, and TED fits it's flashing feature to this
                          register's reaching to 15.
              Bit 7     : Unused
              

$ff3e       : Switching to ROM. A writing statement to this address will
              cause to turn on the ROM between $8000-$ffff. It's an other
              matter, which one; this time, only sure thing that it'll give
              CS signals instead of RAS', CAS' and MUX.
              See $ff13/0 and $ff14
              

$ff3f       : Switching to RAM. The opposite of ff3e.


Original by Levente Harsfalvi. Taken from
C= Hacking #12

Document Revision B