Wednesday, 2 March 2016

Flippin' sprites

I continue to surprise myself with my progress on the Coco3 port; hope I don't jinx myself now...

I started with a rudimentary sprite rendering routine, and then added v-flip, then h-flip. What's missing is the ability to render at non-byte-aligned pixels. But as-is that's sufficient to render the main menu border and the panel, sun/moon and frame correctly.

Main Menu complete with border sprites
Panel display

 After displaying the panel, the code unfortunately goes into la-la land, otherwise the days should be ticking over as they were before. Haven't had a chance to track it down, but it'll be either a register not saved or a stub routine not terminating properly.

I've decided to tackle this port a little differently from the C port; this time 'round I'm going to complete all the rendering logic - including Z-order - before the bulk of the object handlers. So everything should look perfect as I'm adding objects to the game.

Once I've got the sun animating (needs the blit routines) and the days ticking over again, I'll start on the rendering of the background objects which are already built from the location data. In the process I'll add the non-aligned rendering logic as well. So next screen shot should include an empty room.

I discovered a short-cut this evening when running the game in MESS. After loading the data, which takes a number of seconds even in unthrottled mode, I saved the state of the Coco3 emulation. So now all I need to do is run MESS, press <F7>, <1> and then load the code binary. Shaves a bunch of keystrokes and precious seconds off my development-test cycle!

UPDATE: Wow - the ZX Spectrum listing is about 7K lines of Z80 code; my Coco3 port is just under 2K lines of code, and the number of instructions per routine is roughly the same, if not slightly less on the 6809. That tends to suggest I've coded between 20-25% of the game thus far! That sounds like way too much for a few days work... but I just can't see where my arithmetic is wrong?!?

No comments:

Post a Comment