Prev: 5B2F Up: Map Next: 5B8B
5B30: Tape Loader: Game
Loads the game header and the code block it names, and resets the Spectrum if either load fails or the header is not a code file. Called from the loader bytes at 5B10 and 5B18.
Read the game header from tape.
TapeLoader_Game 5B30 LD IX,$5B1E Point IX at the tape header (5B1E), request 11 bytes, and ask the ROM routine to load rather than verify.
5B34 LD DE,$0011
5B37 XOR A
5B38 SCF
5B39 CALL TapeLoader_LoadBytes Call TapeLoader_LoadBytes to load the next tape block.
Give up unless the header loaded.
5B3C LD A,($5B2F) Reset the Spectrum unless the tape load result (5B2F) is 01.
5B3F DEC A
5B40 JP NZ,$0000
The header must describe a code block.
5B43 LD A,($5B1E) Reset the Spectrum unless the header type at 5B1E is 03.
5B46 CP $03
5B48 JP NZ,$0000
Load the game block named by the header.
5B4B LD IX,($5B2B) Take the load address from 5B2B and the length from 5B29, and load that block as data.
5B4F LD DE,($5B29)
5B53 LD A,$FF
5B55 SCF
5B56 CALL TapeLoader_LoadBytes Call TapeLoader_LoadBytes to load the next tape block.
Return to BASIC only if the game block loaded.
5B59 DI Disable interrupts and reset the Spectrum unless the tape load result (5B2F) is 01.
5B5A LD A,($5B2F)
5B5D DEC A
5B5E JP NZ,$0000
5B61 RET Return.
Loads the loading-screen header and then the screen at 4000 and resets the Spectrum if either load fails.
Read a tape header for the loading screen.
TapeLoader_Screen 5B62 LD IX,$5B1E Point IX at the tape header (5B1E), request 11 bytes, and ask the ROM routine to load rather than verify.
5B66 LD DE,$0011
5B69 XOR A
5B6A SCF
5B6B CALL TapeLoader_LoadBytes Call TapeLoader_LoadBytes to load the next tape block.
Give up unless that header loaded.
5B6E LD A,($5B2F) Reset the Spectrum unless the tape load result (5B2F) is 01.
5B71 DEC A
5B72 JP NZ,$0000
Load the picture into the display file.
5B75 LD IX,$4000 Point IX at the screen (4000) and load 1B00 bytes as data.
5B79 LD DE,$1B00
5B7C LD A,$FF
5B7E SCF
5B7F CALL TapeLoader_LoadBytes Call TapeLoader_LoadBytes to load the next tape block.
Return only if the screen loaded.
5B82 DI Disable interrupts and reset the Spectrum unless the tape load result (5B2F) is 01.
5B83 LD A,($5B2F)
5B86 DEC A
5B87 JP NZ,$0000
5B8A RET Return.
Prev: 5B2F Up: Map Next: 5B8B