Jump to content
NHL'94 Forums

HOW TO: Changing the Background Tile - Part 1: The Matchups Screen


Recommended Posts

Posted (edited)

As a follow up to my thread on changing the background graphic of the Main Menu, here is the way to update the tiled background in the Team Matchup screen. I think the method will be the same for the remaining tiled background screens (Edit Lines, stats, etc) but I have not reached that far yet - that will be part 2 of this tutorial.

EASY WAY : 
Copy this data.

00 00 08 0A 00 00 08 8A 00 40 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 76 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 65 77 77 65 55 77 65 64 44 65 67 44 44 67 44 44 44 77 77 77 77 77 77 77 77 77 75 53 33 33 35 77 44 74 44 44 44 44 44 44 44 44 44 44 44 44 44 4F FF 77 77 77 77 77 77 77 77 33 33 35 77 44 47 75 33 44 44 44 44 44 44 44 44 44 44 44 44 FF FF 44 44 77 77 77 77 77 77 77 77 77 77 77 77 35 77 77 77 75 55 77 77 44 47 65 67 44 44 44 65 44 44 44 44 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 67 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 65 77 77 76 54 77 77 6E 44 77 7E 44 44 77 E4 44 44 77 44 44 44 7E 44 44 4F E4 44 44 F7 44 44 44 44 44 44 44 FF 44 44 FF 77 44 4F 47 77 4F 47 77 77 F4 77 77 77 47 77 77 77 77 77 77 77 4F F4 47 77 47 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 74 44 FF 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 44 44 44 44 4F 44 44 44 77 4F 44 44 77 77 4F 44 77 77 77 F4 77 77 77 7F 77 77 77 77 77 77 77 77 45 57 77 77 44 46 77 77 44 44 67 77 44 44 46 77 44 44 4E 67 44 44 44 E7 4F 44 44 4E 74 44 44 44 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 7E 77 77 77 7E 77 77 77 E4 77 77 77 44 77 77 7E 44 77 77 74 44 77 77 E4 44 77 77 44 44 44 44 4F 77 44 44 F7 77 44 44 F7 77 44 4F 77 77 44 44 77 77 44 F7 77 77 44 47 77 77 4F 77 77 77 77 77 77 77 77 77 77 77 77 77 77 75 77 77 75 33 77 77 53 4F 77 75 4F 44 77 57 F4 44 77 5F 44 44 77 77 77 77 77 77 77 77 33 33 77 77 EE EE 35 77 FF FF F3 57 44 44 4F E5 44 44 44 FE 44 44 44 4F 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 57 77 77 77 E5 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 F4 44 44 77 7F 44 44 77 77 F4 44 77 77 F4 44 77 77 44 44 77 75 44 44 77 34 44 44 77 44 44 44 E7 77 77 77 4E 77 77 77 44 77 77 77 44 47 77 77 44 4E 77 77 44 44 77 77 44 44 E7 77 44 44 47 77 77 7E 44 44 77 7E 44 44 77 7E 44 44 77 74 44 44 77 74 44 44 77 74 44 44 77 74 44 44 77 74 44 44 44 77 77 77 44 77 77 77 F7 77 77 77 F7 77 77 77 E7 77 77 77 E7 77 77 77 E7 77 77 77 E7 77 77 77 75 E4 44 44 75 44 44 44 77 44 44 44 77 44 44 44 77 E4 44 44 77 7F 44 44 77 7E F4 44 77 77 EF F4 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 4F 44 44 44 FE 44 44 FF E7 45 77 77 77 47 77 77 77 47 77 77 77 47 77 77 77 47 77 77 77 E7 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 73 77 77 77 34 77 77 77 54 77 77 73 44 77 77 34 44 75 44 F7 EF 34 4F 4E EF 44 4F 77 74 44 FE 77 74 44 47 77 7E 4F E7 77 77 F4 E7 77 77 F7 77 77 77 44 44 47 77 44 44 47 77 44 44 4E 77 44 44 44 77 F4 44 44 77 F4 44 44 77 F4 44 44 77 F4 44 44 77 77 74 44 44 77 74 44 44 77 74 44 44 77 74 44 44 77 7E E4 44 77 77 E4 44 77 77 F4 44 77 77 FF 44 E7 77 77 77 E7 77 77 77 E7 77 77 77 F7 77 77 77 F7 77 77 77 F4 77 77 77 44 57 77 77 4F 77 77 77 77 77 7E FF 77 77 77 7E 77 77 77 77 77 77 77 77 77 77 77 77 77 73 33 33 77 FF FF FF 77 F4 44 44 FF FF FE 77 FF FE 77 77 77 77 77 77 77 77 77 77 77 77 77 77 33 33 33 33 FF FF FF FF 44 44 44 44 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 33 33 33 33 FF FF FF FF 44 44 44 44 77 77 54 4F 77 73 44 44 77 54 44 FE 73 54 4F 47 75 44 4F 77 34 44 F7 77 F4 4F 77 77 44 4F 77 77 E7 77 77 77 77 77 77 77 77 77 77 77 77 77 77 7E 77 77 77 7E 77 77 77 7F 77 77 77 7F 77 77 77 E4 F4 44 44 77 F4 44 44 77 F4 44 44 77 44 44 44 77 44 44 FE 77 44 44 F7 77 44 44 F7 77 44 44 F7 77 77 77 EF 44 77 77 7F 44 77 77 7F 44 77 77 77 F4 77 77 77 F4 77 77 77 EF 77 77 77 7F 77 77 77 77 4F 47 77 77 44 F7 77 77 44 F4 77 77 44 4F 77 77 44 44 47 77 44 44 F7 77 44 44 4F 77 F4 44 44 F7 7E 44 44 44 7F 44 44 44 74 44 44 44 74 44 44 44 74 44 44 44 7F FF FF FF 7E FF FF FF 77 77 77 77 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 FF FF FF FF FF FF FF FF 77 77 77 77 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 44 4F FF FF FF F7 FF FF FF F7 77 77 77 77 44 FE 77 77 44 E7 77 77 4F 77 77 77 F7 77 77 77 E7 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 F4 77 77 7E F4 77 77 5F 44 77 77 EF 44 77 77 F4 44 77 5F E4 44 77 EF 44 44 7E F4 44 44 44 4F E7 77 44 4F 77 77 44 4F 77 77 44 F7 77 77 44 F7 77 77 4F 77 77 77 FF 77 77 77 F7 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 EF 44 44 4F 7F 44 44 44 77 F4 44 44 77 7F F4 44 77 77 FF 44 77 77 7F F4 77 77 77 FF 77 77 77 7F 77 77 77 77 F7 57 77 77 4F E5 77 77 44 FF 55 77 44 44 FE 55 44 44 44 FE 44 44 44 44 F4 44 44 44 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 55 57 77 77 FF E5 55 77 44 44 EE EE 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 55 77 77 55 EE EE EE E4 44 77 77 77 77 77 77 77 7E 77 77 7E FF 77 77 EF E4 75 5F F4 44 EF F4 44 44 44 44 44 44 44 44 44 44 EF 44 44 4F F4 44 44 FF 44 44 44 F7 44 44 FF 77 44 4F F7 77 44 FF 77 77 4F F7 77 77 FF 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 7F FF 44 44 77 EF FE 44 77 77 EF FF 77 77 77 7F 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 44 44 44 FF 44 44 44 44 E4 44 44 44 FF FF E4 44 77 EF FF EE 77 77 7F FF 77 77 77 77 77 77 77 77 FF F4 44 44 44 44 44 44 44 44 44 4E 44 44 EF FF EE EF FF E7 FF FF 77 77 77 77 77 77 77 77 77 77 44 44 4F FF 44 4E FF E7 FF FF E7 77 FF 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 E7 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 04 00 0E E2 0E 00 0C CC 0C 86 0C CA 0E CA 0C A8 0C CC 0E EE 00 EE 0E 00 0C 00 0A 00 0E 88 0A 66 04 00 0C CC 08 88 04 44 02 22 00 8C 00 6A 00 00 08 22 06 00 00 42 00 20 00 4A 00 06 06 6A 02 46 04 00 00 EE 00 00 06 66 06 66 06 66 06 66 06 66 06 66 06 66 06 66 06 66 06 66 0A 00 06 66 06 66 04 00 00 E0 00 00 06 66 06 66 06 66 06 66 06 66 06 66 06 66 06 66 06 66 06 66 00 00 06 66 06 66 00 28 00 1C 00 00 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 00 00 00 00 00 00 00 00 20 00 21 00 22 00 23 00 24 00 25 00 26 00 27 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 00 00 00 00 00 00 00 00 20 00 21 00 22 00 23 00 08 00 09 00 0A 00 0B 00 0C 00 0D 00 0E 00 0F 00 00 00 00 00 00 00 00 00 28 00 29 00 2A 00 2B 00 2C 00 2D 00 2E 00 2F 00 00 00 00 00 00 00 00 00 08 00 09 00 0A 00 0B 00 0C 00 0D 00 0E 00 0F 00 00 00 00 00 00 00 00 00 28 00 29 00 2A 00 2B 00 10 00 11 00 12 00 13 00 14 00 15 00 16 00 17 00 00 00 00 00 00 00 00 00 30 00 31 00 32 00 33 00 34 00 35 00 36 00 37 00 00 00 00 00 00 00 00 00 10 00 11 00 12 00 13 00 14 00 15 00 16 00 17 00 00 00 00 00 00 00 00 00 30 00 31 00 32 00 33 00 18 00 19 00 1A 00 1B 00 1C 00 1D 00 1E 00 1F 00 00 00 00 00 00 00 00 00 38 00 39 00 3A 00 3B 00 3C 00 3D 00 3E 00 3F 00 00 00 00 00 00 00 00 00 18 00 19 00 1A 00 1B 00 1C 00 1D 00 1E 00 1F 00 00 00 00 00 00 00 00 00 38 00 39 00 3A 00 3B 00 20 00 21 00 22 00 23 00 24 00 25 00 26 00 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 20 00 21 00 22 00 23 00 24 00 25 00 26 00 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 28 00 29 00 2A 00 2B 00 2C 00 2D 00 2E 00 2F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 28 00 29 00 2A 00 2B 00 2C 00 2D 00 2E 00 2F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 30 00 31 00 32 00 33 00 34 00 35 00 36 00 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 30 00 31 00 32 00 33 00 34 00 35 00 36 00 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 00 39 00 3A 00 3B 00 3C 00 3D 00 3E 00 3F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 00 39 00 3A 00 3B 00 3C 00 3D 00 3E 00 3F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 09 00 0A 00 0B 00 0C 00 0D 00 0E 00 0F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 09 00 0A 00 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 11 00 12 00 13 00 14 00 15 00 16 00 17 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 11 00 12 00 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18 00 19 00 1A 00 1B 00 1C 00 1D 00 1E 00 1F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18 00 19 00 1A 00 1B 00 00 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 00 00 00 00 00 00 00 00 20 00 21 00 22 00 23 00 24 00 25 00 26 00 27 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 00 00 00 00 00 00 00 00 20 00 21 00 22 00 23 00 08 00 09 00 0A 00 0B 00 0C 00 0D 00 0E 00 0F 00 00 00 00 00 00 00 00 00 28 00 29 00 2A 00 2B 00 2C 00 2D 00 2E 00 2F 00 00 00 00 00 00 00 00 00 08 00 09 00 0A 00 0B 00 0C 00 0D 00 0E 00 0F 00 00 00 00 00 00 00 00 00 28 00 29 00 2A 00 2B 00 10 00 11 00 12 00 13 00 14 00 15 00 16 00 17 00 00 00 00 00 00 00 00 00 30 00 31 00 32 00 33 00 34 00 35 00 36 00 37 00 00 00 00 00 00 00 00 00 10 00 11 00 12 00 13 00 14 00 15 00 16 00 17 00 00 00 00 00 00 00 00 00 30 00 31 00 32 00 33 00 18 00 19 00 1A 00 1B 00 1C 00 1D 00 1E 00 1F 00 00 00 00 00 00 00 00 00 38 00 39 00 3A 00 3B 00 3C 00 3D 00 3E 00 3F 00 00 00 00 00 00 00 00 00 18 00 19 00 1A 00 1B 00 1C 00 1D 00 1E 00 1F 00 00 00 00 00 00 00 00 00 38 00 39 00 3A 00 3B 00 20 00 21 00 22 00 23 00 24 00 25 00 26 00 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 20 00 21 00 22 00 23 00 24 00 25 00 26 00 27 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 28 00 29 00 2A 00 2B 00 2C 00 2D 00 2E 00 2F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 28 00 29 00 2A 00 2B 00 2C 00 2D 00 2E 00 2F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 30 00 31 00 32 00 33 00 34 00 35 00 36 00 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 30 00 31 00 32 00 33 00 34 00 35 00 36 00 37 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 00 39 00 3A 00 3B 00 3C 00 3D 00 3E 00 3F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 38 00 39 00 3A 00 3B 00 3C 00 3D 00 3E 00 3F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 03 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 09 00 0A 00 0B 00 0C 00 0D 00 0E 00 0F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 08 00 09 00 0A 00 0B 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 11 00 12 00 13 00 14 00 15 00 16 00 17 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 10 00 11 00 12 00 13 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18 00 19 00 1A 00 1B 00 1C 00 1D 00 1E 00 1F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 18 00 19 00 1A 00 1B 00 00 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 00 00 00 00 00 00 00 00 20 00 21 00 22 00 23 00 24 00 25 00 26 00 27 00 00 00 00 00 00 00 00 00 00 00 01 00 02 00 03 00 04 00 05 00 06 00 07 00 00 00 00 00 00 00 00 00 20 00 21 00 22 00 23 00 08 00 09 00 0A 00 0B 00 0C 00 0D 00 0E 00 0F 00 00 00 00 00 00 00 00 00 28 00 29 00 2A 00 2B 00 2C 00 2D 00 2E 00 2F 00 00 00 00 00 00 00 00 00 08 00 09 00 0A 00 0B 00 0C 00 0D 00 0E 00 0F 00 00 00 00 00 00 00 00 00 28 00 29 00 2A 00 2B 00 10 00 11 00 12 00 13 00 14 00 15 00 16 00 17 00 00 00 00 00 00 00 00 00 30 00 31 00 32 00 33 00 34 00 35 00 36 00 37 00 00 00 00 00 00 00 00 00 10 00 11 00 12 00 13 00 14 00 15 00 16 00 17 00 00 00 00 00 00 00 00 00 30 00 31 00 32 00 33 00 18 00 19 00 1A 00 1B 00 1C 00 1D 00 1E 00 1F 00 00 00 00 00 00 00 00 00 38 00 39 00 3A 00 3B 00 3C 00 3D 00 3E 00 3F 00 00 00 00 00 00 00 00 00 18 00 19 00 1A 00 1B 00 1C 00 1D 00 1E 00 1F 00 00 00 00 00 00 00 00 00 38 00 39 00 3A 00 3B

