POKES
$adf6 NOP          00          infy health
$8d16 NOP          00               rockets
$8d20 INC (IX+2)   DD 34 02         bullets
$8d2a INC (HL)     34               cartridges


Disk Loading Sequence
=====================
Blocks             Description
------             -----------
001,2,3,5          precursor - not part of game
01                 title screens loader & Digital Reality logo
02,3,4,5,6,7,8     DOOM logo, etc. to Doom SCREEN$
09,10              main program loader & code
T1                 SCREEN$
T2,3,4,5,6         errmmm ...
T7                 more code
T8,9               top 1/3 logo screen & attributes
TA                 new game data
X1,3               load/save game data
X2                 EXIT code
X4,5               top 2/3 keys screen & attributes


Tape Loading Sequence
=====================
dlp1               Doom loader part 1 (BASIC)
dc2                Doom loader part 1 (CODE), comprising:
                     bak2bas: return to BASIC temporarily
                     retfbas: return to Doom loader
                     bypass:  to bypass disk reads
                     copcod:  copy code from block09:$c030 into line 15 REM at $5d40
                              (also done by disk loader, although that uses line 0)
                     put:     save system data for BASIC
                     get:     retrieve system data for BASIC
                     reset:   clears screen & page 7 (copied from Doom loader)
                     xfiles:  RAM backup parameters table
01,2,3,4,5,6,7,8
dlp2               Doom loader part 2 (BASIC)
dc2                Doom loader part 1 (CODE)
dc3                Doom loader part 2 (CODE), comprising:
                     swapit:  copy a code/data block from backup to active location
                     savex:   find xfiles entry & copy block to active location
dc4                Doom loader part 3 (CODE), comprising:
                     get_t7:  recover block T7 & enter tape patches
                     pats:    save to tape patch
                     patl:    load from tape patch
09 : USR copcod : 10
T1,2,3,4,5,6,7 : USR 30553 (Block 10:$7759)
USR bak2bas : X1,2,3,4,5
T8,9,A : USR retfbas


Code Map
========
BASIC      $5ccb-$60af
dc2 m/c   ($5ced-$5e3d)
?          $60b0-$61ff  (336 bytes)
Block 10   $6200-$b2ff
  Block X1     $6640-$673f
  Block X2     $6800-$6aff
dc3 m/c    $b300-$b38f
workspace  $b390-$b54f  (192 bytes + 256 bytes)
dc4 m/c    $b550-$b5d9
?          $b5da-$b67f  (166 bytes)
Block T7   $b680-$be7f
?          $be80-$bfff  (384 bytes)


Before: $1e6d; After: $1eab (TR-DOS ROM)
===========================

 HL    DE    B     A
5d25  0008  01    $00
5d25  0000  01    $00
5d25  0000  01    $00
5e3c  0100  00    $00
5d25  0100  01    $00

On a Pentagon 128 with TR-DOS v6.04, after LOAD "boot", the disk byte INI
loop is at $3fec, ending with a RETM to $3f31, a suitable precursor break
point to a data block read seems to be $3d14 (15636), which gives these
values when loading Doom v1.5b:

Before: $3d14; After: $1eab (TR-DOS ROM)
===========================

start tr/se  #se  page   size         BIN
 HL    DE    B     A(=$7ffd paging byte)
61a8  0101  2b    $10   11008 bytes    01
  then Digital Reality logo displayed
c000  030c  11    $17    4352          02
c000  040d  0f    $16    3840          03
c000  050c  03    $14     768          04
c000  050f  09    $13    2304          05
c000  0608  0f    $11    3840          06
c000  0707  14    $10    5120          07
61a8  080b  2f    $10   12032          08

        LD BC, $7FFD : LD A, $17 : OUT (C), A : CALL $C000 : CALL $5DD4
        LD BC, $7FFD : LD A, $10 : OUT (C), A : CALL $61A8

  then DOOM logo, etc. to Doom SCREEN$ displayed

c000   0b0a    01 $10     256          09

  $5dcb LD HL, $15C9 : LD ($5CC3), HL : JP $C000
  ...
  $c01f CALL $3D13               ; loads next block and JPs to it

6200   0b0b    51 $10   20736          10   $6200-$b2ff

then "turbo" files


***********************************************************************
Block T7 is loaded with page 7 after key '0' in game, page 6 otherwise.
***********************************************************************


Before: $624f; After: $62a1 (Block.10)
===========================

start tr/se  #se  page   size
 HL     DE      B  A
   $7777 (30583) CALL $ACBC   (up to)
4000   100c    1b  15    6912 ($5b00)  T1  (saved from 32768)
   RET -> $622B ... RET -> $ACE7 ... $ACF2 CALL NZ,$006F
