	.reference	___bb_appstub_appstub
	.reference	___bb_audio_audio
	.reference	___bb_basic_basic
	.reference	___bb_blitz_blitz
	.reference	___bb_bmploader_bmploader
	.reference	___bb_d3d7max2d_d3d7max2d
	.reference	___bb_d3d9max2d_d3d9max2d
	.reference	___bb_data_data
	.reference	___bb_directsoundaudio_directsoundaudio
	.reference	___bb_dxgraphics_dxgraphics
	.reference	___bb_eventqueue_eventqueue
	.reference	___bb_freeaudioaudio_freeaudioaudio
	.reference	___bb_freejoy_freejoy
	.reference	___bb_freeprocess_freeprocess
	.reference	___bb_freetypefont_freetypefont
	.reference	___bb_glew_glew
	.reference	___bb_glgraphics_glgraphics
	.reference	___bb_glmax2d_glmax2d
	.reference	___bb_gnet_gnet
	.reference	___bb_jpgloader_jpgloader
	.reference	___bb_macos_macos
	.reference	___bb_map_map
	.reference	___bb_max2d_max2d
	.reference	___bb_maxlua_maxlua
	.reference	___bb_maxutil_maxutil
	.reference	___bb_oggloader_oggloader
	.reference	___bb_openalaudio_openalaudio
	.reference	___bb_pngloader_pngloader
	.reference	___bb_retro_retro
	.reference	___bb_tgaloader_tgaloader
	.reference	___bb_threads_threads
	.reference	___bb_timer_timer
	.reference	___bb_wavloader_wavloader
	.reference	___bb_win32_win32
	.reference	_bbCeil
	.reference	_bbFloatMax
	.reference	_bbFloatMin
	.reference	_bbFloatToInt
	.reference	_bbFloor
	.reference	_brl_graphics_GraphicsHeight
	.reference	_brl_graphics_GraphicsWidth
	.reference	_brl_max2d_Cls
	.reference	_brl_max2d_GetClsColor
	.reference	_brl_max2d_GetOrigin
	.reference	_brl_max2d_GetViewport
	.reference	_brl_max2d_MoveVirtualMouse
	.reference	_brl_max2d_SetClsColor
	.reference	_brl_max2d_SetOrigin
	.reference	_brl_max2d_SetViewport
	.reference	_brl_max2d_SetVirtualResolution
	.reference	_brl_max2d_VirtualMouseX
	.reference	_brl_max2d_VirtualMouseY
	.reference	_brl_max2d_VirtualResolutionHeight
	.reference	_brl_max2d_VirtualResolutionWidth
	.globl	___bb_imports_aspect
	.globl	_bb_AspectCls
	.globl	_bb_AspectMouseX
	.globl	_bb_AspectMouseY
	.globl	_bb_AspectResolutionHeight
	.globl	_bb_AspectResolutionWidth
	.globl	_bb_GetAspectOrigin
	.globl	_bb_GetAspectViewport
	.globl	_bb_MoveAspectMouse
	.globl	_bb_SetAspectColor
	.globl	_bb_SetAspectOrigin
	.globl	_bb_SetAspectResolution
	.globl	_bb_SetAspectViewport
	.globl	_bb_SwitchAspectMode
	.text	
___bb_imports_aspect:
	push	%ebp
	mov	%esp,%ebp
	sub	$8,%esp
	cmpl	$0,_64
	je	_65
	mov	$0,%eax
	mov	%ebp,%esp
	pop	%ebp
	ret
_65:
	movl	$1,_64
	call	___bb_blitz_blitz
	call	___bb_max2d_max2d
	call	___bb_appstub_appstub
	call	___bb_audio_audio
	call	___bb_basic_basic
	call	___bb_bmploader_bmploader
	call	___bb_d3d7max2d_d3d7max2d
	call	___bb_d3d9max2d_d3d9max2d
	call	___bb_data_data
	call	___bb_directsoundaudio_directsoundaudio
	call	___bb_dxgraphics_dxgraphics
	call	___bb_eventqueue_eventqueue
	call	___bb_freeaudioaudio_freeaudioaudio
	call	___bb_freetypefont_freetypefont
	call	___bb_glgraphics_glgraphics
	call	___bb_glmax2d_glmax2d
	call	___bb_gnet_gnet
	call	___bb_jpgloader_jpgloader
	call	___bb_map_map
	call	___bb_maxlua_maxlua
	call	___bb_maxutil_maxutil
	call	___bb_oggloader_oggloader
	call	___bb_openalaudio_openalaudio
	call	___bb_pngloader_pngloader
	call	___bb_retro_retro
	call	___bb_tgaloader_tgaloader
	call	___bb_threads_threads
	call	___bb_timer_timer
	call	___bb_wavloader_wavloader
	call	___bb_freejoy_freejoy
	call	___bb_freeprocess_freeprocess
	call	___bb_glew_glew
	call	___bb_macos_macos
	call	___bb_win32_win32
	mov	$0,%eax
	jmp	_7
