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.

Blades of Steel (NES)/ROM map: Difference between revisions

From Data Crystal
Jump to navigation Jump to search
(returning breadcrumb)
 
(5 intermediate revisions by 3 users not shown)
Line 2: Line 2:


==PPU data bundles==
==PPU data bundles==
This game has a simple RLE compressed format for PPU data. The ROM stores 15 PPU data bundles, decoded by a subroutine at $1C:C818, taking X as an index (x2) to tables that locate the data:
This game has a simple RLE compressed format for PPU data. The ROM stores 15 PPU data bundles, decoded by a subroutine at $7:C818, taking X as an index (x2) to tables that locate the data:


  $1C:C89D - pointer table to packet data (2-byte address, little-endian, X as index)
  $7:C89D - pointer table to packet data (2-byte address, little-endian, X as index)
  $1C:C8BB - bank table for packet data (1-byte UNROM bank numbers, X/2 as index)
  $7:C8BB - bank table for packet data (1-byte UNROM bank numbers, X/2 as index)


After setting the specified bank, and loading the pointer, the data stream encoded at this pointer is as follows:
After setting the specified bank, and loading the pointer, the data stream encoded at this pointer is as follows:
Line 21: Line 21:
         ...    - uncompressed data (length given above)
         ...    - uncompressed data (length given above)
                   return to step 2
                   return to step 2
     2.4. $00    - "invalid" run-length value of 256 (never used)
     2.4. $00    - run-length value of 256 (never used)
         $xx    - byte to be repeated 256 times
         $xx    - byte to be repeated 256 times
                   return to step 2
                   return to step 2
     2.5. $80    - invalid uncompressed length value (never used)
     2.5. $80    - invalid uncompressed length value (causes hang)
         ...    - 255 bytes of uncompressed data
         ...    - 255 bytes of uncompressed data
                   $80 is written as the 256th byte
                   $80 is written as the 256th byte
                   data pointer doesn't advance, return to step 2.5
                   data pointer doesn't advance, return to step 2.5
Python utility for decoding/encoding: [https://gist.github.com/bbbradsmith/eed4194e226fa5bdf6a975e8924ffcf5 Gist]
{{Internal Data}}

Latest revision as of 21:07, 28 January 2024

Chip tiny.png The following article is a ROM map for Blades of Steel (NES).

PPU data bundles

This game has a simple RLE compressed format for PPU data. The ROM stores 15 PPU data bundles, decoded by a subroutine at $7:C818, taking X as an index (x2) to tables that locate the data:

$7:C89D - pointer table to packet data (2-byte address, little-endian, X as index)
$7:C8BB - bank table for packet data (1-byte UNROM bank numbers, X/2 as index)

After setting the specified bank, and loading the pointer, the data stream encoded at this pointer is as follows:

1. 2-byte PPU write address (little endian)
2. Control byte:
   2.1. $FF     - end of bundle
                  stop decoding
   2.2. $7F     - new write address
                  return to step 1
   2.3. $01-$7E - run-length for next byte
        $xx     - byte to be repeated for the duration of the run length
                  return to step 2
   2.4. $81-$FE - & $7F = length of uncompressed data that follows
        ...     - uncompressed data (length given above)
                  return to step 2
   2.4. $00     - run-length value of 256 (never used)
        $xx     - byte to be repeated 256 times
                  return to step 2
   2.5. $80     - invalid uncompressed length value (causes hang)
        ...     - 255 bytes of uncompressed data
                  $80 is written as the 256th byte
                  data pointer doesn't advance, return to step 2.5

Python utility for decoding/encoding: Gist