|
|
преди 1 седмица | |
|---|---|---|
| .. | ||
| src | преди 1 седмица | |
| tools | преди 1 седмица | |
| README.md | преди 1 седмица | |
| c64project.json | преди 1 седмица | |
A tower-building management game for the Commodore 64 (PAL), written in cc65 C with assembly for drawing and interrupts. You build a skyscraper floor by floor, fill it with offices, condos and restaurants, and keep people moving with elevators and stairs.
pwsh tools/c64.ps1 run projects/highrise -ViceArgs "-mouse -controlport1device 3"
This puts a 1351 mouse in control port 1. Click in the VICE window and press Alt+Q to capture the mouse (press it again to release). You can also set the mouse up from the menus: Settings > Input devices > Control port 1: Mouse (1351) and Enable mouse grab.
| Control | Action |
|---|---|
| Click a toolbar entry | Choose what to build: floor, lobby, stairs, elevator, office, condo, food, clear |
| Left click in the tower | Build. Drag sideways for floor and lobby; drag up or down for an elevator |
| Right button | Cancel a drag |
| Mouse at the screen edge, cursor keys, W A S D | Scroll |
| Space | Pause or resume |
| 1 to 8 | Speed: 1, 2, 3, 4, 6, 8, 12 or 16 times normal |
| + and - | Mouse speed (1-8, starts at 3) |
| Click the speed sign (top right) | Next speed (after 8: pause) |
| X | Load a sample tower (only on an empty lot) |
The message line shows what the pointer is over: the cost of a build, why it can't go there, or a room's status.
Getting started: build a lobby along the ground floor. Add floors above it, an elevator from the lobby up, then offices. Tenants move in when they can get from the lobby to their floor.
| File | Contents |
|---|---|
src/main.c |
Setup, input, toolbar and status bar, the elevator cars, the self-test |
src/world.c |
Building and bulldozing, the cell and tile maps |
src/sim.c |
Trips, routing, elevators, people's daily schedules, money and ratings |
src/render.s |
Drawing the view, the raster splits, the mouse pointer callbacks |
tools/gen_gfx.py |
Generates the tiles, tile pairs and sprites (src/gfx.c, src/gfx.h) |
Memory: the screen ($E800), character set ($E000) and sprites ($EC00) are in VIC bank 3, in the RAM under the Kernal ROM. The map is at $A000-$B3FF, one byte per cell indexing a pair of tiles. The cell-ownership grid is at $B400-$C7FF. BASIC ROM is switched out. Two raster splits give the sky its own background color, which follows the time of day.
The mouse is read by the game itself (render.s), not cc65's driver, twice a
frame (in both raster interrupts). A 1351 reports its position modulo 128, so
the change between two readings is only unambiguous under 64 counts; reading
often keeps a fast flick from wrapping and throwing the pointer the wrong way.
Movement is scaled by the mouse speed. While a button is held, the keyboard
scan is skipped so the button can't type phantom keys.
c64 test projects/highrise builds a sample tower, runs it through a working
day, and checks that every worker came and went, rent was paid, nobody gave up
waiting, and that building and bulldozing follow the rules. The day takes
about a minute of C64 time, so it runs only when the test types T at startup.
Powered by TurnKey Linux.