                             ;
                             ; +-------------------------------------------------------------------------+
                             ; ¦                                                                         ¦
                             ; ¦                             B R E C F 6 4 4                             ¦
                             ; ¦                                                                         ¦
                             ; +--------------------------------------------------------------------wiRe-+
                             ;
                             ; ---------------------------------------------------------------------------
                             ; filename    : brecf644.bin
                             ; format      : binary file
                             ; baseaddress :     h
                             ; range       :     h - 4000h
                             ; length      : 4000h
                             ; processor   : z80 []
                             ; assembler   : Zilog Macro Assembler
                             ; ---------------------------------------------------------------------------
                             ;

                                             include "ports.inc"
                                             include "system.inc"

                                             ; segment type: pure code
                                             segment ROM


0000                         ; ---------------------------------------------------------------------------
0000                         ; ||| entry point (0000h..0003h) ||||||||||||||||||||||||||||||||||||||||||||
0000                         ; ---------------------------------------------------------------------------
0000 C3 00 02                ENTRY:          jp      main
0003 00                                      nop


0004                         ; ---------------------------------------------------------------------------
0004                         ; ||| file header (0004h..007Fh) ||||||||||||||||||||||||||||||||||||||||||||
0004                         ; ---------------------------------------------------------------------------
0004 42                      HEADER:         db      "BRECF644"
000C 30                                      db      30h, 30h, 20h, 04h, 11h, 04h
0012                                         org     0080h


0080                         ; ---------------------------------------------------------------------------
0080                         ; ||| stack (0080h..01FFh) ||||||||||||||||||||||||||||||||||||||||||||||||||
0080                         ; ---------------------------------------------------------------------------
0080                         byte_80:        db  0  ; flags for each detected nand device
0081                         byte_81:        db  0  ; get only written to
0082                         byte_82:        db  0
0083                         byte_83:        db  0
0084                                         db  0,0,0,0
0088                         nand_tbl:       db  6*2 dup(0)   ; 6 possible nand devices, 2 bytes for each

0094                                         define  STACK_SIZE 0180h - 14h
0094 00                      STACK:          db      STACK_SIZE dup(0)




0200                         ; ---------------------------------------------------------------------------
0200                         ; ||| main ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
0200                         ; ---------------------------------------------------------------------------
0200                         main:
0200 31 00 02                                ld      sp, STACK + STACK_SIZE   ;setup stack

0203 DB DF                                   in      a, (POWER_CONTROL_REG)   ;select 200kHz DCOP CLK (75%)
0205 F6 01                                   or      1
0207 D3 DF                                   out     (POWER_CONTROL_REG), a

0209 CD 21 27                                call    sub_2721
020C CD 16 02                                call    sub_216

020F 31 00 04                                ld      sp, 400h                 ;setup larger stack
0212 C3 00 06                                jp      sub_600
0212                         ; ---------------------------------------------------------------------------




0216
0216                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
0216
0216
0216                         sub_216:                                ; CODE XREF: sub_2721-2515p
0216 C5                                      push    bc
0217 D5                                      push    de
0218 DD E5                                   push    ix
021A DD 21 00 00                             ld      ix, 0
021E DD 39                                   add     ix, sp
0220 D5                                      push    de
0221 1E 00                                   ld      e, 0
0223 CD D7 03                                call    sub_3D7
0226 D1                                      pop     de
0227 CD 3A 02                                call    sub_23A
022A 4F                                      ld      c, a
022B 06 00                                   ld      b, 0
022D 59                                      ld      e, c
022E 50                                      ld      d, b
022F CD D6 03                                call    nullsub_1
0232 79                                      ld      a, c
0233 DD F9                                   ld      sp, ix
0235 DD E1                                   pop     ix
0237 D1                                      pop     de
0238 C1                                      pop     bc
0239 C9                                      ret
0239                         ; End of function sub_216
0239
023A
023A                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
023A
023A
023A                         sub_23A:                                ; CODE XREF: sub_216+11p
023A C5                                      push    bc
023B D5                                      push    de
023C DD E5                                   push    ix
023E DD 21 00 00                             ld      ix, 0
0242 DD 39                                   add     ix, sp
0244 F5                                      push    af
0245 01 00 00                                ld      bc, 0
0248 21 00 02                                ld      hl, 200h
024B 22 7D 03                                ld      (word_37D), hl
024E ED 43 7F 03                             ld      (word_37F), bc
0252 21 85 03                                ld      hl, 385h
0255 22 82 03                                ld      (word_382), hl
0258 3E 08                                   ld      a, 8
025A 32 84 03                                ld      (byte_384), a
025D
025D                         loc_25D:                                ; CODE XREF: sub_23A+136j
025D 01 20 00                                ld      bc, 20h ; ' '
0260 11 7D 03                                ld      de, 37Dh
0263 CD 25 3F                                call    sub_3F25
0266 B7                                      or      a
0267 CA 73 03                                jp      z, loc_373
026A 3A 85 03                                ld      a, (byte_385)
026D B7                                      or      a
026E CA 73 03                                jp      z, loc_373
0271 3A 85 03                                ld      a, (byte_385)
0274 FE 53                                   cp      'S'
0276 C2 64 03                                jp      nz, loc_364
0279 3A 86 03                                ld      a, (byte_386)
027C FE 59                                   cp      'Y'
027E C2 64 03                                jp      nz, loc_364
0281 3A 87 03                                ld      a, (byte_387)
0284 FE 53                                   cp      'S'
0286 C2 64 03                                jp      nz, loc_364
0289 3A 88 03                                ld      a, (byte_388)
028C FE 43                                   cp      'C'
028E C2 64 03                                jp      nz, loc_364
0291 3A 89 03                                ld      a, (byte_389)
0294 FE 46                                   cp      'F'
0296 C2 64 03                                jp      nz, loc_364
0299 3A 8A 03                                ld      a, (byte_38A)
029C FE 47                                   cp      'G'
029E C2 64 03                                jp      nz, loc_364
02A1 3A 8B 03                                ld      a, (byte_38B)
02A4 FE 20                                   cp      ' '
02A6 C2 64 03                                jp      nz, loc_364
02A9 3A 8C 03                                ld      a, (byte_38C)
02AC FE 20                                   cp      ' '
02AE C2 64 03                                jp      nz, loc_364
02B1 3A 8D 03                                ld      a, (byte_38D)
02B4 FE 53                                   cp      'S'
02B6 C2 64 03                                jp      nz, loc_364
02B9 3A 8E 03                                ld      a, (byte_38E)
02BC FE 59                                   cp      'Y'
02BE C2 64 03                                jp      nz, loc_364
02C1 3A 8F 03                                ld      a, (byte_38F)
02C4 FE 53                                   cp      'S'
02C6 C2 64 03                                jp      nz, loc_364
02C9 21 95 03                                ld      hl, 395h
02CC 5E                                      ld      e, (hl)
02CD 23                                      inc     hl
02CE 56                                      ld      d, (hl)
02CF 23                                      inc     hl
02D0 4E                                      ld      c, (hl)
02D1 23                                      inc     hl
02D2 46                                      ld      b, (hl)
02D3 EB                                      ex      de, hl
02D4 3E 09                                   ld      a, 9
02D6 CD A5 03                                call    sub_3A5
02D9 22 7D 03                                ld      (word_37D), hl
02DC ED 43 7F 03                             ld      (word_37F), bc
02E0 21 00 06                                ld      hl, 600h
02E3 22 82 03                                ld      (word_382), hl
02E6 3E 08                                   ld      a, 8
02E8 32 84 03                                ld      (byte_384), a
02EB AF                                      xor     a
02EC DD 77 FE                                ld      (ix+0FEh), a
02EF DD 77 FF                                ld      (ix+0FFh), a
02F2
02F2                         loc_2F2:                                ; CODE XREF: sub_23A+EFj
02F2                                                                 ; sub_23A+F4j
02F2 01 16 80                                ld      bc, 8016h
02F5 DD 6E FE                                ld      l, (ix+0FEh)
02F8 DD 66 FF                                ld      h, (ix+0FFh)
02FB 3E 80                                   ld      a, 80h ; 'Ç'
02FD AC                                      xor     h
02FE 67                                      ld      h, a
02FF ED 42                                   sbc     hl, bc
0301 30 2D                                   jr      nc, loc_330
0303 01 00 02                                ld      bc, 200h
0306 11 7D 03                                ld      de, 37Dh
0309 CD 25 3F                                call    sub_3F25
030C B7                                      or      a
030D 20 03                                   jr      nz, loc_312
030F AF                                      xor     a
0310 18 62                                   jr      loc_374
0312                         ; ---------------------------------------------------------------------------
0312
0312                         loc_312:                                ; CODE XREF: sub_23A+D3j
0312 21 82 03                                ld      hl, 382h
0315 3E 02                                   ld      a, 2
0317 23                                      inc     hl
0318 86                                      add     a, (hl)
0319 77                                      ld      (hl), a
031A 21 7D 03                                ld      hl, 37Dh
031D 01 00 00                                ld      bc, 0
0320 11 00 02                                ld      de, 200h
0323 CD BD 03                                call    sub_3BD
0326 DD 34 FE                                inc     (ix+0FEh)
0329 20 C7                                   jr      nz, loc_2F2
032B DD 34 FF                                inc     (ix+0FFh)
032E 18 C2                                   jr      loc_2F2
0330                         ; ---------------------------------------------------------------------------
0330
0330                         loc_330:                                ; CODE XREF: sub_23A+C7j
0330 01 00 01                                ld      bc, 100h
0333 11 7D 03                                ld      de, 37Dh
0336 CD 25 3F                                call    sub_3F25
0339 B7                                      or      a
033A 20 03                                   jr      nz, loc_33F
033C AF                                      xor     a
033D 18 35                                   jr      loc_374
033F                         ; ---------------------------------------------------------------------------
033F
033F                         loc_33F:                                ; CODE XREF: sub_23A+100j
033F 21 7D 03                                ld      hl, 37Dh
0342 01 00 00                                ld      bc, 0
0345 11 00 0B                                ld      de, 0B00h
0348 CD BD 03                                call    sub_3BD
034B 21 00 00                                ld      hl, 0
034E 22 82 03                                ld      (word_382), hl
0351 01 80 00                                ld      bc, 80h
0354 11 7D 03                                ld      de, 37Dh
0357 CD 25 3F                                call    sub_3F25
035A B7                                      or      a
035B 20 03                                   jr      nz, loc_360
035D AF                                      xor     a
035E 18 14                                   jr      loc_374
0360                         ; ---------------------------------------------------------------------------
0360
0360                         loc_360:                                ; CODE XREF: sub_23A+121j
0360 3E 01                                   ld      a, 1
0362 18 10                                   jr      loc_374
0364                         ; ---------------------------------------------------------------------------
0364
0364                         loc_364:                                ; CODE XREF: sub_23A+3Cj
0364                                                                 ; sub_23A+44j ...
0364 21 7D 03                                ld      hl, 37Dh
0367 01 00 00                                ld      bc, 0
036A 11 20 00                                ld      de, 20h ; ' '
036D CD BD 03                                call    sub_3BD
0370 C3 5D 02                                jp      loc_25D
0373                         ; ---------------------------------------------------------------------------
0373
0373                         loc_373:                                ; CODE XREF: sub_23A+2Dj
0373                                                                 ; sub_23A+34j
0373 AF                                      xor     a
0374
0374                         loc_374:                                ; CODE XREF: sub_23A+D6j
0374                                                                 ; sub_23A+103j ...
0374 DD F9                                   ld      sp, ix
0376 DD E1                                   pop     ix
0378 D1                                      pop     de
0379 C1                                      pop     bc
037A C9                                      ret
037A                         ; End of function sub_23A



037A
037A                         ; ---------------------------------------------------------------------------
037B 00                                      db    0,0

037D 76 76                   word_37D:       dw ?
037F 76 76                   word_37F:       dw ?
0381 76                                      db ?
0382 76 76                   word_382:       dw ?
0384 76                      byte_384:       db ?
0385 76                      byte_385:       db ?
0386 76                      byte_386:       db ?
0387 76                      byte_387:       db ?
0388 76                      byte_388:       db ?
0389 76                      byte_389:       db ?
038A 76                      byte_38A:       db ?
038B 76                      byte_38B:       db ?
038C 76                      byte_38C:       db ?
038D 76                      byte_38D:       db ?
038E 76                      byte_38E:       db ?
038F 76                      byte_38F:       db ?
0390 76                                      db  21 dup(?)



