Login
Plus/4 EncyclopediaFirstBackNextLast

TED Registers
Category
Programming/Assembly

Topic
The TED has all of its registers between memory addresses $FF00-$FF3F. Some general things to note: unused bits are always one, whatever value is written into them is ignored. E.g. write $12 into $FF15, reading it back will be $92 ($12 + $80 unused bit).

$FF00 $FF01 $FF02 $FF03 $FF04 $FF05 $FF06 $FF07
$FF08 $FF09 $FF0A $FF0B $FF0C $FF0D $FF0E $FF0F
$FF10 $FF11 $FF12 $FF13 $FF14 $FF15 $FF16 $FF17
$FF18 $FF19 $FF1A $FF1B $FF1C $FF1D $FF1E $FF1F
$FF3E $FF3F


$FF00-$FF01: TED timer/counter #1. This 16 bit register counts back from the last value that is written to it.


$FF02-$FF03: TED timer/counter #2. It runs freely from $FFFF.


$FF04-$FF05: TED timer/counter #3. It runs freely from $FFFF.


$FF06: Default $1B (Similar to VIC-II $D011)
Bit 0,1,2 : Vertical smooth-scrolling
Bit 3 : 25/24 rows screen
Bit 4 : Blank screen (0 = screen is blank, 1 (default) = screen is visible)
Bit 5 : Bitmap mode (0 (default) = character mode), 1 = bitmap mode)
Bit 6 : Extended color mode (ECM), see also $FF16/$FF17/$FF18.
Bit 7 : TED's internal test, it should be 0.


$FF07: Default $08/$48 PAL/NTSC (Similar to VIC-II $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 – it has no effect in Drean machines)
Bit 7 : Inverse/256 characters flag (0 (default) = 128 characters + inverse, 1 = 256 characters)
Turning on Enhanced color mode and Multicolor mode at the same time will produce black in the screen area as it does in VIC-II.

$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. See this topic for more details and a working example.


$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 VIC-II $D012 when writing; it stores the position of occurring raster interrupt. Highmost bit is in $FF0A's bit 0.


$FF0C-$FF0D: Hardware-cursor position (10 bits). Lower bits: $FF0D, higher 2 bits in $FF0C's 0th and 1st places. Beyond 1000 the cursor is not visible. However, screen manipulating tricks may cause it to be seen.


$FF0E: This register is the first sound-source's frq-value's lowmost 8 bit. More 2 bits are in $FF10's 0th and 1st places.


$FF0F: 2nd source, lowmost 8 bits. More 2 bits in $FF12, 0. and 1. places. The sound-register value can be calculated as
reg = 1023-(111860.78125/frq[Hz]) (NTSC)
reg = 1023-(110840.46875/frq[Hz]) (PAL – that constant was calculated with assuming the crystal frequency to be 17.734475MHz)
The formulae below, that can be found in various books, is wrong
reg=1024-(111860.781/frq[Hz]) (NTSC)
reg=1024-(111840.45 /frq[Hz]) (PAL)
The frequency constant in the above formulae is 1/160th of the crystal frequency for PAL and 1/128th for NTSC.
A strange thing is that the lowest tone is generated by the highest register value (1023=$3FF).
Even more weird is that the value 1022 ($3FE) locks up the corresponding sound source.


$FF10: 2nd 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 square-wave 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 : 1st 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 character generator or bitmap to build screen. Else, it will give out control-signals to the DRAMs.
Bit 3,4,5 : These bits tell, where to find bitmap in the memory when using bitmap-mode. TED assumes them as A15, A14 and A13 bits. So, the bitmaps 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 generating twiee clock.
Bit 2-7 : Character generator. Bit 7 corresponds to A15, 6 to A14 and so on. This value shows and sets the start of the character generator. It can be paged as $400 bytes. Use with addition of $FF12 bit 2.


$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 bit 2 doesn't affect this, but the actual RAM/ROM mapping (see at $FF3E/$FF3F and $FF13/0) does.


$FF15: Background color. Works/used in every video mode.
Bits 0-3 : color code
Bits 4-6 : luminance
Bit 7 : unused.


$FF16 : Multicolor/Extended color #1. Works/used in multicolor and ECM modes, see $FF07 and $FF06.
Bits 0-3 : color code
Bits 4-6 : luminance
Bit 7 : unused.


$FF17 : Multicolor/Extended color #2. Works/used in multicolor and ECM modes, see $FF07 and $FF06.
Bits 0-3 : color code
Bits 4-6 : luminance
Bit 7 : unused.


$FF18 : Extended color #3. Works/used in ECM mode only, see $FF06.
Bits 0-3 : color code
Bits 4-6 : luminance
Bit 7 : unused.


$FF19 : Border color. Works/used in every video mode. When the screen is turned off, (see $FF06), the whole screen is this color.
Bits 0-3 : color code
Bits 4-6 : luminance
Bit 7 : unused.


$FF1A:
Bit 0-1 : Highmost bits of register $FF1B (only affects bitmap mode)
Bit 2-7 : Unused


$FF1B:
Current character-position (only affects bitmap mode). 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 character row (8 rasterline).


$FF1C:
Bit 0 : Highmost bit of $FF1D
Bit 1-7 : Unused


$FF1D: Current position of vertical scanning. Highmost bit is in $FF1C. Read/Writeable!


$FF1E: Current position of horizontal scanning. R/W!. Lowmost bit is unused. It contains the TED's internal counter's highmost 8 bits. So, it increases by 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:
This so called "shadow register" controls RAM/ROM paging with register $FF3F. Writing an arbitrary value to $FF3E will page in the currently configured ROMs to the upper memory area ($8000..$FFFF).


$FF3F:
This so called "shadow register" controls RAM/ROM paging with register $FF3E. Writing an arbitrary value to $FF3F will page in the RAM to the upper memory area ($8000..$FFFF).


The memory in the hole of the TED register file ($FF20..$FF3D) seems to be always accessible as RAM.

Keywords
$FF00,$FF01,$FF02,$FF03,$FF04,$FF05,$FF06,$FF07,$FF08,$FF09,$FF0A,$FF0B,$FF0C,$FF0D,$FF0E,$FF0F,
$FF10,$FF11,$FF12,$FF13,$FF14,$FF15,$FF16,$FF17,$FF18,$FF19,$FF1A,$FF1B,$FF1C,$FF1D,$FF1E,$FF1F, $FF3E, $FF3F 



Copyright © Plus/4 World Team, 2001-2024. Support Plus/4 World on Patreon