• Open a hex editor, paste the code at the end of the game data in your ROM file. Where the FF's start in the free space. Remember the starting offset you pasted it at - this is your new address.

• Change the pointer at this offset value (0FCD4C) to your new starting offset value (The old value is 54E24 - overwrite it with yours)

• Save the ROM and close it.

• Open the ROM and edit your graphic in Tile Molester, found at the new address you pasted it at. Move forward 10 bytes to line the graphic up, and then paste in your own 64x64 pixel image.

• Change palette colour info, clean up your graphic.

• Serve hot.

 

LONG WAY with explanations - **REMEMBER - create a backup copy before making edits.**

1) In a Hex Editor, navigate to the end of the last set of data in your ROM to an offset of your choosing where the free space FF's appear. Remember the offset value (in this example, I’m using 1EC070)

2) Insert this header information: 00 00 08 0A 00 00 08 8A 00 40
     080A = 2058 bytes (Header + Tile Pixel Data)
    088A = 2186 bytes (Header + Tile Pixel Data + Palette)
    0040 = 64 tiles

3) Prepare an 8-bit 64 x 64 pixel PNG graphic. Make sure it is no more than 10 colours, no transparency. Make a note of the colour values you used in your graphic (RGB) for each colour. Make sure the values are multiples of 32 because they are SEGA friendly (0 32 64 96 128 etc)

4) Open Tile Molester, and bring up your ROM.
Palette > Format > 9bpp (Genesis)
Palette > Byte Order > Motorola
View > Codec > 4bpp Linear

Navigate to the offset you chose - Navigate > Go To > [your offset] and move forward 10 bytes using the byte forward button image.png, so you don’t overwrite the header information.

5) Make your working area 8 x 8 tiles by decreasing the width and height with the appropriate buttons. image.png image.png

6) Go to Edit > Paste From > (navigate to your background tile) to insert the graphic.

7) Save and close your file. Open a Hex Editor and reopen your ROM. Navigate to the starting offset for your graphic. After the header you inserted, there should be a bunch of new data. Scroll to the end of that data (until you reach a bunch of FFFFs). That is the end of the pixel data. Now you are going to insert a palette.

8) Copy/Paste this data right after your pixel data (no spaces)
0EEA 0CCC 0888 0444 0222 008C 006A 0000 0822 0600 0042 0020 004A 0006 066A 0246
0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8
0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8
0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8 0EE8
This is the palette data and will allow you to set custom colours for your background. There are 128 bytes that correspond to the 64 colours available for the screen. Typically, you only want to use no more than 10-12 since there are sprites that often share the same palettes. The colour codes listed above are the generic ones chosen by wboy - we are going to edit these to accommodate your new background.

9) Directly after the palette data, insert the following code (no spaces) 0028 001C -
image.png

this is to specify that we are using the graphic in a 40 tile x 28 tile space, or 320 pixel x 224 pixel screen (Remember 1 tile = 8x8 pixels, 40x8=320 / 28x8=224, 320x224 = full screen on SEGA)

10) Save your file, close it and reopen it in Tile Molester (I know, I know, a lot of back and forth - but there's a reason for it. Each part has to go in stages to build the graphic and set up the corresponding data so you don't miss anything)

11) Navigate to your chosen offset, move forward 10 bytes to get the image to appear in the viewer. Make sure your workspace is 8x8 tiles to line it all up. Your palette information should be at the end of the new graphic file you inserted. To see it in Tile Molester, advance ahead 1 page with the page forward button. At the bottom of your workspace, you should see the offset it is located at. (In my example, it is located at 1EC87A)

12) Convert your offset value to decimal (in my example 1EC87A = 2017402). Then go to Palette > Import from > This File
Offset: [your value in decimal]
Size: 64
Format: 9bpp Genesis

Your palette is now loaded, and now we can edit it to fix your colours.

9) Go back 1 page to return to your assembled graphic. Input the values of the colours you want to use according to the order listed in the table. The colours should be wildly off, so it will give you an easy idea which colour goes where. Double click each colour, and edit the values to correspond to the ones you made a note of in the first step image.
 
10) Once your colours have been inserted into the palette, reimport your image again - this way Tile Molester can try to approximate the closest colours to the ones in your file. You may have to alter some of the pixels in your image so it displays the way you want it, but it will be fairly close. After tweaking and editing your colours, save the file and close it.

image.png

11) NOW comes the tricky part. Since this is a repeating tile, you have to create a tile layout. EA Sports did a staggered repeating logo pattern, and that is what we'll do here. I suggest you have a plan for how you want your graphic to look, because it is difficult to figure out misaligned pixels at a glance.

This is the tile layout map I used. You can see that there is a repeating blank pixel I used frequently (2000). Since the tile is only 8 tiles wide, you have to get creative. 

background-grid.png

I suggest you make a 40 x 28 grid, and experiment with how you want the tile to appear, along with spacers. From there, make a note of the tile label (2000, 2001 etc) on top of each tile in the grid in your diagram. Since the tile layout is a continuous string of numbers, it is easy to lose your place.

12) Once your map has been created, open your ROM in your hex editor and navigate to the end of your pixel data. It should be found close to: your offset value + 088A (which is the tile bytes + palette bytes + header bytes)

Skip over the next 8 bytes that contain your width and height values (0000 0028 0000 001C) and start inputting your tile layout numbers after 001C.

There's 1,120 of them, so it's gonna take a while if you do them manually if you want a special layout. Otherwise you can just copy the ones from the EASY WAY above.

13) Once you've slogged through all of the layout numbers, it's time to change the pointer so it reads your new graphic instead of the old one. The EA Sports tiles graphic pointer is found at 0FCD4C. The value listed there is 054E24. If you go to that offset in Tile Molester, you'll see a lot of garbled pixels and nothing that looks remotely like the tile. It is heavily compressed, and I have yet to figure out what the compression code is (and I'm not too eager to start).

So - at offset 0FCD4C, change the existing value (054E24) to your new value (in my case it is 1EC070)

14) Save your ROM and have a look at it in your emulator.

Fingers crossed you didn't miss a number in the layout. If all goes well, you will have changed the elusive background tile.

Matchup-Background.jpg

**Note: The palette is shared by the text/font information, so be conscious of that when you're adding colours. To be safe, I reduced my palette to 10 colours, included black/white and grey, and left the remaining colours the same. But you can alter the text colours for something a little more "funky."

image.png

Okay - I'm out. Go break your ROMs. Have fun doing it.

image.png

Edited by Drezz
  • Love 3
  • Thanks 2
Posted

Are you sure you can just post it at the end of the ROM file instead of finding open space? It might work in an emulator, but if someone tries it on real hardware it might crash because of the abnormal ROM size. In the decompressed ROM there should be plenty of empty space near the end of the ROM to use.

Posted
7 hours ago, chaos said:

Are you sure you can just post it at the end of the ROM file instead of finding open space? It might work in an emulator, but if someone tries it on real hardware it might crash because of the abnormal ROM size. In the decompressed ROM there should be plenty of empty space near the end of the ROM to use.

By the end of the ROM file, I mean in the free space after the current data (which happens to be the rosters.) Perhaps I should go back and make that clearer. I used wboy's expanded 30-team ROM that is 2MB. The data was placed in the "free space" right after the rosters and the new end of file 60fe would be at 01ED1BE, well before the 2MB limit. I didn't give a specific address to place the decompressed graphics, as the 32-team rom is a bit larger. I could see THAT not working on regular hardware as it potentially could go over the 2MB size.

I haven't tried it finding a home for it on the 1MB version.

6 hours ago, smozoma said:

I wonder if we should standardize the location of these graphics?

It would be a good idea, but I don't know if any modders outside of wboy who made a list with standardized placements and locations of decompressed graphics. Plus, with the 32 team ROMS out there, I haven't had a chance to look into those.

  • Like 1
Posted

Awesome stuff @Drezz  I shared your success on social media. 

  • Love 1
Posted
On 12/20/2022 at 6:47 AM, Drezz said:

