;
; File generated by cc65 v 2.19 - Git 39df6f8
;
	.fopt		compiler,"cc65 v 2.19 - Git 39df6f8"
	.setcpu		"6502"
	.smart		on
	.autoimport	on
	.case		on
	.debuginfo	on
	.importzp	sp, sreg, regsave, regbank
	.importzp	tmp1, tmp2, tmp3, tmp4, ptr1, ptr2, ptr3, ptr4
	.macpack	longbranch
	.dbg		file, "vdc_controls.c", 1821, 1543283770
	.dbg		file, "vdc_gui.h", 778, 1543280824
	.dbg		file, "F:\Software\Emulation\Commodore\Development\cc65\include/c128.h", 6518, 1645504250
	.dbg		file, "F:\Software\Emulation\Commodore\Development\cc65\include/_vic2.h", 10835, 1645504250
	.dbg		file, "F:\Software\Emulation\Commodore\Development\cc65\include/_sid.h", 3626, 1645504250
	.dbg		file, "F:\Software\Emulation\Commodore\Development\cc65\include/_vdc.h", 2827, 1645504250
	.dbg		file, "F:\Software\Emulation\Commodore\Development\cc65\include/_6526.h", 3962, 1645504249
	.dbg		file, "F:\Software\Emulation\Commodore\Development\cc65\include/peekpoke.h", 3108, 1645504251
	.dbg		file, "F:\Software\Emulation\Commodore\Development\cc65\include/string.h", 5187, 1645504251
	.dbg		file, "F:\Software\Emulation\Commodore\Development\cc65\include/stddef.h", 3057, 1645504251
	.dbg		file, "F:\Software\Emulation\Commodore\Development\cc65\include/stdio.h", 5920, 1645504251
	.dbg		file, "F:\Software\Emulation\Commodore\Development\cc65\include/stdarg.h", 2913, 1645504251
	.dbg		file, "F:\Software\Emulation\Commodore\Development\cc65\include/limits.h", 3580, 1645504251
	.dbg		file, "F:\Software\Emulation\Commodore\Development\cc65\include/stdlib.h", 5999, 1645504251
	.dbg		file, "F:\Software\Emulation\Commodore\Development\cc65\include/conio.h", 9026, 1645504250
	.dbg		file, "F:\Software\Emulation\Commodore\Development\cc65\include/target.h", 2992, 1645504251
	.dbg		file, "F:\Software\Emulation\Commodore\Development\cc65\include/cbm.h", 11892, 1645504250
	.dbg		file, "F:\Software\Emulation\Commodore\Development\cc65\include/cbm_filetype.h", 4949, 1645504250
	.dbg		file, "vdc_win.h", 1736, 1543282193
	.dbg		file, "vdc_core.h", 1814, 1543295196
	.dbg		file, "vdc_controls.h", 561, 1543268877
	.dbg		file, "vdc_menus.h", 527, 1543268877
	.dbg		file, "vdc_control_listbox.h", 1037, 1646425066
	.dbg		file, "vdc_control_textbox.h", 916, 1543268877
	.dbg		file, "vdc_control_label.h", 695, 1543268877
	.dbg		file, "vdc_control_button.h", 818, 1543268877
	.dbg		file, "vdc_control_checkbox.h", 815, 1543268877
	.dbg		sym, "strcmp", "00", extern, "_strcmp"
	.dbg		sym, "malloc", "00", extern, "_malloc"
	.dbg		sym, "free", "00", extern, "_free"
	.import		_strcmp
	.import		_malloc
	.import		_free
	.export		_CreateControl
	.export		_FindControl

; ---------------------------------------------------------------
; struct Control *__near__ CreateControl (struct Window *window, unsigned char *name, unsigned char x, unsigned char y, int controlType)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_CreateControl: near

	.dbg	func, "CreateControl", "00", extern, "_CreateControl"
	.dbg	sym, "window", "00", auto, 6
	.dbg	sym, "name", "00", auto, 4
	.dbg	sym, "x", "00", auto, 3
	.dbg	sym, "y", "00", auto, 2
	.dbg	sym, "controlType", "00", auto, 0
	.dbg	sym, "ctrl", "00", auto, -2
	.dbg	sym, "tmpctrl", "00", auto, -4

.segment	"CODE"

	.dbg	line, "vdc_controls.c", 15
	jsr     pushax
	.dbg	line, "vdc_controls.c", 19
	ldx     #$00
	lda     #$13
	jsr     _malloc
	jsr     pushax
	.dbg	line, "vdc_controls.c", 22
	jsr     decsp2
	ldy     #$02
	lda     (sp),y
	iny
	ora     (sp),y
	bne     L0002
	.dbg	line, "vdc_controls.c", 23
	tax
	jmp     L0001
	.dbg	line, "vdc_controls.c", 25
L0002:	ldy     #$0A
	lda     (sp),y
	iny
	ora     (sp),y
	bne     L000D
	.dbg	line, "vdc_controls.c", 26
	ldy     #$03
	jsr     ldaxysp
	jsr     _free
	.dbg	line, "vdc_controls.c", 27
	ldx     #$00
	txa
	jmp     L0001
	.dbg	line, "vdc_controls.c", 34
