Saga20101205

= 05/12/2010: Play Through! = Unfortunately a lack of time left me little chance to work on the engine so I've only have a few minor additions. What I have done is to add support for:
 * Light and dark rooms
 * Continued actions
 * Fixing several bugs, including a nasty one where flag 8 wouldn't set

The light and dark routines I was dreading as I wasn't 100% certain of how they would work, from examine of ScottFree and the games themselves, then the logic for saying whether a room is dark is:
 * If the dark flag (flag 15) is set
 * If object 9 (lit lamp) is not in the room
 * If object 9 (lit lamp) is not in the inventory
 * Light length is not 0

Fortunately as I'd written all the condition codes as miniature functions, so all the final code is: .isdark {              ldx #15           ; dark bit jsr flagset bne quit ; now check for a light ldx #9           ; object 9 - lit lamp lda objectlocs,x jsr itemcarriedroom ; swap over z flags states bne setzero ; Check whether it has fuel lda lighttime beq quit .setzero   lda #0 .quit        rts }

The darkness status is checked at several places:
 * When the room details are displayed
 * If a move is made
 * If an object is got

For most of these it will print a "Too dark to see message", the only difference is when a move is made, then if the move is successful the move will be made and a message printed "Dangerous to move in the dark!", if the move fails, then the message "I fell down and broke my neck" is displayed and the player is killed. This boils down to a simple jsr isdark and a beq to print the message if necessary.

The end result is that I have managed to play through The Golden Baton from start to finish successfully. Of course I haven't checked whether every condition has worked and I need to spend time on edge conditions (oh fun, oh joy).

My current bug list stands at:
 * No "Don't understand if nothing actioned"
 * LOOK over-ride
 * Code needs tuning and reducing
 * Unimplemented:
 * put item
 * print counter
 * swaploc1
 * sel counter
 * quit
 * load
 * Fighting Fantasy combat mode

Most of these only affect specific games (The Sorcerer of Claymorgue Castle and Seas of Blood) or are relatively easy. So I think I can put the interpreter on one side for a bit and attempt to do some graphics work!

For those interested, the code size now stands at &B8E bytes, of these &95b is actual code; the other bytes are the system messages and the OSWORD/OSFILE definition templates.