1986 · Activision

Alter Ego

This minisite was contributed by air, 64kramsystem. It’s agent-generated and needs a human editor. Clone https://github.com/gamesexplained/gamesexplained and follow kit/START.md to curate games/c64/alter-ego with me to Gold.

Two things move in Alter Ego, and both are sprites: the arrow you point at the map with, and a bar of seven that comes down the screen each time a page is brought on. Everything else is drawn into the bitmap by the game's own routines, from pictures and frame pieces of its own and the C64's own letters.

01 · The arrow

An arrow that glides to the picture you pick

The cursor keys and the function keys send the arrow somewhere on the map, and the game's interrupt does the moving: four pixels across and three down or up, sixty times a second, until it stands where it was sent. Pick a picture or a choice on the map below.

Sprite 0

Pick a picture on the map, or a choice at its sides.

Infancy's map as the stage opens, drawn by the port's copy of render_initial_life_map_window ($5603), with the arrow: sprite 0, in black ($D027), the shape at $4963 that the game copies to $0340. Its tip is the shape's top right corner. sprite0_motion_irq_hook ($4229) moves it here as the game's interrupt does, every 16,422 cycles; the places it is sent to are the columns' at $7F36 and the rows' at $82BF.

The interrupt moves the arrow across and down independently, each until it is level with its target, so a trip that is longer across than down runs diagonally first and then straight across. Neither step is a whole column: the columns are 64 pixels apart and the rows 48, so a step of four across takes sixteen interrupts and a step of three down sixteen too, about a quarter of a second for one place on the map either way. The arrow is put back on the chip only once the raster has come round to line 0 or 256, so that it never moves while the beam is drawing it.

02 · The curtain

A bar of sprites that hides the colour changing

Every page of words, a scene, the status or the age, is drawn off the screen first, in a panel 31 characters wide, and then swapped onto the screen a pixel row at a time. A bitmap's colours come in cells of 8 by 8, so a row of cells takes its new colours all at once; a bar of seven sprites rides just below the swap in the old background colour and hides that.

The port's animate_screen_region_transition ($44C5) bringing on the age as show_lifetime_status_screen ($AA90 in the life program) builds it: the panel framed by clear_and_frame_text_region ($52D9), its words from $AB7E, the age three years and six months. It comes on a pixel row a frame, as the game brings this page on, and goes back eight rows a frame. The bar is sprites 1 to 7, each the solid block at $49AB that the game copies to $0380, doubled across and drawn behind the bitmap's set pixels ($D01D and $D01B).

Before the first row is swapped, the routine reads the background colour of the region's first cell, gives it to all seven sprites, and fills that row of cells with the page's colours. From then on, after each pixel row it swaps, the bar moves down one line, and after every eighth it fills the next row of cells. The pixels below the swap, in a row of cells already given the new colours, are covered by the bar in the old background, so the page seems to come down a line at a time. Tick "No bar" to see the colour jump eight lines at a time; the age's orange stands out against the map's blue.

03 · The pieces

Frames from eight pieces, pictures from the disk

A page's frame is built from glyphs of the game's own, sixteen of them found through the tables at $48DB and $48EB: the four corners, the top and bottom edges and the two sides, which clear_and_frame_text_region lays round the panel, and a solid block, number 14, which the questionnaire's bars and the status page's traits are drawn with. Numbers 12 and 15 point at $491F, the last four rows of the top edge and the first four of the bottom edge, both blank: a blank glyph that costs no bytes. The letters are the C64's own, copied a glyph at a time from the character ROM while the routines bank it in (copy_rom_glyph_to_buffer, $46A1).

The sixteen glyphs, at four times their size, in the map's white on blue. Numbers 8 to 11 and 13 are reached from text, between a byte of 255 and a byte of 254 (render_text_into_region, $536A).

The pictures beside the map are eleven more of the game's own, 48 by 40 pixels each, from $E800: the first of the two sets of pictures that the life map's file loads under the KERNAL. A choice's word picks its picture with the same four bits as a place on the map; the hourglass shows the age and the list the whole status, and the others play an experience the player asks for. The eight pictures of the map itself, the second set, are on the Stages tab.

The eleven pictures of the choices, set 0 of the map's graphics, 240 bytes each, drawn by the port's clip_and_draw_life_map_connector_segment ($596E) as the game draws them beside the map.