------------------------------------------------------------------------------- notaz's Pico doc $Id: picodoc.txt 455 2008-05-21 20:35:17Z notaz $ Copyright 2008, GraÅžvydas Ignotas (notaz) ------------------------------------------------------------------------------- If you use this, please credit me in your work or it's documentation. Use monospace font and disable word wrap when reading this document. ------------------------------------------------------------------------------- Table of Contents ------------------------------------------------------------------------------- 0. Introduction 1. Overview 2. Memory map 3. Notes ------------------------------------------------------------------------------- 0. Introduction ------------------------------------------------------------------------------- This document tries to describe some technical aspects of Sega Pico, an electronic toy by Sega. It is based on information obtained by reverse engineering the game ROM images and without performing any hardware tests, so information here is incomplete and is likely to be inaccurate. ------------------------------------------------------------------------------- 1. Overview ------------------------------------------------------------------------------- The Pico hardware has similarities to Sega MegaDrive/Genesis and has the following hardware: * Motorola 68000 @ 7.6 MHz (same as Genesis/MD) * 315-5313 VDP (same as Genesis/MD) * 64KiB of main RAM and 64KiB of video RAM (same as Genesis/MD) * PCM sound chip (custom?) * I/O interface for drawing pad, buttons, Storyware page sensors It doesn't have Z80 or it's RAM, nor does it have YM2612 FM chip or I/O ports, which are normally found in Genesis/MegaDrive. SN76489/SN76496 part of VDP if fully functional, though. ------------------------------------------------------------------------------- 2. Memory map ------------------------------------------------------------------------------- Memory map is similar to one in Genesis/MegaDrive, except that it lacks Axxxxx area, but has it's devices mapped at 8000xx. 000000-3FFFFFh : ROM. Might actually smaller, games are usually 512KiB. 800000-80001Fh : I/O, internal registers and PCM. C00000-C0001Fh : VDP. May be mirrored elsewhere. FF0000-FFFFFFh : RAM. May be mirrored elsewhere. I/O area: addr acc description -------+-----+------------ 800001 byte Version register. ?vv? ????, where v can be: 00 - hardware is for Japan 01 - European version 10 - USA version 11 - ? 800003 byte Buttons, 0 for pressed, 1 for released: bit 0: UP (white) bit 1: DOWN (orange) bit 2: LEFT (blue) bit 3: RIGHT (green) bit 4: red button bit 5: unused? bit 6: unused? bit 7: pen button 800005 byte Most significant byte of pen x coordinate. 800007 byte Least significant byte of pen x coordinate. 800009 byte Most significant byte of pen y coordinate. 80000b byte Least significant byte of pen y coordinate. 80000d byte Page register. One bit means one uncovered page sensor. 00 - storyware closed 01, 03, 07, 0f, 1f, 3f - pages 1-6 either page 5 or page 6 is often unused. 800010 word PCM data register. r/w read returns free bytes left in PCM FIFO buffer writes write data to buffer. 800012 word PCM control register. r/w For writes, it has following possible meanings: ?p?? ???? ???? ?rrr p - set to enable playback? r - sample rate / PCM data type? 0: 8kHz 4bit ADPCM? 1-7: 16kHz variants? For reads, if bit 15 is cleared, it means PCM is 'busy' or something like that, as games sometimes wait for it to become 1. 800019 byte Games write 'S' 80001b byte Games write 'E' 80001d byte Games write 'G' 80001f byte Games write 'A' ------------------------------------------------------------------------------- 3. Notes ------------------------------------------------------------------------------- The pen can be used to 'draw' either on the drawing pad or on the storyware itself. Both storyware and drawing pad are mapped on single virtual plane, where coordinates range: x: 0x03c - 0x17c y: 0x1fc - 0x2f7 (drawing pad) 0x2f8 - 0x3f3 (storyware) Pico has some sort of TMSS equivalent, as games write 'SEGA' to off bytes of 800018-80001f. The 68000 uses following hardware interrupt autovectors: level 2 - seems to be available, but most games put empty handlers here. level 3 - PCM interrupt? Probably occurs when PCM hardware needs more data, and exact conditions probably depend on PCM control register settings. level 4 - horizontal interrupt? Not widely used. level 5 - definitely used for something, but many games work without it. level 6 - 'usual' vertical interrupt. The exact PCM sound format is unknown, but it looks like it's some variant of 4bit ADPCM. The format may depend on PCM control register settings too.