; WonderWitch FreyaBIOS definitions

; INT vector number
INT_EXIT		equ		10h
INT_KEY			equ		11h
INT_DISP		equ		12h
INT_TEXT		equ		13h
INT_COMM		equ		14h
INT_SOUND		equ		15h
INT_TIMER		equ		16h
INT_SYSTEM		equ		17h
INT_BANK		equ		18h

; Key BIOS
KEY_PRESS_CHECK		equ		00h
KEY_HIT_CHECK		equ		01h
KEY_WAIT		equ		02h
KEY_SET_REPEAT		equ		03h
KEY_GET_REPEAT		equ		04h
KEY_HIT_CHECK_WITH_REPEAT	equ	05h

; Disp BIOS
DISPLAY_CONTROL		equ		00h
DISPLAY_STATUS		equ		01h
FONT_SET_MONODATA	equ		02h
FONT_SET_COLORDATA	equ		03h
FONT_GET_DATA		equ		04h
FONT_SET_COLOR		equ		05h
FONT_GET_COLOR		equ		06h
SCREEN_SET_CHAR		equ		07h
SCREEN_GET_CHAR		equ		08h
SCREEN_FILL_CHAR	equ		09h
SCREEN_FILL_ATTR	equ		0ah
SPRITE_SET_RANGE	equ		0bh
SPRITE_SET_CHAR		equ		0ch
SPRITE_GET_CHAR		equ		0dh
SPRITE_SET_LOCATION	equ		0eh
SPRITE_GET_LOCATION	equ		0fh
SPRITE_SET_CHAR_LOCATION	equ	10h
SPRITE_GET_CHAR_LOCATION	equ	11h
SPRITE_SET_DATA		equ		12h
SCREEN_SET_SCROLL	equ		13h
SCREEN_GET_SCROLL	equ		14h
SCREEN2_SET_WINDOW	equ		15h
SCREEN2_GET_WINDOW	equ		16h
SPRITE_SET_WINDOW	equ		17h
SPRITE_GET_WINDOW	equ		18h
PALETTE_SET_COLOR	equ		19h
PALETTE_GET_COLOR	equ		1ah
LCD_SET_COLOR		equ		1bh
LCD_GET_COLOR		equ		1ch
LCD_SET_SEGMENTS	equ		1dh
LCD_GET_SEGMENTS	equ		1eh
LCD_SET_SLEEP		equ		1fh
LCD_GET_SLEEP		equ		20h
SCREEN_SET_VRAM		equ		21h
SPRITE_SET_VRAM		equ		22h

; Text BIOS
TEXT_SCREEN_INIT	equ		00h
TEXT_WINDOW_INIT	equ		01h
TEXT_SET_MODE		equ		02h
TEXT_GET_MODE		equ		03h
TEXT_PUT_CHAR		equ		04h
TEXT_PUT_STRING		equ		05h
TEXT_PUT_SUBSTRING	equ		06h
TEXT_PUT_NUMERIC	equ		07h
TEXT_FILL_CHAR		equ		08h
TEXT_SET_PALETTE	equ		09h
TEXT_GET_PALETTE	equ		0ah
TEXT_SET_ANK_FONT	equ		0bh
TEXT_SET_SJIS_FONT	equ		0ch
TEXT_GET_FONTDATA	equ		0dh
TEXT_SET_SCREEN		equ		0eh
TEXT_GET_SCREEN		equ		0fh
CURSOR_DISPLAY		equ		10h
CURSOR_STATUS		equ		11h
CURSOR_SET_LOCATION	equ		12h
CURSOR_GET_LOCATION	equ		13h
CURSOR_SET_TYPE		equ		14h
CURSOR_GET_TYPE		equ		15h

; Comm BIOS
COMM_OPEN		equ		00h
COMM_CLOSE		equ		01h
COMM_SEND_CHAR		equ		02h
COMM_RECEIVE_CHAR	equ		03h
COMM_RECEIVE_WITH_TIMEOUT	equ	04h
COMM_SEND_STRING	equ		05h
COMM_SEND_BLOCK		equ		06h
COMM_RECEIVE_BLOCK	equ		07h
COMM_SET_TIMEOUT	equ		08h
COMM_SET_BAUDRATE	equ		09h
COMM_GET_BAUDRATE	equ		0ah
COMM_SET_CANCEL_KEY	equ		0bh
COMM_GET_CANCEL_KEY	equ		0ch
COMM_XMODEM		equ		0dh

