Timing

From WSdev Wiki
Jump to navigationJump to search

Clocks

The WonderSwan is clocked with a master clock of approximately 12288000 Hz (= 12.288 MHz).

This clock is split into four internal memory access quadrants, running at 3072000 Hz (= 3.072 MHz) each. Three of those are used by the console in "mono" mode:

On the WonderSwan Color, the fourth quadrant is used to handle color palette reads during display drawing.

Only the CPU quadrant can access the cartridge bus; this means that DMA necessarily stalls the CPU.

In addition, a separate 384000 Hz (3072000 / 8) cartridge clock is provided on one of the cartridge pins.

Display timing

By default, a WonderSwan frame consists of 159 lines, 144 of which are visible. Each line consists of 256 clock cycles, of which 224 are used to draw a pixel at a time. This leads to a total duration of 40704 clock cycles per frame, for an effective default refresh rate of approximately 75.472 Hz.

Vertical blanks are always triggered on line 144; if the display is set to be shorter than 144 lines, vertical blank interrupts will never be triggered.

TODO: back/front porches, etc.

Frame timing

The details of per-line and per-frame timing are available in a table on the Frame timing page.