03A5                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
03A5
03A5
03A5                         sub_3A5:                                ; CODE XREF: sub_23A+9Cp
03A5 B7                                      or      a
03A6
03A6                         loc_3A6:                                ; CODE XREF: sub_3A5+Dj
03A6 C8                                      ret     z
03A7 FE 08                                   cp      8
03A9 38 09                                   jr      c, loc_3B4
03AB 41                                      ld      b, c
03AC 4C                                      ld      c, h
03AD 65                                      ld      h, l
03AE 2E 00                                   ld      l, 0
03B0 D6 08                                   sub     8
03B2 18 F2                                   jr      loc_3A6
03B4                         ; ---------------------------------------------------------------------------
03B4
03B4                         loc_3B4:                                ; CODE XREF: sub_3A5+4j
03B4                                                                 ; sub_3A5+15j
03B4 29                                      add     hl, hl
03B5 CB 11                                   rl      c
03B7 CB 10                                   rl      b
03B9 3D                                      dec     a
03BA 20 F8                                   jr      nz, loc_3B4
03BC C9                                      ret
03BC                         ; End of function sub_3A5
03BC
03BD
03BD                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
03BD
03BD
03BD                         sub_3BD:                                ; CODE XREF: sub_23A+E9p
03BD                                                                 ; sub_23A+10Ep ...
03BD F5                                      push    af
03BE 7E                                      ld      a, (hl)
03BF 83                                      add     a, e
03C0 77                                      ld      (hl), a
03C1 5F                                      ld      e, a
03C2 23                                      inc     hl
03C3 7E                                      ld      a, (hl)
03C4 8A                                      adc     a, d
03C5 77                                      ld      (hl), a
03C6 57                                      ld      d, a
03C7 23                                      inc     hl
03C8 7E                                      ld      a, (hl)
03C9 89                                      adc     a, c
03CA 77                                      ld      (hl), a
03CB 4F                                      ld      c, a
03CC 23                                      inc     hl
03CD 7E                                      ld      a, (hl)
03CE 88                                      adc     a, b
03CF 77                                      ld      (hl), a
03D0 47                                      ld      b, a
03D1 2B                                      dec     hl
03D2 2B                                      dec     hl
03D3 2B                                      dec     hl
03D4 F1                                      pop     af
03D5 C9                                      ret
03D5                         ; End of function sub_3BD
03D5
03D6                         nullsub_1:      ret
03D7
03D7                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
03D7
03D7
03D7                         sub_3D7:                                ; CODE XREF: sub_216+Dp
03D7 06 01                                   ld      b, 1
03D9 CD 2A 3F                                call    nand_init
03DC 21 FA 07                                ld      hl, 7FAh
03DF 22 80 3A                                ld      (word_3A80), hl
03E2 21 07 00                                ld      hl, 7
03E5 22 82 3A                                ld      (word_3A82), hl
03E8 2E 00                                   ld      l, 0
03EA 22 84 3A                                ld      (word_3A84), hl
03ED 26 01                                   ld      h, 1
03EF 22 86 3A                                ld      (word_3A86), hl
03F2 21 80 3A                                ld      hl, 3A80h
03F5 CD D0 3E                                call    sub_3ED0
03F8 AF                                      xor     a
03F9 06 06                                   ld      b, 6
03FB
03FB                         loc_3FB:                                ; CODE XREF: sub_3D7+27j
03FB 29                                      add     hl, hl
03FC CE 00                                   adc     a, 0
03FE 10 FB                                   djnz    loc_3FB
0400 11 20 00                                ld      de, 20h ; ' '
0403 19                                      add     hl, de
0404 22 8A 3A                                ld      (word_3A8A), hl
0407 32 8C 3A                                ld      (byte_3A8C), a
040A CD 4E 3F                                call    nand_deinit
040D 3E 01                                   ld      a, 1
040F C9                                      ret
040F                         ; End of function sub_3D7
040F
040F                         ; ---------------------------------------------------------------------------




0410 76                                      org 0600h
0600
0600                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
0600
0600
0600                         sub_600:                                ; CODE XREF: sub_2721-250Fj
0600                                                                 ; sub_2721+1Ap
0600 00                                      nop
0601 06 00                                   ld      b, 0
0603 CD BA 29                                call    sub_29BA
0606
0606                         loc_606:                                ; CODE XREF: sub_600+58j
0606                                                                 ; sub_600+6Aj
0606 11 00 00                                ld      de, 0
0609 CD AB 06                                call    sub_6AB
060C A7                                      and     a
060D 20 33                                   jr      nz, loc_642
060F 2A ED 1A                                ld      hl, (word_1AED)
0612 22 F1 1A                                ld      (word_1AF1), hl
0615 2A EF 1A                                ld      hl, (word_1AEF)
0618 22 F3 1A                                ld      (word_1AF3), hl
061B 11 00 18                                ld      de, 1800h
061E CD AB 06                                call    sub_6AB
0621 A7                                      and     a
0622 20 37                                   jr      nz, loc_65B
0624 2A F1 1A                                ld      hl, (word_1AF1)
0627 ED 5B ED 1A                             ld      de, (word_1AED)
062B AF                                      xor     a
062C ED 52                                   sbc     hl, de
062E 7D                                      ld      a, l
062F B4                                      or      h
0630 20 29                                   jr      nz, loc_65B
0632 2A F3 1A                                ld      hl, (word_1AF3)
0635 ED 5B EF 1A                             ld      de, (word_1AEF)
0639 AF                                      xor     a
063A ED 52                                   sbc     hl, de
063C 7D                                      ld      a, l
063D B4                                      or      h
063E 20 1B                                   jr      nz, loc_65B
0640 18 2B                                   jr      loc_66D
0642                         ; ---------------------------------------------------------------------------
0642
0642                         loc_642:                                ; CODE XREF: sub_600+Dj
0642 11 00 18                                ld      de, 1800h
0645 CD AB 06                                call    sub_6AB
0648 A7                                      and     a
0649 C2 6D 06                                jp      nz, loc_66D
064C 21 00 18                                ld      hl, 1800h
064F 11 00 00                                ld      de, 0
0652 01 00 18                                ld      bc, 1800h
0655 CD AF 08                                call    sub_8AF
0658 C3 06 06                                jp      loc_606
065B                         ; ---------------------------------------------------------------------------
065B
065B                         loc_65B:                                ; CODE XREF: sub_600+22j
065B                                                                 ; sub_600+30j ...
065B CD 73 06                                call    sub_673
065E 21 00 00                                ld      hl, 0
0661 11 00 18                                ld      de, 1800h
0664 01 00 18                                ld      bc, 1800h
0667 CD AF 08                                call    sub_8AF
066A C3 06 06                                jp      loc_606
066D                         ; ---------------------------------------------------------------------------
066D
066D                         loc_66D:                                ; CODE XREF: sub_600+40j
066D                                                                 ; sub_600+49j
066D F5                                      push    af
066E CD 1F 29                                call    sub_291F
0671 F1                                      pop     af
0672 C9                                      ret
0672                         ; End of function sub_600
0672
0673
0673                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
0673
0673
0673                         sub_673:                                ; CODE XREF: sub_600:loc_65Bp
0673 3E FF                                   ld      a, 0FFh
0675 06 00                                   ld      b, 0
0677 21 F5 1A                                ld      hl, 1AF5h
067A
067A                         loc_67A:                                ; CODE XREF: sub_673+Bj
067A 77                                      ld      (hl), a
067B 23                                      inc     hl
067C 77                                      ld      (hl), a
067D 23                                      inc     hl
067E 10 FA                                   djnz    loc_67A
0680 21 00 30                                ld      hl, 3000h
0683 22 F9 1E                                ld      (word_1EF9), hl
0686 21 00 00                                ld      hl, 0
0689 22 FB 1E                                ld      (word_1EFB), hl
068C 21 F5 1A                                ld      hl, 1AF5h
068F 22 FE 1E                                ld      (word_1EFE), hl
0692 3E 08                                   ld      a, 8
0694 32 00 1F                                ld      (byte_1F00), a
0697 06 80                                   ld      b, 80h ; 'Ç'
0699
0699                         loc_699:                                ; CODE XREF: sub_673+35j
0699 C5                                      push    bc
069A 11 F9 1E                                ld      de, 1EF9h
069D CD 6C 2B                                call    sub_2B6C
06A0 2A F9 1E                                ld      hl, (word_1EF9)
06A3 23                                      inc     hl
06A4 22 F9 1E                                ld      (word_1EF9), hl
06A7 C1                                      pop     bc
06A8 10 EF                                   djnz    loc_699
06AA C9                                      ret
06AA                         ; End of function sub_673
06AA
06AB
06AB                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
06AB
06AB
06AB                         sub_6AB:                                ; CODE XREF: sub_600+9p
06AB                                                                 ; sub_600+1Ep ...
06AB ED 53 EB 1A                             ld      (word_1AEB), de
06AF 21 00 00                                ld      hl, 0
06B2 22 01 1F                                ld      (word_1F01), hl
06B5 22 03 1F                                ld      (word_1F03), hl
06B8 21 F5 1C                                ld      hl, 1CF5h
06BB 22 06 1F                                ld      (word_1F06), hl
06BE 3E 08                                   ld      a, 8
06C0 32 08 1F                                ld      (byte_1F08), a
06C3 11 01 1F                                ld      de, 1F01h
06C6 CD F5 2A                                call    sub_2AF5
06C9 2A F9 1C                                ld      hl, (word_1CF9)
06CC 22 ED 1A                                ld      (word_1AED), hl
06CF 2A FB 1C                                ld      hl, (word_1CFB)
06D2 22 EF 1A                                ld      (word_1AEF), hl
06D5 3A F5 1C                                ld      a, (byte_1CF5)
06D8 FE 55                                   cp      55h                            ; compare header of firmware image (fwi)
06DA C2 EF 07                                jp      nz, loc_7EF
06DD 3A F6 1C                                ld      a, (byte_1CF6)
06E0 FE AA                                   cp      0AAh                           ;...
06E2 C2 EF 07                                jp      nz, loc_7EF
06E5 3A F7 1C                                ld      a, (byte_1CF7)
06E8 FE F0                                   cp      0F0h                           ;...
06EA C2 EF 07                                jp      nz, loc_7EF
06ED 3A F8 1C                                ld      a, (byte_1CF8)
06F0 FE 0F                                   cp      0Fh                            ;...
06F2 C2 EF 07                                jp      nz, loc_7EF

