-
Notifications
You must be signed in to change notification settings - Fork 0
/
plus3ROM2.asm
9655 lines (8909 loc) · 116 KB
/
plus3ROM2.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
OUTPUT "p3t_rom2.rom"
ORG $0000
; *************************************************
; *** SPECTRUM +3 ROM 2 DISASSEMBLY (+3DOS ROM) ***
; *************************************************
; ROM2 del PROYECTO +3e de la VERSION IDE 8bits
; Desensamblado por DJr, con la valiosa ayuda de DZ80 V2.0
; este desensamble no sabe nada de las constantes spanish, garry, y V41
; aca todo es IDE8 v4.0 e ingles . a.k.a no me la compliquesn
n0000: JR $0000 ; que es esto??? no parece tener uso he probado
JP l22c2 ; a sustituirlo pos "DS 8" como en la ROM
JP l196a ; original y aparentemente todo funciona bien
n0008: DB "PLUS3DOS"
n0010: DB $2F,$58,$32,$9A ; ¿¿¿que es todo esto??? son como datos
DB $2F,$9E,$34,$E3 ; al azar si se examina su desensamble
DB $80,$01,$C0,$05 ; y a primera vista no parecen ser
DB $C4,$09,$C8,$0D ; necesarios, pero he comprobado que si
DB $61,$0F,$CC,$14 ; quito esto y pongo "DS 40" como en la
DB $51,$00,$13,$16 ; ROM original muchos Z80s no cargan
DB $24,$17,$56,$19 ; con el comando SPECTRUM
DB $10,$13,$14,$ED
DB $79,$01,$06,$7F
DB $3E,$C3,$FB,$C9
/*
n0000: DS 8
n0008: DM "PLUS3DOS"
n0010: DS 40
*/
/*
;===============================================================================
POR OTRO LADO: NO HAY MUCHO ESPACIO LIBRE PARA RASCAR, PERO CUALQUIER COSA BAJO
LA DIRECTIVA "DS" ES TODO USABLE PARA PONER ALGUN CAMBIO QUE QUIERAS HACER
;===============================================================================
*/
; The maskable interrupt routine
PUSH AF
PUSH HL
LD HL,(FRAMES)
INC HL ; increment FRAMES
LD (FRAMES),HL
LD A,H
OR L
JR NZ,l0048
INC (IY+$40) ; increment high byte of FRAMES
l0048: PUSH BC
PUSH DE
CALL l3e72 ; scan the keyboard
CALL l0068 ; test for disk motor timeout
POP DE
POP BC
POP HL
POP AF
EI
RET
JP l3a24
JP l3cc9
JP l3d5f
JP l3d55
JP l3d64
NOP
; The Non-maskable interrupt
x0066: RETN
l0068: LD BC,PBANKM
LD A,(BANKM)
OR $07
OUT (C),A
LD A,(timeout)
OR A
JR Z,l0095 ; (+$1D)
LD A,(FRAMES)
BIT 0,A
JR NZ,l0095 ; (+$16)
LD A,(timeout)
DEC A
LD (timeout),A
JR NZ,l0095 ; (+$0D)
LD BC,PBANK678
LD A,(BANK678)
AND $F7
LD (BANK678),A
OUT (C),A
l0095: LD BC,PBANKM
LD A,(BANKM)
OUT (C),A
RET
DW $0000
JP l2808
JP l249a
JP l2828
JP l280d
JP l2558
JP l25fb
JP l2a01
JP l2bc8
JP l2de2
JP l2d0b
JP l2f93
JP l2c0f
JP l2b69
JP l2b92
JP l2c3b
JP l2c94
JP l2cdb
JP l306c
JP l3083
JP l318b
JP l2cdb
JP l3131
JP l3106
JP l314e
JP l30af
JP l30bb
JP l31e1
JP l3227
JP l3370
JP l33cd
JP l34ac
JP l3531
l0100: JP l01a8 ; DOS_INITIALISE
l0103: JP l01dc ; DOS_VERSION
l0106: JP l0635 ; DOS_OPEN
l0109: JP l074a ; DOS_CLOSE
l010c: JP l076b ; DOS_ABANDON
x010f: JP l08bb ; DOS_REF_HEAD
l0112: JP l19c0 ; DOS_READ
l0115: JP l117f ; DOS_WRITE
l0118: JP l1129 ; DOS_BYTE_READ
l011b: JP l1219 ; DOS_BYTE_WRITE
l011e: JP l0a23 ; DOS_CATALOG
l0121: JP l08fc ; DOS_FREE_SPACE
l0124: JP l092e ; DOS_DELETE
l0127: JP l0979 ; DOS_RENAME
l012a: JP l1b4d ; DOS_BOOT
l012d: JP l0919 ; DOS_SET_DRIVE
x0130: JP l0906 ; DOS_SET_USER
l0133: JP l105f ; DOS_GET_POSITION
x0136: JP l107b ; DOS_SET_POSITION
l0139: JP l1068 ; DOS_GET_EOF
l013c: JP l01ec ; DOS_GET_1346
l013f: JP l01f2 ; DOS_SET_1346
l0142: JP l05cf ; DOS_FLUSH
l0145: JP l08cd ; DOS_SET_ACCESS
l0148: JP l0963 ; DOS_SET_ATTRIBUTES
l014b: JP l070e ; DOS_OPEN_DRIVE
l014e: JP l02f0 ; DOS_SET_MESSAGE
l0151: JP l17c5 ; DOS_REF_XDPB
l0154: JP l1935 ; DOS_MAP_B
l0157: JP l1f86 ; DD_INTERFACE
l015a: JP l1f91 ; DD_INIT
l015d: JP x1fa6 ; DD_SETUP
l0160: JP l1966 ; DD_SET_RETRY
l0163: JP l1c75 ; DD_READ_SECTOR
l0166: JP x1c83 ; DD_WRITE_SECTOR
l0169: JP x1c8c ; DD_CHECK_SECTOR
x016c: JP l1c9a ; DD_FORMAT
l016f: JP l1cac ; DD_READ_ID
l0172: JP l1edb ; DD_TEST_UNSUITABLE
l0175: JP l1cf6 ; DD_LOGIN
l0178: JP l1d51 ; DD_SEL_FORMAT
l017b: JP l1f4f ; DD_ASK_1
l017e: JP l1f5b ; DD_DRIVE_STATUS
l0181: JP l1eeb ; DD_EQUIPMENT
l0184: JP l1c50 ; DD_ENCODE
l0187: JP l1d64 ; DD_L_XDPB
l018a: JP l1da6 ; DD_L_DPB
l018d: JP l1fd5 ; DD_L_SEEK
l0190: JP l3ef5 ; DD_L_READ
l0193: JP l2122 ; DD_L_WRITE
l0196: JP l2181 ; DD_L_ON_MOTOR
l0199: JP l21a6 ; DD_L_T_OFF_MOTOR
l019c: JP l3ee6 ; DD_L_OFF_MOTOR
JP l39bd
JP l24bf
JP l29ca
l01a8: LD A,($DF9D)
PUSH AF
LD HL,pg_buffer
LD DE,$DB01
LD BC,$09FF
LD (HL),$00
LDIR
CALL l1f86
JR NC,l01c4 ; (+$06)
CALL l1f91
CALL l1737
l01c4: LD HL,$0878
LD DE,$0008
PUSH DE
CALL x1798
POP DE
CALL l14a5
CALL l0508
POP AF
LD ($DF9D),A
JP l2828
l01dc: XOR A
LD B,$01
SUB B
LD A,$00
LD B,A
LD C,A
LD DE,$0101
LD HL,$0069
SCF
RET
l01ec: CALL l1ab1
JP l149c
l01f2: PUSH DE
EX DE,HL
CALL l1ab1
OR A
SBC HL,DE
EX DE,HL
SCF
CALL NZ,l1abb
POP DE
RET NC
EX DE,HL
CALL l149c
EX DE,HL
OR A
SBC HL,DE
ADD HL,DE
SCF
CALL NZ,l14a1
RET
l020f: INC C
DEC C
JR NZ,l0216 ; (+$03)
INC B
DEC B
RET Z
l0216: CALL l021b
LDIR
l021b: PUSH HL
PUSH BC
LD B,A
LD HL,BANKM
LD A,(HL)
AND $07
PUSH AF
LD A,(HL)
AND $F8
OR B
LD BC,PBANKM
LD (HL),A
OUT (C),A
POP AF
POP BC
POP HL
RET
l0233: ADD A,A
LD L,A
OR $C0
LD H,A
LD A,L
LD L,$00
RLCA
RLCA
RLCA
AND $06
CP $04
RET NC
INC A
RET
l0245: LD A,C
CP B
JR NZ,l024f ; (+$06)
PUSH IX
POP BC
JP l020f
l024f: PUSH BC
CALL l02cc
CALL l020f
POP BC
PUSH BC
LD A,B
EX DE,HL
CALL l02cc
EX DE,HL
CALL l020f
PUSH IX
POP BC
LD A,B
OR C
POP BC
RET Z
LD A,R
DI
PUSH AF
OR A
CALL l027b
CALL l0290
SCF
CALL l027b
POP AF
RET po
EI
RET
l027b: PUSH HL
PUSH DE
PUSH BC
LD BC,$0020
LD DE,pg_buffer
LD HL,$BFE0
JR NC,l028a ; (+$01)
EX DE,HL
l028a: LDIR
POP BC
POP DE
POP HL
RET
l0290: PUSH IX
EX (SP),HL
LD A,H
OR A
JR NZ,l029c ; (+$05)
LD A,L
CP $20
JR C,x029e ; (+$02)
l029c: LD A,$20
x029e: PUSH BC
LD C,A
LD B,$00
OR A
SBC HL,BC
POP BC
EX (SP),HL
POP IX
OR A
RET Z
PUSH DE
PUSH BC
PUSH AF
LD B,A
LD A,C
LD C,B
LD B,$00
LD DE,$BFE0
CALL l020f
POP AF
POP BC
POP DE
PUSH HL
PUSH BC
LD C,A
LD A,B
LD B,$00
LD HL,$BFE0
CALL l020f
POP BC
POP HL
JR l0290 ; (-$3C)
l02cc: PUSH HL
LD BC,$0000
LD HL,src_add
OR A
SBC HL,DE
JR C,l02ee ; (+$16)
JR Z,l02ee ; (+$14)
PUSH IX
POP BC
OR A
SBC HL,BC
ADD HL,BC
JR NC,l02e5 ; (+$02)
LD B,H
LD C,L
l02e5: PUSH IX
POP HL
OR A
SBC HL,BC
PUSH HL
POP IX
l02ee: POP HL
RET
l02f0: OR A
JR NZ,l02f6 ; (+$03)
LD HL,$0000
l02f6: LD DE,(rt_alert)
LD (rt_alert),HL
EX DE,HL
RET
l02ff: LD B,A
LD HL,(rt_alert)
LD A,H
OR L
LD A,B
JR NZ,x030a ; (+$02)
INC L
RET
x030a: PUSH BC
LD HL,x03cd
LD (al_resp),HL
CALL l032d
POP BC
PUSH BC
CALL l031f
POP BC
SUB $01
CCF
LD A,B
RET
l031f: PUSH HL
LD HL,(rt_alert)
EX (SP),HL
RET
l0325: LD A,$0A
LD HL,x03cd
LD (al_resp),HL
l032d: LD IX,al_mess
PUSH IX
CALL l033c
LD (IX+$00),$FF
POP HL
RET
l033c: AND $7F
LD HL,(al_resp)
LD B,A
INC B
JR l034a ; (+$05)
l0345: LD A,(HL)
INC HL
INC A
JR NZ,l0345 ; (-$05)
l034a: DJNZ l0345 ; (-$07)
l034c: LD A,(HL)
INC HL
CP $FF
RET Z
PUSH HL
CALL l0358
POP HL
JR l034c ; (-$0C)
l0358: OR A
JP p,l03c7
CP $FE
JR Z,l03c6 ; (+$66)
CP $FD
JR Z,l0397 ; (+$33)
CP $FC
JR Z,l0394 ; (+$2C)
CP $FB
JR Z,l037d ; (+$11)
CP $FA
JR NZ,l033c ; (-$34)
LD (IX+$00),$10
INC IX
LD A,(BORDCR)
AND $07
JR l03c7 ; (+$4A)
l037d: LD (IX+$00),$10
INC IX
LD A,(BORDCR)
AND $38
CP $20
JR NC,l0390 ; (+$04)
LD A,$05
JR l0392 ; (+$02)
l0390: LD A,$02
l0392: JR l03c7 ; (+$33)
l0394: LD A,E
JR l0398 ; (+$01)
l0397: LD A,D
l0398: PUSH DE
PUSH BC
LD L,A
LD H,$00
LD D,H
LD BC,$FF9C
CALL l03b1
LD BC,$FFF6
CALL l03b1
LD A,L
ADD A,$30
POP BC
POP DE
JR l03c7 ; (+$16)
l03b1: LD A,$FF
l03b3: PUSH HL
INC A
ADD HL,BC
JR NC,l03bc ; (+$04)
EX (SP),HL
POP HL
JR l03b3 ; (-$09)
l03bc: POP HL
OR A
JR Z,l03c2 ; (+$02)
LD D,$30
l03c2: ADD A,D
RET Z
JR l03c7 ; (+$01)
l03c6: LD A,C
l03c7: LD (IX+$00),A
INC IX
RET
x03cd: DB $8B, "not ready", $8F, $FF
DB $8C,"write protected", $8F, $FF
DB $8D, "seek fail", $8F, $FF
DB $8E, "data error", $8F, $FF
DB $8E, "no data", $8F, $FF
DB $8E, "missing address mark", $8F, $FF
DB $8B, "bad format", $8F, $FF
DB $8E, "unknown error", $8F, $FF
DB $8C,"changed, please replace", $8F, $FF
DB $8C,"unsuitable", $8F, $FF
DB "Please put the disk for ", $FE, ": into the drive then press "
DB "any key", $FF
DB "Drive ", $FE, ": ", $FF
DB $8B, "disk ", $FF
DB $8B, "track ", $FD, ", ", $FF
DB $8D, "sector ", $FC, ", ", $FF
DB " - Retry, Ignore or Cancel? ", $FF
l04eb: OR A
RET Z
l04ed: SRL D
RR E
DEC A
JR NZ,l04ed ; (-$07)
RET
l04f5: OR A
RET Z
EX DE,HL
l04f8: ADD HL,HL
DEC A
JR NZ,l04f8 ; (-$04)
EX DE,HL
RET
l04fe: JP (HL)
l04ff: CP $61
RET C
CP $7B
RET NC
ADD A,$E0
RET
l0508: LD BC,$1041
l050b: LD A,C
CALL l17cb
LD A,C
JR C,l0517 ; (+$05)
INC C
DJNZ l050b ; (-$0A)
LD A,$41
l0517: LD (def_drv),A
LD (LODDRV),A
LD (SAVDRV),A
RET
x0521: CALL l0532
RET NC
RRA
LD A,$1D
RET
l0529: CALL l0532
RET NC
RRA
RRA
LD A,$1D
RET
l0532: CALL l0558
RET NC
RLCA
RRA
RET C
LD A,$1D
RET
l053c: CALL l0558
RET NC
RLA
CCF
LD A,$1D
RET NC
PUSH HL
PUSH DE
PUSH BC
LD H,B
LD L,C
LD (HL),$00
LD D,B
LD E,C
INC DE
LD BC,$0037
LDIR
POP BC
POP DE
POP HL
RET
l0558: PUSH HL
PUSH DE
LD A,B
CP $10
LD A,$15
JR NC,l0573 ; (+$12)
LD HL,$DB68
LD DE,o0038
INC B
l0568: ADD HL,DE
DJNZ l0568 ; (-$03)
LD B,H
LD C,L
LD HL,$0020
ADD HL,BC
LD A,(HL)
SCF
l0573: POP DE
POP HL
RET
l0576: LD HL,$0020
ADD HL,BC
LD E,(HL)
LD (HL),$00
PUSH HL
PUSH DE
CALL l0586
POP DE
POP HL
LD (HL),E
RET
l0586: LD HL,fcbs
LD E,$12
l058b: PUSH HL
PUSH BC
LD BC,$0020
ADD HL,BC
LD D,(HL)
INC HL
LD A,(HL)
POP BC
POP HL
BIT 7,D
JR Z,l05c4 ; (+$2A)
PUSH HL
LD HL,$0021
ADD HL,BC
CP (HL)
POP HL
JR NZ,l05c4 ; (+$21)
LD A,(BC)
CP $22
JR Z,l05b0 ; (+$08)
LD A,(HL)
CP $22
CALL NZ,l0d7a
JR NZ,l05c4 ; (+$14)
l05b0: PUSH HL
LD HL,$0020
ADD HL,BC
LD A,(HL)
RRCA
RRCA
AND $03
LD H,A
LD A,D
AND $03
OR H
XOR H
LD A,$1E
POP HL
RET NZ
l05c4: PUSH DE
LD DE,o0038
ADD HL,DE
POP DE
DEC E
JR NZ,l058b ; (-$42)
SCF
RET
l05cf: CALL l04ff
CALL l0c13
RET NC
l05d6: PUSH BC
LD BC,fcbs
LD E,$12
l05dc: LD HL,$0020
ADD HL,BC
BIT 7,(HL)
JR Z,l05f1 ; (+$0D)
INC HL
LD A,(HL)
CP (IX+$1C)
SCF
PUSH DE
CALL Z,l0756
POP DE
JR NC,l05fb ; (+$0A)
l05f1: LD HL,o0038
ADD HL,BC
LD B,H
LD C,L
DEC E
JR NZ,l05dc ; (-$1E)
SCF
l05fb: POP BC
RET
l05fd: LD BC,fcbs
LD E,$12
l0602: PUSH HL
PUSH DE
LD A,D
EX DE,HL
LD HL,$0021
ADD HL,BC
CP (HL)
JR NZ,l0627 ; (+$1A)
INC HL
BIT 3,(HL)
JR Z,l0627 ; (+$15)
LD HL,$002B
ADD HL,BC
LD A,E
CP (HL)
JR NZ,l0627 ; (+$0D)
INC HL
LD A,D
CP (HL)
JR NZ,l0627 ; (+$08)
CALL l0c0c
CALL C,l12ab
JR NC,l062e ; (+$07)
l0627: LD HL,o0038
ADD HL,BC
LD B,H
LD C,L
SCF
l062e: POP DE
POP HL
RET NC
DEC E
JR NZ,l0602 ; (-$32)
RET
l0635: PUSH DE
PUSH BC
CALL l053c
CALL C,l0ae9
CALL C,l0c0c
POP HL
POP DE
RET NC
PUSH DE
LD A,L
LD HL,$0020
ADD HL,BC
LD (HL),A
CALL l0586
LD HL,l0d7a
CALL C,l0d9e
POP DE
RET NC
JR NZ,l0687 ; (+$30)
LD A,E
OR A
LD A,$18
RET Z
DEC E
JR NZ,l0667 ; (+$08)
CALL l06cc
CALL C,l080b
JR l06a3 ; (+$3C)
l0667: DEC E
JR NZ,l0672 ; (+$08)
CALL l06cc
CALL C,l0863
JR l06a3 ; (+$31)
l0672: PUSH DE
DEC E
JR NZ,l067e ; (+$08)
CALL l06e8
CALL C,l098d
JR l0685 ; (+$07)
l067e: OR A
LD A,$15
DEC E
CALL Z,l0938
l0685: POP DE
RET NC
l0687: LD A,D
OR A
LD A,$17
RET Z
DEC D
JR NZ,l0697 ; (+$08)
CALL x06b1
CALL C,l07e6
JR l069e ; (+$07)
l0697: OR A
LD A,$15
DEC D
CALL Z,x06b1
l069e: RET NC
XOR A
SCF
JR l06a5 ; (+$02)
l06a3: RET NC
SBC A,A
l06a5: PUSH AF
LD HL,$0020
ADD HL,BC
SET 7,(HL)
INC (IX+$21)
POP AF
RET
x06b1: LD HL,$0020
ADD HL,BC
LD A,(HL)
RRA
RRA
LD A,$1E
CALL C,x1871
LD HL,$0000
CALL C,x0caa
RET NC
LD HL,$0022
ADD HL,BC
SET 0,(HL)
SCF
RET
l06cc: CALL l0d3a
JR NC,l06e0 ; (+$0F)
LD HL,$0020
ADD HL,BC
BIT 1,(HL)
SCF
RET Z
CALL l0eb3
CALL C,x1871
RET
l06e0: CP $19
SCF
CCF
RET NZ
LD A,$17
RET
l06e8: PUSH BC
LD H,B
LD L,C
LD DE,sysfcb0
LD BC,o0038
LDIR
POP BC
LD A,$42
LD ($DF29),A
LD HL,$4B41
LD ($DF2A),HL
PUSH BC
LD BC,sysfcb0
CALL l0938
POP BC
RET C
CP $17
SCF
RET Z
OR A
RET
l070e: CALL l04ff
LD D,A
LD E,C
CALL l053c
RET NC
LD A,$22
LD (BC),A
LD HL,$0020
ADD HL,BC
LD (HL),E
INC HL
LD (HL),D
LD A,D
CALL l17cb
CALL C,l0586
RET NC
LD E,(IX+$05)
LD D,(IX+$06)
INC DE
LD A,(IX+$02)
SUB $02
CALL NZ,l04f5
CALL x1896
SLA E
RL D
LD HL,$0024
ADD HL,BC
LD (HL),E
INC HL
LD (HL),D
SCF
JP l06a5
l074a: CALL l0532
CALL C,l0c0c
CALL C,l0756
RET NC
JR l0789 ; (+$33)
l0756: LD HL,$0020
ADD HL,BC
BIT 1,(HL)
SCF
RET Z
CALL x07a1
CALL C,l12ab
CALL C,l1685
CALL C,l0cb6
RET
l076b: CALL l0532
CALL C,l0c0c
RET NC
LD HL,$0020
ADD HL,BC
BIT 1,(HL)
JR Z,l0789 ; (+$0F)