-
Notifications
You must be signed in to change notification settings - Fork 0
/
PMWC V2-5.S
1060 lines (980 loc) · 11.1 KB
/
PMWC V2-5.S
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
ORG $804A
OBJ $804A
LST OFF
VTAB = $FC22
VTABZ = VTAB+$02
HOME = $FC58
SETNORM = $FE84
INIT = $FB2F
SETVID = $FE93
SETKBD = $FE89
BELL = $FBDD
ROMB = $C600
KBD = $C000
KBDSTRB = $C010
RETURN = $8D
* ZPAG EQUATES
ORGNL = $00
ORGNH = $01
DESTL = $02
DESTH = $03
CH = $24
CV = $25
TBAS = $28
SELNUM = $F9
HORZ = $FA
LR = $1C
CLOC = $D800
PARM = $DFB8
VOLUME = PARM+$03
TRACK = PARM+$04
SECTOR = PARM+$05
DCTP = PARM+$06
BUFF = PARM+$08
BYTECNT = PARM+$0B
COMND = PARM+$0C
ERRCODE = PARM+$0D
JSR INIT
JSR HOME
JSR LPRINT
ASC "POOR MAN'S WILDCARD V2.5"
HEX 8D
ASC "BY ROBIN HOOD"
HEX 8D
ASC "COPYRIGHT 1984"
HEX 8D
ASC "BY SHOE STRING ENTERPRISES"
HEX 8D
HEX 8D
HEX 00
BIT $C093
BIT $C093
LDA #$00
STA $D000
LDA $D000
BNE ERROR
LDA #$FF
STA $D000
LDA $D000
CMP #$FF
BEQ PRESNT
ERROR JSR LPRINT
ASC "16 RAM CARD NOT IN SLOT ONE!"
HEX 8D
ASC "TURN OFF COMPUTER BEFORE MOVING!"
HEX 8D8D
HEX 00
BIT $C090
RTS
PRESNT BIT $C091
BIT $C091
LDA #$00
STA ORGNL
STA DESTL
LDA #$D0
STA ORGNH
STA DESTH
LDX #$30
JSR MOVLAN
BIT $C09B
BIT $C09B
LDA #ROMP+LR
STA ORGNL
LDA #/ROMP+LR
STA ORGNH
LDA #CLOC
STA DESTL
LDA #/CLOC
STA DESTH
LDX #$08
JSR MOVLAN
LDX #LR-2
STINT LDA ROMP+1,X
STA $FECD,X
DEX
BPL STINT
LDX #$17
TPARM LDA $B7E8,X
STA PARM,X
DEX
BPL TPARM
LDA #$00
STA VOLUME
STA BYTECNT
LDA #$CB
STA DCTP
LDA #$DF
STA DCTP+1
LDA #<INTER
STA NMIL
LDA #>INTER
STA NMIH
LDA #$01
STA DISPVAL
BIT $C090
JSR LPRINT
ASC "POOR MAN'S WILDCARD "
ASC "IS INSTALLED"
HEX 8D
ASC "AND READY TO USE !"
HEX 8D8D
HEX 00
BIT $C090
RTS
LDX #$10
MOVLAN LDY #$00
MVL LDA (ORGNL),Y
STA (DESTL),Y
INY
BNE MVL
INC ORGNH
INC DESTH
DEX
BNE MVL
RTS
CHOUT EQU $FDF0
ZL = $FE
ZH = $FF
LPRINT LDA #$00
STA ZL
PLA
TAY
PLA
STA ZH
JMP PRINT2
LOOP LDA (ZL),Y
BEQ DONE
JSR CHOUT
PRINT2 INY
BNE LOOP
INC ZH
BNE LOOP
DONE LDA ZH
PHA
TYA
PHA
ROMP RTS
ORG $FECD
RTI
INTER BIT $C09B
BIT $C09B
DEC NMIL
JMP START
BOOT1 LDA #/ROMB
PHA
LDA #ROMB
PHA
PHA
RESUME INC NMIL
BIT $C090
RTI
ORG CLOC
ONE HEX 00
TWO HEX 00
THREE HEX 00
ASAV HEX 00
YSAV HEX 00
XSAV HEX 00
SSAV HEX 00
DISPVAL HEX 00
TEMP = $DFF0
NMIL = $FFFA
NMIH = $FFFB
START STA ASAV
STY YSAV
STX XSAV
PLA
STA ONE
PLA
STA TWO
PLA
STA THREE
TSX
STX SSAV
LDX #$00
LDF2 LDA $00,X
STA $D000,X
LDA $100,X
STA $D100,X
INX
BNE LDF2
JSR MOVE
LDX #$08
STX SELNUM
BEGIN JSR SETNORM
JSR INIT
JSR SETVID
JSR SETKBD
JSR HOME
JSR TITLE
JSR FLIPLINE
KEYIN BIT KBDSTRB
KEY LDA KBD
BPL KEY
CMP #RETURN
BEQ SELECT
PHA
JSR FLIPLINE
PLA
CMP #$88
BNE NOTUP
DEC SELNUM
LDA SELNUM
CMP #08
BCS NOCHG0
LDA #13
STA SELNUM
BNE NOCHG0
NOTUP INC SELNUM
LDA SELNUM
CMP #14
BCC NOCHG0
LDA #08
STA SELNUM
NOCHG0 JSR FLIPLINE
JMP KEYIN
SELECT BIT $C010
LDX SELNUM
LDA JTABH-8,X
PHA
LDA JTABL-8,X
PHA
RTS
JTABL DFB #SSCRN-1
DFB #CONTIN-1
DFB #BOOT-1
DFB #SAVED-1
DFB #LOADD-1
DFB #MONIT-1
DFB #SSCRN-1
JTABH DFB #/SSCRN-1
DFB #/CONTIN-1
DFB #/BOOT-1
DFB #/SAVED-1
DFB #/LOADD-1
DFB #/MONIT-1
DFB #/SSCRN-1
SSCRN JSR TEXTEX
SS LDA DISPVAL
CMP #$0B
BCC GOSET
LDA #$00
STA DISPVAL
GOSET JSR SETDISP
BIT $C010
WAITKEY LDA $C000
BPL WAITKEY
CMP #RETURN
BEQ BACK
INC DISPVAL
BNE SS
BACK JSR TEXTEX
JMP BEGIN
CONTIN JSR SETDISP
JSR MOVE
LDX #$00
STF2 LDA $D000,X
STA $00,X
LDA $D100,X
STA $100,X
INX
BNE STF2
LDX SSAV
TXS
LDA THREE
PHA
LDA TWO
PHA
LDA ONE
PHA
LDY YSAV
LDX XSAV
LDA ASAV
JMP RESUME
BOOT JSR HOME
JMP BOOT1
MONIT LDA #$4C
STA $3F8
LDA #BEGIN
STA $3F9
LDA #/BEGIN
STA $3FA
JMP $FF59
SAVED LDA #$02
JSR RORW
JMP BEGIN
LOADD LDA #$01
JSR RORW
JMP BEGIN
RORW STA COMND
LDA #$03
STA TRACK
LDA #$00
STA BUFF
LDA #$08
STA BUFF+1
RWLOOP LDA #$0F
STA SECTOR
RWLOOP1 LDY #PARM
LDA #/PARM
JSR RWTS
BCS DSKERR
INCAG INC BUFF+1
LDA BUFF+1
CMP #$D9
BEQ DNRW
AND #$F0
CMP #$C0
BEQ INCAG
DEC SECTOR
BPL RWLOOP1
INC TRACK
BNE RWLOOP
DNRW RTS
DSKERR JSR BELL
JSR BELL
RTS
TEXTEX LDX #$D4
STX ORGNH
LDX #$04
STX DESTH
BNE CMOV
MOVE LDA #$02
STA ORGNH
LDA #$D2
STA DESTH
LDX #$06
CMOV LDY #$00
STY ORGNL
STY DESTL
TEXCH LDA (ORGNL),Y
PHA
LDA (DESTL),Y
STA (ORGNL),Y
PLA
STA (DESTL),Y
INY
BNE TEXCH
INC DESTH
INC ORGNH
DEX
BNE TEXCH
RTS
TITLE LDA #10
STA HORZ
LDX #00
JSR PRINT
LDA #14
STA HORZ
LDX #SELECTS-TEXT
JSR PRINT
RTS
PRINT LDY #$00
PRT1 LDA HORZ
STA CH
JSR VTAB
PRT2 LDA TEXT,X
BEQ DPRT
JSR $FDF0
INX
CMP #$8D
BNE PRT2
BEQ PRT1
DPRT JMP $FD8E
FLIPLINE LDA SELNUM
JSR VTABZ
LDY #39
FLIP LDA (TBAS),Y
CMP #$A0
BEQ NTSP
EOR #$C0
STA (TBAS),Y
NTSP DEY
BPL FLIP
RTS
SETDISP LDY #$06
LDA DISPVAL
SETLOOP LSR
PHA
TYA
ADC #$00
TAX
LDA $C050,X
PLA
DEY
DEY
BPL SETLOOP
RTS
TEXT INV ": :"
HEX 8D
INV " "
ASC "POOR MAN'S WILDCARD"
INV " "
HEX 8D
INV " "
ASC "BY DAVID GALLOWAY "
INV " "
HEX 8D
INV " "
ASC " (C) 1984/85 BY "
INV " "
HEX 8D
INV " "
ASC "SHOE-STRING ENT. "
INV " "
HEX 8D
INV ": :"
HEX 8D8D
HEX 00
SELECTS ASC "SET"
HEX E0
ASC "SCREEN"
HEX 8D
ASC "RESUME"
HEX 8D
ASC "BOOT"
HEX E0
ASC "DISK"
HEX 8D
ASC "SAVE"
HEX E0
ASC "IMAGE"
HEX 8D
ASC "LOAD"
HEX E0
ASC "IMAGE"
HEX 8D
ASC "ENTER"
HEX E0
ASC "MONITOR"
HEX 8D
HEX 00
ERRMSG ASC "DISK ERROR #"
HEX 00
DS $43
ORG $DB00
H0678 = $0678
HC08D = $C08D
HC08E = $C08E
HC08F = $C08F
HC08C = $C08C
H002C = $002C
H0478 = $0478
HC080 = $C080
H06F8 = $06F8
H04F8 = $04F8
H05F8 = $05F8
HC089 = $C089
H0036 = $0036
HC08A = $C08A
HC08B = $C08B
H0578 = $0578
HC088 = $C088
HBB00 = $200
HBBFF = $2FF
HBC00 = $300
PRENIB LDX #$00
LDY #$02
HB804 DEY
LDA ($3E),Y
LSR
ROL HBC00,X
LSR
ROL HBC00,X
STA HBB00,Y
INX
CPX #$56
BCC HB804
LDX #$00
TYA
BNE HB804
LDX #$55
HB81E LDA HBC00,X
AND #$3F
STA HBC00,X
DEX
BPL HB81E
RTS
WRITE SEC
STX $27
STX H0678
LDA HC08D,X
LDA HC08E,X
BMI HB8B4
LDA HBC00
STA $26
LDA #$FF
STA HC08F,X
ORA HC08C,X
PHA
PLA
NOP
LDY #$04
HB84A PHA
PLA
JSR HB8B9
DEY
BNE HB84A
LDA #$D5
JSR HB8B8
LDA #$AA
JSR HB8B8
LDA #$AD
JSR HB8B8
TYA
LDY #$56
BNE HB869
HB866 LDA HBC00,Y
HB869 EOR HBBFF,Y
TAX
LDA HBA29,X
LDX $27
STA HC08D,X
LDA HC08C,X
DEY
BNE HB866
LDA $26
NOP
HB87E EOR HBB00,Y
TAX
LDA HBA29,X
LDX H0678
STA HC08D,X
LDA HC08C,X
LDA HBB00,Y
INY
BNE HB87E
TAX
LDA HBA29,X
LDX $27
JSR HB8BB
LDA #$DE
JSR HB8B8
LDA #$AA
JSR HB8B8
LDA #$EB
JSR HB8B8
LDA #$FF
JSR HB8B8
LDA HC08E,X
HB8B4 LDA HC08C,X
RTS
HB8B8 CLC
HB8B9 PHA
PLA
HB8BB STA HC08D,X
ORA HC08C,X
RTS
HB8C2 LDY #$00
HB8C4 LDX #$56
HB8C6 DEX
BMI HB8C4
LDA HBB00,Y
LSR HBC00,X
ROL
LSR HBC00,X
ROL
STA ($3E),Y
INY
CPY $26
BNE HB8C6
RTS
READ LDY #$20
HB8DE DEY
BEQ HB942
HB8E1 LDA HC08C,X
BPL HB8E1
HB8E6 EOR #$D5
BNE HB8DE
NOP
HB8EB LDA HC08C,X
BPL HB8EB
CMP #$AA
BNE HB8E6
LDY #$56
HB8F6 LDA HC08C,X
BPL HB8F6
CMP #$AD
BNE HB8E6
LDA #$00
HB901 DEY
STY $26
HB904 LDY HC08C,X
BPL HB904
EOR ARMDEL,Y
LDY $26
STA HBC00,Y
BNE HB901
HB913 STY $26
HB915 LDY HC08C,X
BPL HB915
EOR ARMDEL,Y
LDY $26
STA HBB00,Y
INY
BNE HB913
HB925 LDY HC08C,X
BPL HB925
CMP ARMDEL,Y
BNE HB942
HB92F LDA HC08C,X
BPL HB92F
CMP #$DE
BNE HB942
NOP
HB939 LDA HC08C,X
BPL HB939
CMP #$AA
BEQ HB99E
HB942 SEC
RTS
RADRF LDY #$FC
STY $26
HB948 INY
BNE HB94F
INC $26
BEQ HB942
HB94F LDA HC08C,X
BPL HB94F
HB954 CMP #$D5
BNE HB948
NOP
HB959 LDA HC08C,X
BPL HB959
CMP #$AA
BNE HB954
LDY #$03
HB964 LDA HC08C,X
BPL HB964
CMP #$96
BNE HB954
LDA #$00
HB96F STA $27
HB971 LDA HC08C,X
BPL HB971
ROL
STA $26
HB979 LDA HC08C,X
BPL HB979
AND $26
STA H002C,Y
EOR $27
DEY
BPL HB96F
TAY
BNE HB942
HB98B LDA HC08C,X
BPL HB98B
CMP #$DE
BNE HB942
NOP
HB995 LDA HC08C,X
BPL HB995
CMP #$AA
BNE HB942
HB99E CLC
RTS
SEEKABS STX $2B
STA $2A
CMP H0478
BEQ HB9FC
LDA #$00
STA $26
HB9AD LDA H0478
STA $27
SEC
SBC $2A
BEQ HB9EA
BCS HB9C0
EOR #$FF
INC H0478
BCC HB9C5
HB9C0 ADC #$FE
DEC H0478
HB9C5 CMP $26
BCC HB9CB
LDA $26
HB9CB CMP #$0C
BCS HB9D0
TAY
HB9D0 SEC
JSR HB9EE
LDA HBA11,Y
JSR ARMDEL
LDA $27
CLC
JSR HB9F1
LDA HBA1D,Y
JSR ARMDEL
INC $26
BNE HB9AD
HB9EA JSR ARMDEL
CLC
HB9EE LDA H0478
HB9F1 AND #$03
ROL
ORA $2B
TAX
LDA HC080,X
LDX $2B
HB9FC RTS
TAX
LDY #$A0
ARMDEL LDX #$11
HBA02 DEX
BNE HBA02
INC $46
BNE HBA0B
INC $47
HBA0B SEC
SBC #$01
BNE ARMDEL
RTS
HBA11 HEX 01302824201E1D1C
HEX 1C1C1C1C
HBA1D HEX 702C26221F1E1D1C
HEX 1C1C1C1C
HBA29 HEX 96979A9B9D9E9FA6
HEX A7ABACADAEAFB2B3
HEX B4B5B6B7B9BABBBC
HEX BDBEBFCBCDCECFD3
HEX D6D7D9DADBDCDDDE
HEX DFE5E6E7E9EAEBEC
HEX EDEEEFF2F3F4F5F6
HEX F7F9FAFBFCFDFEFF
HEX 20A8A6ADDBBF1005
HEX A902208DB1A9008D
HEX DBBF8DDABFADBAB3
HEX 4CEF9DA9008DED9D
HEX 8DEE9D8DD9BF2076
HEX BA4C51A888000198
HEX 9902039C040506A0
HEX A1A2A3A4A50708A8
HEX A9AA090A0B0C0DB0
HEX B10E0F10111213B8
HEX 1415161718191AC0
HEX C1C2C3C4C5C6C7C8
HEX C9CA1BCC1C1D1ED0
HEX D1D21FD4D52021D8
HEX 22232425262728E0
HEX E1E2E3E4292A2BE8
HEX 2C2D2E2F303132F0
HEX F1333435363738F8
HEX 393A3B3C3D3E3F
RWTS STY $48
STA $49
LDY #$02
STY H06F8
LDY #$04
STY H04F8
LDY #$01
LDA ($48),Y
TAX
LDY #$0F
CMP ($48),Y
BEQ HBD34
TXA
PHA
LDA ($48),Y
TAX
PLA
PHA
STA ($48),Y
LDA HC08E,X
HBD25 LDY #$08
LDA HC08C,X
HBD2A CMP HC08C,X
BNE HBD25
DEY
BNE HBD2A
PLA
TAX
HBD34 LDA HC08E,X
LDA HC08C,X
LDY #$08
HBD3C LDA HC08C,X
PHA
PLA
PHA
PLA
STX H05F8
CMP HC08C,X
BNE HBD4E
DEY
BNE HBD3C
HBD4E PHP
LDA HC089,X
LDY #$06
HBD54 LDA ($48),Y
STA H0036,Y
INY
CPY #$0A
BNE HBD54
LDY #$03
LDA ($3C),Y
STA $47
LDY #$02
LDA ($48),Y
LDY #$10
CMP ($48),Y
BEQ HBD74
STA ($48),Y
PLP
LDY #$00
PHP
HBD74 ROR
BCC HBD7C
LDA HC08A,X
BCS HBD7F
HBD7C LDA HC08B,X
HBD7F ROR $35
PLP
PHP
BNE HBD90
LDY #$07
HBD87 JSR ARMDEL
DEY
BNE HBD87
LDX H05F8
HBD90 LDY #$04
LDA ($48),Y
JSR MYSEEK
PLP
BNE HBDAB
LDY $47
BPL HBDAB
HBD9E LDY #$12
HBDA0 DEY
BNE HBDA0
INC $46
BNE HBD9E
INC $47
BNE HBD9E
HBDAB LDY #$0C
LDA ($48),Y
BEQ HBE0B
ROR
PHP
BCS HBDBC
JSR PRENIB
HBDBC LDY #$30
STY H0578
HBDC1 LDX H05F8
JSR RADRF
BCC HBDED
HBDC9 DEC H0578
BPL HBDC1
HBDCE LDA H0478
PHA
LDA #$60
JSR HBE95
DEC H06F8
BEQ HBE04
LDA #$04
STA H04F8
LDA #$00
JSR MYSEEK
PLA
HBDE7 JSR MYSEEK
JMP HBDBC
HBDED LDY $2E
CPY H0478
BEQ HBE10
LDA H0478
PHA
TYA
JSR HBE95
PLA
DEC H04F8
BNE HBDE7
BEQ HBDCE
HBE04 PLA
LDA #$40
HBE07 PLP
JMP HNDLERR+1
HBE0B BEQ HBE46
HBE10 LDY #$03
LDA ($48),Y
PHA
LDA $2F
LDY #$0E
STA ($48),Y
PLA
BEQ HBE26
CMP $2F
BEQ HBE26
LDA #$20
BNE HBE07
HBE26 LDY #$05
LDA ($48),Y
TAY
LDA INTLEV,Y
CMP $2D
BNE HBDC9
PLP
BCC HBE51
JSR READ
PHP
BCS HBDC9
PLP
LDX #$00
STX $26
JSR HB8C2