I've discovered that Nintendo often uses the same way of storing PPU data into their NES-games. I was on my way writing some kind of ripper-tool but got a bit bored so I might never finish it, so perhaps someone else is interested in my findings.
The structure looks like this:
The structure can be repeated as a list (PPUAddress,Control,Data,PPUAddress,Control,Data etc.) and is terminated by a $0.
CONTROL has a few features:
bit 5-0 = LENGTH (number of bytes to insert).
bit 6 = RLE mode (1=Active)
bit 7 = PPU Write mode (0=Increment by 1, 1=Increment by 32)
When RLE mode is active (=1), DATA byte is inserted <CONTROL.LENGTH> number of times.
The structure looks like this:
Code:
dc.w PPUAddress (hi+lowbyte)
dc.b CONTROL
dc.b DATA (*CONTROL.LENGTH)
dc.b CONTROL
dc.b DATA (*CONTROL.LENGTH)
The structure can be repeated as a list (PPUAddress,Control,Data,PPUAddress,Control,Data etc.) and is terminated by a $0.
CONTROL has a few features:
bit 5-0 = LENGTH (number of bytes to insert).
bit 6 = RLE mode (1=Active)
bit 7 = PPU Write mode (0=Increment by 1, 1=Increment by 32)
When RLE mode is active (=1), DATA byte is inserted <CONTROL.LENGTH> number of times.