How to remake games - routines that work with tape.

47th Byte #01
╔════════════════════════════════════════════════════╗
    ║                                                    ║
    ║ ░                ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒  ║
    ║ ░  █    █ ▀▀▀▀▀▄                                ▒  ║
    ║ ░  █    █      █  ▓   ▓      ▓         ▓        ▒  ║
    ║ ░  █    █      █  ▓▓▓ ▓▓▓    ▓▓▓  ▓  ▓ ▓▓▓  ▓▓  ▒  ║
    ║ ░   ▀▀▀▀▄      █  ▓   ▓  ▓   ▓  ▓ ▓  ▓ ▓   ▓  ▓ ▒  ║
    ║ ░       █      █  ▓   ▓  ▓   ▓  ▓ ▓  ▓ ▓   ▓▓▓  ▒  ║
    ║ ░       █      █   ▓▓ ▓  ▓   ▓▓▓   ▓▓▓  ▓▓ ▓    ▒  ║
    ║ ░                                    ▓      ▓▓  ▒  ║
    ║ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░  ▓▓           ▒  ║
    ║                                                    ║
    ╚════════════════════════════════════════════════════╝



                    * СПЕЦИАЛЬНЫЙ ВЫПУСК *



          К А К   П Е Р Е Д Е Л Ы В А Т Ь   И Г Р Ы


                         ЧАСТЬ ПЕРВАЯ.

           1. ПОДПРОГРАММЫ, РАБОТАЮЩИЕ С ЛЕНТОЙ.

 1.1 Загрузка.

    Программа загрузки блока кодов с магнитофона может иметь
приблизительно такой вид:

            ...
  LOADER  LD IX,HEAD ; В IX-адрес загрузки
          LD DE,#11  ; В DE-длина заголовка
          XOR A      ; В А-0 для заголовка и #FF для тела файла
          SCF        ; Установка CARRY-флага
          CALL #0556 ; Вызов подпрограммы ПЗУ ,осуществляющей
                     ; загрузку блока кодов.
          JPNC,NNNN ; Go to NNNN address in case of error.
          CALL NNNN; There may be a call to a subroutine that
                     ; Raya checks the newly downloaded
                     ; file heads.
         ; If codes are shipped without a header, then this block can be
         ; may not be.
         ;-------------------------------------------------------
          LD IX,START; (*) Starting address.
          LD DE,LENG ; (*) Length.
          LD A,#FF ;
          SCF ;   Loading body
          CALL #0556 ;      file
          JP NC,NNNN ;
            ..... ;
          RET ;
                     ; The stars (*) mark the hell we need.
                     ; Res of placement of the saved block.
                     ; They need to be remembered.

  Routine #0556 is interrupted when BREAK is pressed. For pre-
To prevent this, change the procedure call program:

  LOAD_C LD IX,START; Length and address are transmitted in the same way.
          LD DE,LENG ;
          LD A,NN ;
          SCF ;
          INC D ;
          EX AF,AF' ;
          DEC D ;
          DI;
          LD A,15;
          OUT(254),A;
          CALL #0561 ;
          LD A,7;
          OUT(254),A;
          EI;
          RET ;


 This procedure is usually written as a subroutine:

          LD IX,START
          LD DE,LENG
          LD A,FLAGCALL LOAD_C
           ......


 1.2 Recording.

  The recording routine looks like this:


  SAVE LD IX,HEAD ; The parameters are the same as in LOADER.
          LD DE,#11 ;
          LD A,0 ;
          CALL #04C2 ;
          LD IX,START;
          LD DE,LENG ;
          LD A,#FF ;
          CALL #04C2 ;
          RET ;


 If you replace CALL #04C2 with CALL #04C6, there will be no interruption
by BREAK.

Share your thoughts about the article