_7:
	mov	%ebp,%esp
	pop	%ebp
	ret
_bb_SetAspectResolution:
	push	%ebp
	mov	%esp,%ebp
	sub	$16,%esp
	push	%ebx
	push	%esi
	sub	$16,%esp
	movl	16(%ebp),%eax
	cmp	$1,%eax
	je	_66
	movl	%eax,_60
_66:
	cmpl	$0,_60
	jne	_67
	fldz
	fstps	_56
	fldz
	fstps	_57
	flds	8(%ebp)
	fstps	_58
	flds	12(%ebp)
	fstps	_59
	flds	_59
	fstps	4(%esp)
	flds	_58
	fstps	(%esp)
	call	_brl_max2d_SetVirtualResolution
	flds	_59
	fstpl	(%esp)
	call	_bbCeil
	fstpl	(%esp)
	call	_bbFloatToInt
	movl	%eax,12(%esp)
	flds	_58
	fstpl	(%esp)
	call	_bbCeil
	fstpl	(%esp)
	call	_bbFloatToInt
	movl	%eax,8(%esp)
	flds	_57
	fstpl	(%esp)
	call	_bbFloatToInt
	mov	%eax,%ebx
	flds	_56
	fstpl	(%esp)
	call	_bbFloatToInt
	movl	%ebx,4(%esp)
	movl	%eax,(%esp)
	call	_brl_max2d_SetViewport
	flds	_57
	fstps	4(%esp)
	flds	_56
	fstps	(%esp)
	call	_brl_max2d_SetOrigin
	mov	$0,%eax
	jmp	_12
_67:
	call	_brl_graphics_GraphicsWidth
	mov	%eax,%esi
	call	_brl_graphics_GraphicsHeight
	mov	%eax,%ebx
	flds	8(%ebp)
	fstps	_58
	flds	12(%ebp)
	fstps	_59
	movl	%esi,-16(%ebp)
	fildl	-16(%ebp)
	fdivs	_58
	movl	%ebx,-16(%ebp)
	fildl	-16(%ebp)
	fdivs	_59
	fxch	%st(1)
	fucom	%st(1)
	fnstsw	%ax
	sahf
	setae	%al
	movzbl	%al,%eax
	cmp	$0,%eax
	je	_99
	fstp	%st(0)
	jmp	_72
_99:
	fxch	%st(1)
	fstp	%st(0)
_72:
	movl	_60,%eax
	and	$4,%eax
	cmp	$0,%eax
	je	_73
	fstpl	(%esp)
	call	_bbFloor
	fld1
	fstpl	8(%esp)
	fstpl	(%esp)
	call	_bbFloatMax
_73:
	movl	%ebx,-16(%ebp)
	fildl	-16(%ebp)
	fdiv	%st(1),%st(0)
	fstps	12(%ebp)
	movl	%esi,-16(%ebp)
	fildl	-16(%ebp)
	fdivp	%st(0),%st(1)
	fstps	8(%ebp)
	flds	8(%ebp)
	fsubs	_58
	fmuls	_89
	fstps	_56
	flds	12(%ebp)
	fsubs	_59
	fmuls	_90
	fstps	_57
	movl	_60,%eax
	and	$4,%eax
	cmp	$0,%eax
	je	_74
	flds	_56
	fstpl	(%esp)
	call	_bbFloor
	fstps	_56
	flds	_57
	fstpl	(%esp)
	call	_bbFloor
	fstps	_57