c000   1207    18  10    6144 ($d800)  T2	then $5b00:LDDR $16eb bytes $c0f0-$d7db to $e914-$ffff }
c000   130f    24  11    9216 ($e400)  T3	          "     $22d0   "   $c0f0-$e3c0 to $dd2f-$ffff }
c000   1603    37  13   14080 ($f700)  T4	          "     $35c8   "   $c0f0-$f6b8 to $ca37-$ffff } back to $c000
c000   190a    20  14    8192 ($e000)  T5	          "     $1edd   "   $c0f0-$dfcd to $e122-$ffff }
c000   1b0a    23  16    8960 ($e300)  T6	          "     $2131   "   $c0f0-$e221 to $dece-$ffff }
   $AD00 ... RET $777A ... CALL $6203 ... CALL $5D40 ... JP $6227
b680   1d0d    08  16    2048 ($be80)  T7   $b680-$be7f
4000   2103    08  16    2048 ($4800)  T8  (saved from 32768)
5800   210b    01  16     256 ($5900)  T9
   RET -> $622B ... RET -> $BB5A RET -> $B6DC (46812) page 6
   ... $A5C6 CALL $006F


then the main menu is loaded
New Game : select difficulty
c000   1e05    1c  17    7168 ($dc00)  TA
then the first level loads

Load Game :
6640   2308    01  7      256  (26176) X1 *at b7dc & b81c       $6640-$673f  data
c000   210c    1c  7     7168   (l2)   X3

Save Game :
c000   210c    1c  7     7168   (l2)   X3
6640   2308    01  7      256  (26176) X1 *at b7dc & b81c       $6640-$673f  data

'0' from game:
start tr/se  #se  page   size
 HL     DE      B  A
b680   1d0d    08  7     2048          T7
4000   2103    08  6     2048          T8  (saved from 32768)
5800   210b    01  6      256          T9

EXIT
6800   2309    03  7      768  (26624) X2 *at 63ab              $6800-$6aff  data

Options : Screen Mode

Options : Controls : View Controls
4000   2001    10  6     4096   (l0)   X4  (saved from 32768)
5800   2101    02  6      512  (22528) X5
Options : Controls : Standard I / Standard II / Redefine
after
b680   1d0d    01  6      256          T7 at 6213 (1st sector only)
4000   2001    10  6     4096          X4  (saved from 32768)
5800   2101    02  6      512          X5

Options : Colours (no effect - just returns to menu or game)
4000   2103    08  6     2048          T8  (saved from 32768)
5800   210b    01  6      256          T9
'0' to cancel any menu does the same
as does return to previous menu



To get the first ten regular files I put in a pre-load break at $3d14 to
check the registers as you explained and then a post-load break at $1eab to
save each file as a BIN.

"The turbo loading files are no different than the standard files but the
tr-dos jump to 15663 ($3d2f) is classed as turbo loading rather than comparing it
to the standard 15635 ($3d13) loaders."



4000   100c    1b  15    6912 load     T1  (saved from 32768)   full screen+attribs
4000   2001    10  6     4096   (l0)   X4 *(saved from 32768) + top 2/3 screen
4000   2103    08  16    2048 load     T8 *(saved from 32768) + top 1/3 screen
5800   2101    02  6      512  (22528) X5 *                   + top 2/3 attribs
5800   210b    01  16     256 load     T9 *                   + top 1/3 attribs
6200   0b0b    51 $10   20736          10                       $6200-$b2ff  code+data
6640   2308    01  7      256  (26176) X1 *at b7dc & b81c     + $6640-$673f  data
6800   2309    03  7      768  (26624) X2 *at 63ab            + $6800-$6aff  data
b680   1d0d    08  16/7  2048 load     T7 *                     $b680-$be7f  code

c000   1207    18  10    6144 load     T2
c000   130f    24  11    9216 load     T3
c000   1603    37  13   14080 load     T4
c000   190a    20  14    8192 load     T5
c000   1b0a    23  16    8960 load     T6
c000   1e05    1c  17    7168   (l2)   TA                       level data
c000   210c    1c  7     7168   (l2)   X3 *                   + level data $c000-$dc00
c000   0b0a    01 $10     256          09

page 7 - proposed backup locations (proved to be unsuitable)
c000   1e05    1c  17    7168   (l2)   TA   CONFLICT!> page 7 + $c000-$dbff  new game
c000   210c    1c  17    7168   (l2)   X3 * CONFLICT!> page 7 + $c000-$dbff  load/save game
4000   2001    10  16    4096   (l0)   X4 *(saved from 32768) + $dc00-$ebff  top 2/3 keys screen
4000   2103    08  16    2048 load     T8 *(saved from 32768) + $ec00-$f3ff  top 1/3 logo screen
5800   2101    02  16     512  (22528) X5 *                   + $f400-$f5ff  top 2/3 keys attribs
5800   210b    01  16     256 load     T9 *                   + $f600-$f6ff  top 1/3 logo attribs
6640   2308    01  17     256  (26176) X1 *at b7dc & b81c     + $f700-$f7ff  load/save data
6800   2309    03  17     768  (26624) X2 *at 63ab            + $f800-$faff  EXIT data
----
b680   1d0d    08  16/7  2048 load     T7 *                     $b680-$be7f  code

