6 extrn charini,?const,?conin
19 ;----------------------------------------------------------------------
39 ;----------------------------------------------------------------------
57 ; db rcr,CREFSH ;configure DRAM refresh
58 ; db dcntl,INIWAITS ;wait states
62 ;----------------------------------------------------------------------
81 ; search warm start mark
83 ld ix,mark_55AA ; top of common area
94 ld sp,$stack ; mark found, check
96 jp z,wstart ; check ok,
99 ; ram not ok, initialize -- kstart --
108 ;----------------------------------------------------------------------
111 ld hl,055AAh ;set warm start mark
119 call sysram_init ;027f
142 ;----------------------------------------------------------------------
145 ;TODO: Make a ringbuffer module.
155 ;----------------------------------------------------------------------
158 extrn msginit,msg.sout
159 extrn mtx.fifo,mrx.fifo
160 extrn co.fifo,ci.fifo
212 buftablen equ ($ - buffers)/3
227 ;----------------------------------------------------------------------
232 jr nc,b2p_1 ;A15=1 --> common
240 ;----------------------------------------------------------------------
246 ld bc,sysrame-sysramw
251 ;----------------------------------------------------------------------
259 ; Let all vectors point to spurious int routines.
273 ;----------------------------------------------------------------------
283 ld b,0 ;high byte port adress
289 ld c,(hl) ;port address
292 inc b ;outi decrements b
299 ld c,(hl) ;port address
328 ;----------------------------------------------------------------------
342 ; ---------------------------------------------------------
349 ; Trampoline for interrupt routines in banked ram.
350 ; Switch stack pointer to "system" stack in top ram
352 ; todo: z80 bank switch
355 ex (sp),hl ; save hl, return adr in hl
370 ; switch to system bank
382 pop hl ; restore bank
394 ; ---------------------------------------------------------
399 sp.int.len equ $-sp.int0
419 ; ---------------------------------------------------------
422 ; This routine may not be loaded in page zero
424 ; return Carry clear, if INTs are enabled.
428 xor a ;clear accu and carry
429 push af ;stack bottom := 00xxh
431 ld a,i ;P flag := IFF2
432 ret pe ;exit carry clear, if enabled
434 dec sp ;has stack bottom been overwritten?
436 and a ;if not 00xxh, INTs were
437 ret nz ;actually enabled
438 scf ;Otherwise, they really are disabled
441 ;----------------------------------------------------------------------
475 ret c ;INTs were disabled
479 ;----------------------------------------------------------------------
514 ret nc ;INTs were disabled
520 ;----------------------------------------------------------------------
558 global mm_sio0, mm_sio1
560 @cbnk: db 0 ; current bank (0..2)
566 ;----------------------------------------------------------------------
576 ;-----------------------------------------------------
581 ;ivtab equ 0ffc0h ; 0ffc0h ;int vector table