summaryrefslogtreecommitdiff
path: root/z180/r3init.180
diff options
context:
space:
mode:
authorLeo C2014-10-28 10:29:13 +0100
committerLeo C2014-10-28 10:29:13 +0100
commit30d1329e8e5c029a87f657baace698d1d7031f9e (patch)
tree8968e54145c1212cbaad6938e3da86cb42bf3707 /z180/r3init.180
parent8a7deceacd30529e5c32082b2c719eb055841d0d (diff)
downloadz180-stamp-30d1329e8e5c029a87f657baace698d1d7031f9e.zip
CP/M 3 compatible character i/o handling
Diffstat (limited to 'z180/r3init.180')
-rw-r--r--z180/r3init.18039
1 files changed, 25 insertions, 14 deletions
diff --git a/z180/r3init.180 b/z180/r3init.180
index 2dd1bb8..9adbdd8 100644
--- a/z180/r3init.180
+++ b/z180/r3init.180
@@ -3,7 +3,7 @@
extrn ddtz,bpent
extrn $stack
- extrn $coninit,$cists,$ci
+ extrn charini,?const,?conin
extrn romend
@@ -73,17 +73,20 @@ hwini0:
;----------------------------------------------------------------------
start:
- push af ;003c
- in0 a,(itc) ;003d Illegal opcode trap?
- jp p,??st01 ;0040
- pop af ;0043
- jp bpent ;0044 yes, handle
+ ld (tmpstack),sp
+ ld sp,tmpstack
+ push af
+ in0 a,(itc) ;Illegal opcode trap?
+ jp m,??st01
+ ld a,i ;I register == 0 ?
+ jr z,??st02 ; yes, harware reset
??st01:
- ld a,i ;0047 I register == 0 ?
- jr z,??st02 ;004b yes, harware reset
- pop af ;004d
- jp bpent ;004e no, allready set up
+ ld a,(syscbr)
+ out0 (cbr),a
+ pop af ;restore registers
+ ld sp,(tmpstack) ;
+ jp bpent ;
??st02:
di ;0058
@@ -189,6 +192,8 @@ ramok:
alloc:
out0 (cbr),c ;01de
+ ld a,c
+ ld (syscbr),a
ld sp,$stack ;01e1
; Clear RAM using DMA0
@@ -280,7 +285,7 @@ wstart:
call prt0_init
- call $coninit
+ call charini
call bufferinit
@@ -289,15 +294,21 @@ wstart:
im 2 ;?030e
ei ;0282
- call $cists ;0284
- call $cists ;0287
+ call ?const ;0284
+ call ?const ;0287
or a ;028a
- call nz,$ci ;028d
+ call nz,?conin ;028d
ld a,(banktab) ;
ld e,a ;
jp ddtz ;0290
+
+ ds 8
+tmpstack:
+ dw 2
+syscbr: db 1
+
;
;----------------------------------------------------------------------
;