By the end of the ROM file, I mean in the free space after the current data (which happens to be the rosters.) Perhaps I should go back and make that clearer. I used wboy's expanded 30-team ROM that is 2MB. The data was placed in the "free space" right after the rosters and the new end of file 60fe would be at 01ED1BE, well before the 2MB limit. I didn't give a specific address to place the decompressed graphics, as the 32-team rom is a bit larger. I could see THAT not working on regular hardware as it potentially could go over the 2MB size.

I haven't tried it finding a home for it on the 1MB version.

It would be a good idea, but I don't know if any modders outside of wboy who made a list with standardized placements and locations of decompressed graphics. Plus, with the 32 team ROMS out there, I haven't had a chance to look into those.

This is clearer. You made it sound like go to end of the whole ROM and add it in. Makes more sense now, thanks.

  • Thanks 1
Posted

I've updated the tutorials to reflect that now. Sorry for the confusion!

  • Love 1
  • 2 months later...
Posted

An update..

image.png

image.png

I figured out how to get it to work for the other screens as well. Once you do the leg work for the matchups screen above, the rest of the screens are a cinch. Details to follow.

  • 2 years later...
Posted (edited)

I gave a crack at figuring out the Ron Barr image compression scheme.

I pulled the tiles from vram:

image.png

image.png

(Edit I realize this image is missing one column of repeating characters at the end— doh!)
this is the first tile in the ron barr image, each number is the color index of the color in the palette it uses.

00 00 04 C4 00 00 05 44 80 3D 31 66 00 65 30 55 
00 65 30 44 03 65 47 77 77 8D 04 31 66 31 55 31 
44 3F 77 9B 1F 00 18 51 00 88 51 00 92 8A 20 31 
11 0E 22 28 82 22 33 32 22 34 44 32 98 22 99 98

this is the start of the ron barr image in the file, we can discard the first 10 bytes, thats header data

then we have `31 66` -- i think this means repeat 66, 4 times

`00 65` -- repeat 65 once
`30 55` -- repeat 55, 3 times
`00 65` -- repeat 65 once
`30 44` -- repeat 44, 3 times
`03 65 47 77 77` -- repeat the next sequence 5 times, terminate on `8D 04` (actually I’m thinking this is 03 = repeat 4 times, then maybe the 8D 04 is a reference to repeat the previous line again)

next tile
`31 66` -- repeat 66, 4 times
`31 55` -- repeat 55, 4 times
`31 44` -- repeat 44, 4 times
`3F 77` -- repeat 77, 20 times

it gets screwy after that, i don't fully understand whats going on, maybe some sort of call back to previous runs of data?

 

I think I need to reproduce the uncompressed .map.jim file for this based on the tiles in vram, and then I might be able to reverse engineer the compression scheme.

Edited by bcrt2000
Posted

That's what we were trying to figure out - how many times a specific colour is repeated to make up the data for the tile. Now that you've laid it out like that, Is that 803D in the header the command instead of the info for where number of tiles in the graphic is usually found in the header?

This is super helpful...

Posted
2 minutes ago, Drezz said:

That's what we were trying to figure out - how many times a specific colour is repeated to make up the data for the tile. Now that you've laid it out like that, Is that 803D in the header the command instead of the info for where number of tiles in the graphic is usually found in the header?

This is super helpful...

So I understand it more now. I think I can fully implement the decompression scheme within a day or two. The upper nibble = command. Lower nibble is either length or offset that is paired with that command.

there are 9 unique commands (some repeats for some reason) which tell it how to write the next set of bytes. I have implemented some of them, need to implement the rest.

Posted

From our conversation on Discord, we determined that the two graphics that have been compressed are repeats from NHLPA93 which was highly compressed to keep it under 512kb.

The background tile & Ron Barr.

Everything else in 94 doesn't have the same type of compression, as space on the cart was saved by reusing tiles and designating it to the map (which were further 'decompressed' by @wboy and @kingraph and many others)

This compression scheme could save us a lot of space in the future and allow roms to have more room for things... and still stay within the 2MB threshold.

 

  • Like 2
Posted
On 6/5/2025 at 9:39 AM, Drezz said:

From our conversation on Discord, we determined that the two graphics that have been compressed are repeats from NHLPA93 which was highly compressed to keep it under 512kb.

The background tile & Ron Barr.

Everything else in 94 doesn't have the same type of compression, as space on the cart was saved by reusing tiles and designating it to the map (which were further 'decompressed' by @wboy and @kingraph and many others)

This compression scheme could save us a lot of space in the future and allow roms to have more room for things... and still stay within the 2MB threshold.

 

If enough compression can be done, it could come in handy if the league expands to 34 teams.  The 32 team roms are already very limited for space.

Posted

@Sauce I just tested expanding a 32 team rom to 4MB BTW-- seemed to work fine.

 

Developing the decompression script has been taking a while. Had an extremely busy weekend/week. And I ended up getting stuck on figuring out how to implement one of the decompression commands. I started re-implementing from scratch and discovered that I had implemented one of the commands with an incorrect offset, and that kind of threw off the rest of the ones I implemented to the point where I couldn't make the math work.

Now I've set up a prompting framework to let Claude implement the commands for me, as it gets confusing as a human to read very similar repeating patterns. The trick is I was able to generate the uncompressed version of the Ron Barr image, so its a sort of Rosetta stone. I have a little bit of manual work to do, setting up the prompt for each unimplemented command, but its been more successful than me trying to manually implement these so far. I have the first 0x06C of 0x4BA (compressed) / 0x11A of 0x7A0 (uncompressed) bytes decompressing so far. I think its just a matter of a handful of more commands and hopefully that gets the whole file decompressing.

  • Love 1
Posted (edited)

I’ve had no problems increasing the ROM size to 4 megs. It’s trivially easy to add the bytes and adjust the header. I didn’t see any errors  

I am so curious to see what your decompression cooks up!

are you able to share how you are using Claude to do this?

Edited by AdamCatalyst
Posted

The Save RAM uses addresses in the $200000 range. Did you relocate it, or change the save ram bit at runtime?

Maybe it doesnt really matter, since the "Leave Off!" is left off (User Records)

Posted
23 minutes ago, chaos said:

The Save RAM uses addresses in the $200000 range. Did you relocate it, or change the save ram bit at runtime?

Maybe it doesnt really matter, since the "Leave Off!" is left off (User Records)

Did not test that, just made sure the game ran. I’m assuming you could just skip $200000-$201FFF and then put additional data after that. I guess it’s worth testing at some point.

Posted
12 hours ago, AdamCatalyst said:

I’ve had no problems increasing the ROM size to 4 megs. It’s trivially easy to add the bytes and adjust the header. I didn’t see any errors  

I am so curious to see what your decompression cooks up!

are you able to share how you are using Claude to do this?

I give it a prompt like this. Essentially I'm giving it all of the known information I have:

  • the uncompressed image format
  • the hex code for decompressing the compressed image
  • a sample of the same image compressed and uncompressed
  • the first X bytes that the decompressor script is able to decompress correctly and the correct output of that
  • the first X bytes that the decompressor script is able to decompress + the next command that its unable to decompress correctly, and what the actual and expected responses are

Generally I have had good luck with it correcting it's own mistakes using this. (using Claude in VSCode Github Copilot Extension w/Claude 4).

I'm going to give you the following:
1. The file format for .map.jim files which are image files in the NHL Hockey for Sega Genesis source code. 
2. Then I'm going to give you an uncompressed example which matches that. 
3. Then I'm going to give you the same image, but compressed-- from NHL 94 for Sega Genesis. 
4. Then I'm going to give you an explanation of how some of the compression works based on what I've observed (I might not be fully right! its a guess!)
5. And then I'm going to give you some 68k hex code from NHL94 for sega genesis which is related to decompressing this image. The compressed version of this image lives at $B389C in the NHL94 rom, and the hex code references that.

1. File format for uncompressed .map.jim files:
## NHL92 .map.jim file details (Big Endian)
| Byte (All values in hexadecimal)              | Value         | Description |
| --------                                      | -------       | -------     |
| `0x00..0x03`                                  | `<uint32>`    | Palette Section Offset |
| `0x04..0x07`                                  | `<uint32>`    | Map Section Offset |
| `0x08..0x09`                                  | `<uint16>`    | Number of Tiles/Stamps |
| `0x0A..0x0A+numTiles*32`                      | `Tile Data`   | Raw 8x8 tile data, 4 bits per pixel, 32 bytes per tile. |
| `0xPaletteSectionOffset..0xPaletteSectionOffset+80`| `Palette Data`| 128 bytes of Palette Data. 4 palettes of 16 colors. Each color is 2 bytes in Genesis format (0000BBB0GGG0RRR0, where BBB=Blue bits, GGG=Green bits, RRR=Red bits). |
| `0xMapSectionOffset..0xMapSectionOffset+1`  | `<uint16>`    | Map Width |
| `0xMapSectionOffset+2..0xMapSectionOffset+3`| `<uint16>`    | Map Height |
| `0xMapSectionOffset+4..0x(MapSectionOffset+4)+(mapWidth*mapHeight*2)`| `Map Data Section`    | Map Data |

## Map Data Section
| Byte (All values in hexadecimal)              | Value         | Description |
| --------                                      | -------       | -------     |
| `0x00..0x01`  | `<uint16>:Bits 0-10` | Tile Index |
| `0x00..0x01`  | `<uint16>:Bit 11`    | Horizontal flip |
| `0x00..0x01`  | `<uint16>:Bit 12`    | Vertical flip |
| `0x00..0x01`  | `<uint16>:Bit 13-14` | Palette Index (0–3, selects one of 4 CRAM palettes). |
| `0x00..0x01`  | `<uint16>:Bit 15` | Priority (0=low, 1=high) |

