Changes

Jump to: navigation, search

Renegade

1,154 bytes added, 12:33, 17 February 2019
/* Technical */
== Technical ==
 
=== General ===
* The game is designed to run in 64KB of memory. Therefore they made decisions to make this possible. Even so, the game is one of the best on CPC
* With 64KB one level at a time is loaded. With 128KB all 4 levels are loaded.
* The game doesn't use hardware scrolling and uses a reduced screen and heavily uses the invisible areas of both screens to store code and data.
 
=== Sprites ===
* Sprites are stored upside down in memory.
* Sprites are stored as mode 0 with pen 0 as transparent.
* Sprites are stored facing right only and flipped by code in realtime (e.g. the facing right left sprite is a flip mirror of the facing left right sprite.).* Sprites Characters are stored in as multiple sprite parts and are composed during drawing. Each part has an a signed x,and y offsetrelative to the base x, y position of the feet on screen and a width and height based on the sprite's coordinates. Therefore heads, bodies and legs are separate. This allows re-use for all characters and enemies.* Sprites are Sprite pixel data is stored as follows:
1 byte like normal (to write to same as mode 0 screenbytes), followed by 1 byte with pixels swapped, then this repeats.
It is believed this is done so that drawing a sprite facing left, and drawing a sprite facing right will take the same cpu time and so that the frame rate will remain is more constantconsistent.
* Supports 128K RAM. All levels Characters are loaded at oncesorted by their y position each frame. Each level takes &1000 bytes. There They are 4 stored then draw in 1 16KB page.* 2048 bytes for tile graphics. These are defined per-level. These are copied from &31e0 in 4 parts. There are 128 possible tiles. Runtime ranges: &e600-&e800, &ee00-&f000, &f600-&f800, &fe00-&ffff.* Tiles are 4 pixels wide and 8 pixels tall. Each tile's graphics uses 16 bytes. Tiles are stored uncompressed, left-right and top to bottom.* "Macro tile map" uses 64 bytes. Each byte is 4 tiles wide and 9 tiles tall. Macro tile map's runtime location is at &BF90. Data at 9600 defines actual tiles to useincreasing y coordinate order.
=== Levels ===* Sprites for all levels are loaded at once and use ~13KBEach level takes &1000 bytes. They There are located at 4 stored in 1 16KB page. The data is copied to &4a803000->&7fff 3fff before then being copied to other locations in main ramRAM.* The game doesnEach level't use hardware scrolling s data is prefixed with "JCB Overlay xxxx" where x is the level number. e.g. "JCB Overlay 0000".* Map is 128 tiles wide and 18 tiles tall. But not all map space is used. The remainder is garbage. In reality, Level 1,2,3 are 80 tiles wide. Level 4 is 112 tiles wide.* Each level has it's own palette of 16 colours. The palette for level 1 is at &87b3, level 2 is &87c3, level 3 is &87d3, level 4 is at &87e3. The palette is stored backwards with pen 15 first, then 14 all the way down to 0.* "Macro tile map" uses 64 bytes. It is stored at offset +0x01a0 from the start of the level's data. Each byte is a reduced screen macro tile id. Each macro tile is 4 tiles wide and heavily 9 tiles tall. The data is copied to &BF90 and this is where the runtime uses it from.* The tile ids per macro block are stored at offset +0x09e0 from the invisible areas start of both screens the level's data. The data is encoded as 7 bits per tile all put together. It is decoded to store code and &31a0 overwriting the level data. This is copied to &9600-&9720,&9e00-&9f20,&a600-&a720,&ae00-&af20. The runtime uses the data from &9600. The ids are stored pre-multiplied by 2.
* Map is 128 tiles wide and 18 tiles tall, but not all map width is used. The remainder is garbage. In reality, Level 1,2,3 are 80 tiles wide. Level 4 is 112 tiles wide.
=== Tiles ===* Each level has it's own palette of 16 colours. The palette 2048 bytes for tile graphics. These are defined per-level 1 is . These are stored at +&87b3, 1e0 from the level 2 is data. They are copied from &87c331e0 in 4 parts. There are 128 possible tiles. Runtime ranges: &e600-&e800, level 3 is &87d3ee00-&f000, level 4 is at &87e3f600-&f800, &fe00-&ffff. The palette is * Tile graphics are 4 pixels wide and 8 pixels tall. Each tile's graphics uses 16 bytes. Tiles are stored backwards with pen 15 firstuncompressed, down left-right and top to 0bottom. === Sprites ===* Sprites for all levels are loaded at once and use ~13KB. They are located at &4a80-&7fff in main ram.
== Video ==
2,541
edits