Extended.asm
flypie_Ace-2019/NewROM/Extended.asm

	INCLUDE "iodefs.inc"
	
	.ifndef CTC0INT
	GLOBAL NEWROMSTART

;	EXTERN CTC0INT,CTC1INT,CTC2INT,CTC3INT,INIT_CTC
;	EXTERN INIT_SIO
;	EXTERN SIOAINT_TBE,SIOAINT_ESC,SIOAINT_RCA,SIOAINT_SRC,SIOBINT_TBE,SIOBINT_ESC,SIOBINT_RCA,SIOBINT_SRC

;	EXTERN PIOAINT,PIOBINT,PIACINT,INIT_PIO
	
;	EXTERN INTTBL

;	EXTERN L009B


;	.DEFINE DEUCEROM
;	.SECTION DEUCEROM

	.endif 

NEWROMSTART:


	LD		hl,02000h
	LD		a,055h
Looper:
	LD		C,(hl)
	INC		C
	LD		(HL),C
	OUT		(0FFh),a
	JP Looper

	call INIT_KIO
;	JP	L009B


INIT_KIO:
	ld	A,(1<<7)|011B	; SIOPIA Moude = SIP & Daischain = CTC,SIO,PIO 
	ld	BC,KIOCMDA
	out	(BC),A

	call INIT_CTC
	call INIT_PIO
	call INIT_SIO

	IM	2
	LD	A,INTTABLEBASE/256
	LD	I, A
	EI


