Mercurial > hg > Members > kono > nitros9-code
annotate level1/corsham/modules/boot_cshsd.asm @ 3295:6b7a7b233925 default tip
makefile: Allow PORTS with level1/2 mix
https://sourceforge.net/p/nitros9/feature-requests/10/
author | Tormod Volden <debian.tormod@gmail.com> |
---|---|
date | Tue, 19 Apr 2022 18:12:17 +0200 |
parents | 185c31229f22 |
children |
rev | line source |
---|---|
3182
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
1 ******************************************************************** |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
2 * Boot - Corsham SD Boot module |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
3 * Provides HWInit, HWTerm, HWRead which are called by code in |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
4 * "use"d boot_common.asm |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
5 * |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
6 * $Id$ |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
7 * |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
8 * Edt/Rev YYYY/MM/DD Modified by |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
9 * Comment |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
10 * ------------------------------------------------------------------ |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
11 * 2017/05/01 Darren Atkinson |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
12 * Created. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
13 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
14 nam Boot |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
15 ttl Corsham SD Boot module |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
16 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
17 IFP1 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
18 use defsfile |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
19 ENDC |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
20 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
21 org 0 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
22 * Default Boot is from drive 0 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
23 BootDr set 0 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
24 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
25 * Alternate Boot is from drive 1 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
26 IFEQ DNum-1 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
27 BootDr set 1 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
28 ENDC |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
29 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
30 * Common booter-required defines |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
31 LSN24BIT equ 1 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
32 FLOPPY equ 0 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
33 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
34 * NOTE: these are U-stack offsets, not DP |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
35 seglist rmb 2 pointer to segment list |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
36 blockloc rmb 2 pointer to memory requested |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
37 blockimg rmb 2 duplicate of the above |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
38 bootsize rmb 2 size in bytes |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
39 LSN0Ptr rmb 2 In memory LSN0 pointer |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
40 size equ . |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
41 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
42 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
43 tylg set Systm+Objct |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
44 atrv set ReEnt+rev |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
45 rev set $00 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
46 edition set 1 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
47 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
48 mod eom,name,tylg,atrv,start,size |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
49 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
50 name fcs /Boot/ |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
51 fcb edition |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
52 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
53 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
54 *-------------------------------------------------------------------------- |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
55 * HWInit - Initialize the device |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
56 * |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
57 * Entry: |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
58 * Y = hardware address |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
59 * |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
60 * Exit: |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
61 * Carry Clear = OK, Set = Error |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
62 * B = error (Carry Set) |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
63 * |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
64 HWInit |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
65 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
66 ; Set up the data direction register for port B so that |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
67 ; the DIRECTION and PSTROBE bits are output. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
68 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
69 ldx #PIA0Base |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
70 clr PIACTLB,x ;select DDR ...for port B |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
71 ldd #$04*256+DIRECTION|PSTROBE |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
72 stb PIADDRB,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
73 sta PIACTLB,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
74 lbsr xParSetWrite |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
75 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
76 *-------------------------------------------------------------------------- |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
77 * HWTerm - Terminate the device |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
78 * |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
79 * Entry: |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
80 * Y = hardware address |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
81 * |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
82 * Exit: |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
83 * Carry Clear = OK, Set = Error |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
84 * B = error (Carry Set) |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
85 * |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
86 HWTerm clrb no error |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
87 rts |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
88 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
89 *************************************************************************** |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
90 use boot_common.asm |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
91 *************************************************************************** |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
92 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
93 * |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
94 * HWRead - Read a 256 byte sector from the device |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
95 * |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
96 * Entry: |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
97 * Y = hardware address |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
98 * B = bits 23-16 of LSN |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
99 * X = bits 15-0 of LSN |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
100 * blockloc,u = where to load the 256 byte sector |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
101 * |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
102 * Exit: |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
103 * Carry Clear = OK, Set = Error |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
104 * |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
105 HWRead |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
106 ldy blockloc,u |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
107 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
108 ;===================================================== |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
109 ; This is a low level disk function for a real OS to |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
110 ; perform a disk sector read using a single long |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
111 ; sector number. On entry, X points to a disk |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
112 ; parameter block with the following fields: |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
113 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
114 ; B = sector bits 23-16 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
115 ; X = sector bits 15-0 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
116 ; Y = address to store 256 byte buffer |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
117 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
118 ; The drive and sector number are zero based. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
119 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
120 ; Returns with C clear on success. If error, C is set |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
121 ; and A contains the error code. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
122 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
123 DiskReadLong lda #PC_READ_LONG |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
124 bsr xParWriteByte |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
125 clra |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
126 bsr xParWriteByte ;drive |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
127 lda #2 ;256 byte sectors |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
128 bsr xParWriteByte |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
129 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
130 ; Now send the four byte sector number. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
131 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
132 clra |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
133 bsr xParWriteByte |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
134 tfr b,a |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
135 bsr xParWriteByte |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
136 tfr x,d |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
137 bsr xParWriteByte |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
138 tfr b,a |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
139 bsr xParWriteByte |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
140 ;***************************************************** |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
141 ; This sets up for reading from the Arduino. Sets up |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
142 ; direction registers, clears the direction bit, etc. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
143 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
144 xParSetRead ;select DDR |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
145 ldx #PIA0Base |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
146 clr PIACTLA,x ;...for port A |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
147 clr PIADDRA,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
148 lda #4 ;select data reg |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
149 sta PIACTLA,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
150 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
151 ; Set direction flag to input, clear ACK bit |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
152 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
153 clr PIAREGB,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
154 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
155 bsr xParReadByte ;response |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
156 cmpa #PR_SECTOR_DATA ;data? |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
157 bne DiskCerror ;no |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
158 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
159 lda #'. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
160 jsr [S.CharOut] |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
161 clrb ;256 bytes of data |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
162 DiskReadLp bsr xParReadByte |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
163 sta ,y+ |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
164 decb |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
165 bne DiskReadLp |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
166 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
167 ; All done |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
168 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
169 ;***************************************************** |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
170 ; This sets up for writing to the Arduino. Sets up |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
171 ; direction registers, drives the direction bit, etc. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
172 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
173 xParSetWrite clra ;select DDR |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
174 sta PIACTLA,x ;...for port A |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
175 deca ; $FF set bits for output |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
176 sta PIADDRA,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
177 lda #4 ;select data reg |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
178 sta PIACTLA,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
179 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
180 ; Set direction flag to output, clear ACK bit |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
181 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
182 lda #DIRECTION |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
183 sta PIAREGB,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
184 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
185 ldx blockloc,u |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
186 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
187 clrb |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
188 rts |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
189 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
190 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
191 ; Common error handler. Next byte is the error code |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
192 ; which goes into B, set carry, and exit. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
193 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
194 DiskCerror bsr xParReadByte |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
195 lda #'? |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
196 jsr [S.CharOut] |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
197 comb |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
198 ldb #E$Read |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
199 rts |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
200 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
201 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
202 ;***************************************************** |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
203 ; This writes a single byte to the Arduino. On entry, |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
204 ; the byte to write is in A. This assumes ParSetWrite |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
205 ; was already called. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
206 ;; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
207 ; Write cycle: |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
208 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
209 ; 1. Wait for other side to lower ACK. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
210 ; 2. Put data onto the bus. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
211 ; 3. Set DIRECTION and PSTROBE to indicate data |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
212 ; is valid and ready to read. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
213 ; 4. Wait for ACK line to go high, indicating the |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
214 ; other side has read the data. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
215 ; 5. Lower PSTROBE. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
216 ; 6. Wait for ACK to go low, indicating end of |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
217 ; transfer. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
218 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
219 xParWriteByte pshs b,x ;save data |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
220 ldx #PIA0Base |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
221 Parwl22 ldb PIAREGB,x ;check status |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
222 andb #ACK |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
223 bne Parwl22 ;wait for ACK to go low |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
224 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
225 ; Now put the data onto the bus |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
226 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
227 sta PIAREGA,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
228 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
229 ; Raise the strobe so the Arduino knows there is |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
230 ; new data. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
231 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
232 lda PIAREGB,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
233 ora #PSTROBE |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
234 sta PIAREGB,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
235 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
236 ; Wait for ACK to go high, indicating the Arduino has |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
237 ; pulled the data and is ready for more. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
238 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
239 Parwl33 lda PIAREGB,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
240 anda #ACK |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
241 beq Parwl33 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
242 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
243 ; Now lower the strobe, then wait for the Arduino to |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
244 ; lower ACK. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
245 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
246 lda PIAREGB,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
247 anda #~PSTROBE |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
248 sta PIAREGB,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
249 Parwl44 lda PIAREGB,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
250 anda #ACK |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
251 bne Parwl44 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
252 puls b,x,pc |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
253 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
254 ;***************************************************** |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
255 ; This reads a byte from the Arduino and returns it in |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
256 ; A. Assumes ParSetRead was called before. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
257 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
258 ; This does not have a time-out. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
259 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
260 ; Preserves all other registers. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
261 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
262 ; Read cycle: |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
263 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
264 ; 1. Wait for other side to raise ACK, indicating |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
265 ; data is ready. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
266 ; 2. Read data. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
267 ; 3. Raise PSTROBE indicating data was read. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
268 ; 4. Wait for ACK to go low. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
269 ; 5. Lower PSTROBE. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
270 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
271 xParReadByte pshs a,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
272 ldx #PIA0Base |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
273 parloop@ lda PIAREGB,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
274 anda #ACK ;is their strobe high? |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
275 beq parloop@ ;nope, no data |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
276 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
277 ; Data is available, so grab and save it. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
278 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
279 lda PIAREGA,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
280 sta ,s |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
281 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
282 ; Now raise our strobe (their ACK), then wait for |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
283 ; them to lower their strobe. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
284 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
285 lda PIAREGB,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
286 ora #PSTROBE |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
287 sta PIAREGB,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
288 Parrlp1 lda PIAREGB,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
289 anda #ACK |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
290 bne Parrlp1 ;still active |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
291 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
292 ; Lower our ack, then we're done. |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
293 ; |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
294 lda PIAREGB,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
295 anda #~PSTROBE |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
296 sta PIAREGB,x |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
297 puls a,x,pc |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
298 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
299 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
300 page |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
301 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
302 Address fdb $0000 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
303 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
304 emod |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
305 eom equ * |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
306 EOMSize equ *-Address |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
307 |
185c31229f22
Add level1 corsham port for the Corsham 6809 System
Boisy Pitre <coco@toughmac.com>
parents:
diff
changeset
|
308 end |