⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 newspr2.s

📁 十七种模拟器源代码 非常有用的作课程设计不可缺少的
💻 S
📖 第 1 页 / 共 2 页
字号:
.align	8loop12:	HANDLE_8_PIXELS_TRANSP(0)	HANDLE_8_PIXELS_TRANSP(8)	HANDLE_8_PIXELS_TRANSP(16)	HANDLE_8_PIXELS_TRANSP(24)	HANDLE_8_PIXELS_TRANSP(32)	HANDLE_8_PIXELS_TRANSP(40)	HANDLE_8_PIXELS_TRANSP(48)	HANDLE_8_PIXELS_TRANSP(56)	addl	$64,%esi		/* Next Tile Line */	subl	$0xdeadbeef,%edi	/* prev Screen Line */bitw_12:	decl	%ebp	jne	loop12	popl	%ecx	popl	%ebx	popl	%esi	popl	%edi	popl	%ebp	ret//void Draw64x64_Trans_Mapped_FlipXY(UINT8 *SPR, int x, int y, UINT8 *cmap)// Combination of the 2 last functions : backwards, using the 2nd macro !FUNC( Draw64x64_Trans_Mapped_FlipXY )	pushl	%ebp	pushl	%edi	pushl	%esi	pushl	%ebx	pushl	%ecx		movl	24(%esp),%esi			// source	movl	32(%esp),%eax			// y	sall	$2,%eax	movl	0xDEADBEEF(%eax),%edi	// This time we start at the endblin_13:	movl	36(%esp),%ecx			// cmap	addl	28(%esp),%edi			// +x 	xorl	%edx,%edx	movl	$64,%ebp	// Tile Height	jmp	loop13		// Alignement.align	8loop13:		HANDLE_8_PIXELS_TRANSP_FLIPY(0)	HANDLE_8_PIXELS_TRANSP_FLIPY(8)	HANDLE_8_PIXELS_TRANSP_FLIPY(16)	HANDLE_8_PIXELS_TRANSP_FLIPY(24)	HANDLE_8_PIXELS_TRANSP_FLIPY(32)	HANDLE_8_PIXELS_TRANSP_FLIPY(40)	HANDLE_8_PIXELS_TRANSP_FLIPY(48)	HANDLE_8_PIXELS_TRANSP_FLIPY(56)	addl	$64,%esi		/* Next Tile Line */	subl	$0xdeadbeef,%edi	/* prev Screen Line */bitw_13:	decl	%ebp	jne	loop13	popl	%ecx	popl	%ebx	popl	%esi	popl	%edi	popl	%ebp	ret/************************************************************/// These are functions called by the f3 games (not all of them)// They basically draw a sprite of 8 pixels wide and with an arbitrary heigh	// void Draw8xH_Trans_Packed_Mapped_Column(UINT8 *SPR, int x, int y, int height, UINT8 *cmap)FUNC( Draw8xH_Trans_Packed_Mapped_Column )	pushl	%ebp	pushl	%edi	pushl	%esi	pushl	%ebx	pushl	%ecx		movl	24(%esp),%esi			// source	movl	32(%esp),%eax			// y	sall	$2,%eax	movl	0xDEADBEEF(%eax),%ediblin_20:	movl	40(%esp),%ecx			// cmap	addl	28(%esp),%edi			// +x 	xorl	%edx,%edx	movl	36(%esp),%ebp	// Tile Height	jmp	loop20		// Alignement.align	8loop20:		movl	(%esi),%eax	testl	%eax,%eax		// Skip Blank Lines	jz	8f	movl	%eax,%ebx	andl	$0x0F0F0F0F,%eax	shrl	$4,%ebx	andl	$0x0F0F0F0F,%ebx	testb	%al,%al	jz	7f	movb	%al,%dl	movb	(%ecx,%edx,1),%al	movb	%al,1(%edi)7:	testb	%bl,%bl	jz	7f	movb	%bl,%dl	movb	(%ecx,%edx,1),%al	movb	%al,(%edi)7:	testb	%ah,%ah	jz	7f	movb	%ah,%dl	movb	(%ecx,%edx,1),%al	movb	%al,3(%edi)7:	testb	%bh,%bh	jz	7f	movb	%bh,%dl	movb	(%ecx,%edx,1),%al	movb	%al,2(%edi)7:	shr	$16,%eax	shr	$16,%ebx	testb	%al,%al	jz	7f	movb	%al,%dl	movb	(%ecx,%edx,1),%al	movb	%al,5(%edi)7:	testb	%bl,%bl	jz	7f	movb	%bl,%dl	movb	(%ecx,%edx,1),%al	movb	%al,4(%edi)7:	testb	%ah,%ah	jz	7f	movb	%ah,%dl	movb	(%ecx,%edx,1),%al	movb	%al,7(%edi)7:	testb	%bh,%bh	jz	8f	movb	%bh,%dl	movb	(%ecx,%edx,1),%al	movb	%al,6(%edi)8:	addl	$4,%esi		/* Next Tile Line */	addl	$0xdeadbeef,%edi	/* Next Screen Line */bitw_20:	decl	%ebp	jne	loop20	popl	%ecx	popl	%ebx	popl	%esi	popl	%edi	popl	%ebp	ret//void Draw8xH_Trans_Packed_Mapped_FlipY_Column(UINT8 *SPR, int x, int y, int height, UINT8 *cmap)FUNC( Draw8xH_Trans_Packed_Mapped_Column_FlipY )	pushl	%ebp	pushl	%edi	pushl	%esi	pushl	%ebx	push	%ecx			movl	24(%esp),%esi			// source	movl	32(%esp),%eax			// y	sall	$2,%eax	movl	0xDEADBEEF(%eax),%ediblin_21:	movl	40(%esp),%ecx			// cmap	addl	28(%esp),%edi			// +x 	xorl	%edx,%edx	movl	36(%esp),%ebp	// Tile Height	jmp	loop21		// Alignement.align	8loop21:		movl	(%esi),%eax	testl	%eax,%eax		// Skip Blank Lines	jz	8f	movl	%eax,%ebx	andl	$0x0F0F0F0F,%eax	shrl	$4,%ebx	andl	$0x0F0F0F0F,%ebx	testb	%al,%al	jz	7f	movb	%al,%dl	movb	(%ecx,%edx,1),%al	movb	%al,6(%edi)7:	testb	%bl,%bl	jz	7f	movb	%bl,%dl	movb	(%ecx,%edx,1),%al	movb	%al,7(%edi)7:	testb	%ah,%ah	jz	7f	movb	%ah,%dl	movb	(%ecx,%edx,1),%al	movb	%al,4(%edi)7:	testb	%bh,%bh	jz	7f	movb	%bh,%dl	movb	(%ecx,%edx,1),%al	movb	%al,5(%edi)7:	shr	$16,%eax	shr	$16,%ebx	testb	%al,%al	jz	7f	movb	%al,%dl	movb	(%ecx,%edx,1),%al	movb	%al,2(%edi)7:	testb	%bl,%bl	jz	7f	movb	%bl,%dl	movb	(%ecx,%edx,1),%al	movb	%al,3(%edi)7:	testb	%ah,%ah	jz	7f	movb	%ah,%dl	movb	(%ecx,%edx,1),%al	movb	%al,(%edi)7:	testb	%bh,%bh	jz	8f	movb	%bh,%dl	movb	(%ecx,%edx,1),%al	movb	%al,1(%edi)8:	addl	$4,%esi		/* Next Tile Line */	addl	$0xdeadbeef,%edi	/* Next Screen Line */bitw_21:	decl	%ebp	jne	loop21	popl	%ecx	popl	%ebx	popl	%esi	popl	%edi	popl	%ebp	ret/* The same as the normal Mapped_Column function but :   begins at the last line and goes back to the begining (subl) *///void Draw8xH_Trans_Packed_Mapped_FlipX_Column(UINT8 *SPR, int x, int y, int height, UINT8 *cmap)FUNC( Draw8xH_Trans_Packed_Mapped_Column_FlipX )	pushl	%ebp	pushl	%edi	pushl	%esi	pushl	%ebx	pushl	%ecx		movl	24(%esp),%esi			// source	movl	32(%esp),%eax			// y	movl	36(%esp),%ebp	// Tile Height	addl	%ebp,%eax			// tile height	sall	$2,%eax	movl	0xDEADBEEF(%eax),%ediblin_22:	movl	40(%esp),%ecx			// cmap	addl	28(%esp),%edi			// +x 	xorl	%edx,%edx	jmp	loop22		// Alignement.align	8loop22:		movl	(%esi),%eax	testl	%eax,%eax		// Skip Blank Lines	jz	8f	movl	%eax,%ebx	andl	$0x0F0F0F0F,%eax	shrl	$4,%ebx	andl	$0x0F0F0F0F,%ebx	testb	%al,%al	jz	7f	movb	%al,%dl	movb	(%ecx,%edx,1),%al	movb	%al,1(%edi)7:	testb	%bl,%bl	jz	7f	movb	%bl,%dl	movb	(%ecx,%edx,1),%al	movb	%al,(%edi)7:	testb	%ah,%ah	jz	7f	movb	%ah,%dl	movb	(%ecx,%edx,1),%al	movb	%al,3(%edi)7:	testb	%bh,%bh	jz	7f	movb	%bh,%dl	movb	(%ecx,%edx,1),%al	movb	%al,2(%edi)7:	shr	$16,%eax	shr	$16,%ebx	testb	%al,%al	jz	7f	movb	%al,%dl	movb	(%ecx,%edx,1),%al	movb	%al,5(%edi)7:	testb	%bl,%bl	jz	7f	movb	%bl,%dl	movb	(%ecx,%edx,1),%al	movb	%al,4(%edi)7:	testb	%ah,%ah	jz	7f	movb	%ah,%dl	movb	(%ecx,%edx,1),%al	movb	%al,7(%edi)7:	testb	%bh,%bh	jz	8f	movb	%bh,%dl	movb	(%ecx,%edx,1),%al	movb	%al,6(%edi)8:	addl	$4,%esi		/* Next Tile Line */	subl	$0xdeadbeef,%edi	/* Previous Screen Line */bitw_22:	decl	%ebp	jne	loop22	popl	%ecx			popl	%ebx	popl	%esi	popl	%edi	popl	%ebp	ret/* The 2 previous functions combined :   starts at last line and goes back   x offsets are taken backward (from 7 to 0) *///void Draw8xH_Trans_Packed_Mapped_FlipXY_Column(UINT8 *SPR, int x, int y, int height, UINT8 *cmap)FUNC( Draw8xH_Trans_Packed_Mapped_Column_FlipXY )	pushl	%ebp	pushl	%edi	pushl	%esi	pushl	%ebx	pushl	%ecx		movl	24(%esp),%esi			// source	movl	32(%esp),%eax			// y	movl	36(%esp),%ebp	// Tile Height	addl	%ebp,%eax			// tile height	sall	$2,%eax	movl	0xDEADBEEF(%eax),%ediblin_23:	movl	40(%esp),%ecx			// cmap	addl	28(%esp),%edi			// +x 	xorl	%edx,%edx	jmp	loop23		// Alignement.align	8loop23:		movl	(%esi),%eax	testl	%eax,%eax		// Skip Blank Lines	jz	8f	movl	%eax,%ebx	andl	$0x0F0F0F0F,%eax	shrl	$4,%ebx	andl	$0x0F0F0F0F,%ebx	testb	%al,%al	jz	7f	movb	%al,%dl	movb	(%ecx,%edx,1),%al	movb	%al,6(%edi)7:	testb	%bl,%bl	jz	7f	movb	%bl,%dl	movb	(%ecx,%edx,1),%al	movb	%al,7(%edi)7:	testb	%ah,%ah	jz	7f	movb	%ah,%dl	movb	(%ecx,%edx,1),%al	movb	%al,4(%edi)7:	testb	%bh,%bh	jz	7f	movb	%bh,%dl	movb	(%ecx,%edx,1),%al	movb	%al,5(%edi)7:	shr	$16,%eax	shr	$16,%ebx	testb	%al,%al	jz	7f	movb	%al,%dl	movb	(%ecx,%edx,1),%al	movb	%al,2(%edi)7:	testb	%bl,%bl	jz	7f	movb	%bl,%dl	movb	(%ecx,%edx,1),%al	movb	%al,3(%edi)7:	testb	%ah,%ah	jz	7f	movb	%ah,%dl	movb	(%ecx,%edx,1),%al	movb	%al,(%edi)7:	testb	%bh,%bh	jz	8f	movb	%bh,%dl	movb	(%ecx,%edx,1),%al	movb	%al,1(%edi)8:	addl	$4,%esi		/* Next Tile Line */	subl	$0xdeadbeef,%edi	/* Previous Screen Line */bitw_23:	decl	%ebp	jne	loop23		popl	%ecx			popl	%ebx	popl	%esi	popl	%edi	popl	%ebp	retFUNC(init_newspr2asm)	movl	GLOBL(GameBitmap),%eax	// Adress of the GameBitmap's structure	movl	(%eax),%eax			// Width	movl	%eax,bitw_00-4	movl	%eax,bitw_01-4	movl	%eax,bitw_02-4	movl	%eax,bitw_03-4		movl	%eax,bitw_10-4	movl	%eax,bitw_11-4	movl	%eax,bitw_12-4	movl	%eax,bitw_13-4		movl	%eax,bitw_20-4	movl	%eax,bitw_21-4	movl	%eax,bitw_22-4	movl	%eax,bitw_23-4		movl	GLOBL(GameBitmap),%eax	addl	$64,%eax			// Line 0	movl	%eax,blin_00-4	movl	%eax,blin_01-4		movl	%eax,blin_10-4	movl	%eax,blin_11-4		movl	%eax,blin_20-4	movl	%eax,blin_21-4		pushl	%eax	addl	$63*4,%eax			// Line 63 !!!	movl	%eax,blin_02-4	movl	%eax,blin_03-4	movl	%eax,blin_12-4	movl	%eax,blin_13-4	popl	%eax	subl	$1*4,%eax	// We must point to the last line of the bitmap.	// To speed things up we are doing (bitmap-1)+h instead of	// bitmap+(h-1).	// This will work as long as no one passes height=0 !	movl	%eax,blin_22-4	movl	%eax,blin_23-4		ret

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -