Strider (Genesis)/Notes: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
No edit summary
Line 57: Line 57:


Each entry is a 4 words sequence (a word is pattern id with its attributes, see genvdp.txt §13), successively top-left, top-right, bottom-keft, bottom-right of the tile.
Each entry is a 4 words sequence (a word is pattern id with its attributes, see genvdp.txt §13), successively top-left, top-right, bottom-keft, bottom-right of the tile.
=== Tilemaps ===
The 256x256 pixels tilemaps blocks are compressed. The decompression routine is located at 0x2074a, and the compression format is as follows :
* The 6 first bytes are init values of different constants and variables used later :
** size (1 byte)
** mask (1 byte, only 5 bits used)
** incremental_value (1 word), which is added to a base_value (given as a parameter of the decompression routine ; for tilemaps used in levels, base_value = 0)
** fixed_value (1 word), added to the base_value


=== Maps ===
=== Maps ===


The maps are stored in a table starting at 0x28d7a.
The maps are stored in a table starting at 0x28d7a.

Revision as of 18:23, 20 June 2022

These are notes about gfx ressources. Work in progress...

The vocabulary used in these notes follows Charles McDonalds' document genvdp.txt, easily available. Offsets refer to american version.

A table is an array of values starting with an offset list. For example, if a table is starting at 0x1000, the address of table[5] is obtained by looking at the 10-th offsets (they are 16 bits words) and adding it to 0x1000.

Palettes

Palettes are uncompressed. Most of them are stored from 0x22f08 to 0x23988.

Levels Maps

Levels maps are split in 256x256 submaps. Each submap is made of 16x16 tiles. Each tile is made of 2x2 patterns (a pattern is a 8x8 pixels stored in VRAM).

Due to the size of the map, there's always 2 set of submaps in RAM, one at 0xff0000, the other at 0xff3000. When the submap at 0xff3000 is displayed, the next submap is loaded at 0xff000, and vice-versa. The submap stored in 0xff3000 is refered by tiles id >= 0x80.

For example, the 1st level map is (ignoring 00 and 80's, that are blank submaps) :


                                                                 02 03                         
                                                           86 88 01 04 05 06                   
                                      85 86 88 8a 8c    83 85 87 89 05 01 81 83 85 87          
                                   82 84 87 89 8b 8d    82 84    04 06 02 82 84 86 88          
              01 02 03 04 05 06 07 81 83       8e 01 04 06                                     
                                                  02 03 05                                    

is actually made of 8 sets of submaps, denoted by letters below :


                                                                                 E02 E03                         
                                                                         D86 D88 E01 E04 E05 E06                   
                                              B85 B86 B88 B8a B8c    D83 D85 D87 D89 G05 G01 H81 H83 H85 H87          
                                          B82 B84 B87 B89 B8b B8d    D82 D84     G04 G06 G02 H82 H84 H86 H88          
              A01 A02 A03 A04 A05 A06 A07 B81 B83         B8e C01 C04 C06                                     
                                                              C02 C03 C05                                    

(the F set is loaded in the same location as G when entering a dome).

Patterns

Patterns are compressed for the most part, using the well-known nemesis compression scheme, documented here for example.

Some of them are stored in a list of 8 bytes entries at 0x2e25a, the 4 first bytes are DMA command (see gendvdp.txt §7)

Others of them are stored in a table starting at 0x2e364. Each entry is of the form :

  • N (1 byte) : counter
  • repeat N + 1 times:
    • source address in ROM (4 bytes)
    • dest address in VRAM (2 bytes)

Tiles

The list of 5 addresses (one per level) is stored at 0x249a.

Each entry is a 4 words sequence (a word is pattern id with its attributes, see genvdp.txt §13), successively top-left, top-right, bottom-keft, bottom-right of the tile.

Tilemaps

The 256x256 pixels tilemaps blocks are compressed. The decompression routine is located at 0x2074a, and the compression format is as follows :

  • The 6 first bytes are init values of different constants and variables used later :
    • size (1 byte)
    • mask (1 byte, only 5 bits used)
    • incremental_value (1 word), which is added to a base_value (given as a parameter of the decompression routine ; for tilemaps used in levels, base_value = 0)
    • fixed_value (1 word), added to the base_value

Maps

The maps are stored in a table starting at 0x28d7a.