R Register Slot 2 Mapping

Memory locations

 C004 : Current sound to be played (range is 80-FF)
 C005 : First slot for a requested sound to be played
 C006 : Second slot for a requested sound to be played
 C007 : Third slot for a requested sound to be played
 C008 : Sound related
 C106 : Status of reset button in bit 4. (1= not pressed, 0= pressed)
 C108 : RNG temporary value (16 bits)
 C10A : Last byte generated during RNG update ($069E)
 C10B : Territory flag (affects # of continues given)
 C10E : Copy of value written to banking register $FFFF
 C110 : Demo play loop count (0=J.J. #1, J.J. #2, Apple, Champ)
 C11E : Pending item from scene display list ($FF=continue current one)
 C11F : Current item from scene display list
 C112 : Number of continues remaining
 C127 : Current character (0= J.J., 1= Champ, 2= Apple)
 C129 : Number of blue ID cards
 C12A : Number of red ID cards
 C12B : Number of floppy disks
 C14x : Stats for currently selected character (16 bytes)
 C15x : Stats for J.J.
 C16x : Stats for Champ
 C17x : Stats for Apple
 C198 : Room position (+$08 per row, +$01 per column) Used relating to map display and secret messages.
 C1A1 : Pause flag
 C1A2 : When bit 7 is set, demo play is enabled. Pressing any key restarts the game.
 C1A8 : 1P input (current)
 C1A9 : 1P input (changed from last frame)
 C1AA : 2P input (current)
 C1AB : 2P input (changed from last frame)
 C1B6 : 16-bit down counter used to time duration of title screen and other scenes.
 C1BA : Pointer to input data used for demo play
 C1CD : Animation counter for doors opening. Set to $08 to force one open.
 C1CF : Computer type (0= normal, 1= main)
 C1F0 : Randomly generated password for "DOOR OPEN" command. (4 bytes)
 C26A : Infrared beam alarm is triggered when bit 2 is set.
 C280 : Password buffer, which you load when operating the computer. (4 bytes)
 C287 : Key which cursor is pointing to on computer screen. (0-A=symbols, B=backspace, C=enter, D=exit)
 C288 : Number of text message to print by routine @ $1629.
 C300 : Sprite attributes, 32 entries of 32 bytes
 C324 : Horizontal room position (0-7)
 C329 : Vertical room position (0-F)
 C700 : Copy of VDP sprite table
 C800 : Copy of name table #1
 CF00 : Map of visited rooms (16x16 array, 00=not visited, 80=visited)
 D000 : Copy of name table #2
 D800 : Copy of name table #3
 DE00 : Text output buffer (*1)

Scene display list:

 00 - J.J. shooting animation
 01 - Title screen
 02 - Demo play
 03 - J.J. shooting animation
 04 - Black screen
 05 - Mission briefing 
 06 - Emi wishing you good luck
 07 - Emi instructing you about the recovery device
 08 - Computer screen
 09 - Pause screen
 0A - J.J. shooting animation
 0B - Start of game immediately outside ship
 0C - Main computer room
 0D - Credits (but they don't start)
 0E - Character stats, then credits roll
 0F - J.J. shooting animation

1.) During gameplay this buffer stores a 16x6 array that describes room pieces in 16x32 pixel units:

 '0' : Wall segment (such as those that flank the left/right sides of a room)
 '<' : Area that you can only crawl through
 '9' : Background
 ';' : Background with floor tile along bottom
 ':' : Background with shading along top

Other information such as the location of shock beams, infrared beams, barrels, and doors that can open are not stored in this array. It seems to relate to the tiles displayed and movability characters have when going through those areas.

About name tables

The game maintains three name tables which are used to store the current room ($C800), an adjacent area ($D000, used for real-time scrolling between rooms/tunnels), and a work area that is typically loaded with a tunnel or room adjacent to your map position ($D800). Room data is compressed and loaded from ROM, tunnel sections are stored as raw name table data in ROM.

Format of character data

 +0 : Character is 0=not available, 1=alive, 2=dead
 +1 : Maximum life, used to check when adding life after eating bread
 +3 : Current life
 +5 : Character level, plus one
 +6 : Zillion power level, plus one
 +7 : Character attribute index (0-3)
 +8 : Jump level, plus one
 +9 : Scope (zero= no scope, non-zero= have scope)
 +A : Damage rating.

The game reloads the current character data from the other three arrays when leaving the pause screen.

Leveling up

The level-up data table is stored at ROM offset $7CC8. It consists of eight entries (one for each level) of four bytes each, with this structure repeating three times for J.J., Champ, and Apple. The byte values are: Maximum life, Jump level, Attribute index, Damage rating.

The damage rating is subtracted from your life when you take damage. As you gain levels this value becomes smaller and smaller. If you set it to zero, you are invincible.

The character attribute index increases as you gain rank and seems to increase the speed and responsiveness of your character. Apple maxes out this attribute at level 4, J.J at level 8, and Champ can only attain the next-to-fastest index at level 6.

The character attribute table is at offset $7CA0. It is four groups of ten bytes. Within each group, the first byte corresponds to how quickly your running animation cycles.

Text messages

At ROM offset $1704 is a table of four pointers:

 $530B - List of messages for normal computer (Japanese, $2E total)
 $5369 - List of messages for main computer (Japanese, ?? total)
 $53A1 - List of messages for normal computer (English, $4A total)
 $53FF - List of messages for main computer (English, $1C total)

The list is a sequence of pointers, each one pointing to a string consisting of one word (VRAM write command), an inner loop count byte, an outer loop count byte, and then the text itself. The lists are not terminated.

The normal and main computers have different sets of messages, including ones from the developers about other games (Pit-Pot, Alex Kidd in Miracle World) and hidden item locations.

Text encoding

Text is encoded using RLE. When parsing the text:

For each byte X,

Text is mostly ASCII, but the punctuation is somewhat scrambled. Block text is achieved simply by encoding appropriate numbers of spaces to wrap to the next line. Line length is not stored in the same place as the text.

ROM Map

This table summarises the contents of the Zillion [v1] ROM (Size: 128KB; CRC32: 5718762c):

Address RangeContents
$00000 - $00007Unknown Code
$00008 - $0000eCode: Set VRAM Address to the value stored in register DE
$0000fUnused
$00010 - $00019Code: Load Ath[1] entry of table pointed to by register HL into register HL
$0001aUnused
$0001b - $0001fUnknown Code
$00020 - $00029Code: Jump to Ath[2] entry of jump table pointed to by register HL
$0002a - $0002fUnused
$00030 - $00037Code: Write value of register B bytes from memory location pointed to by register HL to the VRAM address pointed to by register DE
$00038 - $0003bCode: push af jp $0120
$0003c - $00059Jump Table (15 entries, indexed by game state) (Jump instruction at $0029)
$0005a - $00065Unused
$00066 - $00081Pause Button Code: Toggle map if possible
$00082 - $000bbUnknown Code
$000bc - $000d8Code: Main loop
$000d9 - $00101Reset Code
$00102 - $0011fJump Table (15 entries, indexed by game state) (Jump instruction at $0029[3])
$00120 - $0018cInterrupt handling Code
$0018d - $00192Code: Write the value of register A to the VRAM address pointed to by register DE
$00193 - $001a9Code: Write value of register BC bytes from memory location pointed to by register HL to the VRAM address pointed to by register DE setting the VRAM address with interrupts disabled
$00198 - $001a9[4]Code: Write value of register BC bytes from memory location pointed to by register HL to the VRAM address pointed to by register DE
$00199 - $001a9[5]Code: Write value of register BC bytes from memory location pointed to by register HL to the current VRAM address
$001aa - $001afUnknown Code
$001b0 - $001bfCode: Write value of register B name table entries from memory location pointed to by register HL to the VRAM address pointed to by register DE using the value stored at $c10d as flags
$001c0 - $001c3Code: Write value of register B name table entries from memory location pointed to by register HL to the VRAM address pointed to by register DE using the value stored at $c10d as flags setting the VRAM address with interrupts disabled
$001c4 - $001d7Unknown Code
$001d8 - $001f3Code: Clear Name Table
$001e3 - $001f3[6]Code: Write the value of register L to VRAM starting from the address pointed to by register DE the value of register BC times
$001f4 - $00207Code: Load Name Table from memory location pointed to by HL to VRAM address pointed to by DE
$00208 - $0021dCode: Load Name Table from memory location pointed to by HL to VRAM address pointed to by DE setting the VRAM address with interrupts disabled
$0021e - $00259Unknown Code
$0025a - $00279Code: Load 1 BPP Tile from HL to VRAM address DE using the value stored in register A as color (Identical to 1BPPTileLoader)
$0027a - $00349Code: Update Sprites
$0034a - $0035bCode: Initialize VDP
$0035c - $00373Initial Data for VDP Registers 0-9
$00374 - $003adCode: Load Tiles 4 Bit RLE from HL to VRAM address DE (Similar to PhantasyStarTileDecoder uses in a, ($BE) to change the VRAM address)
$003ae - $003e1Code: Load Tiles 4 Bit RLE from HL to VRAM address DE (Identical to PhantasyStarTileDecoder)
$003e2 - $00425Unknown Code
$00426 - $00530Unknown
$00531 - $00537Code: Wait for interrupt
$00538 - $00554Code: Disable Screen
$00544 - $00554[7]Code: Enable Screen
$00555 - $00562Unused Code: Clear Scroll
$00563 - $00588Code: Clear Sprite Attribute Table and Name Table and disable Screen
$00589 - $00597Unknown Code
$00598 - $005bcCode: Detect Region
$005bd - $005daCode: Read Input
$005db - $00b07Unknown
$00b08 - $00b29Palette Descriptor: Game State $1
$00b2a - $00fafUnknown
$00fb0 - $00fd1Palette Descriptor: Game State $b
$00fd2 - $00fd6Palette: J.J.
$00fd7 - $00fdbPalette: Champ
$00fdc - $00fe0Palette: Apple
$00fe1 - $0102bUnknown
$0102c - $01031Jump Table (3 entries) (Jump instruction at $0029)
$01032 - $0103bJump Table (5 entries) (Jump instruction at $0029)
$0103c - $0120fUnknown
$01210 - $0121cPalette Descriptor: Rooms 2
$0121d - $01229Palette Descriptor: Rooms 3
$0122a - $01236Palette Descriptor: Rooms 4
$01237 - $01243Palette Descriptor: Rooms 1
$01244 - $01304Unknown Code
$01305 - $01316Palette Descriptor: Game State $c
$01317 - $01328Unknown Code
$01329 - $01334Jump Table (6 entries, indexed by $c1ae) (Jump instruction at $0029)
$01329 - $014baUnknown
$014bb - $014ccPalette Descriptor: Game State $c
$014cd - $0170bUnknown
$0170c - $0174fPalette Descriptors: Game State $8
$01750 - $01b21Unknown
$01b22 - $01b2d4bpp lines of Tiles: Character Selection Border
$01b2e - $01b4fPalette Descriptor: Game State $9
$01b50 - $01befUnknown
$01bf0 - $01bf9Jump Table (5 entries, indexed by $c1ae) (Jump instruction at $0029)
$01bfa - $01db5Unknown
$01db6 - $01dd7Palette Descriptor: Game State $5
$01dd8 - $020b6Unknown
$020b7 - $020c4Jump Table (7 entries, indexed by $c1ae) (Jump instruction at $0029)
$020c5 - $0246dUnknown
$0246e - $024a2Palette Descriptors: Game State $3 and $e
$024a3 - $026c1Unknown
$026c2 - $026cbJump Table (5 entries, indexed by $c1ae) (Jump instruction at $0029)
$026cc - $027cfUnknown
$027d0 - $027e3Palette Descriptor: Game State $a
$027e4 - $02e88Unknown
$02e89 - $02f18Jump Table (72 entries) (Jump instruction at $0029)
$02f19 - $0318cUnknown
$0318d - $031b8Jump Table (22 entries, indexed by $c316) (Jump instruction at $0029)
$031b9 - $04abbUnknown
$04abc - $04ad3Jump Table (12 entries, indexed by $c316) (Jump instruction at $0029)
$04ad4 - $05005Unknown
$05006 - $05019Jump Table (10 entries, indexed by $c280) (Jump instruction at $0029)
$0501a - $0502dJump Table (10 entries, indexed by $c280) (Jump instruction at $0029)
$0502e - $050fbUnknown
$050fc - $05107Jump Table (6 entries, indexed by $c28a) (Jump instruction at $0029)
$05108 - $0511dJump Table (11 entries, indexed by $c28a) (Jump instruction at $0029)
$0511e - $0732fUnknown
$07330 - $0734bJump Table (11 entries, indexed by $c1c0) (Jump instruction at $732f)
$0734c - $0799aUnknown
$0799b - $079b0Jump Table (11 entries, indexed by $c1d0) (Jump instruction at $799a)
$079b1 - $07dffUnknown
$07e00 - $07effMirrored Bits Table
$07f00 - $07fffUnknown
  
$08000 - $0a0cbUnknown
$0a0cc - $0a2cb4bpp Tiles: Power Ups
$0a2cc - $0a44b4bpp Tiles: ID Card
$0a44c - $0a4c8Unknown
$0a4c9 - $0aaefCompressed 4bpp Tiles: Character Heads in Status Report
$0aaf0 - $0ab13Compressed 4bpp Tiles: Typing Fingers
$0ab14 - $0ae53Compressed 4bpp Tiles: Recovery Device
$0ae54 - $0b1c5Unknown
$0b1c6 - $0b4454bpp Tiles: Key Symbols
$0b446 - $0b9bdCompressed 4bpp Tiles: Computer
$0b9be - $0bb10Compressed 4bpp Tiles: Computer Sprite Tiles (Hand, ID Card)
$0bb11 - $0bbbcCompressed 4bpp Tiles: Map
$0bbbd - $0bfffUnknown
  
$0c000 - $0c659Unknown
$0c65a - $0dd393bpp Tiles: Characters
$0dd3a - $0de394bpp Tiles: Zillion Missiles
$0de3a - $0dfe2Compressed 4bpp Tiles: Elevator
$0dfe3 - $0e894Compressed 4bpp Tiles: Sprites
$0e895 - $0ec9bCompressed 4bpp Tiles: Main Computer Room
$0ec9c - $0efb3Unknown
$0efb4 - $0f120Compressed 4bpp Tiles: Moon
$0f121 - $0f1d4Unknown
$0f1d5 - $0fe10Compressed 4bpp Tiles: Boss
$0fe11 - $0ff57Compressed 4bpp Tiles: Boss Missile
$0ff58 - $0ffffUnused
  
$10000 - $105f8Compressed 4bpp Tiles: Mission Briefing
$105f9 - $107d2Unknown
$107d3 - $1087cCompressed 4bpp Tiles: Mission Briefing Sprites
$1087d - $13fffUnknown
  
$14000 - $142af1bpp Tiles: Font
$142b0 - $1461f1bpp Tiles: Japanese Font
$14620 - $15341Compressed 4bpp Tiles: Zillion
$15342 - $154b7Unknown
$154b8 - $154f2Compressed 4bpp Tiles: SEGA ©
$154f3 - $15b57Compressed 4bpp Tiles: Japanese Logo
$15b58 - $15f94Compressed 4bpp Tiles: Logo
$15f95 - $17fffUnknown
  
$18000 - $1812cCompressed 4bpp Tiles: Top Dream Logo
$1812d - $18271Unknown
$18272 - $183512bpp Tiles: Digits
$18352 - $18b2dCompressed 4bpp Tiles: Shooting J.J. Upper Part
$18b2e - $19a64Compressed 4bpp Tiles: Shooting J.J. Lower Part
$19a65 - $19c50Unknown
$19c51 - $19c7dCompressed 4bpp Tiles: Zillion Missile
$19c7e - $1b5e6Unknown
$1b5e7 - $1b626Compressed 4bpp Tiles: Boss Room Walls
$1b627 - $1bfffUnknown
  
$1c000 - $1c1fcCompressed 4bpp Tiles: Room Tiles 1
$1c1fd - $1c694Compressed 4bpp Tiles: Room Tiles 2
$1c695 - $1cb92Compressed 4bpp Tiles: Room Tiles 3
$1cb93 - $1d0dfCompressed 4bpp Tiles: Room Tiles 4
$1d0e0 - $1d1bfCompressed 4bpp Tiles: Additional Room Tiles
$1d1c0 - $1db23Compressed 4bpp Tiles: Mother Ship and Surface
$1db24 - $1e02dUnknown
$1e02e - $1e3ad1bpp Tiles: SEGA Mark III
$1e3ad - $1e521Unknown
$1e522 - $1f298Compressed 4bpp Tiles: Character Heads
$1f299 - $1f2a8Unknown
$1f2a9 - $1f799Compressed 4bpp Tiles: Head of J.J. when showing his stats
$1f79a - $1ffbdCompressed 4bpp Tiles: Opa-Opa and Villain
$1ffbe - $1ffd9Compressed 4bpp Tiles: Stars
$1ffd9 - $1ffffUnused

Researched by Charles MacDonald and Calindro




Return to top
0.232s