Hardware overview
The Nintendo DS came out in 2004. By the standards of a phone or a PC it is tiny: two small screens, two slow processors, 4 MB of memory. The generation-4 and generation-5 games look the way they do because of those limits, not in spite of them. PokeLoom is built to the same limits, so a game made with it runs on a DS (in the melonDS emulator today) and looks right on a desktop.
This page is the map. Each line below has its own page with the reasons.
The parts
Section titled “The parts”| Part | What the DS has | Its page |
|---|---|---|
| Screens | Two, 256 × 192 pixels each, about 60 pictures a second; the lower one is a touch screen | Two screens and the pen |
| Colour | 15 bits a colour: 32 levels each of red, green and blue | The 2D engines |
| 2D graphics | Two 2D engines, one per screen: 4 tile layers and 128 sprites each | The 2D engines |
| 3D graphics | One 3D engine: about 2,048 polygons and 6,144 vertices a frame, on one screen at a time | The 3D engine |
| Lighting | 4 directional lights, material colours, no shaders | Lights and materials |
| Effects | Toon and highlight tables, edge marking, anti-aliasing, depth fog | Toon, edges, fog |
| Main memory | 4 MB, for code, data and everything loaded | Memory |
| Video memory | 656 KB in nine banks, A to I | Memory |
| Processors | ARM946E-S at about 67 MHz, ARM7TDMI at about 33 MHz | CPUs, sound, clock |
| Sound | 16 hardware channels | CPUs, sound, clock |
| Clock | A battery-backed real-time clock | CPUs, sound, clock |
| Cartridge | Read-only game data and a small save chip | CPUs, sound, clock |
Limits
Section titled “Limits”Two screens of 256 × 192. Every picture is drawn for that size. A character 32 pixels tall is a sixth of the screen; a line of text is a few hundred pixels at most. Pixel art at this scale reads clearly, and anything finer is lost. PokeLoom draws the world at this size on desktop too, then scales it up by a whole number.
15-bit colour. There are 32,768 possible colours, and art is mostly drawn with small palettes of 16 or 256 of them. Smooth gradients band; flat colour and careful shading look clean. Time of day works by changing palettes, not by recolouring pixels.
2,048 polygons a frame. A modern game draws millions. The DS draws a whole screen with about two thousand flat pieces. That is why a DS town is made of boxy buildings, flat ground and characters that are pictures on cards rather than models.
Four lights and no shaders. The 3D engine computes colour at the corners of each polygon with a fixed formula and fills between them. There is no per-pixel program. Light is either baked into the art or one of four directional lights, which is why the games’ shading is soft and simple.
4 MB of main memory. The code, the map around the player, the battle, the menus, the music and the save all share it. Nothing can be loaded “just in case”. PokeLoom splits the 4 MB into budgets and checks them; a change that breaks one is not done.
656 KB of video memory. Every texture, tile and sprite picture on both screens must fit at once. A map’s art is limited by this more than by anything else.
A 67 MHz processor without floating point. A desktop processor does many times
more work in the same time, and the DS has no hardware for fractional numbers. Every
tick of game logic must fit in a sixtieth of a second beside the drawing. PokeLoom uses
fixed-point numbers (Fx) everywhere that runs on the DS, which also makes every
platform compute exactly the same result.
16 sound channels. Music and sound effects share them. Music is a tracker module whose instruments are short samples, not a recorded stream.
PokeLoom
Section titled “PokeLoom”The engine never calls a graphics library. Each frame it fills one description of what both screens show, in the DS’s own terms: tile layers, sprites, and a 3D scene of display lists. Two backends read it:
- On the DS the backend copies that description to the hardware almost unchanged. The 3D scene’s commands go straight to the geometry engine.
- On desktop a software renderer follows the DS’s rules: the same 256 × 192 picture, 15-bit colour, nearest-texel textures, the same layer and sprite order, the same fixed-point arithmetic for 3D. The 2D picture equals the DS’s pixel for pixel; the 3D picture is compared with melonDS and stays within a small tolerance.
Because both backends read one description, a feature is done only when it works on both. How this is organised is on The frame model and Rendering.
Planned (plan 42): on desktop, a player may choose a sharper or more modern picture (higher resolution, smoother edges, a GPU renderer). These settings change only how the game is drawn, never how it plays, and the software renderer that follows the DS stays the reference. See Presentation settings.
Unused hardware
Section titled “Unused hardware”- The microphone. No game feature needs it.
- Sleep mode when the lid closes is not handled beyond what the system does.
- Display capture, which copies a finished picture back into video memory, is not used today. Planned (plan 42): an afterimage effect made with it.
- The GBA cartridge slot of the original DS, and the DSi’s extra memory and camera. PokeLoom targets the original DS’s limits.