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

📄 asm_tiles.old

📁 十七种模拟器源代码 非常有用的作课程设计不可缺少的
💻 OLD
📖 第 1 页 / 共 2 页
字号:
	xor ecx, ecx
	mov edx, line
	test eax, 0x1000

	jz .check_interlace

.y_flipped:

	xor edx, byte 7

	cache_align

.check_interlace:

	mov esi, [_reg]
	mov cl, [esi+12]
	mov esi, [_vram]
	and eax, 0x7ff
	test cl, byte 0x2

	jz .no_interlace

.interlace:

	lea edx, [edx*8]
	shl eax, 6

	jmp .check_x_flip

	cache_align

.no_interlace:
	lea edx, [edx*4]
	shl eax, 5

	cache_align

.check_x_flip:

	add eax, edx
	mov edi, where
	lea esi, [esi+eax]
	mov ebx, [esi]
	pop esi
	test ebx, ebx

	jz near .cleanup		; Don't waste time if the tile is blank!

	mov eax, which
	test eax, 0x800

	jz near .x_not_flipped

.x_flipped:

	blit_pixel2_trans 0x0f000000, 24	; pixel 8
	blit_pixel2_trans 0xf0000000, 28	; ..... 7
	blit_pixel2_trans 0x000f0000, 16	; ..... 6
	blit_pixel2_trans 0x00f00000, 20	; ..... 5
	blit_pixel2_trans 0x00000f00, 8		; ..... 4
	blit_pixel2_trans 0x0000f000, 12	; ..... 3
	blit_pixel2_trans 0x0000000f		; ..... 2
	blit_pixel2_trans 0x000000f0, 4		; ..... 1

	jmp .cleanup

	cache_align

.x_not_flipped:

	blit_pixel2_trans 0x000000f0, 4		; pixel 1
	blit_pixel2_trans 0x0000000f		; ..... 2
	blit_pixel2_trans 0x0000f000, 12	; ..... 3
	blit_pixel2_trans 0x00000f00, 8		; ..... 4
	blit_pixel2_trans 0x00f00000, 20	; ..... 5
	blit_pixel2_trans 0x000f0000, 16	; ..... 6
	blit_pixel2_trans 0xf0000000, 28	; ..... 7
	blit_pixel2_trans 0x0f000000, 24	; ..... 8

	cache_align

.cleanup:

	popad

	ret

	cache_align

; ----------------------------------------

__drawtile3_solid:

	pushad
	mov ebp, esp

.setup

.get_pal:	

	mov ebx, which
	mov esi, [_highpal]
	mov eax, ebx
	shr eax, byte 7
	and eax, 0xc0
	add esi, eax
	push esi

.check_y_flip:

	mov eax, ebx
	xor ecx, ecx
	mov edx, line
	test eax, 0x1000

	jz .check_interlace

.y_flipped:

	xor edx, byte 7

	cache_align

.check_interlace:

	mov esi, [_reg]
	mov cl, [esi+12]
	mov esi, [_vram]
	and eax, 0x7ff
	test cl, byte 0x2

	jz .no_interlace

.interlace:

	lea edx, [edx*8]
	shl eax, 6
	jmp .check_x_flip

	cache_align

.no_interlace:

	lea edx, [edx*4]
	shl eax, 5

	cache_align

.check_x_flip:

	add eax, edx
	mov edi, where
	lea esi, [esi+eax]
	mov ebx, [esi]
	pop esi
	mov eax, which
	test eax, 0x800

	jz near .x_not_flipped

.x_flipped:

	blit_pixel3 0x0f000000, 24	; pixel 8
	blit_pixel3 0xf0000000, 28	; ..... 7
	blit_pixel3 0x000f0000, 16	; ..... 6
	blit_pixel3 0x00f00000, 20	; ..... 5
	blit_pixel3 0x00000f00, 8	; ..... 4
	blit_pixel3 0x0000f000, 12	; ..... 3
	blit_pixel3 0x0000000f		; ..... 2
	blit_pixel3 0x000000f0, 4	; ..... 1

	jmp .cleanup

	cache_align

