summaryrefslogtreecommitdiff
path: root/ports.asm
blob: 056cd825ec3e0c728f8cc2e32d7c43a52b248921 (plain)
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
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
	;; Routines to process OUT and IN instructions.  This is the
	;; bit that's unique to TI calculators.

	;; Port is in d0, byte is in d1
	;; Destroys a0
port_in:
	movea	lut_ports_in(pc,d0),a0
	jmp	(a0)
	rts

lut_ports_in:
	dc.l	port_in_00
	dc.l	port_in_01
	dc.l	port_in_02
	dc.l	port_in_03
	dc.l	port_in_04
	dc.l	port_in_05
	dc.l	port_in_06
	dc.l	port_in_07
	dc.l	port_in_08
	dc.l	port_in_09
	dc.l	port_in_0a
	dc.l	port_in_0b
	dc.l	port_in_0c
	dc.l	port_in_0d
	dc.l	port_in_0e
	dc.l	port_in_0f
	dc.l	port_in_10
	dc.l	port_in_11
	dc.l	port_in_12
	dc.l	port_in_13
	dc.l	port_in_14
	dc.l	port_in_15
	dc.l	port_in_16
	dc.l	port_in_17
	dc.l	port_in_18
	dc.l	port_in_19
	dc.l	port_in_1a
	dc.l	port_in_1b
	dc.l	port_in_1c
	dc.l	port_in_1d
	dc.l	port_in_1e
	dc.l	port_in_1f
	dc.l	port_in_20
	dc.l	port_in_21
	dc.l	port_in_22
	dc.l	port_in_23
	dc.l	port_in_24
	dc.l	port_in_25
	dc.l	port_in_26
	dc.l	port_in_27
	dc.l	port_in_28
	dc.l	port_in_29
	dc.l	port_in_2a
	dc.l	port_in_2b
	dc.l	port_in_2c
	dc.l	port_in_2d
	dc.l	port_in_2e
	dc.l	port_in_2f
	dc.l	port_in_30
	dc.l	port_in_31
	dc.l	port_in_32
	dc.l	port_in_33
	dc.l	port_in_34
	dc.l	port_in_35
	dc.l	port_in_36
	dc.l	port_in_37
	dc.l	port_in_38
	dc.l	port_in_39
	dc.l	port_in_3a
	dc.l	port_in_3b
	dc.l	port_in_3c
	dc.l	port_in_3d
	dc.l	port_in_3e
	dc.l	port_in_3f
	dc.l	port_in_40
	dc.l	port_in_41
	dc.l	port_in_42
	dc.l	port_in_43
	dc.l	port_in_44
	dc.l	port_in_45
	dc.l	port_in_46
	dc.l	port_in_47
	dc.l	port_in_48
	dc.l	port_in_49
	dc.l	port_in_4a
	dc.l	port_in_4b
	dc.l	port_in_4c
	dc.l	port_in_4d
	dc.l	port_in_4e
	dc.l	port_in_4f
	dc.l	port_in_50
	dc.l	port_in_51
	dc.l	port_in_52
	dc.l	port_in_53
	dc.l	port_in_54
	dc.l	port_in_55
	dc.l	port_in_56
	dc.l	port_in_57
	dc.l	port_in_58
	dc.l	port_in_59
	dc.l	port_in_5a
	dc.l	port_in_5b
	dc.l	port_in_5c
	dc.l	port_in_5d
	dc.l	port_in_5e
	dc.l	port_in_5f
	dc.l	port_in_60
	dc.l	port_in_61
	dc.l	port_in_62
	dc.l	port_in_63
	dc.l	port_in_64
	dc.l	port_in_65
	dc.l	port_in_66
	dc.l	port_in_67
	dc.l	port_in_68
	dc.l	port_in_69
	dc.l	port_in_6a
	dc.l	port_in_6b
	dc.l	port_in_6c
	dc.l	port_in_6d
	dc.l	port_in_6e
	dc.l	port_in_6f
	dc.l	port_in_70
	dc.l	port_in_71
	dc.l	port_in_72
	dc.l	port_in_73
	dc.l	port_in_74
	dc.l	port_in_75
	dc.l	port_in_76
	dc.l	port_in_77
	dc.l	port_in_78
	dc.l	port_in_79
	dc.l	port_in_7a
	dc.l	port_in_7b
	dc.l	port_in_7c
	dc.l	port_in_7d
	dc.l	port_in_7e
	dc.l	port_in_7f
	dc.l	port_in_80
	dc.l	port_in_81
	dc.l	port_in_82
	dc.l	port_in_83
	dc.l	port_in_84
	dc.l	port_in_85
	dc.l	port_in_86
	dc.l	port_in_87
	dc.l	port_in_88
	dc.l	port_in_89
	dc.l	port_in_8a
	dc.l	port_in_8b
	dc.l	port_in_8c
	dc.l	port_in_8d
	dc.l	port_in_8e
	dc.l	port_in_8f
	dc.l	port_in_90
	dc.l	port_in_91
	dc.l	port_in_92
	dc.l	port_in_93
	dc.l	port_in_94
	dc.l	port_in_95
	dc.l	port_in_96
	dc.l	port_in_97
	dc.l	port_in_98
	dc.l	port_in_99
	dc.l	port_in_9a
	dc.l	port_in_9b
	dc.l	port_in_9c
	dc.l	port_in_9d
	dc.l	port_in_9e
	dc.l	port_in_9f
	dc.l	port_in_a0
	dc.l	port_in_a1
	dc.l	port_in_a2
	dc.l	port_in_a3
	dc.l	port_in_a4
	dc.l	port_in_a5
	dc.l	port_in_a6
	dc.l	port_in_a7
	dc.l	port_in_a8
	dc.l	port_in_a9
	dc.l	port_in_aa
	dc.l	port_in_ab
	dc.l	port_in_ac
	dc.l	port_in_ad
	dc.l	port_in_ae
	dc.l	port_in_af
	dc.l	port_in_b0
	dc.l	port_in_b1
	dc.l	port_in_b2
	dc.l	port_in_b3
	dc.l	port_in_b4
	dc.l	port_in_b5
	dc.l	port_in_b6
	dc.l	port_in_b7
	dc.l	port_in_b8
	dc.l	port_in_b9
	dc.l	port_in_ba
	dc.l	port_in_bb
	dc.l	port_in_bc
	dc.l	port_in_bd
	dc.l	port_in_be
	dc.l	port_in_bf
	dc.l	port_in_c0
	dc.l	port_in_c1
	dc.l	port_in_c2
	dc.l	port_in_c3
	dc.l	port_in_c4
	dc.l	port_in_c5
	dc.l	port_in_c6
	dc.l	port_in_c7
	dc.l	port_in_c8
	dc.l	port_in_c9
	dc.l	port_in_ca
	dc.l	port_in_cb
	dc.l	port_in_cc
	dc.l	port_in_cd
	dc.l	port_in_ce
	dc.l	port_in_cf
	dc.l	port_in_d0
	dc.l	port_in_d1
	dc.l	port_in_d2
	dc.l	port_in_d3
	dc.l	port_in_d4
	dc.l	port_in_d5
	dc.l	port_in_d6
	dc.l	port_in_d7
	dc.l	port_in_d8
	dc.l	port_in_d9
	dc.l	port_in_da
	dc.l	port_in_db
	dc.l	port_in_dc
	dc.l	port_in_dd
	dc.l	port_in_de
	dc.l	port_in_df
	dc.l	port_in_e0
	dc.l	port_in_e1
	dc.l	port_in_e2
	dc.l	port_in_e3
	dc.l	port_in_e4
	dc.l	port_in_e5
	dc.l	port_in_e6
	dc.l	port_in_e7
	dc.l	port_in_e8
	dc.l	port_in_e9
	dc.l	port_in_ea
	dc.l	port_in_eb
	dc.l	port_in_ec
	dc.l	port_in_ed
	dc.l	port_in_ee
	dc.l	port_in_ef
	dc.l	port_in_f0
	dc.l	port_in_f1
	dc.l	port_in_f2
	dc.l	port_in_f3
	dc.l	port_in_f4
	dc.l	port_in_f5
	dc.l	port_in_f6
	dc.l	port_in_f7
	dc.l	port_in_f8
	dc.l	port_in_f9
	dc.l	port_in_fa
	dc.l	port_in_fb
	dc.l	port_in_fc
	dc.l	port_in_fd
	dc.l	port_in_fe
	dc.l	port_in_ff

port_out:
	movea	lut_ports_out(pc,d0.w),a0
	jmp	(a0)
	rts

lut_ports_out:
	dc.l	port_out_00
	dc.l	port_out_01
	dc.l	port_out_02
	dc.l	port_out_03
	dc.l	port_out_04
	dc.l	port_out_05
	dc.l	port_out_06
	dc.l	port_out_07
	dc.l	port_out_08
	dc.l	port_out_09
	dc.l	port_out_0a
	dc.l	port_out_0b
	dc.l	port_out_0c
	dc.l	port_out_0d
	dc.l	port_out_0e
	dc.l	port_out_0f
	dc.l	port_out_10
	dc.l	port_out_11
	dc.l	port_out_12
	dc.l	port_out_13
	dc.l	port_out_14
	dc.l	port_out_15
	dc.l	port_out_16
	dc.l	port_out_17
	dc.l	port_out_18
	dc.l	port_out_19
	dc.l	port_out_1a
	dc.l	port_out_1b
	dc.l	port_out_1c
	dc.l	port_out_1d
	dc.l	port_out_1e
	dc.l	port_out_1f
	dc.l	port_out_20
	dc.l	port_out_21
	dc.l	port_out_22
	dc.l	port_out_23
	dc.l	port_out_24
	dc.l	port_out_25
	dc.l	port_out_26
	dc.l	port_out_27
	dc.l	port_out_28
	dc.l	port_out_29
	dc.l	port_out_2a
	dc.l	port_out_2b
	dc.l	port_out_2c
	dc.l	port_out_2d
	dc.l	port_out_2e
	dc.l	port_out_2f
	dc.l	port_out_30
	dc.l	port_out_31
	dc.l	port_out_32
	dc.l	port_out_33
	dc.l	port_out_34
	dc.l	port_out_35
	dc.l	port_out_36
	dc.l	port_out_37
	dc.l	port_out_38
	dc.l	port_out_39
	dc.l	port_out_3a
	dc.l	port_out_3b
	dc.l	port_out_3c
	dc.l	port_out_3d
	dc.l	port_out_3e
	dc.l	port_out_3f
	dc.l	port_out_40
	dc.l	port_out_41
	dc.l	port_out_42
	dc.l	port_out_43
	dc.l	port_out_44
	dc.l	port_out_45
	dc.l	port_out_46
	dc.l	port_out_47
	dc.l	port_out_48
	dc.l	port_out_49
	dc.l	port_out_4a
	dc.l	port_out_4b
	dc.l	port_out_4c
	dc.l	port_out_4d
	dc.l	port_out_4e
	dc.l	port_out_4f
	dc.l	port_out_50
	dc.l	port_out_51
	dc.l	port_out_52
	dc.l	port_out_53
	dc.l	port_out_54
	dc.l	port_out_55
	dc.l	port_out_56
	dc.l	port_out_57
	dc.l	port_out_58
	dc.l	port_out_59
	dc.l	port_out_5a
	dc.l	port_out_5b
	dc.l	port_out_5c
	dc.l	port_out_5d
	dc.l	port_out_5e
	dc.l	port_out_5f
	dc.l	port_out_60
	dc.l	port_out_61
	dc.l	port_out_62
	dc.l	port_out_63
	dc.l	port_out_64
	dc.l	port_out_65
	dc.l	port_out_66
	dc.l	port_out_67
	dc.l	port_out_68
	dc.l	port_out_69
	dc.l	port_out_6a
	dc.l	port_out_6b
	dc.l	port_out_6c
	dc.l	port_out_6d
	dc.l	port_out_6e
	dc.l	port_out_6f
	dc.l	port_out_70
	dc.l	port_out_71
	dc.l	port_out_72
	dc.l	port_out_73
	dc.l	port_out_74
	dc.l	port_out_75
	dc.l	port_out_76
	dc.l	port_out_77
	dc.l	port_out_78
	dc.l	port_out_79
	dc.l	port_out_7a
	dc.l	port_out_7b
	dc.l	port_out_7c
	dc.l	port_out_7d
	dc.l	port_out_7e
	dc.l	port_out_7f
	dc.l	port_out_80
	dc.l	port_out_81
	dc.l	port_out_82
	dc.l	port_out_83
	dc.l	port_out_84
	dc.l	port_out_85
	dc.l	port_out_86
	dc.l	port_out_87
	dc.l	port_out_88
	dc.l	port_out_89
	dc.l	port_out_8a
	dc.l	port_out_8b
	dc.l	port_out_8c
	dc.l	port_out_8d
	dc.l	port_out_8e
	dc.l	port_out_8f
	dc.l	port_out_90
	dc.l	port_out_91
	dc.l	port_out_92
	dc.l	port_out_93
	dc.l	port_out_94
	dc.l	port_out_95
	dc.l	port_out_96
	dc.l	port_out_97
	dc.l	port_out_98
	dc.l	port_out_99
	dc.l	port_out_9a
	dc.l	port_out_9b
	dc.l	port_out_9c
	dc.l	port_out_9d
	dc.l	port_out_9e
	dc.l	port_out_9f
	dc.l	port_out_a0
	dc.l	port_out_a1
	dc.l	port_out_a2
	dc.l	port_out_a3
	dc.l	port_out_a4
	dc.l	port_out_a5
	dc.l	port_out_a6
	dc.l	port_out_a7
	dc.l	port_out_a8
	dc.l	port_out_a9
	dc.l	port_out_aa
	dc.l	port_out_ab
	dc.l	port_out_ac
	dc.l	port_out_ad
	dc.l	port_out_ae
	dc.l	port_out_af
	dc.l	port_out_b0
	dc.l	port_out_b1
	dc.l	port_out_b2
	dc.l	port_out_b3
	dc.l	port_out_b4
	dc.l	port_out_b5
	dc.l	port_out_b6
	dc.l	port_out_b7
	dc.l	port_out_b8
	dc.l	port_out_b9
	dc.l	port_out_ba
	dc.l	port_out_bb
	dc.l	port_out_bc
	dc.l	port_out_bd
	dc.l	port_out_be
	dc.l	port_out_bf
	dc.l	port_out_c0
	dc.l	port_out_c1
	dc.l	port_out_c2
	dc.l	port_out_c3
	dc.l	port_out_c4
	dc.l	port_out_c5
	dc.l	port_out_c6
	dc.l	port_out_c7
	dc.l	port_out_c8
	dc.l	port_out_c9
	dc.l	port_out_ca
	dc.l	port_out_cb
	dc.l	port_out_cc
	dc.l	port_out_cd
	dc.l	port_out_ce
	dc.l	port_out_cf
	dc.l	port_out_d0
	dc.l	port_out_d1
	dc.l	port_out_d2
	dc.l	port_out_d3
	dc.l	port_out_d4
	dc.l	port_out_d5
	dc.l	port_out_d6
	dc.l	port_out_d7
	dc.l	port_out_d8
	dc.l	port_out_d9
	dc.l	port_out_da
	dc.l	port_out_db
	dc.l	port_out_dc
	dc.l	port_out_dd
	dc.l	port_out_de
	dc.l	port_out_df
	dc.l	port_out_e0
	dc.l	port_out_e1
	dc.l	port_out_e2
	dc.l	port_out_e3
	dc.l	port_out_e4
	dc.l	port_out_e5
	dc.l	port_out_e6
	dc.l	port_out_e7
	dc.l	port_out_e8
	dc.l	port_out_e9
	dc.l	port_out_ea
	dc.l	port_out_eb
	dc.l	port_out_ec
	dc.l	port_out_ed
	dc.l	port_out_ee
	dc.l	port_out_ef
	dc.l	port_out_f0
	dc.l	port_out_f1
	dc.l	port_out_f2
	dc.l	port_out_f3
	dc.l	port_out_f4
	dc.l	port_out_f5
	dc.l	port_out_f6
	dc.l	port_out_f7
	dc.l	port_out_f8
	dc.l	port_out_f9
	dc.l	port_out_fa
	dc.l	port_out_fb
	dc.l	port_out_fc
	dc.l	port_out_fd
	dc.l	port_out_fe
	dc.l	port_out_ff

