I'm guessing that this little game of mine will mainly appeal to people in Europe (hopefully!), but since I'm part of a C64 group (Arkanix Labs) that is U.S. and therefore NTSC based as well as a U.K. and PAL based group (Cosine Systems), I would feel a little disloyal towards my American cousins if I didn't include compatibility for NTSC systems.
If you don't know anything about NTSC, then do some research possibly by starting here...
Basically, NTSC machines run at 60Hz instead of 50Hz as on PAL. Also, they have fewer display scanlines, 262 versus 312. For my game, this means that my blue top border I wanted for 2 levels and which works nicely under PAL (see diary entry here...), starts waaay too early on NTSC and appears at the bottom of the screen, something like this...
To combat this, I've included an extra IRQ split in the top border. Thus, the first IRQ split colours the background (therefore border area) black to eliminate the blue at the bottom of the screen under NTSC and the second IRQ split, which starts just as a PAL machine begins displaying the visible area of the top display, then colours the background blue.
Miraculously, this seemed to work! Well, in WinVICE at least - I'll have to wait for my NTSC friends to test on real hardware for me and report back to be sure! At present, it now look like this under NTSC in WinVICE...
Adding an additional split did have a knock on effect on some other timings; since the NTSC display has less screen time to execute in it seems, the title screen code was over-running and everything was slow and flickery. A little rearrangement of some of my IRQ code later and all was back up to speed!
The other NTSC issue is the music. Since NTSC machines run slightly quicker, the music was playing too fast and sounded awful. Therefore, I've coded up a timer/counter that skips calling the music driver every few frames thereby slowing it down. Of course, the game needs to know what type of machine it is running on, so I've now included a check at the start of the code to do this.
I've used a modified version of code that was posted on CSDb so thanks to all those involved in that discussion and who shared code, which you can find here...
Next diary entry...


No comments:
Post a Comment