.x_not_flipped:

	blit_pixel3 0x000000f0, 4	; pixel 1
	blit_pixel3 0x0000000f		; ..... 2
	blit_pixel3 0x0000f000, 12	; ..... 3
	blit_pixel3 0x00000f00, 8	; ..... 4
	blit_pixel3 0x00f00000, 20	; ..... 5
	blit_pixel3 0x000f0000, 16	; ..... 6
	blit_pixel3 0xf0000000, 28	; ..... 7
	blit_pixel3 0x0f000000, 24	; ..... 8

	cache_align

.cleanup:

	popad

	ret

	cache_align

; ----------------------------------------

__drawtile3:

	pushad
	mov ebp, esp

.setup

.get_pal:	

	mov ebx, which
	mov esi, [_highpal]
	mov eax, ebx
	shr eax, byte 7
	and eax, 0xc0
	add esi, eax
	push esi

.check_y_flip:

	mov eax, ebx
	xor ecx, ecx
	mov edx, line
	test eax, 0x1000

	jz .check_interlace

.y_flipped:

	xor edx, byte 7

	cache_align

.check_interlace:

	mov esi, [_reg]
	mov cl, [esi+12]
	mov esi, [_vram]
	and eax, 0x7ff
	test cl, byte 0x2

	jz .no_interlace

.interlace:

	lea edx, [edx*8]
	shl eax, 6
	jmp .check_x_flip

	cache_align

.no_interlace:

	lea edx, [edx*4]
	shl eax, 5

	cache_align

.check_x_flip:

	add eax, edx
	mov edi, where
	lea esi, [esi+eax]
	mov ebx, [esi]
	pop esi
	test ebx, ebx

	jz near .cleanup		; Don't waste time if the tile is blank!

	mov eax, which
	test eax, 0x800

	jz near .x_not_flipped

.x_flipped:

	blit_pixel3_trans 0x0f000000, 24	; pixel 8
	blit_pixel3_trans 0xf0000000, 28	; ..... 7
	blit_pixel3_trans 0x000f0000, 16	; ..... 6
	blit_pixel3_trans 0x00f00000, 20	; ..... 5
	blit_pixel3_trans 0x00000f00, 8		; ..... 4
	blit_pixel3_trans 0x0000f000, 12	; ..... 3
	blit_pixel3_trans 0x0000000f		; ..... 2
	blit_pixel3_trans 0x000000f0, 4		; ..... 1

	jmp .cleanup

	cache_align

.x_not_flipped:

	blit_pixel3_trans 0x000000f0, 4		; pixel 1
	blit_pixel3_trans 0x0000000f		; ..... 2
	blit_pixel3_trans 0x0000f000, 12	; ..... 3
	blit_pixel3_trans 0x00000f00, 8		; ..... 4
	blit_pixel3_trans 0x00f00000, 20	; ..... 5
	blit_pixel3_trans 0x000f0000, 16	; ..... 6
	blit_pixel3_trans 0xf0000000, 28	; ..... 7
	blit_pixel3_trans 0x0f000000, 24	; ..... 8

	cache_align

.cleanup:

	popad

	ret

	cache_align

; ----------------------------------------

__drawtile4_solid:

	pushad
	mov ebp, esp

.setup

.get_pal:	

	mov ebx, which
	mov esi, [_highpal]
	mov eax, ebx
	shr eax, byte 7
	and eax, 0xc0
	add esi, eax
	push esi

.check_y_flip:

	mov eax, ebx
	xor ecx, ecx
	mov edx, line
	test eax, 0x1000

	jz .check_interlace

.y_flipped:

	xor edx, byte 7

	cache_align

.check_interlace:

	mov esi, [_reg]
	mov cl, [esi+12]
	mov esi, [_vram]
	and eax, 0x7ff
	test cl, byte 0x2

	jz .no_interlace

.interlace:

	lea edx, [edx*8]
	shl eax, 6
	jmp .check_x_flip

	cache_align

.no_interlace:

	lea edx, [edx*4]
	shl eax, 5

	cache_align

