Welcome to Data Crystal's new home! Data Crystal is now part of the TCRF family (sort of).
The wiki has recently moved; please report any issues in Discord. Pardon the dust.

Shadow Dancer/Notes

From Data Crystal
Jump to navigation Jump to search

Chip tiny.png The following article is a Notes Page for Shadow Dancer.

This page contains notes about an attempt to hack the game, replacing graphics and maps to make the game similar to the arcade classic Shinobi.

I intend to study :

  • how to edit sprites graphical data (mostly done)
  • how to alter character behaviour (to do)
  • how to edit sprites collision boxes (to do)
  • how to edit tiles and maps (mostly done)
  • how to edit collisions with maps (in progress)

The terminology used here is mostly borrowed from the document entitled Sega Genesis VDP documentation by Charles MacDonald (available on RHDN), refered by [CMD] :

  • a pattern is a 8*8 16 colors tile, aimed to be loaded in VRAM (see [CMD])
  • a sprite is made from 1*1 to 4*4 contiguous pattern(s), with palette, flipping and link attributes (see [CMD])
  • a multisprite is made from several sprites, with position relatives to an origin (not in [CMD])
  • a ROM address is between 00000 and 80000, a RAM address between FF0000 and FFFFFF
  • a stage pointer table is read as follow : if you're at mission m and sub-mission s
    • the m-th word is an offset from the beginning of the table ; you get to addr
    • the s-th word from this position in an offset from addr to the relevant entry of the table

Palettes

Palettes are organized as groups of 4 palettes (from 0 to 3)

There two sets of groups.

One is loaded for special events in the game (title screen, mission screen), the other is particular as each stage.

Stages palettes

The table is located at 0x12FA8. It starts with a stage pointer table. Then, each entry is made of 4 words that are all offsets from the beginning of the entry, to the 16 words giving the palette.

It is read by routine at 0x12CC8

Special palettes

They are stored in a table starting with word offsets from the beginning of the table to the entry. Then each entry is a word offset from the beginning of the entry to the palette itself.

It is read by routine at 0x12CFE

 special_id | description
 00         | Sega logo
 01         | Opening
 02         | Start Stage Screen / After Stage Scoring 
 03         | Start Mission Screen
 04         | Bonus Stage
 ??

Sprites

This section describes how the Joe Musashi and the ennemies "sprites" (in fact, multisprites) are loaded.

Joe Musashi

Patterns

A whole set of patterns is loaded at once at RAM address FF9300. Only relevant patterns will later be loaded in VRAM. The set is Nemesis-compressed at ROM address 23540. Nemesis compression is a well-known compression scheme which is described here.

Loading in VRAM

Patterns are loaded at the beginning of each stage. Their are loaded from a table stored at 0x1AD36. It begins with a list of 56 word-offsets to the actual entry.

An entry is :

  • a word, counting the number N of group of patterns to load
  • then, for each group, 14 bytes of data, of the form :
 93xx 94xx 95xx 96xx 97xx cccccccc

The first 5 words are sent to the VDP control port to set VDP registers $13 to $17. In particular, you can get the RAM adress from which the patterns are loaded, and the number of words to copy. The last long is the "copy" command sent to the VDP control port. You can get from it the position in VRAM where to copy patterns.

Building Multisprites

The dog

Ennemies

Bosses