Speculator Filetypes ==================== Speculator recognises three filetypes: &700 - SpecROM ROM Image &701 - SpecTape Tape file &702 - SpecSnap/SpecProg Full memory snapshot &700 - SpecROM (.ROM) --------------------- &4000 bytes long, loaded into the Spectrum's memory map at &0000 to &3FFF. Loaded with *SpecROM. &701 - SpecTape (.STA) ---------------------- Tape file, identical to the standard .TAP tape file, with two expections: A standard .TAP file is this format: {}... A Speculator tape file is this format: {}... So, for example, the command SAVE "ROM" CODE 0,2 would produce: |------ Spectrum-generated data -------| |---------| .TAP: 13 00 00 03 52 4f 4d 7x20 02 00 00 00 00 80 f1 04 00 ff f3 af a3 SpecTape: 11 00 00 03 52 4f 4d 7x20 02 00 00 00 00 80 02 00 ff f2 af ^^^^^...... first block is 19 bytes in a .TAP file (17 bytes+flag+checksum) but in a SpecTape file it is the actual data length (17 bytes). ^^... flag byte (A reg, 00 for headers, ff for data blocks) ^^ first byte of header, indicating a code block file name ..^^^^^^^^^^^^^ header info ..............^^^^^^^^^^^^^^^^^ checksum of header .........................^^ length of second block ........................^^^^^ flag byte ...........................................^^ first two bytes of rom .................................^^^^^ checksum (checkbittoggle would be a better name!).............^^ A .TAP file can be converted to a SpecTape file by decrementing the length by two, and omitting the checksum byte at the end of each block. Speculator expects SpecTape files to be in a directory called Programs within !Spectrum, and cycles through all recognisable files in this directory. Speculator can be easily patched to make it reference a different directory. The following is for Speculator v1.03, and will make Speculator reference the directory pointed to by . Add a line to the !Boot file containing: Set SpecTape$Path .Programs. or whatever path you wish to use. Alter the following eight words in the Speculator module: Module Offset Values to poke 003148 &63657053, &65706154, &0000003A 003174 &63657053, &65706154, &0000003A 0031E4 &FF000027, &E1A0F00E SpecPatch v1.03 allows Speculator to read standard .TAP files as well as SpecTape files. &702 - SpecSnap (.SSN) (formerly SpecProg) ------------------------------------------ Full memory dump snapshot of the full Spectrum memory, prefixed with 256 bytes of workspace data with holds the register contents and other variables. Loaded with *SpecLoad and saved with *SpecSave. &00-&03 : A register &04-&07 : F register &08-&0B : B register &0C-&0F : C register &10-&13 : D register &14-&17 : E register &18-&1B : H register &1C-&1F : L register &20-&23 : PC register &24-&27 : ARM address of the Spectrum memory of this shapshot - ignored on loading &28-&2B : SP register &2C-&2F : ? &30-&8B : ? &8C : ? &8D : ? &8E : Sound flag - &00=off, <>&00=on &8F : Saved escape flag, to restore on exit &90-&93 : SWI intercept vector? &94-&97 : pseudo-R register - initialised with TIME at startup &98-&9B : ? &9C-&9F : ? &A0 : toggled on interupts &A1-&A3 : ? &A4-&A7 : IM 0, 1 or 2 &A8-&AB : Scandir index for scanning tapefile directory &AC-&AF : Currently open file PTR &B0-&B3 : Currently open tapefile handle &B4-&B7 : Filetype of currently open tape file, &701 or &11D &B8-&BB : Saved ARM SP to restore on exit &BC : &BD : &BE : I &BF : IFF - &00=INTs disabled, <>&00=INTs enabled &C0-&C7 : RGB values of border colours &C8-&CB &CC-&CF &D0-&D3 &D4-&D7 &D8-&DB &DC-&DF &E0-&E7 : Keyboard matrix keypressed bitmap &E8-&EB &EC : A' &ED : F' &EE : &EF : &F0 : B' &F1 : C' &F2 : &F3 : &F4 : D' &F5 : E' &F6 : H' &F7 : L' &F8-&F7 : IX &FC-&FF : IY &100 : Start of 64K memory dump &100FF : End of snapshot, total length=&10100 bytes Where a register occupies more space than the register size, the unused high bytes are zero. For example, offset &00 holds the A register and &01, &02 and &03 hold zero. Loading a snapshot with a register holding an oversized value can have unexpected effects.