2. Uncompressed Ron Barr .map.jim image in hex:
00 00 07 AA 00 00 08 2A 00 3D 66 66 66 66 65 55 55 55 65 44 44 44 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 66 66 66 66 55 55 55 55 44 44 44 44 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 66 66 66 66 55 55 55 55 44 44 44 44 77 77 77 77 77 77 77 77 77 77 77 18 77 77 18 88 77 18 88 92 66 66 66 66 55 55 55 55 44 44 44 44 77 11 11 11 11 22 28 82 22 33 32 22 34 44 32 98 22 99 98 88 66 66 66 66 55 55 55 55 44 44 44 44 11 77 77 77 99 88 11 77 98 11 18 77 81 11 11 11 11 11 11 11 66 66 66 66 55 55 55 55 44 44 44 44 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 82 87 77 77 66 66 66 61 55 55 55 21 44 44 43 21 77 77 73 21 77 77 73 21 77 77 73 21 77 77 73 21 77 77 73 21 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 77 77 77 77 77 77 77 77 77 77 77 71 77 77 77 18 77 77 77 18 77 77 77 18 77 77 71 11 77 77 11 11 71 88 89 22 18 88 89 99 88 88 81 11 88 11 11 18 11 18 89 AB 11 AC CD DC 18 BD DD DD 8A DD EE EE 99 98 11 88 81 81 11 11 18 88 88 9A 9A AB BC CC CC CC CD DD DD DD DD DD DD FF 66 FE EF F6 66 FF 88 88 99 98 88 89 AC CA CC CC CC CB DD DD CD CC DD DD DE DC DE EE ED ED EE EE ED ED FF FF FE DD 18 81 17 77 81 81 11 77 A8 82 21 77 B8 11 21 17 CA 81 12 17 CB A1 12 11 DC A1 11 11 DC B8 11 21 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 17 77 77 77 77 77 73 21 77 77 73 21 77 77 73 21 77 77 73 21 77 77 73 21 77 77 73 21 77 77 73 21 77 77 73 21 77 77 11 11 77 77 11 11 77 77 11 11 77 77 11 11 77 77 11 11 77 77 11 11 77 77 11 11 77 77 11 11 8C DD DD DD 9A CD DD DD 89 CD DD DD 89 CD DD DD 89 CD DD DE 8A CD DD DD 8B CD DE ED 8B DD DF 66 FF 66 66 66 DE EE EE EE DD DD DD DD DD DD DD EE EE DD EE EF DE EE FF FF DE EE EE EE FD DD DD DD FF FF EE DD DE EE DD DD DD DD DE EE EE EE EE FE FF F6 6F FE 66 66 FF EE FF FF FF FD DD CC CC CC DD C9 11 11 DD C9 81 11 DD C9 81 11 ED C9 81 11 DC C9 81 11 DC CA 81 11 DD CC 91 11 DC CD A1 11 17 77 77 77 17 77 77 77 11 77 77 77 11 77 77 77 11 77 77 77 11 77 77 77 11 77 77 77 11 77 77 77 77 77 11 11 77 77 11 11 77 77 11 11 77 77 19 91 77 77 7A C1 77 77 7A CA 77 77 79 CA 77 77 78 CB 9C DD CC CC 9C DC A9 88 9C DB AD DC BD DC DB A1 CD DD CA 48 BC DD CC CC AB DD DD DD BA DD FF FF CF FD DD DC 81 8C CD DC CA 18 CD ED 11 19 CD ED 18 49 CD 6D DD CA CD 6D DC CB CD 6D DD DB CD 6D CC BA 99 99 BB 98 18 88 C9 81 8B ED C9 A1 11 1A C9 A6 81 96 CD 9C CD DC CC DD CC BC DC EE DD DD CC CD B1 11 9C CD C8 11 C9 DC C8 11 BD DC C8 8C AC DC C8 9C CD DC CA AC DE DC CA BC EF EC BA BC 11 77 77 77 11 77 77 77 11 77 77 77 97 77 77 77 A7 77 77 77 B7 77 77 77 B8 77 77 77 A7 77 77 77 77 77 77 DC 77 77 77 DC 77 77 77 DF 77 77 77 CE 77 77 77 7D 77 77 77 78 77 77 77 77 77 77 77 77 CA DD F6 66 DA CD E6 66 EA CD DF 66 EA CC DE ED CA BC DD EC CA BC CD CB BA BB CC BA 78 9B BC BB 6F DC CD 66 6F DC DE E6 FC DD EF ED B9 CA BC CC 9C CC A8 11 BC DD CB A9 BC DE ED CA C9 CD DD DD DC CE EF F6 DD CC DF 66 DD DC CE FF BA CA BC EF AB CD DA CD AC DD DD CC BC DE DC CC DD DD DC 9C FF DC BA CD FE DC BA DD FE DC BA DD ED DC BA DC ED CC BA C9 DD CC BA 77 DD CC BA 77 DC CC B9 77 97 77 77 77 87 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 72 77 77 77 21 78 9B BC BB 77 98 BB CB 77 88 BA BC 77 88 8A AC 77 38 8A 9B 72 31 88 A9 21 48 88 AA 11 43 88 8A BB 19 99 99 BC 92 45 55 BC AC AA AA CC CA DD FE CC CC AA AA DD CC BB BB 9D DC CC BB 9A CD DC CC 99 BB 91 CC 55 32 19 CC AC DD BD DC ED CA DD DC AA AD DD CC BC CC CC CA CC CC CD CB CD ED ED CA CC CB A9 77 CC CB A8 77 CB BA 98 77 BB B9 88 77 AA A8 88 77 AA 98 91 27 AA 89 81 12 A8 9A C2 11 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 11 27 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 72 65 47 72 21 65 42 21 11 65 41 11 11 65 41 11 11 77 77 21 11 77 21 11 11 72 11 11 11 21 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 44 A8 88 11 36 28 A8 11 36 2A 8A 11 26 42 9A 11 14 64 98 11 13 66 29 11 11 46 42 11 11 36 64 9A CD EE EE 89 BC DD EE 98 AB CC CA A8 99 AB AB 8A 88 88 89 89 89 81 11 98 88 99 99 29 88 88 88 FF FF CC CA FF ED CC 99 AA CC C9 89 BA AB 98 9A 88 88 88 88 18 88 98 89 99 98 88 99 88 88 88 92 89 AB 22 11 9A AB 43 11 AA A2 63 11 A9 C4 62 11 9A 26 51 11 A2 46 31 11 24 64 11 11 46 63 11 11 11 11 27 77 11 11 11 27 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 77 77 73 21 77 77 73 21 27 77 73 21 12 27 73 21 11 11 23 21 11 11 13 21 11 11 13 21 11 11 13 21 65 41 11 11 65 41 11 11 65 41 11 11 65 41 11 11 65 41 11 11 65 41 11 11 65 41 11 11 65 41 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 26 66 11 11 16 66 11 11 16 66 11 11 14 66 11 11 13 66 11 11 11 46 11 11 11 36 11 11 11 26 42 99 98 88 64 29 98 88 66 64 29 98 66 66 53 98 66 65 31 11 66 53 11 8C 65 31 18 BB 53 11 99 BC 88 98 99 24 88 88 24 56 89 92 46 66 82 46 66 66 13 46 66 66 B1 14 66 66 BB 81 46 66 CB A9 14 66 66 62 11 11 66 61 11 11 66 41 11 11 66 31 11 11 64 21 11 11 63 11 11 11 62 11 11 11 61 11 11 11 11 11 13 21 11 11 13 21 11 11 13 21 11 11 13 21 11 11 13 21 11 11 13 21 11 11 13 21 11 11 13 21 65 41 11 11 65 41 11 11 65 41 11 11 65 41 11 11 65 41 11 11 65 41 11 11 65 22 22 22 61 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 22 22 22 22 11 11 11 11 11 11 11 15 11 11 11 14 11 11 11 13 11 11 11 11 11 11 11 11 11 11 11 11 22 22 22 22 11 11 11 11 31 18 99 BC 11 18 9A BC 11 88 9A BC 18 28 8A BC 26 62 89 CB 26 41 88 AA 22 22 22 22 11 11 11 11 CA 98 81 56 CA A8 81 24 AB 88 12 12 AB 81 33 21 AA 12 44 42 A1 14 66 43 22 22 22 22 11 11 11 11 51 11 11 11 41 11 11 11 31 11 11 11 21 11 11 11 11 11 11 11 21 11 11 11 22 22 22 22 11 11 11 11 11 11 13 21 11 11 13 21 11 11 13 21 11 11 13 21 11 11 13 21 11 11 13 21 22 22 22 21 11 11 11 11 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 00 00 04 44 06 66 0A AA 0C CC 0E EE 08 40 00 04 00 06 00 08 00 2A 02 4C 06 8C 08 AE 0A CE 00 08 00 09 60 00 60 01 60 02 60 03 60 04 60 05 60 01 60 06 60 07 60 08 60 09 60 0A 60 0B 60 0C 60 0D 60 0E 60 07 60 0F 60 10 60 11 60 12 60 13 60 14 60 0E 60 07 60 15 60 16 60 17 60 18 60 19 60 1A 60 0E 60 07 60 1B 60 1C 60 1D 60 1E 60 1F 60 20 60 0E 60 07 60 21 60 22 60 23 60 24 60 25 60 26 60 0E 60 27 60 28 60 29 60 2A 60 2B 60 2C 60 2D 60 2E 60 2F 60 30 60 31 60 32 60 33 60 34 60 30 60 35 60 36 60 37 60 38 60 39 60 3A 60 3B 60 37 60 3C