port_in_00:
port_out_00:
port_in_01:
port_out_01:
port_in_02:
port_out_02:
port_in_03:
port_out_03:
port_in_04:
port_out_04:
port_in_05:
port_out_05:
port_in_06:
port_out_06:
port_in_07:
port_out_07:
port_in_08:
port_out_08:
port_in_09:
port_out_09:
port_in_0a:
port_out_0a:
port_in_0b:
port_out_0b:
port_in_0c:
port_out_0c:
port_in_0d:
port_out_0d:
port_in_0e:
port_out_0e:
port_in_0f:
port_out_0f:
port_in_10:
	;; LCD status
	clr.b	d1
	or.b	video_increment(pc),d1
	or.b	video_row(pc),d1
	or.b	video_enabled(pc),d1
	or.b	video_6bit(pc),d1
	or.b	video_busy(pc),d1
	rts

port_out_10:
	;; LCD command
	tst.b	d1
	beq	port_out_10_00
	subq.b	#1,d1
	beq	port_out_10_01
	subq.b	#1,d1
	beq	port_out_10_02
	subq.b	#1,d1
	beq	port_out_10_03
	subq.b	#1,d1
	beq	port_out_10_04
	subq.b	#1,d1
	beq	port_out_10_05
	subq.b	#1,d1
	beq	port_out_10_06
	subq.b	#1,d1
	beq	port_out_10_07
	addq.b	#7,d1
	cmpi.b	#$0b,d1		; power supply enhancement
	ble	port_out_10_undef
	cmpi.b	#$13,d1		; power supply level
	ble	port_out_10_undef
	cmpi.b	#$17,d1		; undefined
	ble	port_out_10_undef
	cmpi.b	#$18,d1		; cancel test mode
	beq	port_out_10_undef
	cmpi.b	#$1b,d1		; undefined
	beq	port_out_10_undef
	cmpi.b	#$1f,d1		; enter test mode
	ble	port_out_10_undef
	cmpi.b	#$3f,d1		; set column
	ble	port_out_10_set_col
	cmpi.b	#$7f,d1		; z-addressing
	ble	port_out_10_undef ; XXX?
	cmpi.b	#$df,d1		; set row
	ble	port_out_10_set_row
	;; fallthrough: set contrast (unimplemented)
	rts
	;; ...
