login | register
Fri 18 of May, 2012 (00:12 UTC)

V6Z80P Documentation

Similar PagesHistorys5 slideshowPrint

Internal Timing

Created by: phil, Last modification: Sun 14 of Mar, 2010 (14:15 UTC)

timing1.gif

As can be seen from the diagram above, each video line is internally buffered until the next scan line when it actually displayed. The sprites and background video layers are generated simultaneously to separate buffers and combined when the line is eventually clocked out to the display.

Writing to most video registers will have an immediate visible effect (EG: writes to the colour palette, unless double buffered) but some will not visibly change anything until the following scan line as changes are automatically synchronized to the start of a new scan line, these include:

"Live Palette Select" (in vreg_palette_ctrl)

"Live Bitplane Location Register Set Select" (also "Playfield A map buffer select" when in Tilemap mode) (bit 5 in vreg_vidctrl)

"Tilemap Mode Select" (bit 0 in vreg_vidctrl)

"Chunky or Planar Bitmap Mode Select" (also "Dual Playfield On/Off Select" when in Tile Map mode) (bit 7 in vreg_vidctrl)

"Display Window Right Side Position" (in vreg_window)

A note concerning updating bitmap location pointers: Each line is begins generation before the LineCop DMA starts, therefore even if the bitmap location registers are changed with the linecop at the start of a line (IE: immediately following a LineCop WAIT instruction) there will be some pixels at the start of the displayed line (one scanline down) that were fetched before the pointers were changed. This can be avoided using double buffering via the 2nd bitmap location register set, alternatively the unwanted pixels can be masked with a wide border etc.

Also, if you flip the bitplane location register remember this wont have an effect until the next scan line. The new addresses will then be used to generate a line, and finally the line will displayed the next line down. IE:

Scanline 1: User swaps bitplane register set.
Scanline 2: A new scan line of pixels is generated and buffered.
Scanline 3: Pixels from new line are displayed.



Scan Line Timing Detail


timing2.gif

Each scanline as depicted above lasts for 1024 16MHz clock cycles in PAL TV mode (1016 cycles in NTSC or VGA modes). At the start of each line the CPU is taken offline by a BUSREQ signal for audio DMA. (There is short, variable delay of a few cycles following a Bus Request whilst waiting for an acknowledgment from the CPU). Once the audio system is online, it lasts around 20 clock cycles. Following on, the LineCop has control of the main system bus for as long as the necessary to complete the LineCop operations required on that line. Afterwards, the CPU continues normally (as long as it not forced to wait by it accessing video or sprite memory during active display lines).

Bitmap and sprite video data is fetched simultaneously and concurrently with the CPU running normally as the three systems have their own memory buses. The time each system requires to build its internal buffer is variable and depends on the amount of data on a particular scan line. As mentioned, the CPU only has to wait if it tries to access bitmap or sprite memory whilst data is being fetched by the relevant system.

The blitter and linedraw systems are also forced to wait during the bitmap fetch part of a scan line, but these systems have priority over the CPU in accessing video memory – IE: they force the CPU to wait if the CPU is trying to write to access bitmap video memory at the same time. Active blits are paused at the “last 16 cycles” point, ensuring the CPU is not waiting at the start of a scanline (which could cause complications with the DMA functions). A paused blit continues after the bitmap layer data fetch period.


Video Frequencies etc:


PAL non-interlaced50.0801 Hz, 312 lines per frame.
PAL interlaced50 Hz, 625 lines (312 / 313 lines)
Horizontal frequency15625 Hz
Pixel clock8Mhz (125 ns Per Pixel)


NTSC non-interlaced60.106 Hz, 262 lines per frame.
NTSC interlaced59.99 Hz, 525 lines (262 / 263 lines)
Horizontal frequency15748 Hz
Pixel clock 8MHz (125 ns Per Pixel)


VGA 60Hz60.106 Hz, 262 double-lines per frame
Horizontal Frequency31496 Hz (line doubled)
Pixel Clock16 MHz


VGA 50Hz50.4 Hz, 312 double-lines per frame
Horizontal Frequency31496 Hz (line doubled)
Pixel Clock16 MHz


Search


Last modif pages