3. Compressed Ron Barr .map.jim image in hex:
00 00 04 C4 00 00 05 44 80 3D 31 66 00 65 30 55 00 65 30 44 03 65 47 77 77 8D 04 31 66 31 55 31 44 3F 77 9B 1F 00 18 51 00 88 51 00 92 8A 20 31 11 0E 22 28 82 22 33 32 22 34 44 32 98 22 99 98 88 89 20 00 11 30 77 01 99 88 68 04 98 11 18 77 81 34 11 9C FF 01 82 87 82 80 00 61 30 55 07 21 44 44 43 21 77 77 73 8E 04 8F D4 8B 04 38 77 00 71 83 B8 5E 00 71 80 8F 00 11 CC 03 88 89 22 18 58 08 99 88 88 81 11 88 11 11 18 48 12 89 AB 11 AC CD DC 18 BD DD DD 8A DD EE EE 99 98 11 88 81 80 AD 06 18 88 88 9A 9A AB BC 30 CC 00 CD 33 DD 04 FF 66 FE EF F6 CC E0 37 04 98 88 89 AC CA 30 CC 00 CB E1 18 58 04 DE DC DE EE ED C0 59 07 FF FF FE DD 18 81 17 77 80 40 13 77 A8 82 21 77 B8 11 21 17 CA 81 12 17 CB A1 12 11 DC A1 11 58 80 11 3F 77 37 77 00 17 6B 8F F4 8B 04 E2 C3 9B 03 00 8C 30 DD 00 9A 80 B3 00 89 5F 02 DD DE 8A 79 03 8B CD DE ED CC 02 DF 66 FF 30 66 00 DE 30 EE 34 DD 80 09 05 EE EF DE EE FF FF 81 14 00 FD 81 E7 03 FF EE DD DE 82 1E 81 12 05 EE FE FF F6 6F FE E0 32 80 22 02 FF FD DD 30 CC 03 DD C9 11 11 58 00 81 5B 00 ED 59 00 DC 5A 00 CA 80 10 01 CC 91 78 02 CD A1 11 81 C4 5A 80 8D 99 03 8B B0 01 19 91 58 01 7A C1 59 00 CA 58 00 79 59 02 78 CB 9C 80 65 10 9C DC A9 88 9C DB AD DC BD DC DB A1 CD DD CA 48 BC 80 14 00 AB 30 DD 00 BA 80 9E 0D CF FD DD DC 81 8C CD DC CA 18 CD ED 11 19 58 05 18 49 CD 6D DD CA 58 01 DC CB 79 00 DB 58 1C CC BA 99 99 BB 98 18 88 C9 81 8B ED C9 A1 11 1A C9 A6 81 96 CD 9C CD DC CC DD CC BC DC 80 D8 09 CC CD B1 11 9C CD C8 11 C9 DC 58 00 BD 58 01 8C AC 58 80 1E 02 CA AC DE 58 04 BC EF EC BA BC 89 AC 00 97 59 00 A7 59 00 B7 59 00 B8 84 0C 41 00 DC 5D 00 DF 59 00 CE 59 00 7D 59 E0 B9 44 0A CA DD F6 66 DA CD E6 66 EA CD DF 58 06 CC DE ED CA BC DD EC 58 0D CD CB BA BB CC BA 78 9B BC BB 6F DC CD 66 58 12 DE E6 FC DD EF ED B9 CA BC CC 9C CC A8 11 BC DD CB A9 BC 80 2B 0B C9 CD DD DD DC CE EF F6 DD CC DF 66 80 09 01 FF BA 80 93 04 AB CD DA CD AC 80 B7 01 BC DE 80 C3 07 DD DC 9C FF DC BA CD FE 58 00 DD 5A 00 ED 58 C4 03 CC BA C9 DD 58 00 77 5A 02 DC CC B9 82 B4 00 87 3F 77 A8 40 00 72 59 00 21 81 A4 07 77 98 BB CB 77 88 BA BC 58 1F 8A AC 77 38 8A 9B 72 31 88 A9 21 48 88 AA 11 43 88 8A BB 19 99 99 BC 92 45 55 BC AC AA AA CC CA 02 DD FE CC D1 05 DD CC BB BB 9D DC 60 01 9A CD 60 11 99 BB 91 CC 55 32 19 CC AC DD BD DC ED CA DD DC AA AD 80 BC 02 CC CC CA 50 04 CD CB CD ED ED 78 02 CB A9 77 58 03 A8 77 CB BA E0 65 04 B9 88 77 AA A8 59 0A 98 91 27 AA 89 81 12 A8 9A C2 11 3F 77 E8 09 00 27 58 01 65 47 8A 04 00 72 58 08 72 21 65 42 21 11 65 41 11 5B 80 C3 58 50 01 11 72 30 11 71 3F 11 06 44 A8 88 11 36 28 A8 58 11 2A 8A 11 26 42 9A 11 14 64 98 11 13 66 29 11 11 46 42 58 14 36 64 9A CD EE EE 89 BC DD EE 98 AB CC CA A8 99 AB AB 8A 88 88 30 89 06 81 11 98 88 99 99 29 30 88 0F FF FF CC CA FF ED CC 99 AA CC C9 89 BA AB 98 9A 31 88 04 18 88 98 89 99 80 21 30 88 1A 92 89 AB 22 11 9A AB 43 11 AA A2 63 11 A9 C4 62 11 9A 26 51 11 A2 46 31 11 24 64 80 62 00 63 31 11 00 27 E0 A3 60 3F 11 44 02 77 77 73 E0 C1 58 00 27 59 01 12 27 58 02 11 11 23 59 00 13 5F 85 E8 9A 83 9F 80 01 26 66 58 00 16 5D 00 14 59 00 13 59 00 11 E0 9B 01 11 36 81 1D 00 42 80 C9 01 64 29 58 00 66 61 02 66 66 53 58 02 65 31 11 70 01 11 8C 70 01 18 BB 70 01 99 BC E0 1D 01 24 88 C0 05 56 89 92 46 66 82 50 01 66 13 59 01 B1 14 58 05 BB 81 46 66 CB A9 80 09 00 62 E0 4D 00 61 59 80 8C 01 66 31 58 00 64 80 B6 81 F7 80 17 00 11 80 17 41 87 CC 98 83 8F DC 5D 30 22 83 40 99 80 31 22 34 11 00 15 59 E0 D9 00 11 E3 69 8C 20 06 31 18 99 BC 11 18 9A 58 00 88 58 0B 18 28 8A BC 26 62 89 CB 26 41 88 AA 85 20 17 CA 98 81 56 CA A8 81 24 AB 88 12 12 AB 81 33 21 AA 12 44 42 A1 14 66 43 85 20 00 51 59 80 8F 00 11 E1 48 80 B1 43 7A 87 80 8F D8 5A 30 22 82 2F E0 00 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 08 0E 00 00 04 44 06 66 0A AA 0C CC 0E EE 08 40 00 04 00 06 00 08 00 2A 02 4C 06 8C 08 AE 0A CE 00 08 00 09 60 00 60 01 60 02 60 03 60 04 60 05 60 01 60 06 60 07 60 08 60 09 60 0A 60 0B 60 0C 60 0D 60 0E 60 07 60 0F 60 10 60 11 60 12 60 13 60 14 60 0E 60 07 60 15 60 16 60 17 60 18 60 19 60 1A 60 0E 60 07 60 1B 60 1C 60 1D 60 1E 60 1F 60 20 60 0E 60 07 60 21 60 22 60 23 60 24 60 25 60 26 60 0E 60 27 60 28 60 29 60 2A 60 2B 60 2C 60 2D 60 2E 60 2F 60 30 60 31 60 32 60 33 60 34 60 30 60 35 60 36 60 37 60 38 60 39 60 3A 60 3B 60 37 60 3C FF FF FF FF

4. Explanation of compressed file:
You should be able to understand the uncompressed file format from the file format description. You should understand the compressed file format from the assembly.

5. Here is the code from the NHL 94 ROM for sega genesis related to decompression:

$11086-$110BD: 48 E7 E0 00 30 38 D0 68 32 00 34 38 D0 66 C0 FC E6 2D C2 FC BB 40 C4 FC E6 2D D2 42 48 40 D0 41 48 40 52 80 21 C0 D0 66 E0 80 C0 EF 00 02 48 40 58 4F 4C DF 00 06 4E 75

$1169A-$1197D: 3F 38 B0 2A 3F 38 BF 78 08 F8 00 02 BF 78 48 E7 F6 F0 3C 01 36 7C BD 28 60 00 00 18 17 B0 00 00 00 00 51 C8 FF F8 D1 FC 00 00 00 20 D7 FC 00 00 00 20 70 1F E2 4D 65 E4 66 EC 3A 38 B0 2C 02 45 F8 00 34 2F 00 0E 53 42 61 00 02 6E 30 06 C0 D1 D0 6F 00 02 E3 40 32 2F 00 0A 53 41 36 31 00 04 D6 44 BB 43 30 83 54 40 51 C9 FF F2 52 78 B0 2A 52 46 51 CA FF D4 08 38 00 00 C2 F8 66 00 00 06 61 00 00 1C 4C DF 0F 6F 31 DF BF 78 31 DF B0 2A 4E 75 21 D7 CF 32 61 00 00 0A 50 97 4E 75 42 B8 CF 32 48 E7 C0 FE 20 4A 32 04 EB 41 30 18 67 00 00 2A 6B 00 00 1C D8 40 E9 40 48 79 00 01 17 74 4A B8 CF 32 67 00 FC 70 22 78 CF 32 60 00 F7 78 02 40 7F FF D8 40 61 00 00 08 4C DF 7F 03 4E 75 32 7C CF 36 36 7C CF 36 38 7C CF 32 2A 7C 00 01 0E E0 2C 7C 00 01 13 D0 48 E7 F0 E0 36 01 42 41 42 42 10 18 02 40 00 F0 E6 48 45 FA 00 0C 30 32 00 00 4E B2 00 00 60 EA 00 20 00 20 00 3C 00 58 00 78 00 78 00 78 00 78 00 AA 00 B8 00 D2 00 EC 01 06 01 06 01 38 01 58 10 28 FF FF 02 40 00 1F 13 98 10 00 52 01 66 00 00 06 61 00 01 3E 51 C8 FF F0 4E 75 10 28 FF FF 02 40 00 0F 42 31 10 00 52 01 66 00 00 06 61 00 01 22 51 C8 FF F0 4E 75 10 28 FF FF 02 40 00 0F 54 40 14 18 13 82 10 00 52 01 66 00 00 06 61 00 01 02 51 C8 FF F0 4E 75 10 28 FF FF 02 40 00 07 52 40 14 28 FF FF E6 4A 02 42 00 07 52 42 44 02 D4 01 13 B1 20 00 10 00 52 02 52 01 66 00 00 06 61 00 00 D0 51 C8 FF EC 4E 75 10 28 FF FF 02 40 00 0F 54 40 14 18 60 D6 10 10 E3 00 10 28 FF FF E3 10 02 40 00 1F 54 40 14 18 02 42 00 7F 52 42 60 BC 10 28 FF FF E1 40 10 10 EC 48 02 40 00 3F 54 40 14 18 02 42 00 3F 52 42 60 A2 10 28 FF FF E1 40 10 10 EA 48 02 40 00 7F 54 40 14 18 02 42 00 1F 52 42 60 88 10 28 FF FF 02 40 00 03 52 40 14 28 FF FF E4 4A 02 42 00 07 52 42 44 02 D4 01 13 B1 20 00 10 00 53 02 52 01 66 00 00 06 61 00 00 42 51 C8 FF EC 4E 75 10 28 FF FF 02 40 00 0F 54 40 14 18 66 D6 4A 41 67 00 00 06 61 00 00 24 58 4F 4C DF 07 0F 4E 75 10 10 E3 00 10 28 FF FF E3 10 02 40 00 1F 54 40 14 18 02 42 00 7F 52 42 60 AA 48 E7 C0 C0 30 01 66 00 00 06 30 3C 01 00 E2 48 32 03 D6 40 D6 40 20 49 4A 94 67 00 00 0A 22 54 4E 95 60 00 00 04 4E 96 4C DF 03 03 4E 75 48 E7 E0 00 30 38 B0 28 32 38 B0 2A 20 7C FF FF B0 04 D0 F8 B0 2E 34 28 00 02 E5 61 D0 41 E3 40 D0 50 61 00 FD 0A 4C DF 00 07 4E 75

$17CA0-$18031: 48 E7 FF F0 36 7C D0 88 61 00 03 94 30 38 CE EC 80 78 CE EA 67 00 00 5A 61 00 00 C6 70 07 4A 78 D0 46 67 00 00 06 30 3C 00 0B 4A 78 D0 46 66 00 00 14 0C 78 00 02 CE F0 6D 00 00 2E 55 78 CE F0 60 00 00 26 0C 78 00 01 CE F0 66 00 00 0C 31 FC 00 03 CE F0 60 00 00 12 0C 78 00 02 CE F0 66 00 00 08 31 FC 00 04 CE F0 90 78 CE F0 31 C0 D0 4A 4C DF 0F FF 4E 75 70 20 61 00 93 6C 52 40 02 40 00 1F E9 40 20 7C 00 00 55 76 D0 C0 E8 48 72 0F 34 38 D0 4C B4 7C 00 19 63 00 00 04 74 19 B4 18 57 C9 FF FC 66 D6 0A 41 00 0F 31 C1 CE EE 31 C0 CE E8 42 78 CE EC 31 FC 00 07 CE EA 0C 78 00 02 D0 48 67 00 00 1C 42 78 CE EA 70 07 30 7C CE 66 42 68 00 04 42 68 00 06 D0 FC 00 10 51 C8 FF F2 48 E7 F8 F0 32 38 CE E8 E9 41 30 7C CE F4 22 7C 00 00 55 76 D2 C1 20 91 21 69 00 04 00 04 21 69 00 08 00 08 21 69 00 0C 00 0C 43 E8 00 10 74 0E 30 38 CE F2 32 00 02 41 00 01 12 F0 10 00 54 48 E2 48 51 CA FF F0 61 00 04 C2 4A 41 6B 00 00 30 30 7C CE F4 D0 C2 D0 C2 32 7C CE 66 42 69 00 0A 42 69 00 0C 42 69 00 08 08 A9 00 01 00 0E 61 00 00 14 D2 FC 00 10 51 C9 FF E4 61 00 00 46 4C DF 0F 1F 4E 75 0C 78 00 02 CE EA 67 00 00 26 0C 78 00 03 CE EA 67 00 00 1C 0C 78 00 05 CE EA 67 00 00 12 08 E9 00 00 00 0E 13 58 00 03 13 58 00 01 4E 75 08 A9 00 00 00 0E 13 58 00 01 13 58 00 03 4E 75 48 E7 F0 C0 42 78 C3 28 42 78 C3 2A 42 78 C3 2C 42 78 C3 2E 4A 78 D0 64 67 00 01 80 4A 78 D0 48 67 00 01 36 08 38 00 00 C2 FA 66 00 01 2C 61 00 04 18 30 7C CE F4 34 38 CE EE 14 30 20 00 32 7C CE 66 78 10 C8 C1 D2 C4 50 F8 CE E6 42 40 B4 51 67 00 00 32 B4 69 00 02 67 00 00 0E 92 FC 00 10 51 C9 FF EC 60 00 01 38 70 04 4A 78 D0 46 67 00 00 06 30 3C 00 05 31 D1 D0 4E 31 E9 00 02 D0 4C 60 00 00 0E 42 40 31 E9 00 02 D0 4E 31 D1 D0 4C D0 78 CE F0 31 C1 CE E6 31 D1 C3 30 31 E9 00 02 C3 32 E5 40 41 FA 00 6A 4A 78 D0 46 67 00 00 06 41 FA 00 7E 31 F0 00 00 C3 28 31 F0 00 02 C3 2A 4A 78 D0 46 67 00 00 D8 B0 7C 00 04 67 00 00 0E B0 7C 00 18 67 00 00 06 60 00 00 12 31 F8 C3 28 C3 2C 31 F8 C3 2A C3 2E 60 00 00 B4 B0 7C 00 08 67 00 00 0E B0 7C 00 1C 67 00 00 06 60 00 00 A0 31 F8 C3 28 C3 2C 31 FC 00 00 C3 2E 60 00 00 90 00 01 00 00 00 01 00 01 00 01 00 02 00 02 00 01 00 02 00 00 00 02 00 02 00 02 00 01 00 01 00 02 00 01 00 00 00 01 00 02 00 01 00 02 00 01 00 01 00 01 00 02 00 02 00 00 00 02 00 01 00 02 00 01 00 02 00 02 00 02 00 01 30 38 D0 4A E5 40 41 FA 00 44 31 F0 00 00 C3 28 31 F0 00 02 C3 2A B0 7C 00 14 66 00 00 12 31 F8 C3 28 C3 2C 31 FC 00 00 C3 2E 60 00 00 16 B0 7C 00 18 66 00 00 0E 31 F8 C3 28 C3 2C 31 F8 C3 2A C3 2E 61 00 00 24 4C DF 03 0F 4E 75 00 00 00 00 00 01 00 00 00 02 00 00 00 01 00 01 00 01 00 02 00 01 00 02 00 01 00 02 50 F8 CE E6 42 83 32 38 C3 30 03 C3 32 38 C3 32 03 C3 32 7C CE 66 74 07 61 00 00 16 32 80 61 00 00 10 33 40 00 02 D2 FC 00 10 51 CA FF EC 4E 75