06F5 DD 21 F5 1C                             ld      ix, 1CF5h                      ;found correct fwi header!
06F9 21 00 00                                ld      hl, 0
06FC 3E FF                                   ld      a, 0FFh
06FE
06FE                         loc_6FE:                                ; CODE XREF: sub_6AB+5Fj
06FE DD 5E 00                                ld      e, (ix+0)
0701 DD 23                                   inc     ix
0703 DD 56 00                                ld      d, (ix+0)
0706 DD 23                                   inc     ix
0708 19                                      add     hl, de
0709 3D                                      dec     a
070A 20 F2                                   jr      nz, loc_6FE
070C DD 5E 00                                ld      e, (ix+0)
070F DD 56 01                                ld      d, (ix+1)
0712 AF                                      xor     a
0713 ED 52                                   sbc     hl, de
0715 7D                                      ld      a, l
0716 B4                                      or      h
0717 C2 EF 07                                jp      nz, loc_7EF
071A 2A 05 1D                                ld      hl, (word_1D05)
071D 22 F5 1E                                ld      (word_1EF5), hl
0720 2A 07 1D                                ld      hl, (word_1D07)
0723 22 F7 1E                                ld      (word_1EF7), hl
0726 21 00 00                                ld      hl, 0
0729 22 E3 1A                                ld      (word_1AE3), hl
072C 22 E5 1A                                ld      (word_1AE5), hl
072F 22 E7 1A                                ld      (word_1AE7), hl
0732 22 E9 1A                                ld      (word_1AE9), hl
0735 2A EB 1A                                ld      hl, (word_1AEB)
0738 22 01 1F                                ld      (word_1F01), hl
073B 06 0F                                   ld      b, 0Fh
073D
073D                         loc_73D:                                ; CODE XREF: sub_6AB+CEj
073D C5                                      push    bc
073E 2A 01 1F                                ld      hl, (word_1F01)
0741 23                                      inc     hl
0742 22 01 1F                                ld      (word_1F01), hl
0745 21 F5 1C                                ld      hl, 1CF5h
0748 22 06 1F                                ld      (word_1F06), hl
074B 11 01 1F                                ld      de, 1F01h
074E CD F5 2A                                call    sub_2AF5
0751 21 F5 1C                                ld      hl, 1CF5h
0754 06 80                                   ld      b, 80h ; 'Ç'
0756
0756                         loc_756:                                ; CODE XREF: sub_6AB+CBj
0756 3A E3 1A                                ld      a, (word_1AE3)
0759 86                                      add     a, (hl)
075A 23                                      inc     hl
075B 32 E3 1A                                ld      (word_1AE3), a
075E 3A E4 1A                                ld      a, (word_1AE3+1)
0761 8E                                      adc     a, (hl)
0762 23                                      inc     hl
0763 32 E4 1A                                ld      (word_1AE3+1), a
0766 3A E5 1A                                ld      a, (word_1AE5)
0769 8E                                      adc     a, (hl)
076A 23                                      inc     hl
076B 32 E5 1A                                ld      (word_1AE5), a
076E 3A E6 1A                                ld      a, (word_1AE5+1)
0771 8E                                      adc     a, (hl)
0772 23                                      inc     hl
0773 32 E6 1A                                ld      (word_1AE5+1), a
0776 10 DE                                   djnz    loc_756
0778 C1                                      pop     bc
0779 10 C2                                   djnz    loc_73D
077B 2A F5 1E                                ld      hl, (word_1EF5)
077E ED 5B E3 1A                             ld      de, (word_1AE3)
0782 AF                                      xor     a
0783 ED 52                                   sbc     hl, de
0785 C2 EF 07                                jp      nz, loc_7EF
0788 2A F7 1E                                ld      hl, (word_1EF7)
078B ED 5B E5 1A                             ld      de, (word_1AE5)
078F AF                                      xor     a
0790 ED 52                                   sbc     hl, de
0792 20 5B                                   jr      nz, loc_7EF
0794 22 E7 1A                                ld      (word_1AE7), hl
0797 22 E9 1A                                ld      (word_1AE9), hl
079A 2A EB 1A                                ld      hl, (word_1AEB)
079D 22 01 1F                                ld      (word_1F01), hl
07A0
07A0                         loc_7A0:                                ; CODE XREF: sub_6AB+13Bj
07A0 2A 01 1F                                ld      hl, (word_1F01)
07A3 23                                      inc     hl
07A4 22 01 1F                                ld      (word_1F01), hl
07A7 21 F5 1C                                ld      hl, 1CF5h
07AA 22 06 1F                                ld      (word_1F06), hl
07AD 11 01 1F                                ld      de, 1F01h
07B0 CD F5 2A                                call    sub_2AF5
07B3 06 10                                   ld      b, 10h
07B5 21 F5 1C                                ld      hl, 1CF5h
07B8
07B8                         loc_7B8:                                ; CODE XREF: sub_6AB+139j
07B8 C5                                      push    bc
07B9 11 C3 1A                                ld      de, 1AC3h
07BC 01 20 00                                ld      bc, 20h ; ' '
07BF ED B0                                   ldir
07C1 3A C3 1A                                ld      a, (byte_1AC3)
07C4 A7                                      and     a
07C5 CA ED 07                                jp      z, loc_7ED
07C8 E5                                      push    hl
07C9 2A D3 1A                                ld      hl, (word_1AD3)
07CC ED 5B EB 1A                             ld      de, (word_1AEB)
07D0 AF                                      xor     a
07D1 ED 5A                                   adc     hl, de
07D3 22 D3 1A                                ld      (word_1AD3), hl
07D6 E1                                      pop     hl
07D7 DB 4E                                   in      a, (WATCHDOG_REG)
07D9 F6 08                                   or      8
07DB D3 4E                                   out     (WATCHDOG_REG), a
07DD CD F2 07                                call    sub_7F2
07E0 A7                                      and     a
07E1 20 06                                   jr      nz, loc_7E9
07E3 C1                                      pop     bc
07E4 10 D2                                   djnz    loc_7B8
07E6 C3 A0 07                                jp      loc_7A0
07E9                         ; ---------------------------------------------------------------------------
07E9
07E9                         loc_7E9:                                ; CODE XREF: sub_6AB+136j
07E9 3E 01                                   ld      a, 1
07EB C1                                      pop     bc
07EC C9                                      ret
07ED                         ; ---------------------------------------------------------------------------
07ED
07ED                         loc_7ED:                                ; CODE XREF: sub_6AB+11Aj
07ED C1                                      pop     bc
07EE C9                                      ret
07EF                         ; ---------------------------------------------------------------------------
07EF
07EF                         loc_7EF:                                ; CODE XREF: sub_6AB+2Fj
07EF                                                                 ; sub_6AB+37j ...
07EF 3E 01                                   ld      a, 1
07F1 C9                                      ret
07F1                         ; End of function sub_6AB
07F1
07F2
07F2                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
07F2
07F2
07F2                         sub_7F2:                                ; CODE XREF: sub_6AB+132p
07F2 C5                                      push    bc
07F3 D5                                      push    de
07F4 E5                                      push    hl
07F5 DD E5                                   push    ix
07F7 21 00 00                                ld      hl, 0
07FA 22 E7 1A                                ld      (word_1AE7), hl
07FD 22 E9 1A                                ld      (word_1AE9), hl
0800 2A D3 1A                                ld      hl, (word_1AD3)
0803 22 F9 1E                                ld      (word_1EF9), hl
0806 2A D5 1A                                ld      hl, (word_1AD5)
0809 22 FB 1E                                ld      (word_1EFB), hl
080C 21 F5 1A                                ld      hl, 1AF5h
080F 22 FE 1E                                ld      (word_1EFE), hl
0812 3E 08                                   ld      a, 8
0814 32 00 1F                                ld      (byte_1F00), a
0817 ED 4B D8 1A                             ld      bc, (word_1AD8)
081B
081B                         loc_81B:                                ; CODE XREF: sub_7F2+42j
081B C5                                      push    bc
081C 11 F9 1E                                ld      de, 1EF9h
081F CD F5 2A                                call    sub_2AF5
0822 2A F9 1E                                ld      hl, (word_1EF9)
0825 23                                      inc     hl
0826 22 F9 1E                                ld      (word_1EF9), hl
0829 21 F5 1A                                ld      hl, 1AF5h
082C CD 56 08                                call    sub_856
082F C1                                      pop     bc
0830 0B                                      dec     bc
0831 0B                                      dec     bc
0832 78                                      ld      a, b
0833 B1                                      or      c
0834 20 E5                                   jr      nz, loc_81B
0836 2A DF 1A                                ld      hl, (word_1ADF)
0839 ED 5B E7 1A                             ld      de, (word_1AE7)
083D AF                                      xor     a
083E ED 52                                   sbc     hl, de
0840 20 0C                                   jr      nz, loc_84E
0842 2A E1 1A                                ld      hl, (word_1AE1)
0845 ED 5B E9 1A                             ld      de, (word_1AE9)
0849 AF                                      xor     a
084A ED 52                                   sbc     hl, de
084C 28 02                                   jr      z, loc_850
084E
084E                         loc_84E:                                ; CODE XREF: sub_7F2+4Ej
084E 3E 01                                   ld      a, 1
0850
0850                         loc_850:                                ; CODE XREF: sub_7F2+5Aj
0850 DD E1                                   pop     ix
0852 E1                                      pop     hl
0853 D1                                      pop     de
0854 C1                                      pop     bc
0855 C9                                      ret
0855                         ; End of function sub_7F2
0855
0856
0856                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
0856
0856
0856                         sub_856:                                ; CODE XREF: sub_7F2+3Ap
0856 C5                                      push    bc
0857 D5                                      push    de
0858 E5                                      push    hl
0859 FD E5                                   push    iy
085B FD 2A E7 1A                             ld      iy, (word_1AE7)
085F ED 5B E9 1A                             ld      de, (word_1AE9)
0863 06 20                                   ld      b, 20h ; ' '
0865
0865                         loc_865:                                ; CODE XREF: sub_856+49j
0865 C5                                      push    bc
0866 4E                                      ld      c, (hl)
0867 23                                      inc     hl
0868 46                                      ld      b, (hl)
0869 23                                      inc     hl
086A FD 09                                   add     iy, bc
086C 4E                                      ld      c, (hl)
086D 23                                      inc     hl
086E 46                                      ld      b, (hl)
086F 23                                      inc     hl
0870 EB                                      ex      de, hl
0871 ED 4A                                   adc     hl, bc
0873 EB                                      ex      de, hl
0874 4E                                      ld      c, (hl)
0875 23                                      inc     hl
0876 46                                      ld      b, (hl)
0877 23                                      inc     hl
0878 FD 09                                   add     iy, bc
087A 4E                                      ld      c, (hl)
087B 23                                      inc     hl
087C 46                                      ld      b, (hl)
087D 23                                      inc     hl
087E EB                                      ex      de, hl
087F ED 4A                                   adc     hl, bc
0881 EB                                      ex      de, hl
0882 4E                                      ld      c, (hl)
0883 23                                      inc     hl
0884 46                                      ld      b, (hl)
0885 23                                      inc     hl
0886 FD 09                                   add     iy, bc
0888 4E                                      ld      c, (hl)
0889 23                                      inc     hl
088A 46                                      ld      b, (hl)
088B 23                                      inc     hl
088C EB                                      ex      de, hl
088D ED 4A                                   adc     hl, bc
088F EB                                      ex      de, hl
0890 4E                                      ld      c, (hl)
0891 23                                      inc     hl
0892 46                                      ld      b, (hl)
0893 23                                      inc     hl
0894 FD 09                                   add     iy, bc
0896 4E                                      ld      c, (hl)
0897 23                                      inc     hl
0898 46                                      ld      b, (hl)
0899 23                                      inc     hl
089A EB                                      ex      de, hl
089B ED 4A                                   adc     hl, bc
089D EB                                      ex      de, hl
089E C1                                      pop     bc
089F 10 C4                                   djnz    loc_865
08A1 FD 22 E7 1A                             ld      (word_1AE7), iy
08A5 ED 53 E9 1A                             ld      (word_1AE9), de
08A9 FD E1                                   pop     iy
08AB E1                                      pop     hl
08AC D1                                      pop     de
08AD C1                                      pop     bc
08AE C9                                      ret
08AE                         ; End of function sub_856
08AE
08AF
08AF                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
08AF
08AF
08AF                         sub_8AF:                                ; CODE XREF: sub_600+55p
08AF                                                                 ; sub_600+67p
08AF DB 4E                                   in      a, (WATCHDOG_REG)
08B1 F6 08                                   or      8
08B3 D3 4E                                   out     (WATCHDOG_REG), a
08B5 DB 50                                   in      a, (50h)
08B7 CB 77                                   bit     6, a
08B9 20 06                                   jr      nz, loc_8C1
08BB DB D0                                   in      a, (0D0h)
08BD FE 03                                   cp      3
08BF 38 39                                   jr      c, loc_8FA
08C1
08C1                         loc_8C1:                                ; CODE XREF: sub_8AF+Aj
08C1 22 0F 23                                ld      (word_230F), hl
08C4 ED 53 17 23                             ld      (word_2317), de
08C8 ED 43 0D 23                             ld      (word_230D), bc
08CC
08CC                         loc_8CC:                                ; CODE XREF: sub_8AF+49j
08CC DB 4E                                   in      a, (WATCHDOG_REG)
08CE F6 08                                   or      8
08D0 D3 4E                                   out     (WATCHDOG_REG), a
08D2 11 0F 23                                ld      de, 230Fh
08D5 CD F5 2A                                call    sub_2AF5
08D8 2A 0F 23                                ld      hl, (word_230F)
08DB 23                                      inc     hl
08DC 22 0F 23                                ld      (word_230F), hl
08DF 11 17 23                                ld      de, 2317h
08E2 CD 6C 2B                                call    sub_2B6C
08E5 2A 17 23                                ld      hl, (word_2317)
08E8 23                                      inc     hl
08E9 22 17 23                                ld      (word_2317), hl
08EC A7                                      and     a
08ED 20 0D                                   jr      nz, loc_8FC
08EF 2A 0D 23                                ld      hl, (word_230D)
08F2 2B                                      dec     hl
08F3 22 0D 23                                ld      (word_230D), hl
08F6 7D                                      ld      a, l
08F7 B4                                      or      h
08F8 20 D2                                   jr      nz, loc_8CC
08FA
08FA                         loc_8FA:                                ; CODE XREF: sub_8AF+10j
08FA AF                                      xor     a
08FB C9                                      ret
08FC                         ; ---------------------------------------------------------------------------
08FC
08FC                         loc_8FC:                                ; CODE XREF: sub_8AF+3Ej
08FC 3E 01                                   ld      a, 1
08FE C9                                      ret
08FE                         ; End of function sub_8AF


