migrated to ACME assembler
commit 145d64aa6e78838ed07cefed372f0ad6a4687e97 Author: FeralChild64 <you@example.com> Date: Sun Sep 20 20:16:57 2020 +0200 ACME adaptation commit 885209d7822286744ea53232ae7461472a01d5d6 Author: FeralChild64 <you@example.com> Date: Sun Sep 20 19:57:25 2020 +0200 ACME adaptation commit 334d84486bc603551887e7cbeb59d329f2224cc7 Author: FeralChild64 <you@example.com> Date: Sun Sep 20 18:29:15 2020 +0200 ACME adaptation commit b5966f49bcd8f0ca79cbec93819a31238924707e Author: FeralChild64 <you@example.com> Date: Sun Sep 20 18:09:31 2020 +0200 ACME adaptation commit 786536a93a5eab5e676fca99625b4eb094a554e7 Author: FeralChild64 <you@example.com> Date: Sun Sep 20 17:24:48 2020 +0200 ACME adaptation commit 704c70dfb1f5d68775d6f3da220803b8a3990f56 Author: FeralChild64 <you@example.com> Date: Sun Sep 20 15:07:12 2020 +0200 ACME adaptation commit 136874964c9083b375f151475310f9636871fc72 Author: FeralChild64 <you@example.com> Date: Sun Sep 20 14:45:14 2020 +0200 ACME adaptation commit 8eca0d5700b72d04336e72c5cd3a68e18b85f96d Author: FeralChild64 <you@example.com> Date: Sun Sep 20 14:06:52 2020 +0200 ACME adaptation commit 11d29eb7ee318239d782f85498b6d0524624d5c4 Author: FeralChild64 <you@example.com> Date: Sun Sep 20 13:56:45 2020 +0200 ACME apaptation commit c9b5e5e04cceb92c66bc027e6440bc0f7c5a499f Author: FeralChild64 <you@example.com> Date: Sun Sep 20 13:49:04 2020 +0200 ACME adaptation commit f5cc254cbc921f07863807468cb3fe26b410b409 Author: FeralChild64 <you@example.com> Date: Sun Sep 20 13:01:18 2020 +0200 ACME adaptation commit e135a27bf9c30cc0965379c954564e06406303b1 Author: FeralChild64 <you@example.com> Date: Sat Sep 19 21:55:01 2020 +0200 ACME adaptation commit e9dfddf90d9e2795e88b7da40ae050d733faeb56 Author: FeralChild64 <you@example.com> Date: Sat Sep 19 21:48:47 2020 +0200 Makefile fix commit 07030104c65cf5e5beeacf6d629ccb9245e58657 Author: FeralChild64 <you@example.com> Date: Sat Sep 19 21:42:00 2020 +0200 ACME adaptation commit f824362ee5bcfbffca86c430b57773b2ffd65655 Author: FeralChild64 <you@example.com> Date: Sat Sep 19 20:14:56 2020 +0200 ACME adaptation commit 3a3c59007dcd4940d89b8669f34ca56b61c25fdf Author: FeralChild64 <you@example.com> Date: Fri Sep 18 21:51:45 2020 +0200 ACME adaptation commit 6790ef7bc88a41de2881c69b7524dd4ab8c74b5d Author: FeralChild64 <you@example.com> Date: Fri Sep 18 20:35:23 2020 +0200 ACME adaptation commit 38ad18b90e9ec713aa7ca49576b3388ce1733357 Author: FeralChild64 <you@example.com> Date: Fri Sep 18 18:46:20 2020 +0200 ACME adaptation commit 541340371122a9702f7b2d9771c298223cffd0e9 Author: FeralChild64 <you@example.com> Date: Fri Sep 18 16:49:46 2020 +0200 ACME adaptation commit 25cfd5e186459be1a260d3eb8cfff767838de370 Author: FeralChild64 <you@example.com> Date: Thu Sep 17 20:13:33 2020 +0200 ACME adaptation commit f61599444d5b1d03d8fd8e4a6a7c3b85069bedb3 Author: FeralChild64 <you@example.com> Date: Thu Sep 17 19:29:23 2020 +0200 ACME adaptation commit b290be31ec7bb2e5723607697da1bbc621c84429 Author: FeralChild64 <you@example.com> Date: Thu Sep 17 17:20:14 2020 +0200 ACME adaptation commit 877be9e856880d98fd4bcb25b42aaaacda9dc463 Author: FeralChild64 <you@example.com> Date: Wed Sep 16 21:47:38 2020 +0200 ACME adaptation commit bb20edaf85d386e41d5c2f715b745b68fbd3362e Author: FeralChild64 <you@example.com> Date: Wed Sep 16 21:31:30 2020 +0200 ACME adaptation commit c5d31bd8685abce37c8e254d15aac20bd1570d9f Author: FeralChild64 <you@example.com> Date: Wed Sep 16 18:40:49 2020 +0200 ACME adaptation commit 29349826b38f8a89649171559dc8cf24c560aff1 Author: FeralChild64 <you@example.com> Date: Mon Sep 14 23:35:47 2020 +0200 ACME adaptation commit 8bcd6a621c4b11766d0cf34f79858ba90a67248e Author: FeralChild64 <you@example.com> Date: Mon Sep 14 22:52:25 2020 +0200 ACME adaptation commit e87a69edc2ce4bfcc460c31e08dcc352a985f88d Author: FeralChild64 <you@example.com> Date: Mon Sep 14 22:43:27 2020 +0200 ACME adaptation commit f49a097bd52e96d00b866c02bda7121e4543233c Author: FeralChild64 <you@example.com> Date: Mon Sep 14 19:02:07 2020 +0200 ACME adaptation commit fa0e9214a633b8e8f867cc70925b390940dcd426 Author: FeralChild64 <you@example.com> Date: Mon Sep 14 17:47:19 2020 +0200 ACME adaptation commit 1b763b91e7a03e426227129c7f22f0ce57a4c197 Author: FeralChild64 <you@example.com> Date: Mon Sep 14 17:17:10 2020 +0200 ACME adaptation commit e92a4b57b232cd85eb1e71090b8a89c7c8461ebc Author: FeralChild64 <you@example.com> Date: Mon Sep 14 17:15:37 2020 +0200 ACME adaptation commit de3c693e8a7e73ea5289198946058e3240894e6a Author: FeralChild64 <you@example.com> Date: Mon Sep 14 17:10:05 2020 +0200 ACME adaptation commit f9bd7ae0f04e932d613be9ed5cb19af9be5d338e Author: FeralChild64 <you@example.com> Date: Sun Sep 13 14:34:44 2020 +0200 ACME adaptation commit 694dee52555dbfc2b1f7f452a9671ff51106c057 Author: FeralChild64 <you@example.com> Date: Sun Sep 13 14:16:14 2020 +0200 ACME adaptation commit 0af2c55edfcd22942d9f25417eb0d35f55b71604 Author: FeralChild64 <you@example.com> Date: Fri Sep 11 17:38:09 2020 +0200 ACME adaptation commit 2015e17334bd56a1e8a13a5abc098d9c2e7ea44f Author: FeralChild64 <you@example.com> Date: Fri Sep 11 16:46:05 2020 +0200 ACME adaptation commit b1e972162798d60f4483cd6cc261e856c20c2c8c Author: FeralChild64 <you@example.com> Date: Fri Sep 11 16:24:31 2020 +0200 ACME adaptation commit 9d027e868466901ba53bf074a79ec8cf16273021 Author: FeralChild64 <you@example.com> Date: Fri Sep 11 15:04:31 2020 +0200 ACME adaptation commit 957186deddd1aa4f3b4f1aa1f421e4239a584e57 Author: FeralChild64 <you@example.com> Date: Thu Sep 10 22:49:07 2020 +0200 ACME adaptation commit b8060f67a455cfac109f08d96b62c360d693b931 Author: FeralChild64 <you@example.com> Date: Wed Sep 9 23:07:28 2020 +0200 ACME adaptation commit e54d004568f44bbfe5c070ef1d7cf3544112e497 Author: FeralChild64 <you@example.com> Date: Wed Sep 9 22:58:20 2020 +0200 ACME adaptation commit f90b77f073c5a605cb31c6ee451f65c8a8aff7d8 Author: FeralChild64 <you@example.com> Date: Wed Sep 9 22:12:09 2020 +0200 ACME adaptation commit b211bb4afcd9c58fe1f5c92f3007717d611cd531 Author: FeralChild64 <you@example.com> Date: Wed Sep 9 22:01:40 2020 +0200 ACME adaptation commit 8d7ea343b07e9e08e5f77f3c414758a6cffd0440 Author: FeralChild64 <you@example.com> Date: Wed Sep 9 21:38:34 2020 +0200 ACME adaptation commit 46413eb0d92d6400aba0ff8dfe556e61e8a44d78 Author: FeralChild64 <you@example.com> Date: Wed Sep 9 21:07:47 2020 +0200 ACME adaptation commit 9f98f69ecc21f7b74a5eb89e247f5a2c6fcb655d Author: FeralChild64 <you@example.com> Date: Wed Sep 9 20:05:03 2020 +0200 ACME adaptation commit 7bb9f1cadc682c7e0a4a6796739d860d473ca110 Author: FeralChild64 <you@example.com> Date: Wed Sep 9 19:55:12 2020 +0200 ACME adaptation commit 5fc115392b5bdca6b56f67ad866b1884d2d2bdf8 Author: FeralChild64 <you@example.com> Date: Wed Sep 9 19:31:10 2020 +0200 ACME adaptation commit b7940fc60e568d859df9e3156f6bacc6d685b2cc Author: FeralChild64 <you@example.com> Date: Wed Sep 9 19:16:09 2020 +0200 ACME adaptation commit 56288cb97197561afa0816b29c134ec1190e8eab Author: FeralChild64 <you@example.com> Date: Wed Sep 9 18:48:23 2020 +0200 ACME adaptation commit 10401a60fc7922a53d782120ef6795d889140218 Author: FeralChild64 <you@example.com> Date: Wed Sep 9 16:34:16 2020 +0200 ACME adaptation commit 8ce76e4d2b56837a691ae84b1a412a2ae32a157b Author: FeralChild64 <you@example.com> Date: Wed Sep 9 16:20:44 2020 +0200 ACME adaptation commit 33fade899fa6172ea6b5b5f6683bb61f544429fd Author: FeralChild64 <you@example.com> Date: Wed Sep 9 15:28:46 2020 +0200 ACME adaptation commit a416f04734402fcfbc57a933731376df2e0180a1 Author: FeralChild64 <you@example.com> Date: Wed Sep 9 12:40:03 2020 +0200 ACME adaptation commit f8daee005b1d29f6912723be2ac94bc5fbeb0508 Author: FeralChild64 <you@example.com> Date: Mon Sep 7 23:29:54 2020 +0200 ACME adaptation commit 83fe6bdd0b08a44fdbfc6eefe323a4b194ccaf5b Author: FeralChild64 <you@example.com> Date: Mon Sep 7 22:23:16 2020 +0200 ACME adaptation commit cb1f75620b9c83000a15c9c7f7acefdfee79a979 Author: FeralChild64 <you@example.com> Date: Mon Sep 7 19:23:12 2020 +0200 ACME adaptation commit e524d517c933ae1f0aeb49764d307fadb4845025 Author: FeralChild64 <you@example.com> Date: Sun Sep 6 08:24:25 2020 +0200 ACME adaptation - replaced comments commit 2ab572c3a21f4a78a7312d0e684bc11d91d1717a Author: FeralChild64 <you@example.com> Date: Sat Sep 5 17:59:10 2020 +0200 ACME adaptation - replaced the assembler
This commit is contained in:
1 parent
bfc8291e41
commit
c8d255130c
685 files changed
+15835
-16296
No files matched your search
@@ -1,17 +1,17 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// RS-232 part of the CHKIN routine
|
||||
//
|
||||
;
|
||||
; RS-232 part of the CHKIN routine
|
||||
;
|
||||
|
||||
|
||||
#if CONFIG_RS232_UP2400
|
||||
!ifdef CONFIG_RS232_UP2400 {
|
||||
|
||||
|
||||
chkin_rs232:
|
||||
STUB_IMPLEMENTATION() // XXX provide implementation for both UP2400 and UP9600
|
||||
+STUB_IMPLEMENTATION ; XXX provide implementation for both UP2400 and UP9600
|
||||
|
||||
|
||||
#endif // CONFIG_RS232_UP2400
|
||||
} ; CONFIG_RS232_UP2400
|
||||
@@ -1,51 +1,51 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// RS-232 part of the CHKIN routine
|
||||
//
|
||||
;
|
||||
; RS-232 part of the CHKIN routine
|
||||
;
|
||||
|
||||
// Based on UP9600 code by Daniel Dallman with Bo Zimmerman adaptations
|
||||
; Based on UP9600 code by Daniel Dallman with Bo Zimmerman adaptations
|
||||
|
||||
|
||||
#if CONFIG_RS232_UP9600
|
||||
!ifdef CONFIG_RS232_UP9600 {
|
||||
|
||||
|
||||
// XXX get rid of the ENABLE/DISABLE mechanism
|
||||
; XXX get rid of the ENABLE/DISABLE mechanism
|
||||
|
||||
|
||||
chkin_rs232:
|
||||
|
||||
pha
|
||||
lda XXX_UPFLAG
|
||||
bne !+
|
||||
bne @1
|
||||
pla
|
||||
jmp $F20E // XXX
|
||||
jmp $F20E ; XXX
|
||||
|
||||
!:
|
||||
@1:
|
||||
pla
|
||||
jsr $F30F // XXX
|
||||
beq !+
|
||||
jmp $F701 // XXX
|
||||
jsr $F30F ; XXX
|
||||
beq @2
|
||||
jmp $F701 ; XXX
|
||||
|
||||
!:
|
||||
jsr $F31F // XXX
|
||||
@2:
|
||||
jsr $F31F ; XXX
|
||||
lda FA
|
||||
cmp #$02
|
||||
beq !+
|
||||
beq @3
|
||||
cmp #$04
|
||||
bcc chkin_rs232_nochkin
|
||||
jsr XXX_DISABLE
|
||||
jmp chkin_rs232_nochkin
|
||||
!:
|
||||
@3:
|
||||
sta $99
|
||||
jsr XXX_ENABLE
|
||||
clc
|
||||
rts
|
||||
|
||||
chkin_rs232_nochkin
|
||||
jmp $F219 // XXX
|
||||
chkin_rs232_nochkin:
|
||||
jmp $F219 ; XXX
|
||||
|
||||
|
||||
#endif // CONFIG_RS232_UP9600
|
||||
} ; CONFIG_RS232_UP9600
|
||||
@@ -1,17 +1,17 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// RS-232 part of the CHRIN routine
|
||||
//
|
||||
;
|
||||
; RS-232 part of the CHRIN routine
|
||||
;
|
||||
|
||||
|
||||
#if CONFIG_RS232_UP2400
|
||||
!ifdef CONFIG_RS232_UP2400 {
|
||||
|
||||
|
||||
chrin_rs232:
|
||||
STUB_IMPLEMENTATION() // XXX provide implementation for both UP2400 and UP9600
|
||||
+STUB_IMPLEMENTATION ; XXX provide implementation for both UP2400 and UP9600
|
||||
|
||||
|
||||
#endif // CONFIG_RS232_UP2400
|
||||
} ; CONFIG_RS232_UP2400
|
||||
@@ -1,46 +1,46 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// RS-232 part of the CHRIN routine
|
||||
//
|
||||
;
|
||||
; RS-232 part of the CHRIN routine
|
||||
;
|
||||
|
||||
// Based on UP9600 code by Daniel Dallman with Bo Zimmerman adaptations
|
||||
; Based on UP9600 code by Daniel Dallman with Bo Zimmerman adaptations
|
||||
|
||||
|
||||
#if CONFIG_RS232_UP9600
|
||||
!ifdef CONFIG_RS232_UP9600 {
|
||||
|
||||
|
||||
chrin_rs232:
|
||||
|
||||
phy_trash_a
|
||||
phx_trash_a
|
||||
+phy_trash_a
|
||||
+phx_trash_a
|
||||
|
||||
lda #$00
|
||||
sta XXX_SAVBYTE
|
||||
sta RSSTAT
|
||||
jsr up9600_rsin
|
||||
bcc !+
|
||||
plx_trash_a
|
||||
ply_trash_a
|
||||
bcc @1
|
||||
+plx_trash_a
|
||||
+ply_trash_a
|
||||
|
||||
lda #$08 // XXX don't we have some routine for this?
|
||||
lda #$08 ; XXX don't we have some routine for this?
|
||||
sta RSSTAT
|
||||
lda #$00
|
||||
clc
|
||||
rts
|
||||
!:
|
||||
@1:
|
||||
sta XXX_SAVBYTE
|
||||
|
||||
XXX_DOGET4:
|
||||
|
||||
plx_trash_a
|
||||
ply_trash_a
|
||||
+plx_trash_a
|
||||
+ply_trash_a
|
||||
|
||||
lda XXX_SAVBYTE
|
||||
clc
|
||||
rts
|
||||
|
||||
|
||||
#endif // CONFIG_RS232_UP9600
|
||||
} ; CONFIG_RS232_UP9600
|
||||
@@ -1,17 +1,17 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// RS-232 part of the CHROUT routine
|
||||
//
|
||||
;
|
||||
; RS-232 part of the CHROUT routine
|
||||
;
|
||||
|
||||
|
||||
#if HAS_RS232
|
||||
!ifdef HAS_RS232 {
|
||||
|
||||
|
||||
chrout_rs232:
|
||||
STUB_IMPLEMENTATION() // XXX provide implementation for both UP2400 and UP9600
|
||||
+STUB_IMPLEMENTATION ; XXX provide implementation for both UP2400 and UP9600
|
||||
|
||||
|
||||
#endif // HAS_RS232
|
||||
} ; HAS_RS232
|
||||
@@ -1,17 +1,17 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// RS-232 part of the CKOUT routine
|
||||
//
|
||||
;
|
||||
; RS-232 part of the CKOUT routine
|
||||
;
|
||||
|
||||
|
||||
#if CONFIG_RS232_UP2400
|
||||
!ifdef CONFIG_RS232_UP2400 {
|
||||
|
||||
|
||||
ckout_rs232:
|
||||
STUB_IMPLEMENTATION() // XXX provide implementation for both UP2400 and UP9600
|
||||
+STUB_IMPLEMENTATION ; XXX provide implementation for both UP2400 and UP9600
|
||||
|
||||
|
||||
#endif // CONFIG_RS232_UP2400
|
||||
} ; CONFIG_RS232_UP2400
|
||||
@@ -1,20 +1,20 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// RS-232 part of the CKOUT routine
|
||||
//
|
||||
;
|
||||
; RS-232 part of the CKOUT routine
|
||||
;
|
||||
|
||||
// Based on UP9600 code by Daniel Dallman with Bo Zimmerman adaptations
|
||||
; Based on UP9600 code by Daniel Dallman with Bo Zimmerman adaptations
|
||||
|
||||
|
||||
#if CONFIG_RS232_UP9600
|
||||
!ifdef CONFIG_RS232_UP9600 {
|
||||
|
||||
|
||||
ckout_rs232:
|
||||
|
||||
// XXX adapt this
|
||||
; XXX adapt this
|
||||
|
||||
lda #$02
|
||||
sta DFLTO
|
||||
@@ -23,4 +23,4 @@ ckout_rs232:
|
||||
rts
|
||||
|
||||
|
||||
#endif // CONFIG_RS232_UP9600
|
||||
} ; CONFIG_RS232_UP9600
|
||||
@@ -1,35 +1,35 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// RS-232 part of the CLOSE routine
|
||||
//
|
||||
;
|
||||
; RS-232 part of the CLOSE routine
|
||||
;
|
||||
|
||||
|
||||
#if HAS_RS232
|
||||
!ifdef HAS_RS232 {
|
||||
|
||||
|
||||
#if CONFIG_MEMORY_MODEL_60K
|
||||
.error "CONFIG_MEMORY_MODEL_60K is not compatible with RS-232 memory allocation code"
|
||||
#endif
|
||||
!ifdef CONFIG_MEMORY_MODEL_60K {
|
||||
!error "CONFIG_MEMORY_MODEL_60K is not compatible with RS-232 memory allocation code"
|
||||
}
|
||||
|
||||
|
||||
close_rs232:
|
||||
|
||||
// First check how many RS-232 channels are currently allocated.
|
||||
// If more than one, skip deallocation (other channels still uses the buffer).
|
||||
; First check how many RS-232 channels are currently allocated.
|
||||
; If more than one, skip deallocation (other channels still uses the buffer).
|
||||
|
||||
jsr rs232_count_channels
|
||||
cpx #$02 // set Carry if more than one is open
|
||||
cpx #$02 ; set Carry if more than one is open
|
||||
bcs close_rs232_end
|
||||
|
||||
// Deallocate buffer
|
||||
; Deallocate buffer
|
||||
|
||||
inc MEMSIZK+1
|
||||
inc MEMSIZK+1
|
||||
|
||||
// XXX is this needed? check with original ROM what it actually does
|
||||
; XXX is this needed? check with original ROM what it actually does
|
||||
|
||||
lda #$00
|
||||
sta ROBUF+0
|
||||
@@ -37,9 +37,11 @@ close_rs232:
|
||||
sta RIBUF+0
|
||||
sta RIBUF+1
|
||||
|
||||
; FALLTROUGH
|
||||
|
||||
close_rs232_end:
|
||||
|
||||
jmp close_remove_from_table
|
||||
|
||||
|
||||
#endif // HAS_RS232
|
||||
} ; HAS_RS232
|
||||
@@ -1,17 +1,16 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// RS-232 part of the GETIN routine
|
||||
//
|
||||
;
|
||||
; RS-232 part of the GETIN routine
|
||||
;
|
||||
|
||||
|
||||
#if HAS_RS232
|
||||
!ifdef HAS_RS232 {
|
||||
|
||||
|
||||
getin_rs232:
|
||||
STUB_IMPLEMENTATION() // XXX provide implementation for both UP2400 and UP9600
|
||||
|
||||
|
||||
#endif // HAS_RS232
|
||||
STUB_IMPLEMENTATION+ ; XXX provide implementation for both UP2400 and UP9600
|
||||
}
|
||||
@@ -1,31 +1,31 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// RS-232 part of the OPEN routine
|
||||
//
|
||||
;
|
||||
; RS-232 part of the OPEN routine
|
||||
;
|
||||
|
||||
|
||||
#if HAS_RS232
|
||||
!ifdef HAS_RS232 {
|
||||
|
||||
|
||||
#if CONFIG_MEMORY_MODEL_60K
|
||||
.error "CONFIG_MEMORY_MODEL_60K is not compatible with RS-232 memory allocation code"
|
||||
#endif
|
||||
!ifdef CONFIG_MEMORY_MODEL_60K {
|
||||
!error "CONFIG_MEMORY_MODEL_60K is not compatible with RS-232 memory allocation code"
|
||||
}
|
||||
|
||||
|
||||
open_rs232:
|
||||
|
||||
// First check how many RS-232 channels are currently allocated.
|
||||
// If more than one, skip allocation (already allocated).
|
||||
; First check how many RS-232 channels are currently allocated.
|
||||
; If more than one, skip allocation (already allocated).
|
||||
|
||||
jsr rs232_count_channels
|
||||
cpx #$02 // set Carry if more than one is open
|
||||
cpx #$02 ; set Carry if more than one is open
|
||||
bcs open_rs232_end
|
||||
|
||||
// Allocate buffers - first RIBUF, afterwards ROBUF
|
||||
// (checked addresses on original ROMs)
|
||||
; Allocate buffers - first RIBUF, afterwards ROBUF
|
||||
; (checked addresses on original ROMs)
|
||||
|
||||
lda MEMSIZK+0
|
||||
sta ROBUF+0
|
||||
@@ -39,7 +39,7 @@ open_rs232:
|
||||
lda MEMSIZK+1
|
||||
sta ROBUF+1
|
||||
|
||||
// Initialize buffer indexes
|
||||
; Initialize buffer indexes
|
||||
|
||||
lda #$00
|
||||
sta RIDBE
|
||||
@@ -48,16 +48,13 @@ open_rs232:
|
||||
sta RODBE
|
||||
|
||||
|
||||
#if CONFIG_RS232_UP9600
|
||||
!ifdef CONFIG_RS232_UP9600 {
|
||||
|
||||
jmp up9600_enable
|
||||
|
||||
#endif // CONFIG_RS232_UP9600
|
||||
|
||||
}
|
||||
|
||||
open_rs232_end:
|
||||
|
||||
jmp open_done_success
|
||||
}
|
||||
|
||||
|
||||
#endif // HAS_RS232
|
||||
@@ -1,29 +1,28 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// Sets .X to number of open RS-232 channels
|
||||
//
|
||||
;
|
||||
; Sets .X to number of open RS-232 channels
|
||||
;
|
||||
|
||||
|
||||
#if HAS_RS232
|
||||
!ifdef HAS_RS232 {
|
||||
|
||||
|
||||
rs232_count_channels:
|
||||
|
||||
ldx #$00
|
||||
ldy LDTND
|
||||
!:
|
||||
@1:
|
||||
dey
|
||||
bmi !+
|
||||
bmi @2
|
||||
lda FAT, y
|
||||
cmp #$02
|
||||
bne !-
|
||||
bne @1
|
||||
inx
|
||||
bpl !- // branch always
|
||||
!:
|
||||
bpl @1 ; branch always
|
||||
@2:
|
||||
rts
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
@@ -1,32 +1,32 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// Disable UP9600 interface
|
||||
//
|
||||
;
|
||||
; Disable UP9600 interface
|
||||
;
|
||||
|
||||
// Based on UP9600 code by Daniel Dallman with Bo Zimmerman adaptations
|
||||
; Based on UP9600 code by Daniel Dallman with Bo Zimmerman adaptations
|
||||
|
||||
|
||||
#if CONFIG_RS232_UP9600
|
||||
!ifdef CONFIG_RS232_UP9600 {
|
||||
|
||||
|
||||
up9600_disable: // XXX adapt
|
||||
up9600_disable: ; XXX adapt
|
||||
|
||||
// XXX restore interrupt vectors and IRQ timer
|
||||
; XXX restore interrupt vectors and IRQ timer
|
||||
|
||||
sei
|
||||
lda CIA2_PRB // $DD01; DISABLE RTS
|
||||
lda CIA2_PRB ; $DD01; DISABLE RTS
|
||||
and #$FD
|
||||
sta CIA2_PRB // $DD01
|
||||
sta CIA2_PRB ; $DD01
|
||||
lda #$7F
|
||||
sta CIA2_ICR // $DD0D ; DISABLE ALL CIA INTERRUPTS
|
||||
sta CIA1_ICR // $DC0D
|
||||
sta CIA2_ICR ; $DD0D ; DISABLE ALL CIA INTERRUPTS
|
||||
sta CIA1_ICR ; $DC0D
|
||||
lda #$41; QUICK (AND DIRTY) HACK TO SWITCH BACK
|
||||
sta CIA1_TIMAHI // $DC05 ; TO THE DEFAULT CIA1 CONFIGURATION
|
||||
sta CIA1_TIMAHI ; $DC05 ; TO THE DEFAULT CIA1 CONFIGURATION
|
||||
lda #$81
|
||||
sta CIA1_ICR // $DC0D ; ENABLE TIMER1 (THIS IS DEFAULT)
|
||||
sta CIA1_ICR ; $DC0D ; ENABLE TIMER1 (THIS IS DEFAULT)
|
||||
lda #<ORIGIRQ; RESTORE OLD IRQ-HANDLER
|
||||
sta IRQVECT
|
||||
lda #>ORIGIRQ
|
||||
@@ -41,6 +41,4 @@ up9600_disable: // XXX adapt
|
||||
pla
|
||||
tax
|
||||
pla
|
||||
|
||||
|
||||
#endif // CONFIG_RS232_UP9600
|
||||
}
|
||||
@@ -1,23 +1,22 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// Enable UP9600 interface support
|
||||
//
|
||||
;
|
||||
; Enable UP9600 interface support
|
||||
;
|
||||
|
||||
// Based on UP9600 code by Daniel Dallman with Bo Zimmerman adaptations
|
||||
; Based on UP9600 code by Daniel Dallman with Bo Zimmerman adaptations
|
||||
|
||||
|
||||
#if CONFIG_RS232_UP9600
|
||||
!ifdef CONFIG_RS232_UP9600 {
|
||||
|
||||
|
||||
up9600_enable: // XXX adapt
|
||||
up9600_enable: ; XXX adapt
|
||||
|
||||
sei
|
||||
|
||||
|
||||
|
||||
lda IRQVECT
|
||||
cmp #<ORIGIRQ
|
||||
bne INSTERR; IRQ-VECTOR ALREADY CHANGED
|
||||
@@ -38,27 +37,27 @@ up9600_enable: // XXX adapt
|
||||
; PROBE FOR RS232 INTERFACE
|
||||
cli
|
||||
lda #$7F
|
||||
sta CIA2_ICR // $DD0D ; DISABLE ALL NMIS
|
||||
sta CIA2_ICR ; $DD0D ; DISABLE ALL NMIS
|
||||
lda #$80
|
||||
sta CIA2_DDRB // $DD03 ; PB7 USED AS OUTPUT
|
||||
sta CIA2_DDRB ; $DD03 ; PB7 USED AS OUTPUT
|
||||
sta $DD0E; STOP TIMERA
|
||||
sta CIA2_CRB // $DD0F ; STOP TIMERB
|
||||
bit CIA2_ICR // $DD0D ; CLEAR PENDING INTERRUPTS
|
||||
sta CIA2_CRB ; $DD0F ; STOP TIMERB
|
||||
bit CIA2_ICR ; $DD0D ; CLEAR PENDING INTERRUPTS
|
||||
ldx #8
|
||||
INSTALL2
|
||||
stx CIA2_PRB // $DD01; TOGGLE TXD
|
||||
sta CIA2_PRB // $DD01; AND LOOK IF IT TRIGGERS AN
|
||||
INSTALL2:
|
||||
stx CIA2_PRB ; $DD01; TOGGLE TXD
|
||||
sta CIA2_PRB ; $DD01; AND LOOK IF IT TRIGGERS AN
|
||||
dex; SHIFT-REGISTER INTERRUPT
|
||||
bne INSTALL2
|
||||
lda CIA2_ICR // $DD0D ; CHECK FOR BIT3 (SDR-FLAG)
|
||||
lda CIA2_ICR ; $DD0D ; CHECK FOR BIT3 (SDR-FLAG)
|
||||
and #8
|
||||
beq INSTERR; NO INTERFACE DETECTED
|
||||
; GENERATE LOOKUP TABLE
|
||||
ldx #0
|
||||
INSTALL3
|
||||
INSTALL3:
|
||||
stx OUTSTAT; OUTSTAT USED AS TEMPORARY VARIABLE
|
||||
ldy #8
|
||||
INSTALL4
|
||||
INSTALL4:
|
||||
asl OUTSTAT
|
||||
ror
|
||||
dey
|
||||
@@ -72,48 +71,48 @@ INSTALL4
|
||||
|
||||
|
||||
sei
|
||||
// XXX set NEWIRQ as IRQ vector
|
||||
// XXX set NMIDOBIT as NMI vector
|
||||
; XXX set NEWIRQ as IRQ vector
|
||||
; XXX set NMIDOBIT as NMI vector
|
||||
|
||||
ldx TVSFLG; PAL OR NTSC VERSION PRINT
|
||||
lda ILOTAB,X; (KEYSCAN INTERRUPT ONCE EVERY 1/64 SECOND)
|
||||
sta CIA1_TIMBLO // $DC06 ; (SORRY THIS WILL BREAK CODE, THAT USES
|
||||
sta CIA1_TIMBLO ; $DC06 ; (SORRY THIS WILL BREAK CODE, THAT USES
|
||||
lda IHITAB,X; THE TI$ - VARIABLE)
|
||||
sta CIA1_TIMBHI // $DC07 ; START VALUE FOR TIMER B (OF CIA1)
|
||||
sta CIA1_TIMBHI ; $DC07 ; START VALUE FOR TIMER B (OF CIA1)
|
||||
txa
|
||||
asl
|
||||
eor #$33; ** TIME CONSTANT FOR SENDER **
|
||||
ldx #0; 51 OR 55 DEPENDING ON PAL/NTSC VERSION
|
||||
sta CIA1_TIMALO // $DC04 ; START VALUE FOR TIMERA (OF CIA1)
|
||||
stx CIA1_TIMAHI // $DC05 ; (TIME IS AROUND 1/(2*BAUDRATE) )
|
||||
sta CIA1_TIMALO ; $DC04 ; START VALUE FOR TIMERA (OF CIA1)
|
||||
stx CIA1_TIMAHI ; $DC05 ; (TIME IS AROUND 1/(2*BAUDRATE) )
|
||||
asl; ** TIME CONSTANT FOR RECEIVER **
|
||||
ora #1; 103 OR 111 DEPENDING ON PAL/NTSC VERSION
|
||||
sta CIA2_TIMBLO // $DD06 ; START VALUE FOR TIMERB (OF CIA2)
|
||||
stx CIA2_TIMBHI // $DD07 ; (TIME IS AROUND 1/BAUDRATE )
|
||||
sta CIA2_TIMBLO ; $DD06 ; START VALUE FOR TIMERB (OF CIA2)
|
||||
stx CIA2_TIMBHI ; $DD07 ; (TIME IS AROUND 1/BAUDRATE )
|
||||
lda #$41; START TIMERA OF CIA1, SP1 USED AS OUTPUT
|
||||
sta CIA1_CRA // $DC0E ; GENERATES THE SENDER'S BIT CLOCK
|
||||
sta CIA1_CRA ; $DC0E ; GENERATES THE SENDER'S BIT CLOCK
|
||||
lda #1
|
||||
sta OUTSTAT
|
||||
sta CIA1_ICR // $DC0D ; DISABLE TIMERA (CIA1) INTERRUPT
|
||||
sta CIA1_CRB // $DC0F ; START TIMERB OF CIA1 (GENERATES KEYSCAN IRQ)
|
||||
sta CIA1_ICR ; $DC0D ; DISABLE TIMERA (CIA1) INTERRUPT
|
||||
sta CIA1_CRB ; $DC0F ; START TIMERB OF CIA1 (GENERATES KEYSCAN IRQ)
|
||||
lda #$92; STOP TIMERB OF CIA2 (ENABLE SIGNAL AT PB7)
|
||||
sta CIA2_CRB // $DD0F
|
||||
sta CIA2_CRB ; $DD0F
|
||||
lda #$98
|
||||
bit CIA2_ICR // $DD0D ; CLEAR PENDING NMIS
|
||||
sta CIA2_ICR // $DD0D ; ENABLE NMI (SDR AND FLAG) (CIA2)
|
||||
bit CIA2_ICR ; $DD0D ; CLEAR PENDING NMIS
|
||||
sta CIA2_ICR ; $DD0D ; ENABLE NMI (SDR AND FLAG) (CIA2)
|
||||
lda #$8A
|
||||
sta CIA1_ICR // $DC0D ; ENABLE IRQ (TIMERB AND SDR) (CIA1)
|
||||
sta CIA1_ICR ; $DC0D ; ENABLE IRQ (TIMERB AND SDR) (CIA1)
|
||||
lda #$FF
|
||||
sta CIA2_PRB // $DD01; PB0-7 DEFAULT TO 1
|
||||
sta CIA1_SDR // $DC0C ; SP1 DEFAULTS TO 1
|
||||
sta CIA2_PRB ; $DD01; PB0-7 DEFAULT TO 1
|
||||
sta CIA1_SDR ; $DC0C ; SP1 DEFAULTS TO 1
|
||||
sec
|
||||
lda RIDBE
|
||||
sbc RIDBS
|
||||
cmp #200
|
||||
bcc ENABLE2;; DON'T ENABLE RTS IF REC-BUFFER IS FULL
|
||||
lda #2;; ENABLE RTS
|
||||
sta CIA2_DDRB // $DD03 ;; (THE RTS LINE IS THE ONLY OUTPUT)
|
||||
ENABLE2
|
||||
sta CIA2_DDRB ; $DD03 ;; (THE RTS LINE IS THE ONLY OUTPUT)
|
||||
ENABLE2:
|
||||
cli
|
||||
pla
|
||||
tay
|
||||
@@ -125,10 +124,9 @@ ENABLE2
|
||||
|
||||
|
||||
|
||||
INSTERR
|
||||
INSTERR:
|
||||
cli
|
||||
sec
|
||||
rts
|
||||
}
|
||||
|
||||
|
||||
#endif // CONFIG_RS232_UP9600
|
||||
@@ -1,32 +1,32 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// RS-232 IRQ handler part
|
||||
//
|
||||
;
|
||||
; RS-232 IRQ handler part
|
||||
;
|
||||
|
||||
// Based on UP9600 code by Daniel Dallman with Bo Zimmerman adaptations
|
||||
; Based on UP9600 code by Daniel Dallman with Bo Zimmerman adaptations
|
||||
|
||||
|
||||
#if CONFIG_RS232_UP9600
|
||||
!ifdef CONFIG_RS232_UP9600 {
|
||||
|
||||
|
||||
up9600_irq:
|
||||
|
||||
lda CIA1_ICR // $DC0D
|
||||
lda CIA1_ICR ; $DC0D
|
||||
|
||||
lsr
|
||||
lsr // move bit 1 (timer B flag) into Carry
|
||||
and #$02 // test SDR (shift register) status
|
||||
lsr ; move bit 1 (timer B flag) into Carry
|
||||
and #$02 ; test SDR (shift register) status
|
||||
|
||||
beq up9600_irq_continue
|
||||
|
||||
ldx RINONE
|
||||
beq !+ // skip if not waiting for empty SDR
|
||||
beq @1 ; skip if not waiting for empty SDR
|
||||
dex
|
||||
stx RINONE
|
||||
!:
|
||||
@1:
|
||||
bcc up9600_irq_end
|
||||
|
||||
up9600_irq_continue:
|
||||
@@ -38,6 +38,4 @@ up9600_irq_end:
|
||||
pla
|
||||
pla
|
||||
jmp return_from_interrupt
|
||||
|
||||
|
||||
#endif // CONFIG_RS232_UP9600
|
||||
}
|
||||
@@ -1,48 +1,47 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// RS-232 NMI handler part
|
||||
//
|
||||
;
|
||||
; RS-232 NMI handler part
|
||||
;
|
||||
|
||||
// Based on UP9600 code by Daniel Dallman with Bo Zimmerman adaptations
|
||||
; Based on UP9600 code by Daniel Dallman with Bo Zimmerman adaptations
|
||||
|
||||
|
||||
#if CONFIG_RS232_UP9600
|
||||
!ifdef CONFIG_RS232_UP9600 {
|
||||
|
||||
|
||||
up9600_nmi:
|
||||
// XXX integrate with NMI handler
|
||||
; XXX integrate with NMI handler
|
||||
|
||||
pha
|
||||
bit CIA2_ICR // $DD0D; check if CIA caused the interrupt
|
||||
bit CIA2_ICR ; $DD0D; check if CIA caused the interrupt
|
||||
bpl NMIDOBI2; NO STARTBIT RECEIVED, THEN SKIP
|
||||
lda #$13
|
||||
sta CIA2_CRB // $DD0F; START TIMER B (FORCED RELOAD, SIGNAL AT PB7)
|
||||
sta CIA2_ICR // $DD0D; DISABLE TIMER AND FLAG INTERRUPTS
|
||||
sta CIA2_CRB ; $DD0F; START TIMER B (FORCED RELOAD, SIGNAL AT PB7)
|
||||
sta CIA2_ICR ; $DD0D; DISABLE TIMER AND FLAG INTERRUPTS
|
||||
lda #<NMIBYTRY; ON NEXT NMI CALL NMIBYTRY
|
||||
sta NMIVECT; (TRIGGERED BY SDR FULL)
|
||||
lda #>NMIBYTRY
|
||||
sta NMIVECT+1
|
||||
NMIDOBI2
|
||||
NMIDOBI2:
|
||||
pla; IGNORE, IF NMI WAS TRIGGERED BY RESTORE-KEY
|
||||
rti
|
||||
;
|
||||
NMIBYTRY
|
||||
NMIBYTRY:
|
||||
pha
|
||||
bit CIA2_ICR // $DD0D; CHECK BIT 7 (SDR FULL PRINT)
|
||||
bit CIA2_ICR ; $DD0D; CHECK BIT 7 (SDR FULL PRINT)
|
||||
bpl NMIDOBI2; SDR NOT FULL, THEN SKIP (EG. RESTORE-KEY)
|
||||
lda #$92
|
||||
sta CIA2_CRB // $DD0F; STOP TIMER B (KEEP SIGNALLING AT PB7!)
|
||||
sta CIA2_ICR // $DD0D; ENABLE FLAG (AND TIMER) INTERRUPTS
|
||||
sta CIA2_CRB ; $DD0F; STOP TIMER B (KEEP SIGNALLING AT PB7!)
|
||||
sta CIA2_ICR ; $DD0D; ENABLE FLAG (AND TIMER) INTERRUPTS
|
||||
lda #<NMIDOBIT; ON NEXT NMI CALL NMIDOBIT
|
||||
sta NMIVECT; (TRIGGERED BY A STARTBIT)
|
||||
lda #>NMIDOBIT
|
||||
sta NMIVECT+1
|
||||
phx_trash_a
|
||||
phy_trash_a
|
||||
lda CIA2_SDR // $DD0C; READ SDR (BIT0=DATABIT7,...,BIT7=DATABIT0)
|
||||
+phx_trash_a
|
||||
+phy_trash_a
|
||||
lda CIA2_SDR ; $DD0C; READ SDR (BIT0=DATABIT7,...,BIT7=DATABIT0)
|
||||
cmp #128; MOVE BIT7 INTO CARRY-FLAG
|
||||
and #127
|
||||
tax
|
||||
@@ -57,13 +56,12 @@ NMIBYTRY
|
||||
sbc RIDBS
|
||||
cmp #200
|
||||
bcc NMIBYTR2
|
||||
lda CIA2_PRB // $DD01;; MORE THAN 200 BYTES IN THE RECEIVE BUFFER
|
||||
lda CIA2_PRB ; $DD01;; MORE THAN 200 BYTES IN THE RECEIVE BUFFER
|
||||
and #$FD;; THEN DISABLE RTS
|
||||
sta CIA2_PRB // $DD01
|
||||
NMIBYTR2
|
||||
ply_trash_a
|
||||
plx_trash_a
|
||||
sta CIA2_PRB ; $DD01
|
||||
NMIBYTR2:
|
||||
+ply_trash_a
|
||||
+plx_trash_a
|
||||
pla
|
||||
rti
|
||||
|
||||
#endif // CONFIG_RS232_UP9600
|
||||
}
|
||||
@@ -1,46 +1,44 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// Get byte from serial interface
|
||||
//
|
||||
;
|
||||
; Get byte from serial interface
|
||||
;
|
||||
|
||||
// Based on UP9600 code by Daniel Dallman with Bo Zimmerman adaptations
|
||||
; Based on UP9600 code by Daniel Dallman with Bo Zimmerman adaptations
|
||||
|
||||
|
||||
#if CONFIG_RS232_UP9600
|
||||
!ifdef CONFIG_RS232_UP9600 {
|
||||
|
||||
|
||||
up9600_rsin:
|
||||
|
||||
ldy RIDBS
|
||||
cpy RIDBE
|
||||
beq up9600_rsin_end; // skip (empty buffer, return with carry set)
|
||||
beq up9600_rsin_end; ; skip (empty buffer, return with carry set)
|
||||
|
||||
lda (RIBUF),Y
|
||||
iny
|
||||
sty RIDBS
|
||||
pha // begin buffer emptying chk
|
||||
pha ; begin buffer emptying chk
|
||||
tya
|
||||
sec
|
||||
sbc RIDBE
|
||||
cmp #206 // 256-50
|
||||
bcc !+
|
||||
cmp #206 ; 256-50
|
||||
bcc @1
|
||||
lda #$02
|
||||
ora CIA2_PR // $DD01
|
||||
sta CIA2_PR // enable RTS
|
||||
ora CIA2_PR ; $DD01
|
||||
sta CIA2_PR ; enable RTS
|
||||
clc
|
||||
|
||||
// FALLTROUGH
|
||||
|
||||
!:
|
||||
; FALLTROUGH
|
||||
@1:
|
||||
pla
|
||||
|
||||
// FALLTROUGH
|
||||
; FALLTROUGH
|
||||
|
||||
up9600_rsin_end:
|
||||
|
||||
rts
|
||||
|
||||
#endif // CONFIG_RS232_UP9600
|
||||
}
|
||||
@@ -1,25 +1,25 @@
|
||||
// #LAYOUT# STD * #TAKE
|
||||
// #LAYOUT# * KERNAL_0 #TAKE
|
||||
// #LAYOUT# * * #IGNORE
|
||||
;; #LAYOUT# STD * #TAKE
|
||||
;; #LAYOUT# * KERNAL_0 #TAKE
|
||||
;; #LAYOUT# * * #IGNORE
|
||||
|
||||
//
|
||||
// Put byte to serial interface
|
||||
//
|
||||
;
|
||||
; Put byte to serial interface
|
||||
;
|
||||
|
||||
// Based on UP9600 code by Daniel Dallman with Bo Zimmerman adaptations
|
||||
; Based on UP9600 code by Daniel Dallman with Bo Zimmerman adaptations
|
||||
|
||||
|
||||
#if CONFIG_RS232_UP9600
|
||||
!ifdef CONFIG_RS232_UP9600 {
|
||||
|
||||
|
||||
up9600_rsout:
|
||||
|
||||
pha
|
||||
sta $9E // XXX synchronize with aliases
|
||||
sta $9E ; XXX synchronize with aliases
|
||||
cmp #$80
|
||||
and #$7F
|
||||
stx $A8 // XXX synchronize with aliases
|
||||
sty $A7 // XXX synchronize with aliases
|
||||
stx $A8 ; XXX synchronize with aliases
|
||||
sty $A7 ; XXX synchronize with aliases
|
||||
tax
|
||||
jsr up9600_rsout_time
|
||||
|
||||
@@ -27,15 +27,15 @@ up9600_rsout:
|
||||
adc #$00
|
||||
lsr
|
||||
sei
|
||||
sta CIA1_SDR // $DC0C
|
||||
sta CIA1_SDR ; $DC0C
|
||||
lda #$02
|
||||
STA XXX_OUTSTAT
|
||||
sta XXX_OUTSTAT
|
||||
ror
|
||||
ora #$7F
|
||||
sta CIA1_SDR // $DC0C
|
||||
sta CIA1_SDR ; $DC0C
|
||||
cli
|
||||
ldx $A8 // XXX synchronize with aliases
|
||||
ldy $A7 // XXX synchronize with aliases
|
||||
ldx $A8 ; XXX synchronize with aliases
|
||||
ldy $A7 ; XXX synchronize with aliases
|
||||
pla
|
||||
rts
|
||||
|
||||
@@ -43,17 +43,15 @@ up9600_rsout_time:
|
||||
|
||||
cli
|
||||
lda #$FD
|
||||
sta TIME+2 // XXX check if this is the lowest byte
|
||||
sta TIME+2 ; XXX check if this is the lowest byte
|
||||
|
||||
rs232_rsout_wait:
|
||||
|
||||
lda XXX_OUTSTAT
|
||||
beq !+
|
||||
beq @1
|
||||
bit TIME+2
|
||||
bmi up9600_rsout_wait
|
||||
@1:
|
||||
jmp $F490 ; XXX
|
||||
}
|
||||
|
||||
!:
|
||||
jmp $F490 // XXX
|
||||
|
||||
|
||||
#endif // CONFIG_RS232_UP9600
|
||||
Reference in new issue
Block a user