$F70A2-$F70D5: 48 E7 FF 00 32 3C 01 9F 30 3C 00 09 4E B9 00 01 10 7A 2F 08 D1 FC 00 00 01 A2 11 80 10 00 20 5F 51 C9 FF E6 4C DF 00 FF 4E 75 4A 43 6A 00 00 06 42 43 4E 75 B6 7C 00 64 6F 00 00 06 36 3C 00 64 4E 75

$F7318-$F78A1: 48 E7 7F FE 20 7C FF FF C6 CE 61 00 00 5A 31 C1 BF 12 20 7C FF FF CA 32 61 00 00 4C 31 C1 BF 14 32 38 BF 12 34 38 BF 14 94 41 31 FC 00 00 BF 50 4A 42 6B 00 00 08 31 FC 00 01 BF 50 4A 42 6A 00 00 04 44 42 30 3C FF FF B4 7C 00 5E 6D 00 00 12 30 3C 00 22 B4 7C 00 BD 6D 00 00 06 30 3C 00 23 4C DF 7F FE 4E 75 61 00 FE 70 30 3C 00 06 20 7C FF FF BF 20 42 41 14 28 00 01 48 82 D2 42 4A 58 51 C8 FF F4 4E 75 4E B9 00 0F E6 60 26 7C FF FF D0 88 4E B9 00 01 80 3E 31 F8 D0 72 D0 58 31 F8 D0 74 D0 48 08 B8 00 01 C2 FC 4E B9 00 0F D7 3C 4E B9 00 0F 9C 68 61 00 0D 98 42 78 D4 22 42 78 D4 24 61 00 0C 94 4A 78 D0 64 66 00 00 1A 70 1C 4E B9 00 01 10 86 31 C0 D0 4C 70 1C 4E B9 00 01 10 86 31 C0 D0 4E 50 F8 D0 64 0C 78 00 04 D0 48 66 00 00 06 60 00 00 1E 0C 78 00 02 D0 48 6D 00 00 06 61 00 02 AC 0C 78 00 01 D0 48 66 00 00 06 61 00 02 A4 42 47 42 40 61 00 02 A2 61 00 04 6C 31 F8 C3 30 D4 2A 31 F8 C3 30 D4 28 61 00 11 6A 31 F8 C3 32 D4 2C 31 F8 C3 32 D4 28 61 00 11 B2 31 FC 00 18 BD 26 08 B8 00 02 BF 78 0C 78 00 04 D0 48 66 00 00 14 31 FC 00 01 D0 58 31 FC 00 00 D0 56 31 FC 00 01 D0 54 61 00 0E 82 4A 41 66 00 00 06 60 00 0F 8C 08 01 00 07 66 00 0F AA 08 01 00 01 67 00 00 90 4A 78 D0 4A 66 00 00 12 BE 7C 00 08 66 00 00 0A 30 3C 00 04 60 00 00 06 30 3C 00 02 0C 78 00 04 D0 48 67 00 00 1A 4A 78 D0 4A 66 00 00 12 BE 7C 00 08 66 00 00 0A 30 3C 00 06 60 00 00 46 BE 7C 00 06 66 00 00 1A 0C 78 00 04 D0 48 66 00 00 10 4A 78 D0 4A 66 00 00 28 42 40 60 00 00 26 BE 7C 00 0A 66 00 00 1E 0C 78 00 04 D0 48 66 00 00 08 42 40 60 00 00 0E 4A 78 D4 58 6A 00 00 06 30 3C 00 04 61 00 01 B2 61 00 03 7C 60 00 FF 3A 08 01 00 00 67 00 00 7C 4A 78 D0 4A 66 00 00 12 BE 7C 00 0C 66 00 00 0A 30 3C FF FC 60 00 00 28 30 3C FF FE 0C 78 00 04 D0 48 67 00 00 1A 4A 78 D0 4A 66 00 00 12 BE 7C 00 0E 66 00 00 0A 30 3C FF FA 60 00 00 32 BE 7C 00 0A 66 00 00 0C 0C 78 00 04 D0 48 67 00 00 1C BE 7C 00 0E 66 00 00 18 0C 78 00 04 D0 48 67 00 00 0A 4A 78 D4 58 6A 00 00 06 30 3C FF FC 61 00 01 30 61 00 02 FA 60 00 FE B8 74 01 08 01 00 03 66 00 00 0C 08 01 00 02 67 00 FE A6 74 FF 0C 78 00 04 D0 48 67 00 00 08 4E B9 00 01 7E 42 3F 38 D0 4E 3F 38 D0 4C 61 00 03 66 30 1F 0C 78 00 04 D0 48 67 00 00 0A 4A 78 D0 48 66 00 00 0E 31 F8 D0 4C C3 30 31 F8 D0 4E C3 32 31 F8 C3 30 D4 28 08 38 00 06 D4 2E 67 00 00 16 48 A7 80 00 30 38 D4 2A B0 78 C3 30 4C 9F 00 01 67 00 00 0C 31 F8 C3 30 D4 2A 61 00 0F 86 08 38 00 07 D4 2E 67 00 00 16 48 A7 80 00 30 38 D4 2C B0 78 C3 32 4C 9F 00 01 67 00 00 18 31 F8 C3 32 D4 2C 31 F8 C3 32 D4 28 61 00 0F B0 31 F8 C3 30 D4 28 4A 5F 60 00 00 5A 30 1F B0 78 C3 32 67 00 00 50 31 F8 C3 32 D4 28 48 A7 80 00 30 38 C3 32 B0 78 C3 32 4C 9F 00 01 67 00 00 0C 31 F8 C3 32 D4 2C 61 00 0F 76 48 A7 80 00 30 38 D4 2A B0 78 C3 30 4C 9F 00 01 67 00 00 18 31 F8 C3 30 D4 2A 31 F8 C3 30 D4 28 61 00 0E FA 31 F8 C3 32 D4 28 61 00 01 E2 60 00 FD A0 4E 75 4E F9 00 01 7D 16 4E F9 00 01 7C A0 36 07 08 B8 00 02 C2 F6 4A 40 6A 00 00 2A 3F 00 30 07 E2 40 B0 78 D4 22 66 00 00 1A 31 F8 D4 22 D4 24 08 F8 00 02 C2 F6 53 78 D4 22 6A 00 00 06 42 78 D4 22 30 1F 31 C7 BF 12 DE 40 6A 00 00 04 42 47 4A 40 6B 00 00 4E 3F 00 30 07 E2 40 90 78 D4 22 B0 7C 00 05 6E 00 00 06 60 00 00 36 31 F8 D4 22 D4 24 08 F8 00 02 C2 F6 52 78 D4 22 30 07 E2 40 90 78 D4 22 B0 7C 00 05 6F 00 00 06 52 78 D4 22 0C 78 00 03 D4 22 6F 00 00 08 31 FC 00 03 D4 22 30 1F 08 38 00 02 C2 F6 66 00 00 08 31 F8 D4 22 D4 24 BE 7C 00 12 6D 00 00 04 9E 40 0C 78 00 01 D0 48 66 00 00 10 4A 47 67 00 00 0A BE 7C 00 06 63 00 FF 3E 0C 78 00 02 D0 48 6D 00 00 14 0C 78 00 04 D0 48 67 00 00 0A BE 7C 00 06 67 00 FF 22 61 00 00 54 48 E7 FF FE 38 38 D4 26 20 7C 00 0B EF B8 22 48 24 48 D1 DA D3 DA 30 38 B0 28 53 40 36 01 32 38 B0 2A 04 41 00 0E 74 17 7A 00 08 F8 00 00 C2 F8 4E B9 00 01 16 9A 08 B8 00 00 C2 F8 4C DF 7F FF 36 07 61 00 00 66 31 FC 60 00 B0 2C 4E F9 00 01 19 B8 4E B9 00 01 1B 92 00 06 FF 10 0E 00 30 3C 00 17 32 3C 00 0D 4E 75 D7 78 B0 2A 30 38 D4 24 D0 40 91 78 B0 2A 0C 78 00 18 B0 2A 6F 00 00 08 31 FC 00 18 B0 2A 70 17 72 03 0C 78 00 02 D0 48 6D 00 00 54 0C 78 00 04 D0 48 67 00 00 4A B6 7C 00 04 66 00 00 42 72 05 4E 75 4E B9 00 01 1B 92 00 06 FF 10 0E 00 D7 78 B0 2A 30 38 D4 22 D0 40 91 78 B0 2A 70 17 72 03 0C 78 00 02 D0 48 6D 00 00 16 0C 78 00 04 D0 48 67 00 00 0C B6 7C 00 04 66 00 00 04 72 05 4E 75

$F8070-$F80D3: 48 E7 C0 00 08 F8 00 03 C2 F8 22 7C 00 0F 80 D4 30 3C 00 0F 32 38 D4 22 D2 41 90 41 31 C0 B0 2A 0C 78 00 0F B0 2A 6C 00 00 08 D2 D1 60 00 00 24 0C 78 00 19 B0 2A 6E 00 00 20 31 FC 00 03 B0 28 31 FC 00 00 B0 2C 31 FC 00 00 B0 2E 4E B9 00 01 1A 48 54 78 B0 2A 60 C8 08 B8 00 03 C2 F8 4C DF 00 03 4E 75

