Timing

From WSdev Wiki
Revision as of 05:55, 22 August 2023 by Asie (talk | contribs)
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: NEC V30MZ, Display and Sound. On the WonderSwan Color, the fourth quadrant is used to handle color palette reads during display drawing.

Out of those, only the CPU quadrant can access the cartridge bus. It can be additionally configured to use one of two wait states:

  • 1 cycle access - an effective bus speed of 3072000 Hz, same as the CPU,
  • 3 cycle access - an effective bus speed of 1024000 Hz.

Display

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.