08FF                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
08FF                         sub_8FF         PROC
08FF C5                                      push    bc
0900 D5                                      push    de
0901 E5                                      push    hl
0902 DD E5                                   push    ix
0904 06 01                                   ld      b, 1
0906 CD 2A 3F                                call    nand_init
0909 0E 08                                   ld      c, 8
090B
090B                         loc_90B:        ld      b, 4
090D
090D                         loc_90D:        push    bc
090E 21 1F 23                                ld      hl, 231Fh
0911 CD 0F 3B                                call    sub_3B0F       ; do dma transfer flash (0) to IPM low (0)
0914 21 20 23                                ld      hl, 2320h
0917 34                                      inc     (hl)
0918 34                                      inc     (hl)
0919 21 25 23                                ld      hl, 2325h
091C 34                                      inc     (hl)
091D 34                                      inc     (hl)
091E C1                                      pop     bc
091F 10 EC                                   djnz    loc_90D
0921 AF                                      xor     a
0922 21 1F 23                                ld      hl, 231Fh
0925 77                                      ld      (hl), a
0926 23                                      inc     hl
0927 77                                      ld      (hl), a
0928 23                                      inc     hl
0929 34                                      inc     (hl)
092A 0D                                      dec     c
092B 20 DE                                   jr      nz, loc_90B
092D CD 4E 3F                                call    nand_deinit
0930 DD E1                                   pop     ix
0932 E1                                      pop     hl
0933 D1                                      pop     de
0934 C1                                      pop     bc
0935 C9                                      ret
0935                         sub_8FF         ENDP



0936                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
0936
0936
0936                         sub_936:                                ; CODE XREF: sub_B7E+39p
0936                                                                 ; sub_BC2+B2p ...
0936 C5                                      push    bc
0937 D5                                      push    de
0938 E5                                      push    hl
0939 DD E5                                   push    ix
093B 06 01                                   ld      b, 1
093D CD 2A 3F                                call    nand_init
0940 0E 08                                   ld      c, 8
0942
0942                         loc_942:                                ; CODE XREF: sub_936+2Cj
0942 06 04                                   ld      b, 4
0944
0944                         loc_944:                                ; CODE XREF: sub_936+20j
0944 C5                                      push    bc
0945 21 1F 23                                ld      hl, 231Fh
0948 CD 1B 26                                call    sub_261B
094B 21 20 23                                ld      hl, 2320h
094E 34                                      inc     (hl)
094F 34                                      inc     (hl)
0950 21 25 23                                ld      hl, 2325h
0953 34                                      inc     (hl)
0954 34                                      inc     (hl)
0955 C1                                      pop     bc
0956 10 EC                                   djnz    loc_944
0958 AF                                      xor     a
0959 21 1F 23                                ld      hl, 231Fh
095C 77                                      ld      (hl), a
095D 23                                      inc     hl
095E 77                                      ld      (hl), a
095F 23                                      inc     hl
0960 34                                      inc     (hl)
0961 0D                                      dec     c
0962 20 DE                                   jr      nz, loc_942
0964 CD 4E 3F                                call    nand_deinit
0967 DD E1                                   pop     ix
0969 E1                                      pop     hl
096A D1                                      pop     de
096B C1                                      pop     bc
096C C9                                      ret
096C                         ; End of function sub_936
096C
096D
096D                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
096D
096D
096D                         sub_96D:                                ; CODE XREF: sub_2721+Ep
096D DB 05                                   in      a, (MROM_PAGE_REG)
096F F5                                      push    af
0970 06 01                                   ld      b, 1
0972 CD 2A 3F                                call    nand_init
0975 21 F8 07                                ld      hl, 7F8h
0978 22 1F 23                                ld      (word_231F), hl
097B 21 07 00                                ld      hl, 7
097E 22 21 23                                ld      (word_2321), hl
0981 2E 00                                   ld      l, 0
0983 22 23 23                                ld      (word_2323), hl
0986 21 1F 23                                ld      hl, 231Fh
0989 CD D0 3E                                call    sub_3ED0
098C CD 4E 3F                                call    nand_deinit
098F E5                                      push    hl
0990 06 01                                   ld      b, 1
0992 CD 55 24                                call    nand_detect_id
0995 C1                                      pop     bc
0996 FE 02                                   cp      2
0998 C2 B4 09                                jp      nz, loc_9B4
099B 24                                      inc     h
099C 2E 00                                   ld      l, 0
099E EB                                      ex      de, hl
099F 41                                      ld      b, c
09A0 0E 01                                   ld      c, 1
09A2 CD DC 0C                                call    sub_CDC
09A5 3E 05                                   ld      a, 5
09A7 CD B9 09                                call    sub_9B9
09AA 3E 04                                   ld      a, 4
09AC CD B9 09                                call    sub_9B9
09AF 3E 02                                   ld      a, 2
09B1 CD B9 09                                call    sub_9B9
09B4
09B4                         loc_9B4:                                ; CODE XREF: sub_96D+2Bj
09B4 F1                                      pop     af
09B5 D3 05                                   out     (MROM_PAGE_REG), a
09B7 AF                                      xor     a
09B8 C9                                      ret
09B8                         ; End of function sub_96D
09B8
09B9
09B9                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
09B9
09B9
09B9                         sub_9B9:                                ; CODE XREF: sub_96D+3Ap
09B9                                                                 ; sub_96D+3Fp ...
09B9 32 31 23                                ld      (byte_2331), a
09BC 47                                      ld      b, a
09BD CD 55 24                                call    nand_detect_id
09C0 FE 02                                   cp      2
09C2 C2 B0 0A                                jp      nz, locret_AB0
09C5 24                                      inc     h
09C6 2E 00                                   ld      l, 0
09C8 22 2F 23                                ld      (word_232F), hl
09CB 3A 31 23                                ld      a, (byte_2331)
09CE 47                                      ld      b, a
09CF CD 2A 3F                                call    nand_init
09D2 21 00 00                                ld      hl, 0
09D5 22 27 23                                ld      (word_2327), hl
09D8 22 29 23                                ld      (word_2329), hl
09DB 22 2B 23                                ld      (word_232B), hl
09DE 22 2D 23                                ld      (word_232D), hl
09E1 06 20                                   ld      b, 20h ; ' '
09E3
09E3                         loc_9E3:                                ; CODE XREF: sub_9B9+46j
09E3 C5                                      push    bc
09E4 21 27 23                                ld      hl, 2327h
09E7 CD 0F 3B                                call    sub_3B0F
09EA 21 28 23                                ld      hl, 2328h
09ED 34                                      inc     (hl)
09EE 34                                      inc     (hl)
09EF 7E                                      ld      a, (hl)
09F0 FE 08                                   cp      8
09F2 20 05                                   jr      nz, loc_9F9
09F4 3E 00                                   ld      a, 0
09F6 77                                      ld      (hl), a
09F7 23                                      inc     hl
09F8 34                                      inc     (hl)
09F9
09F9                         loc_9F9:                                ; CODE XREF: sub_9B9+39j
09F9 21 2D 23                                ld      hl, 232Dh
09FC 34                                      inc     (hl)
09FD 34                                      inc     (hl)
09FE C1                                      pop     bc
09FF 10 E2                                   djnz    loc_9E3
0A01 CD 4E 3F                                call    nand_deinit
0A04 3E F0                                   ld      a, 0F0h
0A06 D3 05                                   out     (MROM_PAGE_REG), a
0A08 AF                                      xor     a
0A09 2A FC 7F                                ld      hl, (7FFCh)
0A0C 01 55 AA                                ld      bc, 0AA55h
0A0F ED 42                                   sbc     hl, bc
0A11 20 30                                   jr      nz, loc_A43
0A13 21 00 00                                ld      hl, 0
0A16 01 FE 7F                                ld      bc, 7FFEh
0A19
0A19                         loc_A19:                                ; CODE XREF: sub_9B9+69j
0A19                                                                 ; sub_9B9+6Ej
0A19 0B                                      dec     bc
0A1A 0A                                      ld      a, (bc)
0A1B 57                                      ld      d, a
0A1C 0B                                      dec     bc
0A1D 0A                                      ld      a, (bc)
0A1E 5F                                      ld      e, a
0A1F 19                                      add     hl, de
0A20 79                                      ld      a, c
0A21 A7                                      and     a
0A22 20 F5                                   jr      nz, loc_A19
0A24 78                                      ld      a, b
0A25 FE 40                                   cp      40h ; '@'
0A27 20 F0                                   jr      nz, loc_A19
0A29 ED 5B FE 7F                             ld      de, (7FFEh)
0A2D AF                                      xor     a
0A2E ED 52                                   sbc     hl, de
0A30 20 11                                   jr      nz, loc_A43
0A32 3A F8 7F                                ld      a, (7FF8h)
0A35 47                                      ld      b, a
0A36 3A 31 23                                ld      a, (byte_2331)
0A39 4F                                      ld      c, a
0A3A ED 5B 2F 23                             ld      de, (word_232F)
0A3E CD DC 0C                                call    sub_CDC
0A41 18 6D                                   jr      locret_AB0
0A43                         ; ---------------------------------------------------------------------------
0A43
0A43                         loc_A43:                                ; CODE XREF: sub_9B9+58j
0A43                                                                 ; sub_9B9+77j
0A43 3A 31 23                                ld      a, (byte_2331)
0A46 4F                                      ld      c, a
0A47 ED 5B 2F 23                             ld      de, (word_232F)
0A4B CD C0 15                                call    sub_15C0
0A4E EB                                      ex      de, hl
0A4F AF                                      xor     a
0A50 21 00 40                                ld      hl, 4000h
0A53
0A53                         loc_A53:                                ; CODE XREF: sub_9B9+A0j
0A53 AF                                      xor     a
0A54 77                                      ld      (hl), a
0A55 23                                      inc     hl
0A56 7C                                      ld      a, h
0A57 FE 80                                   cp      80h ; 'Ç'
0A59 20 F8                                   jr      nz, loc_A53
0A5B ED 53 F8 7F                             ld      (7FF8h), de
0A5F ED 53 FA 7F                             ld      (7FFAh), de
0A63 21 55 AA                                ld      hl, 0AA55h
0A66 22 FC 7F                                ld      (7FFCh), hl
0A69 19                                      add     hl, de
0A6A 19                                      add     hl, de
0A6B 22 FE 7F                                ld      (7FFEh), hl
0A6E 3A 31 23                                ld      a, (byte_2331)
0A71 47                                      ld      b, a
0A72 CD 2A 3F                                call    nand_init
0A75 21 00 00                                ld      hl, 0
0A78 22 27 23                                ld      (word_2327), hl
0A7B 22 29 23                                ld      (word_2329), hl
0A7E 22 2B 23                                ld      (word_232B), hl
0A81 22 2D 23                                ld      (word_232D), hl
0A84 21 29 23                                ld      hl, 2329h
0A87 CD 63 25                                call    sub_2563
0A8A 06 20                                   ld      b, 20h ; ' '
0A8C
0A8C                         loc_A8C:                                ; CODE XREF: sub_9B9+EFj
0A8C C5                                      push    bc
0A8D 21 27 23                                ld      hl, 2327h
0A90 CD 1B 26                                call    sub_261B
0A93 21 28 23                                ld      hl, 2328h
0A96 34                                      inc     (hl)
0A97 34                                      inc     (hl)
0A98 7E                                      ld      a, (hl)
0A99 FE 08                                   cp      8
0A9B 20 05                                   jr      nz, loc_AA2
0A9D 3E 00                                   ld      a, 0
0A9F 77                                      ld      (hl), a
0AA0 23                                      inc     hl
0AA1 34                                      inc     (hl)
0AA2
0AA2                         loc_AA2:                                ; CODE XREF: sub_9B9+E2j
0AA2 21 2D 23                                ld      hl, 232Dh
0AA5 34                                      inc     (hl)
0AA6 34                                      inc     (hl)
0AA7 C1                                      pop     bc
0AA8 10 E2                                   djnz    loc_A8C
0AAA CD 4E 3F                                call    nand_deinit
0AAD C3 B9 09                                jp      sub_9B9
0AB0                         ; ---------------------------------------------------------------------------
0AB0
0AB0                         locret_AB0:                             ; CODE XREF: sub_9B9+9j
0AB0                                                                 ; sub_9B9+88j
0AB0 C9                                      ret
0AB0                         ; End of function sub_9B9