$F8168-$F8416: 21 FC 00 01 7C 42 B0 3A 46 FC 25 00 08 B8 00 00 BF 78 08 F8 00 02 BF 78 08 B8 00 01 BF 78 31 FC 00 00 B0 00 31 FC B4 00 B0 02 31 FC B8 00 B0 0C 31 FC 00 05 B0 0E 31 FC C0 00 B0 08 31 FC 00 06 B0 0A 31 FC E0 00 B0 04 31 FC 00 06 B0 06 30 3C 00 00 4E B9 00 01 15 94 4E B9 00 01 12 BC 4E B9 00 0F 84 D0 31 C4 B0 1E 24 7C 00 0B F5 4A 4E B9 00 01 17 2C 03 56 75 64 89 AB CD EF 31 C4 B0 12 24 7C 00 0A AC 5A 4E B9 00 01 17 2C 0F C0 45 67 89 AB CD EF 31 C4 BF 52 24 7C 00 0B E2 72 4E B9 00 01 17 2C 01 23 45 67 89 AB CD EF 4E B9 00 01 1B 92 00 06 FF 00 00 00 70 28 72 1C 34 3C 07 FF 4E B9 00 01 19 7E 4E B9 00 01 1B 92 00 06 FE 00 00 00 20 7C 00 04 B7 A0 22 48 24 48 D1 DA D3 DA 42 40 42 41 74 28 76 1C 7A 0D 4E B9 00 01 16 9A 31 C4 D4 32 06 44 00 24 4E B9 00 01 1B 92 00 06 FF 00 00 00 20 7C 00 04 DE EE 22 48 24 48 D1 DA D3 DA 42 40 42 41 74 28 76 04 7A 00 4E B9 00 01 16 9A 4E B9 00 01 1B 92 00 06 FF 01 0E 00 31 C4 D4 26 20 7C 00 0B EF B8 22 48 24 48 D1 DA D3 DA 42 40 42 41 74 26 76 0D 7A 00 4E B9 00 01 16 9A 31 C4 D4 30 06 44 00 24 31 C4 D4 36 24 7C 00 0B F7 0A 4E B9 00 01 17 38 31 C4 D4 38 24 7C 00 0B F7 0A 4E B9 00 01 17 2C 03 41 45 67 89 AB CD EF 4E B9 00 01 6E 82 31 FC 00 28 B0 66 31 FC 00 28 B3 66 50 F8 C6 CE 50 F8 CA 32 4E 75 2C 3C 00 00 54 60 32 38 B0 3E 92 78 B0 40 67 F6 31 F8 B0 3E B0 40 08 B8 00 05 D4 2E 4E B9 00 0F 84 F8 4E B9 00 01 13 40 4E B9 00 01 13 18 4A 41 67 00 00 20 08 01 00 05 67 00 00 D8 08 02 00 05 67 00 00 0A 33 FC 00 53 FF FF D4 3C 08 F8 00 05 D4 2E 4E B9 00 01 13 58 4E B9 00 01 13 18 4A 41 67 00 00 10 08 01 00 05 67 00 00 A8 08 F8 00 05 D4 2E 4A 78 D0 46 67 00 00 42 4E B9 00 01 13 70 4E B9 00 01 13 18 4A 41 67 00 00 10 08 01 00 05 67 00 00 80 08 F8 00 05 D4 2E 4E B9 00 01 13 88 4E B9 00 01 13 18 4A 41 67 00 00 10 08 01 00 05 67 00 00 60 08 F8 00 05 D4 2E 08 38 00 06 D4 2E 67 00 00 16 08 38 00 07 D4 2E 66 00 00 20 31 F8 D4 2C D4 28 61 00 02 2E 08 38 00 07 D4 2E 67 00 00 0C 31 F8 D4 2A D4 28 61 00 01 C2 BC 7C 46 50 6E 00 00 16 08 38 00 00 D4 2E 66 00 00 0C 4E B9 00 0F 87 D2 60 00 00 08 4E B9 00 0F 87 EA 51 CE FE F6 4E 75

$F9C68-$F9CA3: 08 B8 00 06 C2 F8 48 E7 FF FE 22 3C 00 00 00 80 20 3C 00 00 0D A0 20 7C FF FF D4 5A 08 38 00 06 C2 F8 67 00 00 0C 4E B9 00 01 A1 E4 60 00 00 08 4E B9 00 01 A2 44 4C DF 7F FF 4E 75

$FCC76-$FCF85: 4E B9 00 0F 9C 68 4E B9 00 0F 71 A2 42 78 D5 A4 3F 3C 00 7A 4E B9 00 01 11 56 21 FC 00 01 5E 4C B0 3A 4E B9 00 01 71 02 2F 08 20 7C FF FF C6 CE 4E B9 00 0F 70 A2 20 7C FF FF CA 32 4E B9 00 0F 70 A2 20 5F 4E B9 00 0F 71 A2 08 B8 00 01 BF 78 31 FC 00 06 B0 06 31 FC 00 06 B0 0A 30 3C 00 00 4E B9 00 01 15 94 38 3C 00 02 31 C4 D4 30 06 44 00 24 31 C4 D4 32 06 44 00 24 31 C4 B0 10 24 7C 00 0A 9A 18 4E B9 00 01 17 2C 05 43 15 67 79 AB CD EF 4E B9 00 01 1F 04 31 C4 B0 14 24 7C 00 0A AC 5A 4E B9 00 01 17 2C 0A 23 45 67 89 AB CD EF 24 7C 00 05 5B 86 31 C4 B0 1E 4E B9 00 01 17 2C 05 42 25 61 89 AB CD EF 4E B9 00 01 1B 92 00 06 FE 00 00 00 20 7C 00 05 4E 24 22 48 24 48 D1 DA D3 DA 42 40 42 41 74 28 76 1C 7A 03 4E B9 00 01 16 9A 4E B9 00 01 1D E2 00 0E DF 0C 0D 4D 41 54 43 48 55 50 53 00 31 FC 00 00 B0 30 4E B9 00 01 1B 92 00 10 FF 10 11 41 44 56 41 4E 54 41 47 45 3A 00 4E B9 00 01 1B 92 00 06 DE 06 03 00 70 21 72 09 4E B9 00 01 19 B8 4E B9 00 01 1B 92 00 06 DE 01 0E 00 30 3C 00 08 32 3C 00 08 4E B9 00 01 19 B8 4E B9 00 01 1B 92 00 06 DE 1F 0E 00 30 3C 00 08 32 3C 00 08 4E B9 00 01 19 B8 4E B9 00 01 1B 92 00 06 FF 01 01 00 20 7C 00 0B 38 9C 22 48 24 48 D1 DA D3 DA 42 40 42 41 34 11 36 29 00 02 7A 0C 4E B9 00 01 16 9A 24 7C 00 0F 5A FE 31 C4 DE E4 4E B9 00 01 17 38 24 7C 00 0F 5D 24 31 C4 DE E6 4E B9 00 01 17 38 42 78 D5 98 42 78 D5 9A 33 FC 01 0D FF FF D5 A8 61 00 06 2C 61 00 02 40 61 00 03 B6 31 FC 00 18 BD 26 21 FC 00 01 5E 4C B0 3A 46 FC 25 00 4E B9 00 01 77 18 30 FC 00 1B 30 FC 00 1D 30 FC 00 1A 30 FC 00 1D 4E B9 00 0F 73 18 4A 40 6B 00 00 08 30 C0 30 FC 00 1D 30 38 C3 30 30 FC 00 1E 30 FC 00 1D B0 78 C3 32 67 00 00 06 30 FC 00 1F 30 FC 00 1D 30 FC 00 20 30 FC 00 1D 30 FC 00 21 30 BC FF FF 42 78 B0 44 31 FC 7F FF D5 B6 21 FC 00 00 8C A0 DE EC 70 00 4E B9 00 01 11 76 53 78 D5 A8 6A 00 00 0A 33 FC 01 0E FF FF D5 A8 61 00 05 EE 08 01 00 07 66 00 00 9A 0C 78 01 0E D5 A8 67 00 00 18 08 01 00 05 67 00 00 20 31 FC 7F FF D5 B6 21 FC 00 00 8C A0 DE EC 61 00 05 B8 30 3C 00 01 61 00 00 76 60 00 00 38 08 01 00 06 67 00 00 20 31 FC 7F FF D5 B6 21 FC 00 00 8C A0 DE EC 61 00 05 92 30 3C FF FF 61 00 00 50 60 00 00 12 42 78 B0 44 08 01 00 01 67 00 00 06 50 F8 B0 44 08 38 00 01 DE D5 67 00 00 06 50 F8 B0 44 4E B9 00 01 77 30 53 78 D5 B6 6A 00 FF 5C 4A 78 D0 4A 67 00 00 10 31 FC FF FF D5 B6 53 B8 DE EC 6A 00 FF 46 31 FC 00 00 B0 30 4E 75

I had you write this script but there are some issues. The main one I want to focus on now is that the 0x50-0x5F command seems broken. I have a file that has the following in it:

31 66 00 65 30 55 00 65 30 44 03 65 47 77 77 8D 04 31 66 31 55 31 44 3F 77 9B 1F 00 18 51 00 88 51 00 92 8A 20 31 11 0E 22 28 82 22 33 32 22 34 44 32 98 22 99 98 88 89 20 00 11 30 77 01 99 88 68 04 98 11 18 77 81 34 11 9C FF 01 82 87 82 80 00 61 30 55 07 21 44 44 43 21 77 77 73 8E 04 8F D4 8B 04 38 77 00 71 83 B8

it correctly outputs the following as expected:
66 66 66 66 65 55 55 55 65 44 44 44 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 66 66 66 66 55 55 55 55 44 44 44 44 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 66 66 66 66 55 55 55 55 44 44 44 44 77 77 77 77 77 77 77 77 77 77 77 18 77 77 18 88 77 18 88 92 66 66 66 66 55 55 55 55 44 44 44 44 77 11 11 11 11 22 28 82 22 33 32 22 34 44 32 98 22 99 98 88 66 66 66 66 55 55 55 55 44 44 44 44 11 77 77 77 99 88 11 77 98 11 18 77 81 11 11 11 11 11 11 11 66 66 66 66 55 55 55 55 44 44 44 44 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 82 87 77 77 66 66 66 61 55 55 55 21 44 44 43 21 77 77 73 21 77 77 73 21 77 77 73 21 77 77 73 21 77 77 73 21 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 77 77 77 77 77 77 77 77 77 77 77 71

I have another file which has the following in it:
31 66 00 65 30 55 00 65 30 44 03 65 47 77 77 8D 04 31 66 31 55 31 44 3F 77 9B 1F 00 18 51 00 88 51 00 92 8A 20 31 11 0E 22 28 82 22 33 32 22 34 44 32 98 22 99 98 88 89 20 00 11 30 77 01 99 88 68 04 98 11 18 77 81 34 11 9C FF 01 82 87 82 80 00 61 30 55 07 21 44 44 43 21 77 77 73 8E 04 8F D4 8B 04 38 77 00 71 83 B8 5E

I would expect it to output:
66 66 66 66 65 55 55 55 65 44 44 44 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 66 66 66 66 55 55 55 55 44 44 44 44 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 66 66 66 66 55 55 55 55 44 44 44 44 77 77 77 77 77 77 77 77 77 77 77 18 77 77 18 88 77 18 88 92 66 66 66 66 55 55 55 55 44 44 44 44 77 11 11 11 11 22 28 82 22 33 32 22 34 44 32 98 22 99 98 88 66 66 66 66 55 55 55 55 44 44 44 44 11 77 77 77 99 88 11 77 98 11 18 77 81 11 11 11 11 11 11 11 66 66 66 66 55 55 55 55 44 44 44 44 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 82 87 77 77 66 66 66 61 55 55 55 21 44 44 43 21 77 77 73 21 77 77 73 21 77 77 73 21 77 77 73 21 77 77 73 21 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 77 77 77 77 77 77 77 77 77 77 77 71 77 77 77 18 77 77 77 18 77 77 77 18 77 77

But it outputs:
66 66 66 66 65 55 55 55 65 44 44 44 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 66 66 66 66 55 55 55 55 44 44 44 44 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 66 66 66 66 55 55 55 55 44 44 44 44 77 77 77 77 77 77 77 77 77 77 77 18 77 77 18 88 77 18 88 92 66 66 66 66 55 55 55 55 44 44 44 44 77 11 11 11 11 22 28 82 22 33 32 22 34 44 32 98 22 99 98 88 66 66 66 66 55 55 55 55 44 44 44 44 11 77 77 77 99 88 11 77 98 11 18 77 81 11 11 11 11 11 11 11 66 66 66 66 55 55 55 55 44 44 44 44 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 77 82 87 77 77 66 66 66 61 55 55 55 21 44 44 43 21 77 77 73 21 77 77 73 21 77 77 73 21 77 77 73 21 77 77 73 21 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 65 47 77 77 77 77 77 77 77 77 77 77 77 77 77 71 65 47 77 77 77 77 77 77 77 77 77 77 77 77 77 71

this is the output from the script:
C:\repository\EA-NHL-Tools\Kosinski-Tools> node nhl94-decompressor.js ronbarr_short.bin output.bin --verbose
Processing .\ronbarr_short.bin (106 bytes)
Starting decompression from offset 0
Command byte: 0x31 at offset 0
  Repeat with count: 0x66 × 4
Command byte: 0x00 at offset 2
  Literal bytes: 1 bytes
    Byte 0: 0x65
Command byte: 0x30 at offset 4
  Repeat with count: 0x55 × 3
Command byte: 0x00 at offset 6
  Literal bytes: 1 bytes
    Byte 0: 0x65
Command byte: 0x30 at offset 8
  Repeat with count: 0x44 × 3
Command byte: 0x03 at offset 10
  Literal bytes: 4 bytes
    Byte 0: 0x65
    Byte 1: 0x47
    Byte 2: 0x77
    Byte 3: 0x77
Command byte: 0x8d at offset 15
  Long copy (8D): copy last 4 bytes and repeat 4 times
Command byte: 0x31 at offset 17
  Repeat with count: 0x66 × 4
Command byte: 0x31 at offset 19
  Repeat with count: 0x55 × 4
Command byte: 0x31 at offset 21
  Repeat with count: 0x44 × 4
Command byte: 0x3f at offset 23
  Repeat with count: 0x77 × 18
Command byte: 0x9b at offset 25
  Extended 90: copy 25 bytes from offset -32 (subcmd=11)
Command byte: 0x00 at offset 27
  Literal bytes: 1 bytes
    Byte 0: 0x18
Command byte: 0x51 at offset 29
  Extended 50: copy 3 bytes from recent output position (cmd=0x51)
Command byte: 0x00 at offset 30
  Literal bytes: 1 bytes
    Byte 0: 0x88
Command byte: 0x51 at offset 32
  Extended 50: copy 3 bytes from recent output position (cmd=0x51)
Command byte: 0x00 at offset 33
  Literal bytes: 1 bytes
    Byte 0: 0x92
Command byte: 0x8a at offset 35
  Long copy (8A): copy pattern starting from offset -32 (parameter=0x20)
Command byte: 0x31 at offset 37
  Repeat with count: 0x11 × 4
Command byte: 0x0e at offset 39
  Literal bytes: 15 bytes
    Byte 0: 0x22
    Byte 1: 0x28
    Byte 2: 0x82
    Byte 3: 0x22
    Byte 4: 0x33
    Byte 5: 0x32
    Byte 6: 0x22
    Byte 7: 0x34
    Byte 8: 0x44
    Byte 9: 0x32
    Byte 10: 0x98
    Byte 11: 0x22
    Byte 12: 0x99
    Byte 13: 0x98
    Byte 14: 0x88
Command byte: 0x89 at offset 55
  Long copy (89): copy 12 bytes from offset -32 (parameter=0x20)
Command byte: 0x00 at offset 57
  Literal bytes: 1 bytes
    Byte 0: 0x11
Command byte: 0x30 at offset 59
  Repeat with count: 0x77 × 3
Command byte: 0x01 at offset 61
  Literal bytes: 2 bytes
    Byte 0: 0x99
    Byte 1: 0x88
Command byte: 0x68 at offset 64
  Extended 60: copy 2 bytes from offset -6 (cmd=0x68)
Command byte: 0x04 at offset 65
  Literal bytes: 5 bytes
    Byte 0: 0x98
    Byte 1: 0x11
    Byte 2: 0x18
    Byte 3: 0x77
    Byte 4: 0x81
Command byte: 0x34 at offset 71
  Repeat with count: 0x11 × 7
Command byte: 0x9c at offset 73
  Extended 90: copy 28 bytes from offset -128 (subcmd=12, param=0xff as signed=-1)
Command byte: 0x01 at offset 75
  Literal bytes: 2 bytes
    Byte 0: 0x82
    Byte 1: 0x87
Command byte: 0x82 at offset 78
  Long copy (82): copy 5 bytes from offset -128 (parameter=0x80)
Command byte: 0x00 at offset 80
  Literal bytes: 1 bytes
    Byte 0: 0x61
Command byte: 0x30 at offset 82
  Repeat with count: 0x55 × 3
Command byte: 0x07 at offset 84
  Literal bytes: 8 bytes
    Byte 0: 0x21
    Byte 1: 0x44
    Byte 2: 0x44
    Byte 3: 0x43
    Byte 4: 0x21
    Byte 5: 0x77
    Byte 6: 0x77
    Byte 7: 0x73
Command byte: 0x8e at offset 93
  Long copy (8e): copy 17 bytes from offset -4 (parameter=0x4)
Command byte: 0x8f at offset 95
  Long copy (8f): copy 18 bytes from offset -212 (parameter=0xd4)
Command byte: 0x8b at offset 97
  Long copy (8b): copy 14 bytes from offset -4 (parameter=0x4)
Command byte: 0x38 at offset 99
  Repeat with count: 0x77 × 11
Command byte: 0x00 at offset 101
  Literal bytes: 1 bytes
    Byte 0: 0x71
Command byte: 0x83 at offset 103
  Long repeat (83): termination/control command (parameter=0xb8)
Command byte: 0x5e at offset 105
  Extended 50: copy 16 bytes from recent output position (cmd=0x5e)
Decompression complete. Output length: 284
Decompressed 284 bytes
Saved decompressed data to output.bin
First 16 bytes: 66 66 66 66 65 55 55 55 65 44 44 44 65 47 77 77

It seems like the 0x50-0x5F command isn't implemented correctly. It works for 51 earlier in the file, but not for 5E. Can you disassemble the hex code I included above and understand how this should be implemented and implement it?

 

  • Thanks 2
Posted

Here is some WIP documentation on how the compression algorithm works. I still need to figure out a handful of more commands, and some of the calculations here may not be fully correct (but they work with the examples I've encountered so far):

File Layout

The input file consists of:

  • Header (10 bytes):
    • paletteOffset (4 bytes, BE): Offset to palette data
    • mapOffset (4 bytes, BE): Offset to map data
    • paletteSize (1 byte): Size of palette data
    • numTiles (1 byte): Number of tiles (each tile is 32 bytes decompressed)
  • Compressed tile data: Starts at byte 10, ends before the palette offset (or file end)
  • Palette data: Starts at paletteOffset, length paletteSize
  • Map data: Starts at mapOffset to the end of the file (excluding possible end marker)

There may be a 4-byte end marker (0xFFFFFFFF) at the end of compressed or map data.


Decompression Flow

  1. Read Header: Get offsets, palette size, and tile count.
  2. Extract Compressed Data: From byte 10 up to palette offset or file end.
  3. Process Commands: Starting at offset 10, parse command bytes and execute decompression commands, writing to an output buffer.
  4. Write Output File: Build output (.jim) file with a new header, decompressed tiles, palette, and map data.

Command Processing

Each command is a single byte, possibly followed by additional bytes ("parameters"). The high nibble (commandByte >> 4) identifies the command type, the low nibble (commandByte & 0xF) parameterizes the command.

Command Table

Command High Nibble Description Additional Bytes
0x0 0 Literal copy count
0x3 3 Run-Length Encoding (RLE) 1
0x4 4 Short back reference (pattern) 0
0x5 5 Short pattern repeat 0
0x6 6 Short back reference (offset+count) 0
0x8 8 Pattern repeat (with offset byte) 1
0x9 9 Variable back reference 1
0xC 12 Fixed offset back reference 0

1. Literal Copy (cmd === 0x0)

  • Purpose: Copy literal bytes from compressed stream to output.
  • Count: param + 1
  • Additional bytes: Exactly count bytes.

2. Run-Length Encoding (RLE) (cmd === 0x3)

  • Purpose: Repeat a single byte multiple times.
  • Count: param + 3
  • Additional bytes: 1 (the byte to repeat).

3. Short Back Reference (cmd === 0x4)

  • Purpose: Copy a short sequence from earlier in output buffer.
  • Offset: (param >> 2) & 0x3 (upper 2 bits of param)
  • Count: (param & 0x3) + 2 (lower 2 bits + 2)
  • Copies: count bytes from position - offset in output.

4. Short Pattern Repeat (cmd === 0x5)

  • Purpose: Repeat a short pattern from output.
  • Offset and Count: Derived from param:
    • Offset: 3 + ((param >> 3) & 1)
    • Count: 2 + (param & 7)
  • Action: Repeat previous offset bytes until count bytes are produced.

5. Short Back Reference with Offset (cmd === 0x6)

  • Purpose: Similar to 0x4, but with different offset/count logic.
  • Offset: (param >> 2) + 2
  • Count: (param & 0x3) + 2
  • Action: Copy count bytes from position - (offset + count).

6. Pattern Repeat with Byte Offset (cmd === 0x8)

  • Purpose: Repeat a pattern from output, length and offset given.
  • Count: param + 3
  • Additional byte: Pattern offset.
  • Action: Repeat previous offset bytes until count bytes are produced.

7. Variable Back Reference (cmd === 0x9)

  • Purpose: Copy a variable-length sequence from output, offset given by parameter byte.
  • Count: (3 * param) - 8
  • Additional byte: Offset (signed)
  • Action: Copy count bytes from position - (offset + 1).

8. Fixed Offset Back Reference (cmd === 0xC)

  • Purpose: Copy bytes from a fixed offset backwards in output.
  • Offset: (param >> 2) + 1
  • Count: (param & 0x3) + 2
  • Action: Copy count bytes from position - offset - i (i = 0..count-1).

Output Assembly

  • Header: 4 bytes palette offset, 4 bytes map offset
  • Tile count: 2 bytes (uint16)
  • Tiles: Decompressed tile data
  • Palette: Copied or zero-padded as needed
  • Map data: Copied or omitted if not present

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...