Timing: Difference between revisions

From WSdev Wiki
Jump to navigationJump to search
(Created page with "== 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 car...")
 
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
== Clocks ==
== Clocks ==


The WonderSwan is clocked with a master clock of approximately 12288000 Hz (= 12.288 MHz).
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: [[CPU|NEC V30MZ]], [[Display]] and [[Sound]]. On the WonderSwan Color, the fourth quadrant is used to handle color palette reads during display drawing.
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:


Out of those, only the CPU quadrant can access the cartridge bus. It can be additionally configured to use one of two wait states:
* [[CPU|NEC V30MZ]] - referred to as the ''CPU clock'',
* [[Display]],
* [[Sound]].


* 1 cycle access - an effective bus speed of 3072000 Hz, same as the CPU,
On the WonderSwan Color, the fourth quadrant is used to handle color palette reads during display drawing.
* 3 cycle access - an effective bus speed of 1024000 Hz.


== Display ==
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.
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.

Latest revision as of 18:20, 22 August 2023

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.