want to alter the puck in Blades Of Steel - can't find it

A place for your artistic side. Discuss techniques and tools for pixel art on the NES, GBC, or similar platforms.

Moderator: Moderators

Post Reply
Pacorabanix
Posts: 5
Joined: Tue Jun 24, 2014 9:35 pm

want to alter the puck in Blades Of Steel - can't find it

Post by Pacorabanix »

Hello !

I guess some people here know the hockey-game Blades of Steel (Konami). If you don't, it's not important and you might still help us.

For an artistic project of some person I know, he needs to have the puck graphic modified.

We already tried to use classic softwares for sprite extractions ( Tile layer pro, tile molester), but, despite having spent hours trying and staring and enjoying a nice tapestry/world of 4-colors pixels, we haven't been able to spot it .

It just doesn't seem to be there....
That puzzles me. I see no reason for the puck not to be in the sprites section of the rom. We can see and modify easily the letters, numbers.
It fits without trouble in a 8x8 square, it is heavily used during the game and moving around and interacting a lot with the game, IMHO it *must* be a sprite.

My questions :

* Am I wrong in my assumptions (I guess I am...), and more importantly why ?
* How could we spot it ?
* How could we modify it ?

He is no nes hacker, and neither do I, but I may happily implement any solution involving programming (like a python script) in order to spot it out of the .nes rom .

There are some screenshots attached, two of the game,
blades1.png
blades2.png

and the puck itself.
There is the block of black pixels and the 4 red pixels, all the others are transparent
There is the block of black pixels and the 4 red pixels, all the others are transparent
puck.png (954 Bytes) Viewed 7813 times
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: want to alter the puck in Blades Of Steel - can't find i

Post by tepples »

According to NesCartDB, Blades of Steel uses CHR RAM. This means the ROM doesn't really have a "sprite section"; instead, the sprite graphics are copied from the main program section to video memory before being used. Some of the tricks that can be done with CHR RAM include compression of tile data, which lets everything fit in the 1 Mbit ROM, and obfuscation of tile data, which makes it harder for Chinese and Russian pirates to rip evidence of their infringement out of the game.
User avatar
thefox
Posts: 3134
Joined: Mon Jan 03, 2005 10:36 am
Location: 🇫🇮
Contact:

Re: want to alter the puck in Blades Of Steel - can't find i

Post by thefox »

Yes, it's a sprite but the graphics in BoS are RLE compressed. I happened to take a look at this game a year ago.

You can use a Python tool from http://thefox.aspekt.fi/graveduck.py to decompress the tiles. You'll then need to apply the modifications, compress the tiles again, and put them back into the ROM. (I have slightly modified the linked Python script to fix a couple of bugs in the original.)

Since I was bored, I even took the time to find the file offset in which the gameplay sprites are, it's 49171. So you can use the following command to decompress the tiles:

Code: Select all

python graveduck.py -d "Blades of Steel (U) [!].nes" 49171 bos.chr
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
Pacorabanix
Posts: 5
Joined: Tue Jun 24, 2014 9:35 pm

Re: want to alter the puck in Blades Of Steel - can't find i

Post by Pacorabanix »

Owww !

Thank you very much for the clues !

We thought that the gibberish we saw was somehow some code put in the graphic section. So it was compressed graphics.

I'll keep you informed on our progression.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: want to alter the puck in Blades Of Steel - can't find i

Post by tepples »

This topic inspired me to finally create the wiki page about tile compression that I promised four years ago.
Pacorabanix
Posts: 5
Joined: Tue Jun 24, 2014 9:35 pm

Re: want to alter the puck in Blades Of Steel - can't find i

Post by Pacorabanix »

It worked extremely fine !

Thank you very much thefox and Nesdev community !


@thefox
Since I was bored, I even took the time to find the file offset in which the gameplay sprites are, it's 49171
How did you find the offset ?
We're now trying to find the title-screen tiles, I suspect they may be compressed too; not sure though.
I might also use my boredtime to find them :P
Last edited by Pacorabanix on Thu Jun 26, 2014 5:53 pm, edited 1 time in total.
User avatar
thefox
Posts: 3134
Joined: Mon Jan 03, 2005 10:36 am
Location: 🇫🇮
Contact:

Re: want to alter the puck in Blades Of Steel - can't find i

Post by thefox »

Pacorabanix wrote:How did you find the offset ?
We're now trying to find the title-screen tiles, I suspect they may be compressed too; not sure though.
I might also use my boringness time to find them :P
I can spare you the trouble, I already found the title screen tile offset when previously re'ing this game, it's 65932.

The way I found these was by looking at the (unpacked) tile memory in an emulator's PPU memory viewer, took some 4-5 byte pattern from there and searched for it in an hex editor. Then used some educated guesses to find out where the compressed data begins.

An even easier way (that requires 6502 asm knowledge, though) would probably be to set a breakpoint on reads from any compressed tile data, use that to locate the tile decompression routine, and set a breakpoint there. Then look at what parameters get passed to the routine.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
Pacorabanix
Posts: 5
Joined: Tue Jun 24, 2014 9:35 pm

Re: want to alter the puck in Blades Of Steel - can't find i

Post by Pacorabanix »

I can spare you the trouble, I already found the title screen tile offset when previously re'ing this game, it's 65932.
Err. WOW ! ^^

I just can't find words to thank you again.
The way I found these was by looking at the (unpacked) tile memory in an emulator's PPU memory viewer, took some 4-5 byte pattern from there and searched for it in an hex editor.
very clever.

I was about to generate possible patterns by looking at a screenshot, take a 8x8 square, and generate all combinations of the 3 different colours involved and then lot of work , and so on. xD
Then used some educated guesses to find out where the compressed data begins.
I'm curious, which ones ? spec of some sort ?
User avatar
thefox
Posts: 3134
Joined: Mon Jan 03, 2005 10:36 am
Location: 🇫🇮
Contact:

Re: want to alter the puck in Blades Of Steel - can't find i

Post by thefox »

Pacorabanix wrote:
Then used some educated guesses to find out where the compressed data begins.
I'm curious, which ones ? spec of some sort ?
I just looked at the compressed data in hex editor and tried to match it up with the data in the PPU memory viewer based on how the compression algorithm works. Yet another way would be to take some decompressed tiles from the PPU memory viewer, compress them manually (or with graveduck), and then search for that compressed pattern in a hex editor.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
Pacorabanix
Posts: 5
Joined: Tue Jun 24, 2014 9:35 pm

Re: want to alter the puck in Blades Of Steel - can't find i

Post by Pacorabanix »

thefox wrote:
Pacorabanix wrote:
Then used some educated guesses to find out where the compressed data begins.
I'm curious, which ones ? spec of some sort ?
I just looked at the compressed data in hex editor and tried to match it up with the data in the PPU memory viewer based on how the compression algorithm works. Yet another way would be to take some decompressed tiles from the PPU memory viewer, compress them manually (or with graveduck), and then search for that compressed pattern in a hex editor.
mmok, I could definitely use the latter approach if I have to find other tiles (if there are still some of them you don't know where they are :lol: )

Which PPU viewer do you use (or emulator that provides that) ?
User avatar
thefox
Posts: 3134
Joined: Mon Jan 03, 2005 10:36 am
Location: 🇫🇮
Contact:

Re: want to alter the puck in Blades Of Steel - can't find i

Post by thefox »

Pacorabanix wrote:Which PPU viewer do you use (or emulator that provides that) ?
FCEUX and Nintendulator both work fine for that.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
User avatar
tokumaru
Posts: 12427
Joined: Sat Feb 12, 2005 9:43 pm
Location: Rio de Janeiro - Brazil

Re: want to alter the puck in Blades Of Steel - can't find i

Post by tokumaru »

Pacorabanix wrote:I could definitely use the latter approach if I have to find other tiles
Just keep in mind that these techniques might not work with all compression formats... most RLE variants are simple enough that you can still find sections of the original data untouched in the compressed stream, but other forms of compression might make the data completely unrecognizable.

The simplicity of RLE also makes it easy for you to manually compress some data in order to look for its offset in the ROM, but other algorithms might be able to compress the same data in different ways, or even be too complex to simulate by hand.

The most effective method is indeed to use breakpoints and step through the decompression routine(s) to see where the data is being read from, and what kinds of transformations are being applied to it.
Post Reply