0AB1                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
0AB1                         sub_AB1         PROC
0AB1 E5                                      push    hl
0AB2
0AB2                         loc_AB2:        ld      hl, 0
0AB5 CD 1E 0B                                call    sub_B1E              ; sub_B1E(0) - check for firmware
0AB8 A7                                      and     a
0AB9 20 21                                   jr      nz, loc_ADC          ; firmware not found (nonzero)? -> branch

0ABB DB 05                                   in      a, (MROM_PAGE_REG)   ; read value 3FFAh from IPM(low) into hl
0ABD F5                                      push    af
0ABE 3E F0                                   ld      a, 0F0h
0AC0 D3 05                                   out     (MROM_PAGE_REG), a
0AC2 2A FA 7F                                ld      hl, (7FFAh)
0AC5 F1                                      pop     af
0AC6 D3 05                                   out     (MROM_PAGE_REG), a

0AC8 29                                      add     hl, hl               ; hl <<= 6
0AC9 29                                      add     hl, hl
0ACA 29                                      add     hl, hl
0ACB 29                                      add     hl, hl
0ACC 29                                      add     hl, hl
0ACD 29                                      add     hl, hl
0ACE 22 32 23                                ld      (word_2332), hl      ; store hl
0AD1 CD 1E 0B                                call    sub_B1E
0AD4 A7                                      and     a
0AD5 28 2E                                   jr      z, loc_B05           ; returned zero value? -> branch

0AD7 CD C2 0B                                call    sub_BC2
0ADA 18 D6                                   jr      loc_AB2
0ADC                         ; ---------------------------------------------------------------------------
0ADC                         loc_ADC:        ld      hl, 40h
0ADF 22 32 23                                ld      (word_2332), hl
0AE2 CD 1E 0B                                call    sub_B1E              ; sub_B1E(40h) - check for firmware
0AE5 A7                                      and     a
0AE6 28 18                                   jr      z, loc_B00

0AE8 21 80 00                                ld      hl, 80h
0AEB 22 32 23                                ld      (word_2332), hl
0AEE CD 1E 0B                                call    sub_B1E             ; sub_B1E(80h) - check for firmware
0AF1 A7                                      and     a
0AF2 28 0C                                   jr      z, loc_B00

0AF4 21 C0 00                                ld      hl, 0C0h
0AF7 22 32 23                                ld      (word_2332), hl
0AFA CD 1E 0B                                call    sub_B1E            ; sub_B1E(0C0h) - check for firmware
0AFD A7                                      and     a
0AFE 20 05                                   jr      nz, loc_B05        ; -> nothing found
0B00
0B00                         loc_B00:        call    sub_B7E
0B03 18 AD                                   jr      loc_AB2
0B05                         ; ---------------------------------------------------------------------------
0B050B05                         loc_B05:    push    af                   ; copy 32 bytes from byte_2334 to 0000h @IPM(low)
0B06 DB 05                                   in      a, (MROM_PAGE_REG)
0B08 F5                                      push    af
0B09 3E F0                                   ld      a, 0F0h
0B0B D3 05                                   out     (MROM_PAGE_REG), a
0B0D 21 00 40                                ld      hl, INT_MEMORY_ADDR
0B10 11 34 23                                ld      de, byte_2334
0B13 01 20 00                                ld      bc, 32
0B16 ED B0                                   ldir
0B18 F1                                      pop     af
0B19 D3 05                                   out     (MROM_PAGE_REG), a
0B1B F1                                      pop     af

0B1C E1                                      pop     hl
0B1D C9                                      ret
0B1D                         sub_AB1         ENDP




0B1E                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
0B1E                         ; in: hl = ?
                             ; out: a = 0 or 1
0B1E                         sub_B1E         PROC
0B1E                                         push    hl
0B1F 22 21 23                                ld      (word_2321), hl
0B22 21 00 00                                ld      hl, 0
0B25 22 1F 23                                ld      (word_231F), hl
0B28 22 23 23                                ld      (word_2323), hl
0B2B 22 25 23                                ld      (word_2325), hl
0B2E CD 33 0B                                call    sub_B33
0B31 E1                                      pop     hl
0B32 C9                                      ret
0B32                         sub_B1E         ENDP


0B33                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
                             ; out: a = 0 or 1
0B33                         sub_B33         PROC
0B33 C5                                      push    bc
0B34 D5                                      push    de
0B35 E5                                      push    hl
0B36 DD E5                                   push    ix
0B38 FD E5                                   push    iy
0B3A CD FF 08                                call    sub_8FF                ; do a lot of dma transfers from flash to IPM-low
0B3D DB 05                                   in      a, (MROM_PAGE_REG)
0B3F F5                                      push    af
0B40 3E F0                                   ld      a, 0F0h
0B42 D3 05                                   out     (MROM_PAGE_REG), a
0B44 2A FC 7F                                ld      hl, (INT_MEMORY_ADDR + 3FFCh)
0B47 11 AA 55                                ld      de, 55AAh              ; check for our firmware id
0B4A AF                                      xor     a
0B4B ED 52                                   sbc     hl, de
0B4D 7D                                      ld      a, l
0B4E B4                                      or      h
0B4F C2 71 0B                                jp      nz, loc_B71            ; not our firmware id?
0B52 21 00 00                                ld      hl, 0
0B55 01 FE 7F                                ld      bc, INT_MEMORY_ADDR + 3FFEh
0B58
0B58                         loc_B58:        dec     bc
0B59 0A                                      ld      a, (bc)
0B5A 57                                      ld      d, a
0B5B 0B                                      dec     bc
0B5C 0A                                      ld      a, (bc)
0B5D 5F                                      ld      e, a
0B5E 19                                      add     hl, de
0B5F 79                                      ld      a, c
0B60 A7                                      and     a
0B61 20 F5                                   jr      nz, loc_B58
0B63 78                                      ld      a, b
0B64 FE 40                                   cp      40h
0B66 20 F0                                   jr      nz, loc_B58
0B68 ED 5B FE 7F                             ld      de, (INT_MEMORY_ADDR + 3FFEh)
0B6C AF                                      xor     a
0B6D ED 52                                   sbc     hl, de
0B6F 7D                                      ld      a, l
0B70 B4                                      or      h
0B71
0B71                         loc_B71:        ld      b, a
0B72 F1                                      pop     af
0B73 D3 05                                   out     (MROM_PAGE_REG), a
0B75 78                                      ld      a, b
0B76 FD E1                                   pop     iy
0B78 DD E1                                   pop     ix
0B7A E1                                      pop     hl
0B7B D1                                      pop     de
0B7C C1                                      pop     bc
0B7D C9                                      ret
0B7D                         sub_B33         ENDP




0B7E                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
0B7E                         sub_B7E:                                ; CODE XREF: sub_AB1:loc_B00p
0B7E C5                                      push    bc
0B7F D5                                      push    de
0B80 E5                                      push    hl
0B81 DD E5                                   push    ix
0B83 FD E5                                   push    iy
0B85 21 00 00                                ld      hl, 0
0B88 22 1F 23                                ld      (word_231F), hl
0B8B 22 23 23                                ld      (word_2323), hl
0B8E 22 25 23                                ld      (word_2325), hl
0B91 2A 32 23                                ld      hl, (word_2332)
0B94 22 21 23                                ld      (word_2321), hl
0B97 CD FF 08                                call    sub_8FF
0B9A 06 01                                   ld      b, 1
0B9C CD 2A 3F                                call    nand_init
0B9F 21 00 00                                ld      hl, 0
0BA2 22 1F 23                                ld      (word_231F), hl
0BA5 22 21 23                                ld      (word_2321), hl
0BA8 22 23 23                                ld      (word_2323), hl
0BAB 22 25 23                                ld      (word_2325), hl
0BAE 21 21 23                                ld      hl, 2321h
0BB1 CD 63 25                                call    sub_2563
0BB4 CD 4E 3F                                call    nand_deinit
0BB7 CD 36 09                                call    sub_936
0BBA FD E1                                   pop     iy
0BBC DD E1                                   pop     ix
0BBE E1                                      pop     hl
0BBF D1                                      pop     de
0BC0 C1                                      pop     bc
0BC1 C9                                      ret
0BC1                         ; End of function sub_B7E
0BC1
0BC2
0BC2                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
0BC2
0BC2
0BC2                         sub_BC2:                                ; CODE XREF: sub_AB1+26p
0BC2 C5                                      push    bc
0BC3 D5                                      push    de
0BC4 E5                                      push    hl
0BC5 DD E5                                   push    ix
0BC7 FD E5                                   push    iy
0BC9 21 00 00                                ld      hl, 0
0BCC 22 1F 23                                ld      (word_231F), hl
0BCF 22 23 23                                ld      (word_2323), hl
0BD2 22 25 23                                ld      (word_2325), hl
0BD5 2A 32 23                                ld      hl, (word_2332)
0BD8 11 20 00                                ld      de, 20h ; ' '
0BDB AF                                      xor     a
0BDC ED 5A                                   adc     hl, de
0BDE 22 21 23                                ld      (word_2321), hl
0BE1 3E 00                                   ld      a, 0
0BE3 32 26 23                                ld      (word_2325+1), a
0BE6 CD FF 08                                call    sub_8FF
0BE9 21 00 00                                ld      hl, 0
0BEC 22 1F 23                                ld      (word_231F), hl
0BEF 22 23 23                                ld      (word_2323), hl
0BF2 22 25 23                                ld      (word_2325), hl
0BF5 3E 01                                   ld      a, 1
0BF7 32 26 23                                ld      (word_2325+1), a
0BFA CD FF 08                                call    sub_8FF
0BFD 21 00 00                                ld      hl, 0
0C00 22 1F 23                                ld      (word_231F), hl
0C03 22 23 23                                ld      (word_2323), hl
0C06 22 25 23                                ld      (word_2325), hl
0C09 3E 02                                   ld      a, 2
0C0B 32 26 23                                ld      (word_2325+1), a
0C0E CD FF 08                                call    sub_8FF
0C11 21 00 00                                ld      hl, 0
0C14 22 1F 23                                ld      (word_231F), hl
0C17 22 23 23                                ld      (word_2323), hl
0C1A 22 25 23                                ld      (word_2325), hl
0C1D 3E 04                                   ld      a, 4
0C1F 32 26 23                                ld      (word_2325+1), a
0C22 CD FF 08                                call    sub_8FF
0C25 06 01                                   ld      b, 1
0C27 CD 2A 3F                                call    nand_init
0C2A 21 00 00                                ld      hl, 0
0C2D 22 1F 23                                ld      (word_231F), hl
0C30 22 23 23                                ld      (word_2323), hl
0C33 22 25 23                                ld      (word_2325), hl
0C36 2A 32 23                                ld      hl, (word_2332)
0C39 22 21 23                                ld      (word_2321), hl
0C3C 21 21 23                                ld      hl, 2321h
0C3F CD 63 25                                call    sub_2563
0C42 21 00 08                                ld      hl, 800h
0C45 22 1F 23                                ld      (word_231F), hl
0C48 21 1F 23                                ld      hl, 231Fh
0C4B 11 55 AA                                ld      de, 0AA55h
0C4E 01 FE FF                                ld      bc, 0FFFEh
0C51 CD BC 26                                call    sub_26BC
0C54 CD 4E 3F                                call    nand_deinit
0C57 21 00 00                                ld      hl, 0
0C5A 22 1F 23                                ld      (word_231F), hl
0C5D 22 23 23                                ld      (word_2323), hl
0C60 22 25 23                                ld      (word_2325), hl
0C63 2A 32 23                                ld      hl, (word_2332)
0C66 11 20 00                                ld      de, 20h ; ' '
0C69 AF                                      xor     a
0C6A ED 5A                                   adc     hl, de
0C6C 22 21 23                                ld      (word_2321), hl
0C6F 3E 00                                   ld      a, 0
0C71 32 26 23                                ld      (word_2325+1), a
0C74 CD 36 09                                call    sub_936
0C77 21 00 00                                ld      hl, 0
0C7A 22 1F 23                                ld      (word_231F), hl
0C7D 22 23 23                                ld      (word_2323), hl
0C80 22 25 23                                ld      (word_2325), hl
0C83 3E 01                                   ld      a, 1
0C85 32 26 23                                ld      (word_2325+1), a
0C88 CD 36 09                                call    sub_936
0C8B 21 00 00                                ld      hl, 0
0C8E 22 1F 23                                ld      (word_231F), hl
0C91 22 23 23                                ld      (word_2323), hl
0C94 22 25 23                                ld      (word_2325), hl
0C97 3E 02                                   ld      a, 2
0C99 32 26 23                                ld      (word_2325+1), a
0C9C CD 36 09                                call    sub_936
0C9F 21 00 00                                ld      hl, 0
0CA2 22 1F 23                                ld      (word_231F), hl
0CA5 3E 04                                   ld      a, 4
0CA7 32 26 23                                ld      (word_2325+1), a
0CAA CD 36 09                                call    sub_936
0CAD 21 00 00                                ld      hl, 0
0CB0 22 1F 23                                ld      (word_231F), hl
0CB3 22 21 23                                ld      (word_2321), hl
0CB6 22 23 23                                ld      (word_2323), hl
0CB9 22 25 23                                ld      (word_2325), hl
0CBC CD FF 08                                call    sub_8FF
0CBF 21 00 00                                ld      hl, 0
0CC2 22 1F 23                                ld      (word_231F), hl
0CC5 22 23 23                                ld      (word_2323), hl
0CC8 22 25 23                                ld      (word_2325), hl
0CCB 2A 32 23                                ld      hl, (word_2332)
0CCE 22 21 23                                ld      (word_2321), hl
0CD1 CD 36 09                                call    sub_936
0CD4 FD E1                                   pop     iy
0CD6 DD E1                                   pop     ix
0CD8 E1                                      pop     hl
0CD9 D1                                      pop     de
0CDA C1                                      pop     bc
0CDB C9                                      ret
0CDB                         ; End of function sub_BC2
0CDB
0CDC
0CDC                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
0CDC
0CDC
0CDC                         sub_CDC:                                ; CODE XREF: sub_96D+35p
0CDC                                                                 ; sub_9B9+85p
0CDC C5                                      push    bc
0CDD D5                                      push    de
0CDE E5                                      push    hl
0CDF AF                                      xor     a
0CE0 32 70 23                                ld      (byte_2370), a
0CE3 32 72 23                                ld      (byte_2372), a
0CE6 DB 05                                   in      a, (MROM_PAGE_REG)
0CE8 32 90 23                                ld      (byte_2390), a
0CEB 79                                      ld      a, c
0CEC 32 74 23                                ld      (byte_2374), a
0CEF ED 53 77 23                             ld      (word_2377), de
0CF3 78                                      ld      a, b
0CF4 32 76 23                                ld      (byte_2376), a
0CF7 3A 74 23                                ld      a, (byte_2374)
0CFA 47                                      ld      b, a
0CFB CD 2A 3F                                call    nand_init
0CFE CD A0 3F                                call    nand_read_status
0D01 32 71 23                                ld      (byte_2371), a
0D04 A7                                      and     a
0D05 20 1F                                   jr      nz, loc_D26
0D07 CD 47 14                                call    sub_1447
0D0A CD EF 14                                call    sub_14EF
0D0D 3A 73 23                                ld      a, (byte_2373)
0D10 FE 00                                   cp      0
0D12 CC 37 0D                                call    z, sub_D37
0D15 3A 70 23                                ld      a, (byte_2370)
0D18 A7                                      and     a
0D19 20 0B                                   jr      nz, loc_D26
0D1B 3A 73 23                                ld      a, (byte_2373)
0D1E FE 01                                   cp      1
0D20 CC 02 0F                                call    z, sub_F02
0D23 3A 70 23                                ld      a, (byte_2370)
0D26
0D26                         loc_D26:                                ; CODE XREF: sub_CDC+29j
0D26                                                                 ; sub_CDC+3Dj
0D26 F5                                      push    af
0D27 CD D0 3F                                call    sub_3FD0
0D2A CD 4E 3F                                call    nand_deinit
0D2D 3A 90 23                                ld      a, (byte_2390)
0D30 D3 05                                   out     (MROM_PAGE_REG), a
0D32 F1                                      pop     af
0D33 E1                                      pop     hl
0D34 D1                                      pop     de
0D35 C1                                      pop     bc
0D36 C9                                      ret
0D36                         ; End of function sub_CDC
0D36
0D37
0D37                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
0D37
0D37
0D37                         sub_D37:                                ; CODE XREF: sub_CDC+36p
0D37 CD 44 0D                                call    sub_D44
0D3A 3A 70 23                                ld      a, (byte_2370)
0D3D A7                                      and     a
0D3E 20 03                                   jr      nz, locret_D43
0D40 CD BF 0D                                call    sub_DBF
0D43
0D43                         locret_D43:                             ; CODE XREF: sub_D37+7j
0D43 C9                                      ret
0D43                         ; End of function sub_D37
0D43
0D44
0D44                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
0D44
0D44
0D44                         sub_D44:                                ; CODE XREF: sub_D37p
0D44 C5                                      push    bc
0D45 D5                                      push    de
0D46 E5                                      push    hl
0D47 DB 05                                   in      a, (MROM_PAGE_REG)
0D49 32 6F 23                                ld      (byte_236F), a
0D4C 3E C1                                   ld      a, 0C1h                ;
0D4E D3 05                                   out     (MROM_PAGE_REG), a
0D50 21 FB 43                                ld      hl, 43FBh
0D53 22 7D 23                                ld      (word_237D), hl
0D56
0D56                         loc_D56:                                ; CODE XREF: sub_D44+34j
0D56                                                                 ; sub_D44:loc_DAFj
0D56 DB 4E                                   in      a, (WATCHDOG_REG)
0D58 F6 08                                   or      8
0D5A D3 4E                                   out     (WATCHDOG_REG), a
0D5C 2A 7D 23                                ld      hl, (word_237D)
0D5F 56                                      ld      d, (hl)
0D60 2B                                      dec     hl
0D61 5E                                      ld      e, (hl)
0D62 2B                                      dec     hl
0D63 22 7D 23                                ld      (word_237D), hl
0D66 ED 53 86 23                             ld      (word_2386), de
0D6A AF                                      xor     a
0D6B 01 00 40                                ld      bc, 4000h
0D6E ED 42                                   sbc     hl, bc
0D70 38 3F                                   jr      c, loc_DB1
0D72 AF                                      xor     a
0D73 21 FF FF                                ld      hl, 0FFFFh
0D76 ED 52                                   sbc     hl, de
0D78 28 DC                                   jr      z, loc_D56
0D7A 2E 00                                   ld      l, 0
0D7C 06 06                                   ld      b, 6
0D7E AF                                      xor     a
0D7F
0D7F                         loc_D7F:                                ; CODE XREF: sub_D44+41j
0D7F CB 23                                   sla     e
0D81 CB 12                                   rl      d
0D83 CB 15                                   rl      l
0D85 10 F8                                   djnz    loc_D7F
0D87 DD 21 54 23                             ld      ix, 2354h
0D8B DD 36 00 00                             ld      (ix+0), 0
0D8F DD 36 01 08                             ld      (ix+1), 8
0D93 DD 73 02                                ld      (ix+2), e
0D96 DD 72 03                                ld      (ix+3), d
0D99 DD 75 04                                ld      (ix+4), l
0D9C 21 54 23                                ld      hl, 2354h
0D9F CD E0 26                                call    sub_26E0
0DA2 AF                                      xor     a
0DA3 01 FF AF                                ld      bc, 0AFFFh
0DA6 ED 42                                   sbc     hl, bc
0DA8 28 05                                   jr      z, loc_DAF
0DAA 3E 02                                   ld      a, 2
0DAC CD B4 13                                call    sub_13B4
0DAF
0DAF                         loc_DAF:                                ; CODE XREF: sub_D44+64j
0DAF 18 A5                                   jr      loc_D56
0DB1                         ; ---------------------------------------------------------------------------
0DB1
0DB1                         loc_DB1:                                ; CODE XREF: sub_D44+2Cj
0DB1 3A 70 23                                ld      a, (byte_2370)
0DB4 F5                                      push    af
0DB5 3A 6F 23                                ld      a, (byte_236F)
0DB8 D3 05                                   out     (MROM_PAGE_REG), a
0DBA F1                                      pop     af
0DBB E1                                      pop     hl
0DBC D1                                      pop     de
0DBD C1                                      pop     bc
0DBE C9                                      ret
0DBE                         ; End of function sub_D44
0DBE
0DBF
0DBF                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
0DBF
0DBF
0DBF                         sub_DBF:                                ; CODE XREF: sub_D37+9p
0DBF C5                                      push    bc
0DC0 D5                                      push    de
0DC1 E5                                      push    hl
0DC2 21 00 00                                ld      hl, 0
0DC5 22 84 23                                ld      (word_2384), hl
0DC8 DB 05                                   in      a, (MROM_PAGE_REG)
0DCA 32 6F 23                                ld      (byte_236F), a
0DCD 3E C0                                   ld      a, 0C0h
0DCF D3 05                                   out     (MROM_PAGE_REG), a
0DD1
0DD1                         loc_DD1:                                ; CODE XREF: sub_DBF+135j
0DD1 DB 4E                                   in      a, (WATCHDOG_REG)
0DD3 F6 08                                   or      8
0DD5 D3 4E                                   out     (WATCHDOG_REG), a
0DD7 2A 84 23                                ld      hl, (word_2384)
0DDA CB 25                                   sla     l
0DDC CB 14                                   rl      h
0DDE AF                                      xor     a
0DDF 01 00 40                                ld      bc, 4000h
0DE2 09                                      add     hl, bc
0DE3 5E                                      ld      e, (hl)
0DE4 23                                      inc     hl
0DE5 56                                      ld      d, (hl)
0DE6 23                                      inc     hl
0DE7 ED 53 86 23                             ld      (word_2386), de
0DEB AF                                      xor     a
0DEC 21 FF FF                                ld      hl, 0FFFFh
0DEF ED 52                                   sbc     hl, de
0DF1 CA F7 0E                                jp      z, loc_EF7
0DF4 2E 00                                   ld      l, 0
0DF6 06 06                                   ld      b, 6
0DF8 AF                                      xor     a
0DF9
0DF9                         loc_DF9:                                ; CODE XREF: sub_DBF+40j
0DF9 CB 23                                   sla     e
0DFB CB 12                                   rl      d
0DFD CB 15                                   rl      l
0DFF 10 F8                                   djnz    loc_DF9
0E01 DD 21 54 23                             ld      ix, 2354h
0E05 DD 36 00 00                             ld      (ix+0), 0
0E09 DD 36 01 08                             ld      (ix+1), 8
0E0D DD 73 02                                ld      (ix+2), e
0E10 DD 72 03                                ld      (ix+3), d
0E13 DD 75 04                                ld      (ix+4), l
0E16 21 54 23                                ld      hl, 2354h
0E19 CD F6 26                                call    sub_26F6
0E1C 01 FF AA                                ld      bc, 0AAFFh
0E1F AF                                      xor     a
0E20 ED 42                                   sbc     hl, bc
0E22 C2 34 0E                                jp      nz, loc_E34
0E25 AF                                      xor     a
0E26 62                                      ld      h, d
0E27 6B                                      ld      l, e
0E28 ED 4B 84 23                             ld      bc, (word_2384)
0E2C ED 42                                   sbc     hl, bc
0E2E C2 34 0E                                jp      nz, loc_E34
0E31 C3 ED 0E                                jp      loc_EED
0E34                         ; ---------------------------------------------------------------------------
0E34
0E34                         loc_E34:                                ; CODE XREF: sub_DBF+63j
0E34                                                                 ; sub_DBF+6Fj
0E34 ED 5B 86 23                             ld      de, (word_2386)
0E38 2E 00                                   ld      l, 0
0E3A 06 06                                   ld      b, 6
0E3C AF                                      xor     a
0E3D
0E3D                         loc_E3D:                                ; CODE XREF: sub_DBF+84j
0E3D CB 23                                   sla     e
0E3F CB 12                                   rl      d
0E41 CB 15                                   rl      l
0E43 10 F8                                   djnz    loc_E3D
0E45 DD 21 54 23                             ld      ix, 2354h
0E49 DD 36 00 00                             ld      (ix+0), 0
0E4D DD 36 01 00                             ld      (ix+1), 0
0E51 DD 73 02                                ld      (ix+2), e
0E54 DD 72 03                                ld      (ix+3), d
0E57 DD 75 04                                ld      (ix+4), l
0E5A DD 21 FB 43                             ld      ix, 43FBh
0E5E 3E C1                                   ld      a, 0C1h ; '-'
0E60 D3 05                                   out     (MROM_PAGE_REG), a
0E62 DD 56 00                                ld      d, (ix+0)
0E65 DD 2B                                   dec     ix
0E67 DD 5E 00                                ld      e, (ix+0)
0E6A DD 2B                                   dec     ix
0E6C 3E C0                                   ld      a, 0C0h ; '+'
0E6E D3 05                                   out     (MROM_PAGE_REG), a
0E70 2E 00                                   ld      l, 0
0E72 06 06                                   ld      b, 6
0E74 AF                                      xor     a
0E75
0E75                         loc_E75:                                ; CODE XREF: sub_DBF+BCj
0E75 CB 23                                   sla     e
0E77 CB 12                                   rl      d
0E79 CB 15                                   rl      l
0E7B 10 F8                                   djnz    loc_E75
0E7D DD 21 54 23                             ld      ix, 2354h
0E81 DD 36 05 00                             ld      (ix+5), 0
0E85 DD 36 06 00                             ld      (ix+6), 0
0E89 DD 73 07                                ld      (ix+7), e
0E8C DD 72 08                                ld      (ix+8), d
0E8F DD 75 09                                ld      (ix+9), l
0E92 21 5B 23                                ld      hl, 235Bh
0E95 CD 63 25                                call    sub_2563
0E98 32 70 23                                ld      (byte_2370), a
0E9B A7                                      and     a
0E9C 20 59                                   jr      nz, loc_EF7
0E9E 21 54 23                                ld      hl, 2354h
0EA1 11 59 23                                ld      de, 2359h
0EA4 CD 7A 14                                call    sub_147A
0EA7 21 56 23                                ld      hl, 2356h
0EAA CD 63 25                                call    sub_2563
0EAD 21 59 23                                ld      hl, 2359h
0EB0 11 54 23                                ld      de, 2354h
0EB3 CD 7A 14                                call    sub_147A
0EB6 DD 21 54 23                             ld      ix, 2354h
0EBA DD 36 00 00                             ld      (ix+0), 0
0EBE DD 36 01 08                             ld      (ix+1), 8
0EC2 21 54 23                                ld      hl, 2354h
0EC5 11 FF AA                                ld      de, 0AAFFh
0EC8 ED 4B 84 23                             ld      bc, (word_2384)
0ECC CD BC 26                                call    sub_26BC
0ECF 21 5B 23                                ld      hl, 235Bh
0ED2 CD 63 25                                call    sub_2563
0ED5 DD 21 59 23                             ld      ix, 2359h
0ED9 DD 36 00 00                             ld      (ix+0), 0
0EDD DD 36 01 08                             ld      (ix+1), 8
0EE1 21 59 23                                ld      hl, 2359h
0EE4 11 FF AF                                ld      de, 0AFFFh
0EE7 01 FF FF                                ld      bc, 0FFFFh
0EEA CD BC 26                                call    sub_26BC
0EED
0EED                         loc_EED:                                ; CODE XREF: sub_DBF+72j
0EED 2A 84 23                                ld      hl, (word_2384)
0EF0 23                                      inc     hl
0EF1 22 84 23                                ld      (word_2384), hl
0EF4 C3 D1 0D                                jp      loc_DD1
0EF7                         ; ---------------------------------------------------------------------------
0EF7
0EF7                         loc_EF7:                                ; CODE XREF: sub_DBF+32j
0EF7                                                                 ; sub_DBF+DDj
0EF7 F5                                      push    af
0EF8 3A 6F 23                                ld      a, (byte_236F)
0EFB D3 05                                   out     (MROM_PAGE_REG), a
0EFD F1                                      pop     af
0EFE E1                                      pop     hl
0EFF D1                                      pop     de
0F00 C1                                      pop     bc
0F01 C9                                      ret
0F01                         ; End of function sub_DBF
0F01
0F02
0F02                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
0F02
0F02
0F02                         sub_F02:                                ; CODE XREF: sub_CDC+44p
0F02 C5                                      push    bc
0F03 D5                                      push    de
0F04 E5                                      push    hl
0F05 DD E5                                   push    ix
0F07 CD 47 14                                call    sub_1447
0F0A 11 04 00                                ld      de, 4
0F0D ED 53 86 23                             ld      (word_2386), de
0F11 11 F3 43                                ld      de, 43F3h
0F14 ED 53 88 23                             ld      (word_2388), de
0F18
0F18                         loc_F18:                                ; CODE XREF: sub_F02+D0j
0F18 DB 4E                                   in      a, (WATCHDOG_REG)
0F1A F6 08                                   or      8
0F1C D3 4E                                   out     (WATCHDOG_REG), a
0F1E ED 5B 86 23                             ld      de, (word_2386)
0F22 2E 00                                   ld      l, 0
0F24 06 06                                   ld      b, 6
0F26 AF                                      xor     a
0F27
0F27                         loc_F27:                                ; CODE XREF: sub_F02+2Bj
0F27 CB 23                                   sla     e
0F29 CB 12                                   rl      d
0F2B CB 15                                   rl      l
0F2D 10 F8                                   djnz    loc_F27
0F2F DB 05                                   in      a, (MROM_PAGE_REG)
0F31 32 6F 23                                ld      (byte_236F), a
0F34 DD 21 54 23                             ld      ix, 2354h
0F38 DD 36 00 00                             ld      (ix+0), 0
0F3C DD 36 01 08                             ld      (ix+1), 8
0F40 DD 73 02                                ld      (ix+2), e
0F43 DD 72 03                                ld      (ix+3), d
0F46 DD 75 04                                ld      (ix+4), l
0F49 21 54 23                                ld      hl, 2354h
0F4C CD F6 26                                call    sub_26F6
0F4F AF                                      xor     a
0F50 01 FE FF                                ld      bc, 0FFFEh
0F53 ED 42                                   sbc     hl, bc
0F55 CA C3 0F                                jp      z, loc_FC3
0F58 09                                      add     hl, bc
0F59 AF                                      xor     a
0F5A 01 FF AA                                ld      bc, 0AAFFh
0F5D ED 42                                   sbc     hl, bc
0F5F CA 76 0F                                jp      z, loc_F76
0F62 09                                      add     hl, bc
0F63 AF                                      xor     a
0F64 01 FF AF                                ld      bc, 0AFFFh
0F67 ED 42                                   sbc     hl, bc
0F69 C2 B7 0F                                jp      nz, loc_FB7
0F6C 21 FF FF                                ld      hl, 0FFFFh
0F6F 42                                      ld      b, d
0F70 4B                                      ld      c, e
0F71 AF                                      xor     a
0F72 ED 42                                   sbc     hl, bc
0F74 28 2D                                   jr      z, loc_FA3
0F76
0F76                         loc_F76:                                ; CODE XREF: sub_F02+5Dj
0F76 42                                      ld      b, d
0F77 4B                                      ld      c, e
0F78 3E C0                                   ld      a, 0C0h ; '+'
0F7A D3 05                                   out     (MROM_PAGE_REG), a
0F7C CB 21                                   sla     c
0F7E CB 10                                   rl      b
0F80 AF                                      xor     a
0F81 21 00 40                                ld      hl, 4000h
0F84 09                                      add     hl, bc
0F85 ED 4B 86 23                             ld      bc, (word_2386)
0F89 E5                                      push    hl
0F8A DD E1                                   pop     ix
0F8C AF                                      xor     a
0F8D DD 6E 00                                ld      l, (ix+0)
0F90 DD 66 01                                ld      h, (ix+1)
0F93 11 FF FF                                ld      de, 0FFFFh
0F96 ED 52                                   sbc     hl, de
0F98 DD E5                                   push    ix
0F9A E1                                      pop     hl
0F9B 20 1A                                   jr      nz, loc_FB7
0F9D 71                                      ld      (hl), c
0F9E 23                                      inc     hl
0F9F 70                                      ld      (hl), b
0FA0 23                                      inc     hl
0FA1 18 20                                   jr      loc_FC3
0FA3                         ; ---------------------------------------------------------------------------
0FA3
0FA3                         loc_FA3:                                ; CODE XREF: sub_F02+72j
0FA3                                                                 ; sub_F02+BFj
0FA3 ED 4B 86 23                             ld      bc, (word_2386)
0FA7 3E C1                                   ld      a, 0C1h ; '-'
0FA9 D3 05                                   out     (MROM_PAGE_REG), a
0FAB 2A 88 23                                ld      hl, (word_2388)
0FAE 70                                      ld      (hl), b
0FAF 2B                                      dec     hl
0FB0 71                                      ld      (hl), c
0FB1 2B                                      dec     hl
0FB2 22 88 23                                ld      (word_2388), hl
0FB5 18 0C                                   jr      loc_FC3
0FB7                         ; ---------------------------------------------------------------------------
0FB7
0FB7                         loc_FB7:                                ; CODE XREF: sub_F02+67j
0FB7                                                                 ; sub_F02+99j
0FB7 3E 02                                   ld      a, 2
0FB9 CD B4 13                                call    sub_13B4
0FBC 3A 72 23                                ld      a, (byte_2372)
0FBF FE FF                                   cp      0FFh
0FC1 28 E0                                   jr      z, loc_FA3
0FC3
0FC3                         loc_FC3:                                ; CODE XREF: sub_F02+53j
0FC3                                                                 ; sub_F02+9Fj ...
0FC3 ED 5B 86 23                             ld      de, (word_2386)
0FC7 13                                      inc     de
0FC8 ED 53 86 23                             ld      (word_2386), de
0FCC AF                                      xor     a
0FCD 2A 77 23                                ld      hl, (word_2377)
0FD0 ED 52                                   sbc     hl, de
0FD2 C2 18 0F                                jp      nz, loc_F18
0FD5 3A 6F 23                                ld      a, (byte_236F)
0FD8 D3 05                                   out     (MROM_PAGE_REG), a
0FDA DD 21 81 23                             ld      ix, 2381h
0FDE DD 7E 00                                ld      a, (ix+0)
0FE1 E6 C0                                   and     0C0h ; '+'
0FE3 5F                                      ld      e, a
0FE4 DD 56 01                                ld      d, (ix+1)
0FE7 DD 6E 02                                ld      l, (ix+2)
0FEA DD 21 54 23                             ld      ix, 2354h
0FEE DD 73 00                                ld      (ix+0), e
0FF1 DD 72 01                                ld      (ix+1), d
0FF4 DD 75 02                                ld      (ix+2), l
0FF7 21 54 23                                ld      hl, 2354h
0FFA CD 63 25                                call    sub_2563
0FFD CD 00 11                                call    sub_1100
1000 CD 0F 10                                call    sub_100F
1003 CD 92 12                                call    sub_1292
1006 CD 21 13                                call    sub_1321
1009 DD E1                                   pop     ix
100B E1                                      pop     hl
100C D1                                      pop     de
100D C1                                      pop     bc
100E C9                                      ret
100E                         ; End of function sub_F02
100E
100F
100F                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
100F
100F
100F                         sub_100F:                               ; CODE XREF: sub_F02+FEp
100F C5                                      push    bc
1010 D5                                      push    de
1011 E5                                      push    hl
1012 DD E5                                   push    ix
1014 FD E5                                   push    iy
1016 DB 05                                   in      a, (MROM_PAGE_REG)
1018 32 6F 23                                ld      (byte_236F), a
101B ED 5B 77 23                             ld      de, (word_2377)
101F 7A                                      ld      a, d
1020 FE 02                                   cp      2
1022 28 0C                                   jr      z, loc_1030
1024 FE 04                                   cp      4
1026 28 0D                                   jr      z, loc_1035
1028 FE 08                                   cp      8
102A 28 0E                                   jr      z, loc_103A
102C FE 10                                   cp      10h
102E 28 0F                                   jr      z, loc_103F
1030
1030                         loc_1030:                               ; CODE XREF: sub_100F+13j
1030 11 F8 01                                ld      de, 1F8h
1033 18 0D                                   jr      loc_1042
1035                         ; ---------------------------------------------------------------------------
1035
1035                         loc_1035:                               ; CODE XREF: sub_100F+17j
1035 11 F0 03                                ld      de, 3F0h
1038 18 08                                   jr      loc_1042
103A                         ; ---------------------------------------------------------------------------
103A
103A                         loc_103A:                               ; CODE XREF: sub_100F+1Bj
103A 11 E0 07                                ld      de, 7E0h
103D 18 03                                   jr      loc_1042
103F                         ; ---------------------------------------------------------------------------
103F
103F                         loc_103F:                               ; CODE XREF: sub_100F+1Fj
103F 11 C0 0F                                ld      de, 0FC0h
1042
1042                         loc_1042:                               ; CODE XREF: sub_100F+24j
1042                                                                 ; sub_100F+29j ...
1042 ED 53 8C 23                             ld      (word_238C), de
1046 11 00 00                                ld      de, 0
1049 ED 53 84 23                             ld      (word_2384), de
104D
104D                         loc_104D:                               ; CODE XREF: sub_100F+C2j
104D 3E C0                                   ld      a, 0C0h ; '+'
104F D3 05                                   out     (MROM_PAGE_REG), a
1051 FD 21 F2 43                             ld      iy, 43F2h
1055 2A 84 23                                ld      hl, (word_2384)
1058 CB 25                                   sla     l
105A CB 14                                   rl      h
105C AF                                      xor     a
105D 01 00 40                                ld      bc, 4000h
1060 09                                      add     hl, bc
1061 E5                                      push    hl
1062 DD E1                                   pop     ix
1064 5E                                      ld      e, (hl)
1065 23                                      inc     hl
1066 56                                      ld      d, (hl)
1067 2A 77 23                                ld      hl, (word_2377)
106A 2B                                      dec     hl
106B AF                                      xor     a
106C ED 52                                   sbc     hl, de
106E 30 53                                   jr      nc, loc_10C3
1070 3E C1                                   ld      a, 0C1h ; '-'
1072 D3 05                                   out     (MROM_PAGE_REG), a
1074
1074                         loc_1074:                               ; CODE XREF: sub_100F+97j
1074 FD 5E 00                                ld      e, (iy+0)
1077 FD 56 01                                ld      d, (iy+1)
107A 4A                                      ld      c, d
107B FD 2B                                   dec     iy
107D FD 2B                                   dec     iy
107F C5                                      push    bc
1080 2A 84 23                                ld      hl, (word_2384)
1083 ED 4B 8C 23                             ld      bc, (word_238C)
1087 CB 38                                   srl     b
1089 CB 19                                   rr      c
108B AF                                      xor     a
108C ED 42                                   sbc     hl, bc
108E 3A 85 23                                ld      a, (word_2384+1)
1091 38 07                                   jr      c, loc_109A
1093 3A 85 23                                ld      a, (word_2384+1)
1096 B8                                      cp      b
1097 20 01                                   jr      nz, loc_109A
1099 3C                                      inc     a
109A
109A                         loc_109A:                               ; CODE XREF: sub_100F+82j
109A                                                                 ; sub_100F+88j
109A C1                                      pop     bc
109B 2A 7A 23                                ld      hl, (word_237A)
109E
109E                         loc_109E:                               ; CODE XREF: sub_100F+94j
109E CB 39                                   srl     c
10A0 CB 3F                                   srl     a
10A2 2D                                      dec     l
10A3 20 F9                                   jr      nz, loc_109E
10A5 B9                                      cp      c
10A6 20 CC                                   jr      nz, loc_1074
10A8 3E FF                                   ld      a, 0FFh
10AA FD 77 02                                ld      (iy+2), a
10AD FD 77 03                                ld      (iy+3), a
10B0 3E C0                                   ld      a, 0C0h ; '+'
10B2 D3 05                                   out     (MROM_PAGE_REG), a
10B4 DD 73 00                                ld      (ix+0), e
10B7 DD 72 01                                ld      (ix+1), d
10BA 3E 01                                   ld      a, 1
10BC ED 53 86 23                             ld      (word_2386), de
10C0 CD B4 13                                call    sub_13B4
10C3
10C3                         loc_10C3:                               ; CODE XREF: sub_100F+5Fj
10C3 2A 84 23                                ld      hl, (word_2384)
10C6 23                                      inc     hl
10C7 22 84 23                                ld      (word_2384), hl
10CA ED 5B 8C 23                             ld      de, (word_238C)
10CE AF                                      xor     a
10CF ED 52                                   sbc     hl, de
10D1 C2 4D 10                                jp      nz, loc_104D
10D4 3E C1                                   ld      a, 0C1h ; '-'
10D6 D3 05                                   out     (MROM_PAGE_REG), a
10D8 3E 55                                   ld      a, 55h ; 'U'
10DA 32 FC 43                                ld      (43FCh), a
10DD 3E AA                                   ld      a, 0AAh ; '¬'
10DF 32 FD 43                                ld      (43FDh), a
10E2 CD 77 15                                call    sub_1577
10E5 3E C1                                   ld      a, 0C1h ; '-'
10E7 D3 05                                   out     (MROM_PAGE_REG), a
10E9 DD 21 FE 43                             ld      ix, 43FEh
10ED DD 73 00                                ld      (ix+0), e
10F0 DD 72 01                                ld      (ix+1), d
10F3 3A 6F 23                                ld      a, (byte_236F)
10F6 D3 05                                   out     (MROM_PAGE_REG), a
10F8 FD E1                                   pop     iy
10FA DD E1                                   pop     ix
10FC E1                                      pop     hl
10FD D1                                      pop     de
10FE C1                                      pop     bc
10FF C9                                      ret
10FF                         ; End of function sub_100F
10FF
1100
1100                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
1100
1100
1100                         sub_1100:                               ; CODE XREF: sub_F02+FBp
1100 C5                                      push    bc
1101 D5                                      push    de
1102 E5                                      push    hl
1103 DD E5                                   push    ix
1105 ED 5B 77 23                             ld      de, (word_2377)
1109 CB 3A                                   srl     d
110B CB 1B                                   rr      e
110D AF                                      xor     a
110E
110E                         loc_110E:                               ; CODE XREF: sub_1100+11j
110E 3C                                      inc     a
110F CB 3A                                   srl     d
1111 20 FB                                   jr      nz, loc_110E
1113 3D                                      dec     a
1114 FE 01                                   cp      1
1116 20 02                                   jr      nz, loc_111A
1118 3E 02                                   ld      a, 2
111A
111A                         loc_111A:                               ; CODE XREF: sub_1100+16j
111A 32 7A 23                                ld      (word_237A), a
111D DB 05                                   in      a, (MROM_PAGE_REG)
111F 32 6F 23                                ld      (byte_236F), a
1122 3E C1                                   ld      a, 0C1h ; '-'
1124 D3 05                                   out     (MROM_PAGE_REG), a
1126 AF                                      xor     a
1127 FD 21 FA 43                             ld      iy, 43FAh
112B 06 04                                   ld      b, 4
112D
112D                         loc_112D:                               ; CODE XREF: sub_1100+63j
112D DD 21 F2 43                             ld      ix, 43F2h
1131
1131                         loc_1131:                               ; CODE XREF: sub_1100+4Ej
1131 DD 5E 00                                ld      e, (ix+0)
1134 DD 56 01                                ld      d, (ix+1)
1137 DD 4E 01                                ld      c, (ix+1)
113A DD 2B                                   dec     ix
113C DD 2B                                   dec     ix
113E DD E5                                   push    ix
1140 E1                                      pop     hl
1141 CB 74                                   bit     6, h
1143 28 20                                   jr      z, loc_1165
1145 2A 7A 23                                ld      hl, (word_237A)
1148
1148                         loc_1148:                               ; CODE XREF: sub_1100+4Bj
1148 CB 39                                   srl     c
114A 2D                                      dec     l
114B 20 FB                                   jr      nz, loc_1148
114D B9                                      cp      c
114E 20 E1                                   jr      nz, loc_1131
1150 3C                                      inc     a
1151 DD 36 02 FF                             ld      (ix+2), 0FFh
1155 DD 36 03 FF                             ld      (ix+3), 0FFh
1159 FD 72 01                                ld      (iy+1), d
115C FD 73 00                                ld      (iy+0), e
115F FD 2B                                   dec     iy
1161 FD 2B                                   dec     iy
1163 10 C8                                   djnz    loc_112D
1165
1165                         loc_1165:                               ; CODE XREF: sub_1100+43j
1165 3A 6F 23                                ld      a, (byte_236F)
1168 D3 05                                   out     (MROM_PAGE_REG), a
116A DD E1                                   pop     ix
116C E1                                      pop     hl
116D D1                                      pop     de
116E C1                                      pop     bc
116F C9                                      ret
116F                         ; End of function sub_1100
116F
1170
1170                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
1170
1170
1170                         sub_1170:                               ; CODE XREF: sub_14EF+28p
1170 C5                                      push    bc
1171 D5                                      push    de
1172 E5                                      push    hl
1173 DD E5                                   push    ix
1175 DD 21 81 23                             ld      ix, 2381h
1179 DD 5E 00                                ld      e, (ix+0)
117C 7B                                      ld      a, e
117D C6 1F                                   add     a, 1Fh
117F 5F                                      ld      e, a
1180 DD 56 01                                ld      d, (ix+1)
1183 DD 6E 02                                ld      l, (ix+2)
1186 01 00 04                                ld      bc, 400h
1189 ED 43 7B 23                             ld      (word_237A+1), bc
118D 21 00 00                                ld      hl, 0
1190 22 7D 23                                ld      (word_237D), hl
1193 3E 02                                   ld      a, 2
1195 32 80 23                                ld      (byte_2380), a
1198
1198                         loc_1198:                               ; CODE XREF: sub_1170+82j
1198                                                                 ; sub_1170+8Bj
1198 DB 4E                                   in      a, (WATCHDOG_REG)
119A F6 08                                   or      8
119C D3 4E                                   out     (WATCHDOG_REG), a
119E DD 21 54 23                             ld      ix, 2354h
11A2 ED 4B 7B 23                             ld      bc, (word_237A+1)
11A6 DD 71 00                                ld      (ix+0), c
11A9 DD 70 01                                ld      (ix+1), b
11AC DD 73 02                                ld      (ix+2), e
11AF DD 72 03                                ld      (ix+3), d
11B2 DD 75 04                                ld      (ix+4), l
11B5 D5                                      push    de
11B6 E5                                      push    hl
11B7 ED 4B 7D 23                             ld      bc, (word_237D)
11BB DD 71 05                                ld      (ix+5), c
11BE DD 70 06                                ld      (ix+6), b
11C1 DD 36 07 01                             ld      (ix+7), 1
11C5 21 54 23                                ld      hl, 2354h
11C8 06 00                                   ld      b, 0
11CA CD 0F 3B                                call    sub_3B0F
11CD E1                                      pop     hl
11CE D1                                      pop     de
11CF 3A 80 23                                ld      a, (byte_2380)
11D2 3D                                      dec     a
11D3 32 80 23                                ld      (byte_2380), a
11D6 A7                                      and     a
11D7 28 24                                   jr      z, loc_11FD
11D9 E5                                      push    hl
11DA 2A 7D 23                                ld      hl, (word_237D)
11DD 01 00 02                                ld      bc, 200h
11E0 09                                      add     hl, bc
11E1 22 7D 23                                ld      (word_237D), hl
11E4 E1                                      pop     hl
11E5 ED 4B 7B 23                             ld      bc, (word_237A+1)
11E9 04                                      inc     b
11EA 04                                      inc     b
11EB ED 43 7B 23                             ld      (word_237A+1), bc
11EF 78                                      ld      a, b
11F0 FE 08                                   cp      8
11F2 20 A4                                   jr      nz, loc_1198
11F4 06 00                                   ld      b, 0
11F6 ED 43 7B 23                             ld      (word_237A+1), bc
11FA 1C                                      inc     e
11FB 18 9B                                   jr      loc_1198
11FD                         ; ---------------------------------------------------------------------------
11FD
11FD                         loc_11FD:                               ; CODE XREF: sub_1170+67j
11FD DD E1                                   pop     ix
11FF E1                                      pop     hl
1200 D1                                      pop     de
1201 C1                                      pop     bc
1202 C9                                      ret
1202                         ; End of function sub_1170
1202
1203
1203                         ; ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ S U B R O U T I N E ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
1203
1203
1203                         sub_1203:                               ; CODE XREF: sub_14EF+2Bp
1203 C5                                      push    bc
1204 D5                                      push    de
1205 E5                                      push    hl
1206 DD E5                                   push    ix
1208 DD 2