.check_x_flip:

	add eax, edx
	mov edi, where
	lea esi, [esi+eax]
	mov ebx, [esi]
	pop esi
	mov eax, which
	test eax, 0x800

	jz near .x_not_flipped

.x_flipped:

	blit_pixel4 0x0f000000, 24	; pixel 8
	blit_pixel4 0xf0000000, 28	; ..... 7
	blit_pixel4 0x000f0000, 16	; ..... 6
	blit_pixel4 0x00f00000, 20	; ..... 5
	blit_pixel4 0x00000f00, 8	; ..... 4
	blit_pixel4 0x0000f000, 12	; ..... 3
	blit_pixel4 0x0000000f		; ..... 2
	blit_pixel4 0x000000f0, 4	; ..... 1

	jmp .cleanup

	cache_align

.x_not_flipped:

	blit_pixel4 0x000000f0, 4	; pixel 1
	blit_pixel4 0x0000000f		; ..... 2
	blit_pixel4 0x0000f000, 12	; ..... 3
	blit_pixel4 0x00000f00, 8	; ..... 4
	blit_pixel4 0x00f00000, 20	; ..... 5
	blit_pixel4 0x000f0000, 16	; ..... 6
	blit_pixel4 0xf0000000, 28	; ..... 7
	blit_pixel4 0x0f000000, 24	; ..... 8

	cache_align

.cleanup:

	popad

	ret

	cache_align

; ----------------------------------------

__drawtile4:

	pushad
	mov ebp, esp

.setup

.get_pal:	

	mov ebx, which
	mov esi, [_highpal]
	mov eax, ebx
	shr eax, byte 7
	and eax, 0xc0
	add esi, eax
	push esi

.check_y_flip:

	mov eax, ebx
	xor ecx, ecx
	mov edx, line
	test eax, 0x1000

	jz .check_interlace

.y_flipped:

	xor edx, byte 7

	cache_align

.check_interlace:

	mov esi, [_reg]
	mov cl, [esi+12]
	mov esi, [_vram]
	and eax, 0x7ff
	test cl, byte 0x2

	jz .no_interlace

.interlace:

	lea edx, [edx*8]
	shl eax, 6
	jmp .check_x_flip

	cache_align

.no_interlace:

	lea edx, [edx*4]
	shl eax, 5

	cache_align

.check_x_flip:

	add eax, edx
	mov edi, where
	lea esi, [esi+eax]
	mov ebx, [esi]
	pop esi
	test ebx, ebx

	jz near .cleanup		; Don't waste time if the tile is blank!

	mov eax, which
	test eax, 0x800

	jz near .x_not_flipped

.x_flipped:

	blit_pixel4_trans 0x0f000000, 24	; pixel 8
	blit_pixel4_trans 0xf0000000, 28	; ..... 7
	blit_pixel4_trans 0x000f0000, 16	; ..... 6
	blit_pixel4_trans 0x00f00000, 20	; ..... 5
	blit_pixel4_trans 0x00000f00, 8		; ..... 4
	blit_pixel4_trans 0x0000f000, 12	; ..... 3
	blit_pixel4_trans 0x0000000f		; ..... 2
	blit_pixel4_trans 0x000000f0, 4		; ..... 1

	jmp .cleanup

	cache_align

.x_not_flipped:

	blit_pixel4_trans 0x000000f0, 4		; pixel 1
	blit_pixel4_trans 0x0000000f		; ..... 2
	blit_pixel4_trans 0x0000f000, 12	; ..... 3
	blit_pixel4_trans 0x00000f00, 8		; ..... 4
	blit_pixel4_trans 0x00f00000, 20	; ..... 5
	blit_pixel4_trans 0x000f0000, 16	; ..... 6
	blit_pixel4_trans 0xf0000000, 28	; ..... 7
	blit_pixel4_trans 0x0f000000, 24	; ..... 8

	cache_align

.cleanup:

	popad

	ret

	cache_align

section .data

	_vram		dd 0
	_reg		dd 0
	_highpal	dd 0

; ----------------------------------------

⌨️ 快捷键说明

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