L000D:	jsr     ldaxysp
	ldy     #$0C
	jsr     ldaxidx
	cpx     #$00
	bne     L0006
	cmp     #$00
	bne     L0006
	.dbg	line, "vdc_controls.c", 36
	ldy     #$0D
	jsr     pushwysp
	ldx     #$00
	lda     #$13
	jsr     _malloc
	ldy     #$0B
	jsr     staxspidx
	.dbg	line, "vdc_controls.c", 37
	jsr     ldaxysp
	ldy     #$0C
	jsr     ldaxidx
	ldy     #$02
	jsr     staxysp
	.dbg	line, "vdc_controls.c", 38
	sta     ptr1
	stx     ptr1+1
	lda     #$00
	ldy     #$0A
	sta     (ptr1),y
	iny
	sta     (ptr1),y
	.dbg	line, "vdc_controls.c", 40
	jmp     L0008
	.dbg	line, "vdc_controls.c", 42
L0006:	ldy     #$0B
	jsr     ldaxysp
	ldy     #$0C
	jsr     ldaxidx
	ldy     #$02
	jsr     staxysp
	.dbg	line, "vdc_controls.c", 44
	jmp     L000B
	.dbg	line, "vdc_controls.c", 46
L0009:	ldy     #$03
	jsr     ldaxysp
	jsr     stax0sp
	.dbg	line, "vdc_controls.c", 47
	ldy     #$03
	jsr     ldaxysp
	ldy     #$0D
	jsr     ldaxidx
	ldy     #$02
	jsr     staxysp
	.dbg	line, "vdc_controls.c", 48
	sta     ptr1
	stx     ptr1+1
	jsr     ldax0sp
	ldy     #$0A
	sta     (ptr1),y
	iny
	txa
	sta     (ptr1),y
	.dbg	line, "vdc_controls.c", 44
L000B:	ldy     #$03
	jsr     ldaxysp
	ldy     #$0D
	jsr     ldaxidx
	cpx     #$00
	bne     L0009
	cmp     #$00
	bne     L0009
	.dbg	line, "vdc_controls.c", 51
	ldy     #$05
	jsr     pushwysp
	ldx     #$00
	lda     #$13
	jsr     _malloc
	ldy     #$0C
	jsr     staxspidx
	.dbg	line, "vdc_controls.c", 52
	ldy     #$03
	jsr     ldaxysp
	ldy     #$0D
	jsr     ldaxidx
	ldy     #$02
	jsr     staxysp
	.dbg	line, "vdc_controls.c", 55
L0008:	ldy     #$03
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$09
	jsr     ldaxysp
	ldy     #$00
	sta     (ptr1),y
	iny
	txa
	sta     (ptr1),y
	.dbg	line, "vdc_controls.c", 56
	ldy     #$03
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$07
	lda     (sp),y
	ldy     #$02
	sta     (ptr1),y
	.dbg	line, "vdc_controls.c", 57
	iny
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$06
	lda     (sp),y
	ldy     #$03
	sta     (ptr1),y
	.dbg	line, "vdc_controls.c", 58
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	lda     #$01
	ldy     #$04
	sta     (ptr1),y
	.dbg	line, "vdc_controls.c", 59
	dey
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	lda     #$00
	ldy     #$0C
	sta     (ptr1),y
	iny
	sta     (ptr1),y
	.dbg	line, "vdc_controls.c", 60
	ldy     #$03
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	lda     #$00
	ldy     #$0E
	sta     (ptr1),y
	.dbg	line, "vdc_controls.c", 62
	ldy     #$03
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$04
	lda     (sp),y
	iny
	sta     (ptr1),y
	.dbg	line, "vdc_controls.c", 63
	ldy     #$03
	jsr     ldaxysp
	sta     ptr1
	stx     ptr1+1
	ldy     #$0B
	jsr     ldaxysp
	ldy     #$08
	sta     (ptr1),y
	iny
	txa
	sta     (ptr1),y
	.dbg	line, "vdc_controls.c", 67
	ldy     #$03
	jsr     ldaxysp
	.dbg	line, "vdc_controls.c", 68
L0001:	ldy     #$0C
	jmp     addysp

	.dbg	line
.endproc

; ---------------------------------------------------------------
; struct Control *__near__ FindControl (struct Window *window, unsigned char *name)
; ---------------------------------------------------------------

.segment	"CODE"

.proc	_FindControl: near

	.dbg	func, "FindControl", "00", extern, "_FindControl"
	.dbg	sym, "window", "00", auto, 2
	.dbg	sym, "name", "00", auto, 0
	.dbg	sym, "ctrl", "00", auto, -2

.segment	"CODE"

	.dbg	line, "vdc_controls.c", 74
	jsr     pushax
	.dbg	line, "vdc_controls.c", 75
	ldy     #$03
	jsr     ldaxysp
	ldy     #$0C
	jsr     pushwidx
	.dbg	line, "vdc_controls.c", 77
	jmp     L0008
	.dbg	line, "vdc_controls.c", 79
L0002:	ldy     #$05
	jsr     pushwysp
	ldy     #$03
	jsr     ldaxysp
	jsr     ldaxi
	jsr     _strcmp
	cpx     #$00
	bne     L0006
	cmp     #$00
	bne     L0006
	.dbg	line, "vdc_controls.c", 80
	jsr     ldax0sp
	jmp     L0001
	.dbg	line, "vdc_controls.c", 82
L0006:	jsr     ldax0sp
	ldy     #$0D
	jsr     ldaxidx
	jsr     stax0sp
	.dbg	line, "vdc_controls.c", 77
L0008:	ldy     #$00
	lda     (sp),y
	iny
	ora     (sp),y
	bne     L0002
	.dbg	line, "vdc_controls.c", 85
	tax
	.dbg	line, "vdc_controls.c", 86
L0001:	jmp     incsp6

	.dbg	line
.endproc