port_out_10_00:		; 6-bit mode
	move.b	#$00,video_6bit
	rts
port_out_10_01:		; 8-bit mode
	move.b	#$40,video_6bit
	rts
port_out_10_02:		; screen off
	move.b	#$20,video_enabled
	rts
port_out_10_03:		; screen on
	move.b	#$00,video_enabled
	rts
port_out_10_04:		; x--
	move.b	#$01,video_row
	move.b	#$00,video_increment
	rts
port_out_10_05:		; x++
	move.b	#$01,video_row
	move.b	#$02,video_increment
	rts
port_out_10_06:		; y--
	move.b	#$00,video_row
	move.b	#$00,video_increment
	rts
port_out_10_07:		; y++
	move.b	#$00,video_row
	move.b	#$02,video_increment
	rts
port_out_10_undef:
	rts
port_out_10_set_col:
	sub.b	#$20,d1
	move.b	d1,video_cur_col
	rts
port_out_10_set_row:
	sub.b	#$80,d1
	move.b	d1,video_cur_row
	rts


port_in_11:
	;; LCD data
	bra	video_read

port_out_11:
	;; LCD data
	bra	video_write

port_in_12:
port_out_12:
port_in_13:
port_out_13:
port_in_14:
port_out_14:
port_in_15:
port_out_15:
port_in_16:
port_out_16:
port_in_17:
port_out_17:
port_in_18:
port_out_18:
port_in_19:
port_out_19:
port_in_1a:
port_out_1a:
port_in_1b:
port_out_1b:
port_in_1c:
port_out_1c:
port_in_1d:
port_out_1d:
port_in_1e:
port_out_1e:
port_in_1f:
port_out_1f:
port_in_20:
port_out_20:
port_in_21:
port_out_21:
port_in_22:
port_out_22:
port_in_23:
port_out_23:
port_in_24:
port_out_24:
port_in_25:
port_out_25:
port_in_26:
port_out_26:
port_in_27:
port_out_27:
port_in_28:
port_out_28:
port_in_29:
port_out_29:
port_in_2a:
port_out_2a:
port_in_2b:
port_out_2b:
port_in_2c:
port_out_2c:
port_in_2d:
port_out_2d:
port_in_2e:
port_out_2e:
port_in_2f:
port_out_2f:
port_in_30:
port_out_30:
port_in_31:
port_out_31:
port_in_32:
port_out_32:
port_in_33:
port_out_33:
port_in_34:
port_out_34:
port_in_35:
port_out_35:
port_in_36:
port_out_36:
port_in_37:
port_out_37:
port_in_38:
port_out_38:
port_in_39:
port_out_39:
port_in_3a:
port_out_3a:
port_in_3b:
port_out_3b:
port_in_3c:
port_out_3c:
port_in_3d:
port_out_3d:
port_in_3e:
port_out_3e:
port_in_3f:
port_out_3f:
port_in_40:
port_out_40:
port_in_41:
port_out_41:
port_in_42:
port_out_42:
port_in_43:
port_out_43:
port_in_44:
port_out_44:
port_in_45:
port_out_45:
port_in_46:
port_out_46:
port_in_47:
port_out_47:
port_in_48:
port_out_48:
port_in_49:
port_out_49:
port_in_4a:
port_out_4a:
port_in_4b:
port_out_4b:
port_in_4c:
port_out_4c:
port_in_4d:
port_out_4d:
port_in_4e:
port_out_4e:
port_in_4f:
port_out_4f:
port_in_50:
port_out_50:
port_in_51:
port_out_51:
port_in_52:
port_out_52:
port_in_53:
port_out_53:
port_in_54:
port_out_54:
port_in_55:
port_out_55:
port_in_56:
port_out_56:
port_in_57:
port_out_57:
port_in_58:
port_out_58:
port_in_59:
port_out_59:
port_in_5a:
port_out_5a:
port_in_5b:
port_out_5b:
port_in_5c:
port_out_5c:
port_in_5d:
port_out_5d:
port_in_5e:
port_out_5e:
port_in_5f:
port_out_5f:
port_in_60:
port_out_60:
port_in_61:
port_out_61:
port_in_62:
port_out_62:
port_in_63:
port_out_63:
port_in_64:
port_out_64:
port_in_65:
port_out_65:
port_in_66:
port_out_66:
port_in_67:
port_out_67:
port_in_68:
port_out_68:
port_in_69:
port_out_69:
port_in_6a:
port_out_6a:
port_in_6b:
port_out_6b:
port_in_6c:
port_out_6c:
port_in_6d:
port_out_6d:
port_in_6e:
port_out_6e:
port_in_6f:
port_out_6f:
port_in_70:
port_out_70:
port_in_71:
port_out_71:
port_in_72:
port_out_72:
port_in_73:
port_out_73:
port_in_74:
port_out_74:
port_in_75:
port_out_75:
port_in_76:
port_out_76:
port_in_77:
port_out_77:
port_in_78:
port_out_78:
port_in_79:
port_out_79:
port_in_7a:
port_out_7a:
port_in_7b:
port_out_7b:
port_in_7c:
port_out_7c:
port_in_7d:
port_out_7d:
port_in_7e:
port_out_7e:
port_in_7f:
port_out_7f:
port_in_80:
port_out_80:
port_in_81:
port_out_81:
port_in_82:
port_out_82:
port_in_83:
port_out_83:
port_in_84:
port_out_84:
port_in_85:
port_out_85:
port_in_86:
port_out_86:
port_in_87:
port_out_87:
port_in_88:
port_out_88:
port_in_89:
port_out_89:
port_in_8a:
port_out_8a:
port_in_8b:
port_out_8b:
port_in_8c:
port_out_8c:
port_in_8d:
port_out_8d:
port_in_8e:
port_out_8e:
port_in_8f:
port_out_8f:
port_in_90:
port_out_90:
port_in_91:
port_out_91:
port_in_92:
port_out_92:
port_in_93:
port_out_93:
port_in_94:
port_out_94:
port_in_95:
port_out_95:
port_in_96:
port_out_96:
port_in_97:
port_out_97:
port_in_98:
port_out_98:
port_in_99:
port_out_99:
port_in_9a:
port_out_9a:
port_in_9b:
port_out_9b:
port_in_9c:
port_out_9c:
port_in_9d:
port_out_9d:
port_in_9e:
port_out_9e:
port_in_9f:
port_out_9f:
port_in_a0:
port_out_a0:
port_in_a1:
port_out_a1:
port_in_a2:
port_out_a2:
port_in_a3:
port_out_a3:
port_in_a4:
port_out_a4:
port_in_a5:
port_out_a5:
port_in_a6:
port_out_a6:
port_in_a7:
port_out_a7:
port_in_a8:
port_out_a8:
port_in_a9:
port_out_a9:
port_in_aa:
port_out_aa:
port_in_ab:
port_out_ab:
port_in_ac:
port_out_ac:
port_in_ad:
port_out_ad:
port_in_ae:
port_out_ae:
port_in_af:
port_out_af:
port_in_b0:
port_out_b0:
port_in_b1:
port_out_b1:
port_in_b2:
port_out_b2:
port_in_b3:
port_out_b3:
port_in_b4:
port_out_b4:
port_in_b5:
port_out_b5:
port_in_b6:
port_out_b6:
port_in_b7:
port_out_b7:
port_in_b8:
port_out_b8:
port_in_b9:
port_out_b9:
port_in_ba:
port_out_ba:
port_in_bb:
port_out_bb:
port_in_bc:
port_out_bc:
port_in_bd:
port_out_bd:
port_in_be:
port_out_be:
port_in_bf:
port_out_bf:
port_in_c0:
port_out_c0:
port_in_c1:
port_out_c1:
port_in_c2:
port_out_c2:
port_in_c3:
port_out_c3:
port_in_c4:
port_out_c4:
port_in_c5:
port_out_c5:
port_in_c6:
port_out_c6:
port_in_c7:
port_out_c7:
port_in_c8:
port_out_c8:
port_in_c9:
port_out_c9:
port_in_ca:
port_out_ca:
port_in_cb:
port_out_cb:
port_in_cc:
port_out_cc:
port_in_cd:
port_out_cd:
port_in_ce:
port_out_ce:
port_in_cf:
port_out_cf:
port_in_d0:
port_out_d0:
port_in_d1:
port_out_d1:
port_in_d2:
port_out_d2:
port_in_d3:
port_out_d3:
port_in_d4:
port_out_d4:
port_in_d5:
port_out_d5:
port_in_d6:
port_out_d6:
port_in_d7:
port_out_d7:
port_in_d8:
port_out_d8:
port_in_d9:
port_out_d9:
port_in_da:
port_out_da:
port_in_db:
port_out_db:
port_in_dc:
port_out_dc:
port_in_dd:
port_out_dd:
port_in_de:
port_out_de:
port_in_df:
port_out_df:
port_in_e0:
port_out_e0:
port_in_e1:
port_out_e1:
port_in_e2:
port_out_e2:
port_in_e3:
port_out_e3:
port_in_e4:
port_out_e4:
port_in_e5:
port_out_e5:
port_in_e6:
port_out_e6:
port_in_e7:
port_out_e7:
port_in_e8:
port_out_e8:
port_in_e9:
port_out_e9:
port_in_ea:
port_out_ea:
port_in_eb:
port_out_eb:
port_in_ec:
port_out_ec:
port_in_ed:
port_out_ed:
port_in_ee:
port_out_ee:
port_in_ef:
port_out_ef:
port_in_f0:
port_out_f0:
port_in_f1:
port_out_f1:
port_in_f2:
port_out_f2:
port_in_f3:
port_out_f3:
port_in_f4:
port_out_f4:
port_in_f5:
port_out_f5:
port_in_f6:
port_out_f6:
port_in_f7:
port_out_f7:
port_in_f8:
port_out_f8:
port_in_f9:
port_out_f9:
port_in_fa:
port_out_fa:
port_in_fb:
port_out_fb:
port_in_fc:
port_out_fc:
port_in_fd:
port_out_fd:
port_in_fe:
port_out_fe:
port_in_ff:
port_out_ff: