
;LSI C parser ver 3.5.12 for WonderWitch Copyright (C) 1988-2000 by LSI JAPAN [Apr 13 2000]
;LSI i8086 CG ver 3.5.12 for WonderWitch Copyright (C) 1988-1991, 1995-2000 by LSI JAPAN [Apr 13 2000]


CGROUP	GROUP	TEXT
DGROUP	GROUP	DATA,BSS

TEXT	CSEG

DATA	DSEG

BSS	DSEG
	EVEN
Z2:	RS	8


TEXT	CSEG

_InitHblank::
	PUSH	BP
	MOV	BP,SP
	MOV	[_usehblank].W,0
	MOV	AX,[BP+4].W
	MOV	[Z2].W,AX
	MOV	[_palfg].W,0
	mov	ax,cs
	MOV	[Z2+2].W,AX
	mov	ax,ds
	MOV	[Z2+4].W,AX
	MOV	BX,0
	MOV	AX,0
	PUSH	AX
	PUSH	BX
	MOV	AX,Z2
	PUSH	DS
	PUSH	AX
	MOV	AX,7
	PUSH	AX
	CALL	_sys_interrupt_set_hook
	ADD	SP,10
	MOV	AX,1
	PUSH	AX
	MOV	AX,1
	PUSH	AX
	XOR	AX,AX
	PUSH	AX
	CALL	_timer_enable
	ADD	SP,6
	MOV	[_usehblank].W,1
	POP	BP
	RET


BSS	DSEG
	EVEN
Z6:	RS	8


TEXT	CSEG

_InitVblank::
	PUSH	BP
	MOV	BP,SP
	MOV	[_usevblank].W,0
	MOV	AX,[BP+4].W
	MOV	[Z6].W,AX
	mov	ax,cs
	MOV	[Z6+2].W,AX
	mov	ax,ds
	MOV	[Z6+4].W,AX
	MOV	BX,0
	MOV	AX,0
	PUSH	AX
	PUSH	BX
	MOV	AX,Z6
	PUSH	DS
	PUSH	AX
	MOV	AX,5
	PUSH	AX
	CALL	_sys_interrupt_set_hook
	ADD	SP,10
	MOV	AX,1
	PUSH	AX
	MOV	AX,1
	PUSH	AX
	MOV	AX,1
	PUSH	AX
	CALL	_timer_enable
	ADD	SP,6
	MOV	[_usevblank].W,1
	POP	BP
	RET



_hb_callback:
	CMP	[_palfg].W,0
	JE	_6
	MOV	AX,240
	PUSH	AX
	XOR	AX,AX
	PUSH	AX
	XOR	AX,AX
	PUSH	AX
	CALL	_wwc_palette_set_color
	ADD	SP,6
	JMP	_7
_6:
	MOV	AX,3855
	PUSH	AX
	XOR	AX,AX
	PUSH	AX
	XOR	AX,AX
	PUSH	AX
	CALL	_wwc_palette_set_color
	ADD	SP,6
_7:
	MOV	AX,1
	SUB	AX,[_palfg].W
	MOV	[_palfg].W,AX
	RETF



_vb_callback:
	MOV	[_palfg].W,0
	RETF



_HIntStop::
	CMP	[_usehblank].W,0
	JE	_14
	XOR	AX,AX
	PUSH	AX
	CALL	_timer_disable
	ADD	SP,2
	MOV	BX,0
	MOV	AX,0
	PUSH	AX
	PUSH	BX
	MOV	AX,7
	PUSH	AX
	CALL	_sys_interrupt_reset_hook
	ADD	SP,6
	MOV	[_usehblank].W,0
_14:
	RET



_VIntStop::
	CMP	[_usevblank].W,0
	JE	_18
	MOV	AX,1
	PUSH	AX
	CALL	_timer_disable
	ADD	SP,2
	MOV	BX,0
	MOV	AX,0
	PUSH	AX
	PUSH	BX
	MOV	AX,5
	PUSH	AX
	CALL	_sys_interrupt_reset_hook
	ADD	SP,6
	MOV	[_usevblank].W,0
_18:
	RET


BSS	DSEG
	EVEN
Z21:	RS	512
	EVEN
Z22:	RS	512


TEXT	CSEG

_main::
	PUSH	BP
	MOV	BP,SP
	SUB	SP,8
	PUSH	SI
	CALL	_text_screen_init
	MOV	AX,128
	PUSH	AX
	CALL	_wwc_set_color_mode
	ADD	SP,2
	MOV	[BP-2].W,0
	JMP	_20
_21:
	PUSH	[BP-2].W
	MOV	AX,Z27
	PUSH	DS
	PUSH	AX
	MOV	AX,_str
	PUSH	DS
	PUSH	AX
	CALL	_sprintf
	ADD	SP,10
	MOV	AX,_str
	PUSH	DS
	PUSH	AX
	PUSH	[BP-2].W
	XOR	AX,AX
	PUSH	AX
	CALL	_text_put_string
	ADD	SP,8
	INC	[BP-2].W
_20:
	CMP	[BP-2].W,16
	JL	_21
	MOV	AX,240
	PUSH	AX
	XOR	AX,AX
	PUSH	AX
	XOR	AX,AX
	PUSH	AX
	CALL	_wwc_palette_set_color
	ADD	SP,6
	MOV	AX,3840
	PUSH	AX
	MOV	AX,1
	PUSH	AX
	XOR	AX,AX
	PUSH	AX
	CALL	_wwc_palette_set_color
	ADD	SP,6
	MOV	AX,240
	PUSH	AX
	MOV	AX,2
	PUSH	AX
	XOR	AX,AX
	PUSH	AX
	CALL	_wwc_palette_set_color
	ADD	SP,6
	MOV	AX,15
	PUSH	AX
	MOV	AX,3
	PUSH	AX
	XOR	AX,AX
	PUSH	AX
	CALL	_wwc_palette_set_color
	ADD	SP,6
	CALL	_key_press_check
	MOV	[BP-4].W,AX
	TEST	[BP-4].W,2
	JE	_26
_26:
	CALL	_lcd_get_display_line
	XOR	AH,AH
	MOV	[BP-6].W,AX
	MOV	[BP-2].W,0
	JMP	_27
_28:
	MOV	SI,[BP-2].W
	SHL	SI,1
	MOV	BX,[BP-2].W
	SHL	BX,1
	MOV	AX,[Z22+BX].W
	MOV	[Z21+SI].W,AX
	INC	[BP-2].W
_27:
	CMP	[BP-2].W,512
	JL	_28
	CALL	_lcd_get_display_line
	XOR	AH,AH
	MOV	[BP-8].W,AX
	PUSH	[BP-8].W
	PUSH	[BP-6].W
	MOV	AX,Z34
	PUSH	DS
	PUSH	AX
	MOV	AX,_str
	PUSH	DS
	PUSH	AX
	CALL	_sprintf
	ADD	SP,12
	MOV	AX,_str
	PUSH	DS
	PUSH	AX
	XOR	AX,AX
	PUSH	AX
	XOR	AX,AX
	PUSH	AX
	CALL	_text_put_string
	ADD	SP,8
	POP	SI
	MOV	SP,BP
	POP	BP
	RET


DATA	DSEG
	EVEN
Z27:	DB	109
	DB	111
	DB	106
	DB	105
	DB	32
	DB	37
	DB	100
	DB	0

	EVEN
Z34:	DB	72
	DB	76
	DB	105
	DB	110
	DB	101
	DB	58
	DB	32
	DB	115
	DB	58
	DB	32
	DB	37
	DB	100
	DB	32
	DB	32
	DB	101
	DB	58
	DB	32
	DB	37
	DB	100
	DB	0


BSS	DSEG
	EVEN
_palfg:	RS	2
	EVEN
_str:	RS	64
	EVEN
_usehblank:	RS	2
	EVEN
_usevblank:	RS	2
	EVEN
_debugIL::	RS	22
	EXTRN	_key_press_check
	EXTRN	_lcd_get_display_line
	EXTRN	_sprintf
	EXTRN	_sys_interrupt_reset_hook
	EXTRN	_sys_interrupt_set_hook
	EXTRN	_text_put_string
	EXTRN	_text_screen_init
	EXTRN	_timer_disable
	EXTRN	_timer_enable
	EXTRN	_wwc_palette_set_color
	EXTRN	_wwc_set_color_mode


;core used: 13468

	END
