The Machine Pack


&BD13MC BOOT PROGRAM
ActionLoads a program into RAM and then executes it
EntryHL contains the address of the routine which is used to load the program
ExitControl is handed over to the program and so the routine is not returned from
NotesAll events, sounds and interrupts are turned off, the firmware indirections are returned to their default settings, and the stack is reset; the routine to run the program should be in the central block of memory, and should obey the following exit conditions:
if the program was loaded successfully, then Carry is true, and HL contains the prograrn entry point; if the program failed to load, then Carry is false, and HL is corrupt; in either case, A, BC, DE, IX, IY and the other flags are all corrupt Should the program fail to load, control is returned to the previous foreground program
&BD16MC START PROGRAM
ActionRuns a foreground program
EntryHL contains the entry point for the program, and C contains the ROM selection number
ExitControl is handed over to the prograrn and so the routine is not returned from
&BD19MC WAIT FLYBACK
ActionWaits until a frame flyback occurs
EntryNo entry conditions
ExitAll registers are preserved
NotesWhen the frame flyback occurs the screen is not being written to and so the screen c~n be manipulated during this period without any flickering or ghosting on the screen
&BD1CMC SET MODE
ActionSets the screen mode
EntryA contains the required mode
ExitAF is corrupt, and all other registers are preserved
NotesAlthough this routine changes the screen mode it does not inform the routines which write to the screen that the mode has been changed; therefore these routines will write to the screen as if the mode had not been changed; however as the hardware is now interpreting these signals differently, unusual effects may occur
&BD1FMC SCREEN OFFSET
ActionSets the screen offset
EntryA contains the screen base, and HL contains the screen offset
ExitAF is corrupt, and all other registers are preserved
NotesAs with MC SET MODE, this routine changes the hardware setting without telling the routines that write to the screen; therefore these routines may cause unpredictable effects if called; the default screen base is &C0
&BD22MC CLEAR INKS
ActionSets all the PENs and the border to one colour, so making it seem as if the screen has been cleared
EntryDE contains the address of the ink vector
ExitAF is corrupt, and all other registers are preserved
NotesThe ink vector takes the following form:
byte 0 - holds the colour for the border
byte 1 - holds the colour for all of the PENs
The values for the colours are all given as hardware values
&BD25MC SET INKS
ActionSets the colours of all the PENs and the border
EntryDE contains the address of the ink vector
ExitAF is corrupt, and all other registers are preserved
NotesThe ink vector takes the following form:
byte 0 - holds the colour for the border
byte 1 - holds the colour for PEN 0... byte 16 - holds the colour for PEN 15. The values for the colours are all given as hardware values; the routine sets all sixteen PEN's
&BD28MC RESET PRINTER
ActionSets the MC WAIT PRINTER indirection to its original routine
EntryNo entry conditions
ExitAF, BC, DE and HL are corrupt, and all others are preserved
&BD2BMC PRINT CHAR
ActionSends a character to the printer and detects if it is busy for too long (more than 0.4 seconds)
EntryA contains the character to be printed - only characters upto ASCII 127 can be printed
ExitIf the character was sent properly, then Carry is true; if the printer was busy, then Carry is false; in either case, A and the other flags are corrupt, and all other registers are preserved
NotesThis routine uses the MC WAIT PRINTER indirection
&BD2EMC BUSY PRINTER
ActionTests to see if the printer is busy
EntryNo entry conditions
ExitIf the printer is busy, then Carry is true; if the printer is not busy, then Carry is false; in both cases, the other flags are corrupt, and all other registers are preserved
&BD31MC SEND PRINTER
ActionSends a character to the printer, which must not be busy
EntryA contains tlle character to be printed - only characters up to ASCII 127 can be printed
ExitCarry is true, A and the other flags are corrupt, and all other registers are preserved
&BD34MC SOUND REGISTER
ActionSends data to a sound chip register
EntryA contains the register nurnber, and C contains the data to be sent
ExitAF and BC are corrupt, and all other registers are preserved
&BD37JUMP RESTORE
ActionRestores the jumpblock to its default state
EntryNo entry conditions
ExitAF, BC, DE and HL are corrupt, and all other registers are preserved
NotesThis routine does not affect the indirections jumpblock, but restores all entries in the main jumpblock


David Cantrell, March 1996