News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Uncompressing Tiles  (Read 2024 times)

AlienX

  • Newbie
  • *
  • Posts: 4
    • View Profile
Uncompressing Tiles
« on: May 18, 2014, 03:58:43 pm »
I have a problem and I hope you can help me. So, I've been trying to hack some Japanese Konami NES games, but I ran into something. When I look at the tiles, used for letters, they all look scrambled and unrecognizable. A good example of this is "Dracula II: Noroi no Fuuin":
http://s34.photobucket.com/user/AlienX97/media/CVII-1_zps43fd6895.png.html
I thought there was something wrong, but after I looked at the Japanese version of "Contra", I saw the same thing, except this time, the letters were large enough to see what's going on. Apparently they used some kind of compression that allows two graphics to be stored in one tile. If you look closely, you'll see both, with the "main" one in a lighter shade and the "hidden" one in a darker one. Byte shifting in YY-CHR reveals the "hidden" graphic, but makes the "main" one become darker. Trying to just edit the tiles by drawing normal English letters doesn't work, as it screws up the rest of the tiles, when the game is running. So, my question is, how can you decompress the graphics? I've seen English translations of "Gryzor"(the Japanese "Contra"), so I know it's possible. Can anyone, please, help?

Pennywise

  • Hero Member
  • *****
  • Posts: 2272
  • I'm curious
    • View Profile
    • Yojimbo's Translations
Re: Uncompressing Tiles
« Reply #1 on: May 18, 2014, 04:38:22 pm »
Yes, it's true. Many NES games by Konami use a common type of compression called RLE (Run Length Encoding). If you're new to assembly and programming, dealing with the compression is probably going to be very difficult/near impossible for you to take care of. There is a tool called Graveyard Duck that was made for Konami's compression on the FDS. But I don't think it'd work on any of the NES games as the code is likely a bit different.

Contra is a different case. The intro uses some kind of simple compression. The tiles can still be edited in a tile editor.

MrBing

  • Jr. Member
  • **
  • Posts: 88
    • View Profile
Re: Uncompressing Tiles
« Reply #2 on: May 18, 2014, 06:29:39 pm »
It's doable but you'll probably have to reverse-engineer a good portion of the game. NES assembly is pretty easy to master, but it will take some time. The good news is that once you're finished, you'll be able to tweak the game to anything the NES' limited hardware will allow (which might not be very much).

The compression technique in question is called "dual-tile" encoding. There are plenty of docs about it.
« Last Edit: May 18, 2014, 09:30:21 pm by MrBing »

AlienX

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Uncompressing Tiles
« Reply #3 on: May 19, 2014, 12:46:52 pm »
Thanks. I think Graveyard Duck will work fine, because I want to do an English translation of "Dracula II: Noroi no Fuuin", which is on the FDS. And considering the name of the program is a reference to dialogue, found in the NES version ("Simon's Quest"), it has to work.

Bregalad

  • Hero Member
  • *****
  • Posts: 2699
    • View Profile
Re: Uncompressing Tiles
« Reply #4 on: May 19, 2014, 02:47:53 pm »
Quote
The compression technique in question is called "dual-tile" encoding. There are plenty of docs about it.
Nope, dual tile encoding is usually used to compress text and is not related to what this guy is mentioning.

Also the technique used by the Japanese Contra is yet something completely else, it's just a trick with palettes to turn 2-bitplane tiles into twice as many monochrome tiles, but by using 2 different palettes. (black-black-white-whie and black-white-black-white)