# The WonderSwan on one page Sources by short name (terms and tiers in [sources.md](sources.md)): WSDEV (the WSdev wiki at the pinned revisions, page named), WSMAN (trap15's WSMan rev. 7), STSWS (Guy Perfect's Sacred Tech Scroll), WSTECH (Judge and Dox, 2003), WSHW (FluBBa's WSHWTest README), WSTS (asie's ws-test-suite). ## Machines | Row | Product | SoC | Display | Internal EEPROM | Boot ROM | MAME set | | --- | --- | --- | --- | --- | --- | --- | | `ws` | WonderSwan (SW-001, 1999) | ASWAN | FSTN, 16 shades, ~linear gamma | 1 Kbit (128 B), M93LC46-compatible | 4 KiB at FF000h | `wswan` | | `pcv2` | Benesse Pocket Challenge V2 | ASWAN | as `ws` | **none** | 4 KiB (MAME uses the WS image, marked baddump) | `pockchv2` | | `wsc` | WonderSwan Color (WSC-001, 2000) | SPHINX | CSTN, 4096 colours | 16 Kbit (2 KiB), M93LC86-compatible | 8 KiB at FE000h | `wscolor` | | `sc` | SwanCrystal (SCT-001, 2002) | SPHINX2 | TFT, gamma near 2.2; panel set from EEPROM through ports 70h-77h | as `wsc` | 8 KiB, its own image (not in MAME 0.285; held in No-Intro, census.md) | none | Sources: WSDEV "SoC", "Internal EEPROM", "Display/Palette", "Boot ROM", "EEPROM"; WSMAN "System Overview" (models, PCB IDs; PCV2 "nearly identical aside from differences in the input layout"). SPHINX and SPHINX2 differ to software by port 62h bit 7 (WSDEV "SoC") and the TFT ports; the CPU differs between ASWAN and SPHINX in ZF after MULU (v30mz-python docs/flags-and-undocumented.md). A planned CAIRO SoC (ASWAN at double clock with ADPCM) never shipped (WSDEV "SoC"). ## The SoC One chip holds the CPU (an NEC V30MZ, [v30mz-python](../v30mz-python)), the display controller, the sound unit, the interrupt controller, timers, the UART, the keypad scan, the internal EEPROM interface, 16 KiB (mono) or 64 KiB (colour) of RAM, the boot ROM and, on colour SoCs, general and sound DMA. The master clock is 12.288 MHz, split into four 3.072 MHz quadrants: CPU, display, sound and (colour) palette fetch; only the CPU quadrant reaches the cartridge bus, so DMA stalls the CPU (WSDEV "Timing", "Memory map", "DMA"). Memory is unified: tiles, maps, sprite tables, wave tables and the colour palette live in the same internal RAM the CPU uses (WSDEV "Memory map"). ## Video timing 159 lines of 256 clocks, 144 visible lines of 224 pixels; 40,704 clocks per frame, 75.47 Hz (WSDEV "Timing"). VBlank always at line 144. MAME's screen agrees (htotal 256, vtotal 159, 75.471698 Hz, `mame -listxml wswan`). **Orientation is not a video mode.** The picture is always 224 x 144. Games meant to be held upright draw their graphics rotated; the console tells the player by an LCD segment (port 15h bits 1-2) and the header's flags bit 0 sets the splash screen's orientation (WSDEV "Display/IO Ports", "ROM header"). The board reports the orientation icon's state; rotating the picture is the host's job. Census: 37 of 257 mono and 46 of 242 colour images start vertical. ## The board's parts and their documents | Part | Document | | --- | --- | | Memory map, I/O map, interrupts, timers, DMA, keypad, UART | [memory-and-io.md](memory-and-io.md) | | Display: screens, sprites, windows, palettes, LCD icons, timing | [display.md](display.md) | | Sound: four channels, noise, sweep, voice, Hyper Voice, sound DMA | [sound.md](sound.md) | | Internal and cartridge EEPROM, the S-3511A RTC | [eeprom-rtc.md](eeprom-rtc.md) | | Cartridges: header, Bandai 2001 and 2003, KARNAK, WonderWitch flash | [cartridges.md](cartridges.md) | | Boot ROM: flow, startup state, lockout, pin strapping | [boot-rom.md](boot-rom.md) | | Domains, channels and speed | [domains-and-speed.md](domains-and-speed.md) | ## Modelling level Cycle level for the SoC: the display fetches per clock in the CPU-free quadrants (WSDEV "Frame timing" gives the per-cycle fetch order, with TODOs), the sound unit sums one channel per clock (same page), sound DMA takes CPU cycles at fixed points of each 128. The CPU at cycle level through v30mz-python's bus contract. EEPROM and RTC at the level of their serial protocols, timed in cartridge clocks (384 kHz).