extrn $stack\r
extrn charini,?const,?conin\r
extrn ?cono,?conos\r
-\r
extrn romend\r
\r
\r
+ global iobyte\r
global isv_sw\r
\r
include config.inc\r
org romstart+0\r
jp start\r
\r
-iobyte: db 0\r
+iobyte: db 2\r
+\r
; restart vectors\r
\r
rsti defl 1\r
\r
hwini0:\r
if CPU_Z180\r
-\r
db 3 ;count\r
db rcr,CREFSH ;configure DRAM refresh\r
db dcntl,INIWAITS ;wait states\r
db cbar,SYS$CBAR\r
- else\r
- db 0\r
endif\r
+ db 0\r
\r
if CPU_Z180\r
dmclrt: ;clear ram per dma\r
db 00h ;dst\r
dw 0-romend ;count (64k)\r
dmct_e:\r
+ db 0\r
endif\r
\r
\r
if 0\r
\r
ld hl,dmclrt ;load DMA registers\r
- call io.ini.m\r
+ call ioiniml\r
ld a,0cbh ;01ef dst +1, src fixed, burst\r
out0 (dmode),a ;01f1\r
\r
inc hl\r
ld (hl),high iprt0\r
ld hl,prt0itab\r
- call io.ini.m\r
+ call ioiniml\r
ret\r
\r
prt0itab:\r
dw PRT_TC10MS\r
db M_TIE0+M_TDE0 ;enable timer 0 interrupt and down count.\r
prt0it_e:\r
+ db 0\r
endif\r
\r
\r
;----------------------------------------------------------------------\r
;\r
\r
+ if CPU_Z180\r
io.ini:\r
+ if 0\r
push bc\r
- if CPU_Z180\r
-\r
ld b,0 ;high byte port adress\r
+ioi_nxt:\r
ld a,(hl) ;count\r
inc hl\r
or a\r
jr z,ioi_e\r
-ioi_1:\r
+\r
ld c,(hl) ;port address\r
inc hl\r
+ioi_r:\r
outi\r
inc b ;outi decrements b\r
dec a\r
- jr nz,ioi_1\r
+ jr nz,ioi_r\r
+ jr ioi_nxt\r
ioi_e: \r
+ pop bc\r
+ ret\r
+ \r
+ else ;(if 1/0)\r
+ \r
+ push bc\r
+ jr ioi_nxt\r
+ioi_l:\r
+ ld c,(hl) ;port address\r
+ inc hl\r
+ inc c\r
+ioi_r:\r
+ dec c ;otim increments c\r
+ otim\r
+ jr z,ioi_r\r
+ioi_nxt:\r
+ ld b,(hl) ;count\r
+ inc hl\r
+ inc b ;stop if count == 0\r
+ djnz ioi_l\r
+ pop bc\r
+ ret\r
+ \r
+ endif ;(1/0)\r
+\r
else\r
+\r
+io.ini:\r
+ push bc\r
jr ioi_nxt\r
ioi_l:\r
ld c,(hl) ;port address\r
pop bc\r
ret\r
\r
+;----------------------------------------------------------------------\r
+\r
if CPU_Z180\r
-io.ini.m:\r
+\r
+ global ioiniml\r
+\r
+ioiniml:\r
push bc\r
+ xor a\r
+ioml_lp:\r
ld b,(hl)\r
inc hl\r
+ cp b\r
+ jr z,ioml_e\r
+ \r
ld c,(hl)\r
inc hl\r
otimr\r
+ jr ioml_lp\r
+ioml_e:\r
pop bc\r
- ret\r
+ ret z\r
endif\r
\r
io.ini.l:\r