_74:
	flds	12(%ebp)
	fstps	4(%esp)
	flds	8(%ebp)
	fstps	(%esp)
	call	_brl_max2d_SetVirtualResolution
	movl	_60,%eax
	and	$1,%eax
	cmp	$0,%eax
	je	_75
	movl	$0,-4(%ebp)
	movl	$0,-8(%ebp)
	movl	$0,-12(%ebp)
	lea	-12(%ebp),%eax
	movl	%eax,8(%esp)
	lea	-8(%ebp),%eax
	movl	%eax,4(%esp)
	lea	-4(%ebp),%eax
	movl	%eax,(%esp)
	call	_brl_max2d_GetClsColor
	movl	_63,%eax
	movl	%eax,8(%esp)
	movl	_62,%eax
	movl	%eax,4(%esp)
	movl	_61,%eax
	movl	%eax,(%esp)
	call	_brl_max2d_SetClsColor
	call	_brl_max2d_Cls
	movl	-12(%ebp),%eax
	movl	%eax,8(%esp)
	movl	-8(%ebp),%eax
	movl	%eax,4(%esp)
	movl	-4(%ebp),%eax
	movl	%eax,(%esp)
	call	_brl_max2d_SetClsColor
	flds	_59
	fstpl	(%esp)
	call	_bbFloatToInt
	movl	%eax,12(%esp)
	flds	_58
	fstpl	(%esp)
	call	_bbFloatToInt
	movl	%eax,8(%esp)
	flds	_57
	fstpl	(%esp)
	call	_bbFloatToInt
	mov	%eax,%ebx
	flds	_56
	fstpl	(%esp)
	call	_bbFloatToInt
	movl	%ebx,4(%esp)
	movl	%eax,(%esp)
	call	_brl_max2d_SetViewport
	jmp	_79
_75:
	call	_brl_max2d_VirtualResolutionHeight
	fstpl	(%esp)
	call	_bbCeil
	fstpl	(%esp)
	call	_bbFloatToInt
	movl	%eax,12(%esp)
	call	_brl_max2d_VirtualResolutionWidth
	fstpl	(%esp)
	call	_bbCeil
	fstpl	(%esp)
	call	_bbFloatToInt
	movl	%eax,8(%esp)
	movl	$0,4(%esp)
	movl	$0,(%esp)
	call	_brl_max2d_SetViewport
_79:
	flds	_57
	fstps	4(%esp)
	flds	_56
	fstps	(%esp)
	call	_brl_max2d_SetOrigin
	mov	$0,%eax
	jmp	_12
_12:
	add	$16,%esp
	pop	%esi
	pop	%ebx
	mov	%ebp,%esp
	pop	%ebp
	ret
_bb_SetAspectColor:
	push	%ebp
	mov	%esp,%ebp
	sub	$8,%esp
	movl	8(%ebp),%ecx
	movl	12(%ebp),%edx
	movl	16(%ebp),%eax
	movl	%ecx,_61
	movl	%edx,_62
	movl	%eax,_63
	mov	$0,%eax
	jmp	_17
_17:
	mov	%ebp,%esp
	pop	%ebp
	ret
_bb_AspectCls:
	push	%ebp
	mov	%esp,%ebp
	sub	$12,%esp
	push	%ebx
	sub	$24,%esp
	movl	_60,%eax
	and	$1,%eax
	cmp	$0,%eax
	je	_80
	call	_brl_max2d_VirtualResolutionHeight
	fstpl	(%esp)
	call	_bbCeil
	fld1
	faddp	%st(0),%st(1)
	fstpl	(%esp)
	call	_bbFloatToInt
	movl	%eax,12(%esp)
	call	_brl_max2d_VirtualResolutionWidth
	fstpl	(%esp)
	call	_bbCeil
	fld1
	faddp	%st(0),%st(1)
	fstpl	(%esp)
	call	_bbFloatToInt
	movl	%eax,8(%esp)
	movl	$0,4(%esp)
	movl	$0,(%esp)
	call	_brl_max2d_SetViewport
	movl	$0,-4(%ebp)
	movl	$0,-8(%ebp)
	movl	$0,-12(%ebp)
	lea	-12(%ebp),%eax
	movl	%eax,8(%esp)
	lea	-8(%ebp),%eax
	movl	%eax,4(%esp)
	lea	-4(%ebp),%eax
	movl	%eax,(%esp)
	call	_brl_max2d_GetClsColor
	movl	_63,%eax
	movl	%eax,8(%esp)
	movl	_62,%eax
	movl	%eax,4(%esp)
	movl	_61,%eax
	movl	%eax,(%esp)
	call	_brl_max2d_SetClsColor
	call	_brl_max2d_Cls
	movl	-12(%ebp),%eax
	movl	%eax,8(%esp)
	movl	-8(%ebp),%eax
	movl	%eax,4(%esp)
	movl	-4(%ebp),%eax
	movl	%eax,(%esp)
	call	_brl_max2d_SetClsColor
	flds	_59
	fstpl	(%esp)
	call	_bbFloatToInt
	movl	%eax,12(%esp)
	flds	_58
	fstpl	(%esp)
	call	_bbFloatToInt
	movl	%eax,8(%esp)
	flds	_57
	fstpl	(%esp)
	call	_bbFloatToInt
	mov	%eax,%ebx
	flds	_56
	fstpl	(%esp)
	call	_bbFloatToInt
	movl	%ebx,4(%esp)
	movl	%eax,(%esp)
	call	_brl_max2d_SetViewport