; Sound BIOS
SOUND_INIT		equ		00h
SOUND_SET_CHANNEL	equ		01h
SOUND_GET_CHANNEL	equ		02h
SOUND_SET_OUTPUT	equ		03h
SOUND_GET_OUTPUT	equ		04h
SOUND_SET_WAVE		equ		05h
SOUND_SET_PITCH		equ		06h
SOUND_GET_PITCH		equ		07h
SOUND_SET_VOLUME	equ		08h
SOUND_GET_VOLUME	equ		09h
SOUND_SET_SWEEP		equ		0ah
SOUND_GET_SWEEP		equ		0bh
SOUND_SET_NOISE		equ		0ch
SOUND_GET_NOISE		equ		0dh
SOUND_GET_RANDOM	equ		0eh

; Timer BIOS
RTC_RESET		equ		00h
RTC_SET_DATETIME	equ		01h
RTC_GET_DATETIME	equ		02h
RTC_SET_DATETIME_STRUCT	equ		03h
RTC_GET_DATETIME_STRUCT	equ		04h
RTC_ENABLE_ALARM	equ		05h
RTC_DISABLE_ALARM	equ		06h
TIMER_ENABLE		equ		07h
TIMER_DISABLE		equ		08h
TIMER_GET_COUNT		equ		09h

; System BIOS
SYS_INTERRUPT_SET_HOOK	equ		00h
SYS_INTERRUPT_RESET_HOOK	equ	01h
SYS_WAIT		equ		02h
SYS_GET_TICK_COUNT	equ		03h
SYS_SLEEP		equ		04h
SYS_SET_SLEEP_TIME	equ		05h
SYS_GET_SLEEP_TIME	equ		06h
SYS_SET_AWAKE_KEY	equ		07h
SYS_GET_AWAKE_KEY	equ		08h
SYS_SET_KEEPALIVE_INT	equ		09h
SYS_GET_OWNERINFO	equ		0ah
SYS_SUSPEND		equ		0bh
SYS_RESUME		equ		0ch
SYS_SET_REMOTE		equ		0dh
SYS_GET_REMOTE		equ		0eh
SYS_ALLOC_IRAM		equ		0fh
SYS_FREE_IRAM		equ		10h
SYS_GET_MY_IRAM		equ		11h
SYS_GET_VERSION		equ		12h
SYS_SWAP		equ		13h
SYS_SET_RESUME		equ		14h
SYS_GET_RESUME		equ		15h

; Bank BIOS
BANK_SET_MAP		equ		00h
BANK_GET_MAP		equ		01h
BANK_READ_BYTE		equ		02h
BANK_WRITE_BYTE		equ		03h
BANK_READ_WORD		equ		04h
BANK_WRITE_WORD		equ		05h
BANK_READ_BLOCK		equ		06h
BANK_WRITE_BLOCK	equ		07h
BANK_FILL_BLOCK		equ		08h
BANK_ERASE_FLASH	equ		09h



;ex) BIOS_KEY		KEY_PRESS_CHECK

%macro BIOS_EXIT 0
			int		INT_EXIT
%endmacro
%macro BIOS_KEY 1
			mov		ah, %1
			int		INT_KEY
%endmacro
%macro BIOS_DISP 1
			mov		ah, %1
			int		INT_DISP
%endmacro
%macro BIOS_TEXT 1
			mov		ah, %1
			int		INT_TEXT
%endmacro
%macro BIOS_COMM 1
			mov		ah, %1
			int		INT_COMM
%endmacro
%macro BIOS_SOUND 1
			mov		ah, %1
			int		INT_SOUND
%endmacro
%macro BIOS_TIMER 1
			mov		ah, %1
			int		INT_TIMER
%endmacro
%macro BIOS_SYSTEM 1
			mov		ah, %1
			int		INT_SYSTEM
%endmacro
%macro BIOS_BANK 1
			mov		ah, %1
			int		INT_BANK
%endmacro
