Przejdź do głównej zawartości

Wheels & Fire

After looong break i'm looking again at Wheels & Fire from TCH.
Game is running on custom, blitter based hardware (sprites + framebuffer layer with linescroll feature, and sprite-to-framebuffer rendering mode ).
I have made a lot of changes/improvements lately, but there's still a lot to do:
- proper image scaling - quite weird (close to hardware, i think) way to draw scaled images. for more details pls scroll down to the end of this post.
- framebuffer (various problems)
- sound - not emulated yet (2nd 68k + samples)


Here's few pics from the game:


W&F video hardware supports image scaling. For each image(sprite) to draw, there's a couple of parameters sent to the blitter:
- screen cooridnates of image rectangle ( top left ad bottom right corners) _after_ scale transform applied,
- source image cooridnates (only the upper-left corner, no info about the source dimensions),
- two sets (for x and y scale) of magic parameters : data1 (5 bit), data2 (5 bit), four flags ( double/half scale , zero/nonzero params (maybe they are just the MSB of the data1/data2))
Magic ;) parameters are packed into 5 bytes. They are essential to udnerestand how the hw works and how the scaling is done. So far it's just pure magic ;) Params are copied from a lookup table addressed by the scale factor (0-400%):

X Scale Table:
7 6 543210
---ABCDE
---FGHIJ
--------
---K-L-M
-------N

Y Scale Table:
7 6 543210
-A------
DE------
BC-FGHIJ
--K-L-M-
------N-


BITS ABCDE = DATA1 (0-31)
BITS FGHIJ = DATA2 (0-31)
BIT K - ( scale > 200% ) ? 1 : 0
BIT L - ( DATA2 != 0) ? 1 : 0
BIT M - ( DATA1 != 0) ? 1 : 0
BIT N - ( scale < 50% ) ? 1 : 0


Both (x and y) tables contians exactly the same data, just shuffled arround to easielly pack (by OR-ing) into 5 bytes and send to blitter. For now i'm uisng lookup table to determine the scale factor (based on the above params). Works pretty well, but the goal is to underestand how the data is interpreted by video hw and emulate it properly.


RED = data1 (0-31), WHITE = data2 (0-31)
Ranges 25-50% and 50-100% (as well as 100-200% and 200-400%) contains very similiar data, and the first one has special ("half") bitflag set (same for 200-400% - there's another bitflag set("double")). Probably for change the video hw (fpga based) pixel counter/clock.

Both data1 and data2 are mysterious for now. There's few ideas about them:
- fixed point 5.5 (src pixel delta/step?)
- pair of step + oveflow for src pixel "counter"
- floating point num (5 bit mantissa, 5 bit exponent)

A couple of examples ( scale factor - data1 - data2 - bit M - bit L) :


Any ideas ?

Komentarze

Popularne posty z tego bloga

$7dc

There was not much progress in 2011. I've been lately very busy with my work projects ( this and this one). But at least i've prepared a TO-DO list for 2012 ;) : 1. VEGA ( Olympia, 1982 ) I have recently got Vega PCB. Special thanks to Mark Frisbee for help. Unfortunately board has few faults ( no sound, gfx glitches ) and inverted colors (like early Nintendo boards). Theres a couple solutions for the latter problem. I have decided to mod the pcb a bit and invert the digital signals before the DAC (made of resistors). Here's a video from attract mode: So, next step is to emulate the game :) 2. TIME ATTACKER ( Shonan, 1980 ) Currently i'm making schematics of video section. It's similar to classic Pong discrete logic, but a bit more complicated (game has Z80 cpu). TA is a breakout clone, with special add-ons like oil zones and moving enemies ( btw : background color - blue or black - is selectable with a jumper on board ): 3. WHEELS & FIRE ( ...

The art of rippping.

New board arrived. " Spinkick " by Seojin/Heasung (notice the big epoxy block with "HEC" logo). PCB is 'almost' working, but there's no way to insert coin(s) and start the game (probably one of the input buffer chips is broken... very common). And yes, it's rip-off of the Sega's "Free Kick" game, running on really weird korean hardware based on MSX2 home computer ( plus additional sound cpu (Z80) and extra logic to handle a bit different (than in MSX2) rom banking ). Game ROMs contains hacked MSX2 bios - they removed all (c) texts, blanked font area and added few mods here and there to skip boot sequence. Also, for some unknown reason, Yamaha v9938 VDP is hidden in big and heavy epoxy block. Probably to make a fake impression of being orginal, not stolen piece of hardware. So .. what's the point of use MSX2 as the base ? I have NO idea... Imho it's way easier to start from scratch and design own, simple hardware (vdp...

Sonic Blast Man.

Few words about an arcade bootleg game called ' Sonic Blast Man 2 Special Turbo '. The game is a slighty modified copy of Taito's 'Sonic Blast Man 2'. It runs on hardware ( custom chinese, not the NSS ) "borrowed" from Super Nintendo home console. Just few eproms, rams, three custom QFP chips (there's also another, odler version of the hw, with 6 of them) and Lattice PLD - to handle the most annoying part, protection. So... What's the point to encrypt/protect pirate game? To hide the 'real' (in fact - stolen ) game code and data? Or maybe to annoy other bootlegers? No idea. Kold666 already dumped the ROMs while ago. Unfortunately the pcb is no longer available for additional testing or analysis. The data encryption is not as simple as in other arcade SNES hacks (Killer Instinct, Final Fight 2). But with great help from Andreas Naive it's finally broken. Also the in-game protection checks are now gone (took me a couple of hours t...