_80:
	call	_brl_max2d_Cls
	mov	$0,%eax
	jmp	_19
_19:
	add	$24,%esp
	pop	%ebx
	mov	%ebp,%esp
	pop	%ebp
	ret
_bb_SwitchAspectMode:
	push	%ebp
	mov	%esp,%ebp
	sub	$24,%esp
	movl	8(%ebp),%eax
	movl	%eax,8(%esp)
	flds	_59
	fstps	4(%esp)
	flds	_58
	fstps	(%esp)
	call	_bb_SetAspectResolution
	mov	$0,%eax
	jmp	_22
_22:
	mov	%ebp,%esp
	pop	%ebp
	ret
_bb_SetAspectOrigin:
	push	%ebp
	mov	%esp,%ebp
	sub	$8,%esp
	flds	8(%ebp)
	flds	12(%ebp)
	fadds	_57
	fstps	4(%esp)
	fadds	_56
	fstps	(%esp)
	call	_brl_max2d_SetOrigin
	mov	$0,%eax
	jmp	_26
_26:
	mov	%ebp,%esp
	pop	%ebp
	ret
_bb_GetAspectOrigin:
	push	%ebp
	mov	%esp,%ebp
	push	%ebx
	push	%esi
	sub	$16,%esp
	movl	8(%ebp),%esi
	movl	12(%ebp),%ebx
	lea	(%ebx),%eax
	movl	%eax,4(%esp)
	lea	(%esi),%eax
	movl	%eax,(%esp)
	call	_brl_max2d_GetOrigin
	flds	(%esi)
	fsubs	_56
	fstps	(%esi)
	flds	(%ebx)
	fsubs	_57
	fstps	(%ebx)
	mov	$0,%eax
	jmp	_30
_30:
	add	$16,%esp
	pop	%esi
	pop	%ebx
	mov	%ebp,%esp
	pop	%ebp
	ret
_bb_SetAspectViewport:
	push	%ebp
	mov	%esp,%ebp
	sub	$12,%esp
	push	%ebx
	push	%esi
	push	%edi
	sub	$16,%esp
	movl	8(%ebp),%esi
	movl	12(%ebp),%ebx
	movl	16(%ebp),%edx
	movl	20(%ebp),%edi
	flds	_56
	fadds	_58
	fstpl	8(%esp)
	mov	%esi,%eax
	add	%edx,%eax
	movl	%eax,-12(%ebp)
	fildl	-12(%ebp)
	fstpl	(%esp)
	call	_bbFloatMin
	fstps	-8(%ebp)
	flds	_57
	fadds	_59
	fstpl	8(%esp)
	mov	%ebx,%eax
	add	%edi,%eax
	movl	%eax,-12(%ebp)
	fildl	-12(%ebp)
	fstpl	(%esp)
	call	_bbFloatMin
	fstps	-4(%ebp)
	flds	_56
	fstpl	8(%esp)
	movl	%esi,-12(%ebp)
	fildl	-12(%ebp)
	fstpl	(%esp)
	call	_bbFloatMax
	fstpl	(%esp)
	call	_bbFloatToInt
	mov	%eax,%esi
	flds	_57
	fstpl	8(%esp)
	movl	%ebx,-12(%ebp)
	fildl	-12(%ebp)
	fstpl	(%esp)
	call	_bbFloatMax
	fstpl	(%esp)
	call	_bbFloatToInt
	mov	%eax,%ebx
	flds	-4(%ebp)
	movl	%ebx,-12(%ebp)
	fildl	-12(%ebp)
	fsubrp	%st(0),%st(1)
	fstpl	(%esp)
	call	_bbFloatToInt
	movl	%eax,12(%esp)
	flds	-8(%ebp)
	movl	%esi,-12(%ebp)
	fildl	-12(%ebp)
	fsubrp	%st(0),%st(1)
	fstpl	(%esp)
	call	_bbFloatToInt
	movl	%eax,8(%esp)
	movl	%ebx,4(%esp)
	movl	%esi,(%esp)
	call	_brl_max2d_SetViewport
	mov	$0,%eax
	jmp	_36
_36:
	add	$16,%esp
	pop	%edi
	pop	%esi
	pop	%ebx
	mov	%ebp,%esp
	pop	%ebp
	ret
_bb_GetAspectViewport:
	push	%ebp
	mov	%esp,%ebp
	sub	$4,%esp
	push	%ebx
	push	%esi
	sub	$28,%esp
	movl	8(%ebp),%esi
	movl	12(%ebp),%ebx
	movl	16(%ebp),%eax
	movl	20(%ebp),%edx
	lea	(%edx),%edx
	movl	%edx,12(%esp)
	lea	(%eax),%eax
	movl	%eax,8(%esp)
	lea	(%ebx),%eax
	movl	%eax,4(%esp)
	lea	(%esi),%eax
	movl	%eax,(%esp)
	call	_brl_max2d_GetViewport
	movl	(%esi),%eax
	movl	%eax,-4(%ebp)
	fildl	-4(%ebp)
	fsubs	_56
	fstpl	(%esp)
	call	_bbFloatToInt
	movl	%eax,(%esi)
	movl	(%ebx),%eax
	movl	%eax,-4(%ebp)
	fildl	-4(%ebp)
	fsubs	_57
	fstpl	(%esp)
	call	_bbFloatToInt
	movl	%eax,(%ebx)
	mov	$0,%eax
	jmp	_42
_42:
	add	$28,%esp
	pop	%esi
	pop	%ebx
	mov	%ebp,%esp
	pop	%ebp
	ret
_bb_AspectMouseX:
	push	%ebp
	mov	%esp,%ebp
	sub	$8,%esp
	call	_brl_max2d_VirtualMouseX
	fsubs	_56
	jmp	_44
_44:
	mov	%ebp,%esp
	pop	%ebp
	ret
_bb_AspectMouseY:
	push	%ebp
	mov	%esp,%ebp
	sub	$8,%esp
	call	_brl_max2d_VirtualMouseY
	fsubs	_57
	jmp	_46
_46:
	mov	%ebp,%esp
	pop	%ebp
	ret
_bb_MoveAspectMouse:
	push	%ebp
	mov	%esp,%ebp
	sub	$8,%esp
	flds	8(%ebp)
	flds	12(%ebp)
	fadds	_57
	fstps	4(%esp)
	fadds	_56
	fstps	(%esp)
	call	_brl_max2d_MoveVirtualMouse
	mov	$0,%eax
	jmp	_50
_50:
	mov	%ebp,%esp
	pop	%ebp
	ret
_bb_AspectResolutionWidth:
	push	%ebp
	mov	%esp,%ebp
	sub	$8,%esp
	flds	_58
	jmp	_52
_52:
	mov	%ebp,%esp
	pop	%ebp
	ret
_bb_AspectResolutionHeight:
	push	%ebp
	mov	%esp,%ebp
	sub	$8,%esp
	flds	_59
	jmp	_54
_54:
	mov	%ebp,%esp
	pop	%ebp
	ret
	.data	
	.align	4
_64:
	.long	0
	.align	4
_56:
	.long	0x0
	.align	4
_57:
	.long	0x0
	.align	4
_58:
	.long	0x0
	.align	4
_59:
	.long	0x0
	.align	4
_60:
	.long	0
	.align	4
_61:
	.long	0
	.align	4
_62:
	.long	0
	.align	4
_63:
	.long	0
	.align	4
_89:
	.long	0x3f000000
	.align	4
_90:
	.long	0x3f000000
