-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhisiocode-send.src
75 lines (68 loc) · 1.76 KB
/
hisiocode-send.src
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
; highsiocode-send.src - highspeed SIO routine, send byte/block
;
; Copyright (c) 2003-2009 by Matthias Reichl <[email protected]>
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2 of the License, or
; (at your option) any later version.
;
; This program is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with this program; if not, write to the Free Software
; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
; send a byte. Note. we don't check for the break key
; here since it confuses several drives (eg. speedy 1050)
?SENDBYT TAX
LDA #IMSEND
?WPUT BIT IRQST
BNE ?WPUT
LDA #RMSEND
STA IRQEN
LDA #MSKSEND
STA IRQEN
TXA
STA SEROUT
?ADDSUM CLC
ADC CHKSUM
ADC #$00
STA CHKSUM
RTS
?SENDBLK LDY #$00 ; short delay before sending data
?WT1 INY
BNE ?WT1
LDA #SKSEND ; set pokey to transmit data mode
STA SKCTL
STA SKREST
LDA #MSKSEND
STA IRQEN
LDA (BUFRLO),Y ; start transmission by sending first byte
STA CHKSUM
STA SEROUT
INY
BNE ?SND2 ; always
?SND1 LDA (BUFRLO),Y
?ABS61 JSR ?SENDBYT ; normal send, wait for pokey clear
INY
BNE ?SND2
INC BUFRHI
DEC BFENHI
; wait a litte after sending a full page, needed by some
; drives when sending more than 256 bytes
LDX #$E0
?WT2 INX
BNE ?WT2
?SND2 CPY BFENLO
BNE ?SND1
LDA BFENHI
BNE ?SND1
LDA CHKSUM
?ABS62 JSR ?SENDBYT
LDA #IMSCPL
?WTSND BIT IRQST ; wait until transmit complete
BNE ?WTSND
RTS