-
Notifications
You must be signed in to change notification settings - Fork 2
/
commands.asm
1657 lines (1405 loc) · 31 KB
/
commands.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
;$9EFF
;the asm file for the command interpreter
parseCliInput:
;check if the inputted command is the print command
ld hl, $2010
ld de, printcmd
ld b, 6
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputPrintString
;check if the input is the show time command
ld hl, $2010
ld de, printtimecmd
ld b, 4
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputShowTime
;check if the input is the show date command
ld hl, $2010
ld de, printdatecmd
ld b, 4
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputShowDate
;check if the input is the set time command
ld hl, $2010
ld de, settimecmd
ld b, 8
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputSetTime
;check if the input is the set date command
ld hl, $2010
ld de, setdatecmd
ld b, 8
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputSetDate
;check if the input is the test video command
ld hl, $2010
ld de, testvideocmd
ld b, 9
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputTestVideo
;check if the input is the vdp status register command
ld hl, $2010
ld de, vdpstatuscmd
ld b, 10
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputVdpStatus
;check if the input is the vdp manual register set command
ld hl, $2010
ld de, setvdpregcmd
ld b, 7
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputvdpregset
;check if the input is the load fonts command
ld hl, $2010
ld de, loadfontscmd
ld b, 9
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputLoadFonts
;check if the input is the clear command
ld hl, $2010
ld de, clearscreencmd
ld b, 5
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputClearScreen
;check if the input is the testvram command
ld hl, $2010
ld de, testvramcmd
ld b, 8
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputTestVram
;check if the input is the togglevmode command
ld hl, $2010
ld de, togglevmodecmd
ld b, 11
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputToggleVMode
;check if the input is the change color command
ld hl, $2010
ld de, changecolorcmd
ld b, 11
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputChangeColor
;check if the input is the drive status command
ld hl, $2010
ld de, driveStatuscmd
ld b, 11
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputDriveStatus
;check if the input is the drive error command
ld hl, $2010
ld de, driveerrorcmd
ld b, 10
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputDriveError
;check if the input is the cftest command
ld hl, $2010
ld de, cftestcmd
ld b, 6
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputCFTest
;check if the input is the read command
ld hl, $2010
ld de, readmemorycmd
ld b, 5
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputReadMemory
;check if the input is the iowr command
ld hl, $2010
ld de, iowrcmd
ld b, 5
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputIOWRITE
;check if the input is the iord command
ld hl, $2010
ld de, iordcmd
ld b, 5
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputIOREAD
;check if the input is the mmwr command
ld hl, $2010
ld de, memwrcmd
ld b, 5
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputMEMWRITE
;check if the input is the mmrd command
ld hl, $2010
ld de, memrdcmd
ld b, 5
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputMEMREAD
;check if the input is the fsinfo command
ld hl, $2010
ld de, fsinfocmd
ld b, 6
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputFsInfo
;check if the input is the fsinfo command
ld hl, $2010
ld de, testaddcmd
ld b, 7
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputTestAdd
;check if the input is the ls command
ld hl, $2010
ld de, lscmd
ld b, 2
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputPrintDirectory
;check if the input is the dir command
ld hl, $2010
ld de, dircmd
ld b, 3
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputPrintDirectory
;check if the input is the cd command
ld hl, $2010
ld de, cdcmd
ld b, 3
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputChangeDirectory
;check if the input is the test1 command
ld hl, $2010
ld de, test1cmd
ld b, 5
call areStringsEqual
ld a, 1
cp c
jp z, parseCliTest1
;check if the input is the call command
ld hl, $2010
ld de, callcmd
ld b, 5
call areStringsEqual
ld a, 1
cp c
jp z, parseCliCallCommand
;check if the input is the run command
ld hl, $2010
ld de, runcmd
ld b, 4
call areStringsEqual
ld a, 1
cp c
jp z, parseCliRunCommand
;check if the input is the cfreset command
ld hl, $2010
ld de, cfresetcmd
ld b, 7
call areStringsEqual
ld a, 1
cp c
jp z, parseCliCfReset
;check if the input is the help command
ld hl, $2010
ld de, helpcmd
ld b, 4
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputHelp
;check if the input is the sysinfo command
ld hl, $2010
ld de, sysinfocmd
ld b, 7
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputSysinfo
;check if the input is the sysinfo command
ld hl, $2010
ld de, randomcmd
ld b, 6
call areStringsEqual
ld a, 1
cp c
jp z, parseCliInputRandom
;check if the input is the get key
ld hl, $2010
ld de, getKeyCommandText
ld b, 6
call areStringsEqual
ld a, 1
cp c
jr z, parseCliInputGetKey
jp parseCliInputInvalidCommand
parseCliInputPrintString:
call printTextCommand
jp parseCliInputExit
parseCliInputShowTime:
call printTime
jp parseCliInputExit
parseCliInputShowDate:
call printDate
jp parseCliInputExit
parseCliInputSetTime:
call setTime
jp parseCliInputExit
parseCliInputSetDate:
call setDate
jp parseCliInputExit
parseCliInputGetKey:
call getKeyCommand
jp parseCliInputExit
parseCliInputTestVideo:
call initializeVideo
jp parseCliInputExit
parseCliInputVdpStatus:
call VdpStatusManualCommand
jp parseCliInputExit
parseCliInputvdpregset:
call VdpManualSetCommand
jr parseCliInputExit
parseCliInputLoadFonts:
call VdpLoadFonts
jr parseCliInputExit
parseCliInputClearScreen:
call ClearScreen
jr parseCliInputExit
parseCliInputTestVram:
call VdpTestVram
jr parseCliInputExit
parseCliInputToggleVMode:
call togglevmode
jr parseCliInputExit
parseCliInputChangeColor:
call changeColor
jr parseCliInputExit
parseCliInputDriveStatus:
call getCFStatusCommand
jr parseCliInputExit
parseCliInputDriveError:
call getCFErrorCommand
jr parseCliInputExit
parseCliInputCFTest:
call CFTestCommand
jr parseCliInputExit
parseCliInputReadMemory:
call readAndDisplayMemory
jr parseCliInputExit
parseCliInputIOREAD:
call manualioread
jr parseCliInputExit
parseCliInputIOWRITE:
call manualiowrite
jr parseCliInputExit
parseCliInputMEMREAD:
call manualmemread
jr parseCliInputExit
parseCliInputMEMWRITE:
call manualmemwrite
jr parseCliInputExit
parseCliInputFsInfo:
call fsInfoTestCommand
jr parseCliInputExit
parseCliInputTestAdd:
call test32bitAdd
jr parseCliInputExit
parseCliInputPrintDirectory:
call printCurrentDirectory
jr parseCliInputExit
parseCliInputChangeDirectory:
call changeDirectoryCommand
jr parseCliInputExit
parseCliTest1:
call genericTest1Command
jr parseCliInputExit
parseCliCallCommand:
call callCommand
jr parseCliInputExit
parseCliRunCommand:
call runProgramFromDisk
jr parseCliInputExit
parseCliCfReset:
call CfReset
jr parseCliInputExit
parseCliInputHelp:
call helpCommand
jr parseCliInputExit
parseCliInputSysinfo:
call sysinfoCommand
jr parseCliInputExit
parseCliInputRandom:
call randomCommand
jr parseCliInputExit
parseCliInputInvalidCommand:
call invalidCommand
parseCliInputExit:
call VdpInsertEnter
call clearCommandBuffer ;reset command buffer so you dont have to press backspace a bunch after entering a command
ret
printTime:
call VdpInsertEnter
;ld a, %11000000 ;the lcd's address for the 2nd line
;call lcdBlankLine ;print a blank line on the 2nd line on the lcd to discard any data from the previous command
ld hl, time
;call printString
call VPrintString
;hours
ld hl, $A014
ld a, (hl)
call aToScreenHex
ld a, ":"
;call printChar
call VdpPrintChar
;minutes
ld hl, $A012
ld a, (hl)
call aToScreenHex
ld a, ":"
;call printChar
call VdpPrintChar
;seconds
ld hl, $A010
ld a, (hl)
call aToScreenHex
;call backToPrevCursorPos
ret
printDate:
;ld a, %11000000 ;the lcd's address for the 2nd line
;call lcdBlankLine ;print a blank line on the 2nd line on the lcd to discard any data from the previous command
call VdpInsertEnter
;months
ld hl, $A019
ld a, (hl)
call aToScreenHex
ld a, "/"
;call printChar
call VdpPrintChar
;days
ld hl, $A016
ld a, (hl)
call aToScreenHex
ld a, "/"
;call printChar
call VdpPrintChar
;years
ld hl, $A01A
ld a, (hl)
call aToScreenHex
;call backToPrevCursorPos
ret
setTime:
;inhibit updating to allow time to be set
call VdpInsertEnter
ld hl, $A01E
ld a, %00001110
ld (hl), a
ld hl, $2018
ld a, (hl)
sub a, 48
sla a
sla a
sla a
sla a
and %00110000
ld b, a
inc hl
ld a, (hl)
sub a, 48
add a, b ;now we have the 1s and 10s place for the current hour.
ld hl, $A014
ld (hl), a
ld hl, $201A
ld a, (hl)
sub a, 48
sla a
sla a
sla a
sla a
and %01110000
ld b, a
inc hl
ld a, (hl)
sub a, 48
add a, b ;now we have the 1s and 10s place for the current minute.
ld hl, $A012
ld (hl), a
ld hl, $201C
ld a, (hl)
sub a, 48
sla a
sla a
sla a
sla a
and %01110000
ld b, a
inc hl
ld a, (hl)
sub a, 48
add a, b ;now we have the 1s and 10s place for the current second.
ld hl, $A010
ld (hl), a
;re-enable updating now that time has been set
ld hl, $A01E
ld a, %00000110
ld (hl), a
;ld a, %11000000 ;the lcd's address for the 2nd line
;call lcdBlankLine ;print a blank line on the 2nd line on the lcd to discard any data from the previous command
ld hl, genericok
;call printString
call VPrintString
;call backToPrevCursorPos
ret
setDate:
call VdpInsertEnter
;inhibit updating to allow time to be set
ld hl, $A01E
ld a, %00001110
ld (hl), a
ld hl, $2018
ld a, (hl)
sub a, 48
sla a
sla a
sla a
sla a
and %00010000
ld b, a
inc hl
ld a, (hl)
sub a, 48
add a, b ;now we have the 1s and 10s place for the current month.
ld hl, $A019
ld (hl), a
ld hl, $201A
ld a, (hl)
sub a, 48
sla a
sla a
sla a
sla a
and %00110000
ld b, a
inc hl
ld a, (hl)
sub a, 48
add a, b ;now we have the 1s and 10s place for the current day.
ld hl, $A016
ld (hl), a
ld hl, $201C
ld a, (hl)
sub a, 48
sla a
sla a
sla a
sla a
and %11110000
ld b, a
inc hl
ld a, (hl)
sub a, 48
add a, b ;now we have the 1s and 10s place for the current year.
ld hl, $A01A
ld (hl), a
;re-enable updating now that time has been set
ld hl, $A01E
ld a, %00000110
ld (hl), a
;ld a, %11000000 ;the lcd's address for the 2nd line
;call lcdBlankLine ;print a blank line on the 2nd line on the lcd to discard any data from the previous command
ld hl, genericok
;call printString
call VPrintString
;call backToPrevCursorPos
ret
;display next pressed key to the screen
getKeyCommand:
call VdpInsertEnter
;ld a, %11000000
;call lcdBlankLine
printAnotherKey_getKeyCommand:
call waitChar
push af
call aToScreenHex
pop af
;esc currently returns "2A" (the ascii value for *). So if that happens, exit the program
cp $2A
jr nz, printAnotherKey_getKeyCommand
;call backToPrevCursorPos
ret
printTextCommand:
call VdpInsertEnter
;;ld a, %11000000 ;the lcd's address for the 2nd line
;;call lcdBlankLine ;print a blank line on the 2nd line on the lcd to discard any data from the previous command
;call waitForLcdReady
;ld hl, $A000
;ld (hl), %11000000 ;the text is going to be printed on the second line of the lcd
ld hl, $2016 ;print whatever's in the saved command variable as a string, discarding the first 6 characters since they are part of the command
;call printString
call VPrintString
;call backToPrevCursorPos
ret
invalidCommand:
call VdpInsertEnter
;ld a, %11000000 ;the lcd's address for the 2nd line
;call lcdBlankLine ;print a blank line on the 2nd line on the lcd to discard any data from the previous command
;call waitForLcdReady
;ld hl, $A000
;ld (hl), %11000000 ;the text is going to be printed on the second line of the lcd
ld hl, badcommand ;print whatever's in the saved command variable as a string to see just how accurate that thing actually is
;call printString
call VPrintString
;call backToPrevCursorPos
ret
;put the cursor back to whereever it was before typing in the command (not the best thing to do but I will change it later after I get a few other things working)
;will probably no longer be used if I ever get a video card for this
backToPrevCursorPos:
call waitForLcdReady
ld hl, $2009
ld a, (hl) ;get whatever value the character counter has
add a, %10000000 ;add it to the starting lcd ram address
ld hl, $A000
ld (hl), a ;put the cursor back to whereever it was before typing in the command (not the best thing to do but I will change it later after I get a few other things working)
ret
;if the first b characters of string in de is equal to the string in hl, c becomes set. otherwise, c gets reset
areStringsEqual:
ld c, 0
areStringsEqualDoAgain:
ld a, (de)
cp (hl)
jr z, areStringsEqualContinue
jr nz, areStringsEqualExit
areStringsEqualContinue:
inc hl
inc de
dec b
ld a, 0
cp b
jr nz, areStringsEqualDoAgain
ld c, 1
jr areStringsEqualGTFO
areStringsEqualExit:
ld c, 0
areStringsEqualGTFO:
ret
VdpStatusManualCommand:
ld a, %11000000
call lcdBlankLine
ld a, "R"
call printChar
ld hl, $201A ;ram address of whatever command parameter is in the correct place
ld a, (hl)
push af
call printChar
ld a, "="
call printChar
pop af
sub a, 48
call VdpReadStatus
call aToScreenHex
call backToPrevCursorPos
ret
VdpManualSetCommand:
ld hl, $2017
ld a, (hl)
call aToHex
sla a
sla a
sla a
sla a
ld b, a
inc hl
ld a, (hl)
call aToHex
add a, b
;assuming the user typed a hex value, we now we have the hex value of the register to use
ld c, a ;save it to c for temporary safe keeping
ld hl, $2020
ld a, (hl)
call aToHex
sla a
sla a
sla a
sla a
ld b, a
inc hl
ld a, (hl)
call aToHex
add a, b
;now load register a into d and c into a in preparation for the write register subroutine
ld d, a
ld a, c
call VdpWriteToStandardRegister
ld hl, genericok
call printString
ret
VdpLoadFonts:
call VdpCharsIntoRam
ld a, %11000000
call lcdBlankLine
ld hl, fontLoaded
call printString
call backToPrevCursorPos
ret
;TO-DO: Fix the bug where it puts the cursor on row 1 and not row zero
ClearScreen:
;set column and row counters to zero
ld a, 0
ld hl, $9EFA
ld (hl), a
inc hl
ld (hl), a
ld hl, $2009
ld (hl), a
;fill the 40 character keyboard input store-er with null characters
inc hl
ld c, 80
call clearRangeInRam
;only thing left is to clear the screen in vram
call eraseScreen
;now run this so the vram addres pointer will be at top of screen area and ready to be used some more
call RowsColumnsToVram
ret
VdpTestVram:
ld a, %11000000
call lcdBlankLine ;clear second row of lcd to make room for the test results
ld a, 14
ld d, %00000000
call VdpWriteToStandardRegister
ld a, %00000010
out (c), a
ld a, %01010010
out (c), a
ld c, $20
ld a, %00000000
out (c), a
ld a, %11111111
out (c), a
ld a, $69
out (c), a
ld a, 69
out (c), a
ld a, 14
ld d, %00000000
call VdpWriteToStandardRegister
ld a, %00000010
out (c), a
ld a, %00010010
out (c), a
;start writing results of the vram reads to the screen. Let's see if this son of a bitch actually works or not
ld c, $20
in a,(c)
call aToScreenHex
in a,(c)
call aToScreenHex
in a,(c)
call aToScreenHex
in a,(c)
call aToScreenHex
ld hl, genericok
call printString
call backToPrevCursorPos
ret
togglevmode:
;first, set cursor to second row of lcd in preparation to print the results
ld a, %11000000
call lcdBlankLine ;clear second row of lcd to make room for the test results
;0 = ntsc. 1 = pal
ld hl, $9EFD
ld a, (hl)
and a, %00000001
cp %00000001
jr z, togglevmodePal
;ntsc. switch to pal
;write 1 to area in ram to indicate pal
ld a, 1
ld (hl), a
ld a, 9
ld d, %00000010 ;change respective vdp register. bit 1 = 1 means pal
call VdpWriteToStandardRegister
;put visual confirmation on lcd that video mode as been changed to correct format
ld hl, palmsg
call printString
jr togglevmodeExit
togglevmodePal:
;pal. switch to ntsc
;write 0 to area in ram to indicate ntsc
ld a, 0
ld (hl), a
ld a, 9
ld d, %00000000 ;change respective vdp register. bit 1 = 0 means ntsc
call VdpWriteToStandardRegister
;put visual confirmation on lcd that video mode as been changed to correct format
ld hl, ntscmsg
call printString
jr togglevmodeExit
togglevmodeExit:
call backToPrevCursorPos
ret
changeColor:
;blank the screen because this didn't work before I blanked it
ld d, %00000000
ld a, 1
call VdpWriteToStandardRegister
ld hl, $9EFC
ld a, (hl)
and a, %00000001
cp %00000001
jr z, makeColorRed
ld a, 1
ld hl, $9EFC
ld (hl), a
ld a, 0
ld d, %01110000
ld e, %00000000
jr changeColorContinue
makeColorRed:
ld a, 0
ld hl, $9EFC
ld (hl), a
ld a, 0
ld d, %00000111
ld e, %00000000
changeColorContinue:
call VdpWriteToPaletteRegister
;put the screen back to the way it was before
ld d, %01010000
ld a, 1
call VdpWriteToStandardRegister
ld a, %11000000
call lcdBlankLine ;clear second row of lcd to make room for the test results
ld hl, genericok
call printString
call backToPrevCursorPos
ret
getCFStatusCommand:
call VdpInsertEnter
ld hl, cfstatusequals
call VPrintString
call getCFStatus
call aToScreenHex
ret
getCFErrorCommand:
call VdpInsertEnter
ld hl, cferrorequals
call VPrintString
ld b, $A0
ld c, $31
in a, (c)
call aToScreenHex
ret
CFTestCommand:
call readCFSector
;ld d, $FF
;ld hl, $3000
;call displayMemoryToScreen
call VdpInsertEnter
ld hl, genericok
call VPrintString
ret
callCommand:
;go ahead and make a new line
call VdpInsertEnter
ld hl, $2015
ld a, (hl)
inc hl
ld b, (hl)
call asciiToHex
ld d, a
inc hl
ld a, (hl)
inc hl
ld b, (hl)
call asciiToHex
ld e, a
;address of where to jump to is now in hl
;load return address into hl
ld hl, callCommandPlaceToReturnTo
ex de, hl
push de ;push return address onto the stack without popping it
jp (hl) ;jump to user inputted address
callCommandPlaceToReturnTo:
ret
readAndDisplayMemory: