game boy advance · demo · v0.44.0
VECTOR
A tribute to Portal for the Game Boy Advance, built from scratch. The gun doesn't fire bullets but portals, two of them, one warm and one cold, and they only stick to the pale panels. Go in one, come out of the other, and keep your speed: fall from high up and you come out fast. Twelve rooms in two halves, and the second is the same facility years later.

cover illustration, not a screenshot: the GBA has sixteen colours per palette and 240×160 pixels. The real screens are below.
What it is
It's a demo, and I want that said before anything else: the rooms built so far were what it took to get on speaking terms with this machine's processor and see what came out. It isn't a finished game and doesn't pretend to be one: the rooms will grow, the ones here now are the beginning.
It's not a port and it uses nothing from the original: it's the same idea, two linked portals and speed carried through them intact, brought inside the constraints of a machine from 2001. Two hundred and forty pixels by a hundred and sixty, sixteen colours per palette, and everything you see drawn point by point: the walls, the steam from the air vents, the cones of light from the lamps, the neon tubes around the doorways.
no bitmaps. just code
The rooms
Each one teaches a single thing, and asks for it once. Then it opens onto the next. The game is split in two halves, and the second one is the same place, years later. These are the rooms built so far: more are coming, and the count isn't the point.

Everything still works here
The doors open, the water runs, the machines wait for orders. Six rooms to learn the rules: walking, the portals, the cube on the button, the turret, the beam, the machines.

The same place, years later
Collapsed walls, moss and vines over the concrete, daylight through the holes. You recognise it, and that's the point: it isn't a new world, it's the earlier one left to go.
In the second half there are three things that don't exist in the first.
- glass stops you, not your portals
- wall sentries only destroyed by throwing a cube
- consoles drive a machine you can only watch through glass

THE TOWER, the last room: 30 blocks by 20, the first in the game taller than the screen. A drain at the top pours a waterfall crossing both floors, and for most of the room it's the only thing visible from both.

every room is two screens wide, so walking in leaves half of it behind you. Before handing you the controls the camera goes to see the far end and comes back: barely two seconds, and it doesn't replay when you die.
The controls
The game's text is in English, and these are the buttons.
- D-PAD walk
- UP jump
- A / B orange portal / blue portal
- R grab or drop the cube
- LEFT or RIGHT + R throw the cube
- HOLD L aim in eight directions
- LEFT or RIGHT on a console drive the machine
How it's built
No standard library and no engine: the game writes straight into the machine's registers. memset is hand-written, three lines, because the compiler needs it and the library isn't there. And the processor can't divide, so every cycle, every cadence and every ramp is a power of two or a counter that wraps: a division by an arbitrary number would become a call into a library that doesn't exist, and the program would stop linking.
The graphics aren't drawn in a paint program: they're generated. A set of JavaScript tools produces the tiles, palettes, maps and tables as C files, which are then compiled into the cartridge. The rooms live in a text file, and there's an editor that shows them drawn with the real game pieces, with the light cones, the beam runs, the lift travel and the jump arc, and that rebuilds the cartridge on save.

the character's sixteen frames: eight of walk, three of jump, five of aim. The walk poses aren't drawn by hand, they come from a curve.
- version 0.44.0
- machine Game Boy Advance · ARM7TDMI, 16,8 MHz
- screen 240 × 160, 15 bit di colore
- cartridge 293 KB
- rooms 12 so far, in two halves
- a clean run about two minutes fifty
- character frames 16
- built with C · devkitARM · no engine, no libraries
Behind the scenes
Two of the walls I hit getting here, told in full: what was happening, why it was happening, and the code that fixed it.
The light that cast a shadow
The GBA has no lighting engine: it has an adder. How it blends two layers, why a brown cone darkens the wall instead of lighting it, and why putting sprites among the targets blends every one of them.
read →It compiles, it runs, it doesn't work
A variable living in ROM, a branch of code written twice, tiles treading on each other, ivy growing where it shouldn't and video memory running out without warning. Five faults that raise no error at all.
read →The tribute, and what it isn't
VECTOR is a tribute to Portal, by Valve. The tribute is declared inside the game itself, on the INFO page, with the name of the original and of who made it: a tribute that doesn't name the original isn't a tribute.
From Portal it takes the idea: two linked portals, speed preserved, rooms that teach one thing at a time. It takes nothing material: no art, no sound, no music, no text, no characters, no names. It isn't called Portal, it doesn't use the trademark, it doesn't use the characters and it doesn't claim any connection to Valve.
Portal and Valve are trademarks of their respective owners. Game Boy Advance is a Nintendo trademark: VECTOR is an independent program for that machine, it contains no Nintendo code and is neither approved nor sponsored by Nintendo.