Sunday, 1 June 2014

Getting there

Fixed another 3 bugs; 2 in the AI and another in the guard re-spawn routine. In one case I hadn't flipped a BCS/BCC when translating, the other two I didn't realise that SEC, SBC actually performed a subtraction without borrow on the 6502! Why did they invert the Carry flag???

The guard AI is so close now I can't even say for sure that it's not complete and accurate. The game is certainly playable and seemingly just as challenging as the Apple II version.

What is throwing things a little off atm is the speed of the guards. It's telling on the demo screen that the guards do choose the correct path, but lag behind the Apple II somewhat and as a result the demo doesn't play properly. I implemented the guard speed logic in haste the other night so I guess it's time to go back and verify that.

Back to the 4-colour mode; I think I've deduced that it won't be possible to emulate both mono and colour modes with the same tile data. I've not sat down and thought it through properly either way yet, but I'm pretty sure I've reached the right conclusion here. No matter...


  1. Well, you can find out exactly why here:

    I think it saves some gates when constructing the adder since you can simply complement the subtracted part and fire off an add to implement subtract.

    Just another in a long line of electrical engineers making life harder for programmers through their incompetence. Present company excepted, of course. :-)

    There's not some horrible problem where everything moves at 7 pixels/tile in the original but it is 8 pixels/tile in the port?

  2. No, the graphics between the two are pixel-perfect, and everything is calculated in terms of tiles and offsets within tiles anyway. I'm pretty sure it's the guard speed algorithm which I ported late one night without taking too much notice of what I was doing at the time.

  3. Wow! Just fixed the guard speed bug and now the demo runs all the way though all 3 levels! I'm yet to study it in enough detail to confirm that it's identical to the original, but it's a very good sign and means that if it's not perfect, it's very, very close!

    There is another graphics glitch but that shouldn't be too difficult to track down either.