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

📄 tetris.lst

📁 一个类linux的dos下开发的操作系统.
💻 LST
📖 第 1 页 / 共 5 页
字号:
tetris.c:248
/* draw vertical edges of playing field */
		_screen[0][y_pos] = _screen[SCN_WID - 1][y_pos] = COLOR_BLUE;
400001f1:	c6 04 0f 04          	movb   $0x4,(%edi,%ecx,1)
400001f5:	c6 04 31 04          	movb   $0x4,(%ecx,%esi,1)
tetris.c:241
400001f9:	89 d9                	mov    %ebx,%ecx
400001fb:	83 f9 13             	cmp    $0x13,%ecx
400001fe:	76 d2                	jbe    400001d2 <_init_screen+0x12>
tetris.c:251
	}
/* draw horizontal edges of playing field */
	for(x_pos = 0; x_pos < SCN_WID; x_pos++)
40000200:	31 d2                	xor    %edx,%edx
40000202:	bb 18 20 00 40       	mov    $0x40002018,%ebx
40000207:	b9 2b 20 00 40       	mov    $0x4000202b,%ecx
4000020c:	31 c0                	xor    %eax,%eax
4000020e:	89 f6                	mov    %esi,%esi
tetris.c:252
		_screen[x_pos][0] = _screen[x_pos][SCN_HT - 1] = COLOR_BLUE;
40000210:	c6 04 01 04          	movb   $0x4,(%ecx,%eax,1)
40000214:	c6 04 03 04          	movb   $0x4,(%ebx,%eax,1)
tetris.c:251
40000218:	83 c0 14             	add    $0x14,%eax
4000021b:	42                   	inc    %edx
4000021c:	83 fa 0e             	cmp    $0xe,%edx
4000021f:	76 ef                	jbe    40000210 <_init_screen+0x50>
40000221:	5b                   	pop    %ebx
40000222:	5e                   	pop    %esi
40000223:	5f                   	pop    %edi
40000224:	89 ec                	mov    %ebp,%esp
40000226:	5d                   	pop    %ebp
40000227:	c3                   	ret    

40000228 <.ef>:
tetris.c:253
}
40000228:	1b 5b 25             	sbb    0x25(%ebx),%ebx
4000022b:	64 3b 31             	cmp    %fs:(%ecx),%esi
4000022e:	48                   	dec    %eax
4000022f:	00 1b                	add    %bl,(%ebx)
40000231:	5b                   	pop    %ebx
40000232:	25 64 6d db db       	and    $0xdbdb6d64,%eax
40000237:	00 1b                	add    %bl,(%ebx)
40000239:	5b                   	pop    %ebx
4000023a:	33 37                	xor    (%edi),%esi
4000023c:	6d                   	insl   (%dx),%es:(%edi)
4000023d:	00 89 f6 55 89 e5    	add    %cl,0xe58955f6(%ecx)

40000240 <_refresh>:
_refresh():
tetris.c:260
/*****************************************************************************
*****************************************************************************/
static void refresh(void)
{
	unsigned x_pos, y_pos;

	for(y_pos = 0; y_pos < SCN_HT; y_pos++)
40000240:	55                   	push   %ebp
40000241:	89 e5                	mov    %esp,%ebp
40000243:	83 ec 0c             	sub    $0xc,%esp
40000246:	57                   	push   %edi
40000247:	56                   	push   %esi
40000248:	53                   	push   %ebx
40000249:	31 ff                	xor    %edi,%edi
4000024b:	90                   	nop    
4000024c:	8d 74 26 00          	lea    0x0(%esi,1),%esi
tetris.c:262
	{
		if(!_dirty[y_pos])
40000250:	8d 47 01             	lea    0x1(%edi),%eax
40000253:	89 45 fc             	mov    %eax,0xfffffffc(%ebp)
40000256:	80 bf 00 20 00 40 00 	cmpb   $0x0,0x40002000(%edi)
4000025d:	74 41                	je     400002a0 <_refresh+0x60>
tetris.c:265
			continue;
/* gotoxy(0, y_pos) */
		printf("\x1B[%d;1H", y_pos + 1);
4000025f:	83 c4 f8             	add    $0xfffffff8,%esp
40000262:	50                   	push   %eax
40000263:	68 28 02 00 40       	push   $0x40000228
40000268:	e8 43 06 00 00       	call   400008b0 <_printf>
tetris.c:266
		for(x_pos = 0; x_pos < SCN_WID; x_pos++)
4000026d:	31 f6                	xor    %esi,%esi
4000026f:	83 c4 10             	add    $0x10,%esp
40000272:	8d 9f 18 20 00 40    	lea    0x40002018(%edi),%ebx
tetris.c:268
/* 0xDB is a solid rectangular block in the PC character set */
			printf("\x1B[%dm\xDB\xDB", 30 + _screen[x_pos][y_pos]);
40000278:	83 c4 f8             	add    $0xfffffff8,%esp
4000027b:	31 c0                	xor    %eax,%eax
4000027d:	8a 03                	mov    (%ebx),%al
4000027f:	83 c0 1e             	add    $0x1e,%eax
40000282:	50                   	push   %eax
40000283:	68 30 02 00 40       	push   $0x40000230
40000288:	e8 23 06 00 00       	call   400008b0 <_printf>
tetris.c:266
4000028d:	83 c4 10             	add    $0x10,%esp
40000290:	83 c3 14             	add    $0x14,%ebx
40000293:	46                   	inc    %esi
40000294:	83 fe 0e             	cmp    $0xe,%esi
40000297:	76 df                	jbe    40000278 <_refresh+0x38>
tetris.c:269
		_dirty[y_pos] = 0;
40000299:	c6 87 00 20 00 40 00 	movb   $0x0,0x40002000(%edi)
tetris.c:260
400002a0:	8b 7d fc             	mov    0xfffffffc(%ebp),%edi
400002a3:	83 ff 13             	cmp    $0x13,%edi
400002a6:	76 a8                	jbe    40000250 <_refresh+0x10>
tetris.c:272
	}
/* reset foreground color to gray */
	printf("\x1B[37m");
400002a8:	83 c4 f4             	add    $0xfffffff4,%esp
400002ab:	68 38 02 00 40       	push   $0x40000238
400002b0:	e8 fb 05 00 00       	call   400008b0 <_printf>
tetris.c:273
	fflush(stdout);
400002b5:	83 c4 f4             	add    $0xfffffff4,%esp
400002b8:	68 98 11 00 40       	push   $0x40001198
400002bd:	e8 0e 06 00 00       	call   400008d0 <_fflush>
400002c2:	8d 65 e8             	lea    0xffffffe8(%ebp),%esp
400002c5:	5b                   	pop    %ebx
400002c6:	5e                   	pop    %esi
400002c7:	5f                   	pop    %edi
400002c8:	89 ec                	mov    %ebp,%esp
400002ca:	5d                   	pop    %ebp
400002cb:	c3                   	ret    

400002cc <_collapse>:
_collapse():
tetris.c:283
}
/*****************************************************************************
*****************************************************************************/
static void collapse(void)
{
	unsigned char solid_row[SCN_HT], solid_rows;
	int row, col, temp;

/* determine which rows are solidly filled */
	solid_rows = 0;
400002cc:	55                   	push   %ebp
400002cd:	89 e5                	mov    %esp,%ebp
400002cf:	83 ec 3c             	sub    $0x3c,%esp
tetris.c:284
	for(row = 1; row < SCN_HT - 1; row++)
400002d2:	8d 45 ec             	lea    0xffffffec(%ebp),%eax
tetris.c:283
400002d5:	57                   	push   %edi
400002d6:	56                   	push   %esi
400002d7:	53                   	push   %ebx
400002d8:	c6 45 eb 00          	movb   $0x0,0xffffffeb(%ebp)
tetris.c:284
400002dc:	bf 01 00 00 00       	mov    $0x1,%edi
400002e1:	89 45 dc             	mov    %eax,0xffffffdc(%ebp)
tetris.c:286
	{
		temp = 0;
400002e4:	31 f6                	xor    %esi,%esi
tetris.c:287
		for(col = 1; col < SCN_WID - 1; col++)
400002e6:	bb 01 00 00 00       	mov    $0x1,%ebx
400002eb:	8d 47 01             	lea    0x1(%edi),%eax
400002ee:	89 45 d8             	mov    %eax,0xffffffd8(%ebp)
tetris.c:289
		{
			if(detect_block_hit(col, row))
400002f1:	83 c4 f8             	add    $0xfffffff8,%esp
400002f4:	57                   	push   %edi
400002f5:	53                   	push   %ebx
400002f6:	e8 3d fd ff ff       	call   40000038 <_detect_block_hit>
400002fb:	83 c4 10             	add    $0x10,%esp
400002fe:	85 c0                	test   %eax,%eax
40000300:	74 01                	je     40000303 <_collapse+0x37>
tetris.c:290
				temp++;
40000302:	46                   	inc    %esi
tetris.c:287
40000303:	43                   	inc    %ebx
40000304:	83 fb 0d             	cmp    $0xd,%ebx
40000307:	7e e8                	jle    400002f1 <_collapse+0x25>
tetris.c:292
		}
		if(temp == SCN_WID - 2)
40000309:	83 fe 0d             	cmp    $0xd,%esi
4000030c:	75 12                	jne    40000320 <_collapse+0x54>
tetris.c:294
		{
			solid_row[row] = 1;
4000030e:	8b 45 dc             	mov    0xffffffdc(%ebp),%eax
40000311:	c6 04 07 01          	movb   $0x1,(%edi,%eax,1)
tetris.c:295
			solid_rows++;
40000315:	fe 45 eb             	incb   0xffffffeb(%ebp)
tetris.c:296
		}
40000318:	eb 0d                	jmp    40000327 <_collapse+0x5b>
4000031a:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
tetris.c:298
		else
			solid_row[row] = 0;
40000320:	8b 45 dc             	mov    0xffffffdc(%ebp),%eax
40000323:	c6 04 07 00          	movb   $0x0,(%edi,%eax,1)
tetris.c:284
40000327:	8b 7d d8             	mov    0xffffffd8(%ebp),%edi
4000032a:	83 ff 12             	cmp    $0x12,%edi
4000032d:	7e b5                	jle    400002e4 <_collapse+0x18>
tetris.c:300
	}
	if(solid_rows == 0)
4000032f:	80 7d eb 00          	cmpb   $0x0,0xffffffeb(%ebp)
40000333:	0f 84 91 00 00 00    	je     400003ca <_collapse+0xfe>
tetris.c:303
		return;
/* collapse them */
	for(temp = row=SCN_HT - 2; row > 0; row--, temp--)
40000339:	8b 45 dc             	mov    0xffffffdc(%ebp),%eax
4000033c:	bf 12 00 00 00       	mov    $0x12,%edi
40000341:	be 12 00 00 00       	mov    $0x12,%esi
40000346:	89 45 e4             	mov    %eax,0xffffffe4(%ebp)
40000349:	8d b4 26 00 00 00 00 	lea    0x0(%esi,1),%esi
tetris.c:306
	{
/* find a solid row */
		while(solid_row[temp])
40000350:	8d 47 ff             	lea    0xffffffff(%edi),%eax
40000353:	89 45 e0             	mov    %eax,0xffffffe0(%ebp)
40000356:	8b 45 e4             	mov    0xffffffe4(%ebp),%eax
40000359:	80 3c 06 00          	cmpb   $0x0,(%esi,%eax,1)
4000035d:	74 0b                	je     4000036a <_collapse+0x9e>
4000035f:	90                   	nop    
tetris.c:307
			temp--;
40000360:	8b 45 dc             	mov    0xffffffdc(%ebp),%eax
40000363:	4e                   	dec    %esi
40000364:	80 3c 06 00          	cmpb   $0x0,(%esi,%eax,1)
40000368:	75 f6                	jne    40000360 <_collapse+0x94>
tetris.c:309
/* copy it */
		if(temp < 1)
4000036a:	85 f6                	test   %esi,%esi
4000036c:	7f 22                	jg     40000390 <_collapse+0xc4>
tetris.c:311
		{
			for(col = 1; col < SCN_WID - 1; col++)
4000036e:	4e                   	dec    %esi
4000036f:	89 75 d4             	mov    %esi,0xffffffd4(%ebp)
40000372:	8d 87 2c 20 00 40    	lea    0x4000202c(%edi),%eax
40000378:	bb 0c 00 00 00       	mov    $0xc,%ebx
4000037d:	8d 76 00             	lea    0x0(%esi),%esi
tetris.c:312
				_screen[col][row] = COLOR_BLACK;
40000380:	c6 00 00             	movb   $0x0,(%eax)
tetris.c:311
40000383:	83 c0 14             	add    $0x14,%eax
40000386:	4b                   	dec    %ebx
40000387:	79 f7                	jns    40000380 <_collapse+0xb4>
tetris.c:313
		}
40000389:	eb 29                	jmp    400003b4 <_collapse+0xe8>
4000038b:	90                   	nop    
4000038c:	8d 74 26 00          	lea    0x0(%esi,1),%esi
tetris.c:316
		else
		{
			for(col = 1; col < SCN_WID - 1; col++)
40000390:	8d 46 ff             	lea    0xffffffff(%esi),%eax
40000393:	89 45 d4             	mov    %eax,0xffffffd4(%ebp)
40000396:	8d 8f 2c 20 00 40    	lea    0x4000202c(%edi),%ecx
4000039c:	8d 96 2c 20 00 40    	lea    0x4000202c(%esi),%edx
400003a2:	bb 0c 00 00 00       	mov    $0xc,%ebx
tetris.c:317
				_screen[col][row] = _screen[col][temp];
400003a7:	8a 02                	mov    (%edx),%al
400003a9:	88 01                	mov    %al,(%ecx)
tetris.c:316
400003ab:	83 c1 14             	add    $0x14,%ecx
400003ae:	83 c2 14             	add    $0x14,%edx
400003b1:	4b                   	dec    %ebx
400003b2:	79 f3                	jns    400003a7 <_collapse+0xdb>
tetris.c:319
		}
		_dirty[row] = 1;
400003b4:	c6 87 00 20 00 40 01 	movb   $0x1,0x40002000(%edi)
tetris.c:303
400003bb:	8b 7d e0             	mov    0xffffffe0(%ebp),%edi
400003be:	8b 75 d4             	mov    0xffffffd4(%ebp),%esi
400003c1:	85 ff                	test   %edi,%edi
400003c3:	7f 8b                	jg     40000350 <_collapse+0x84>
tetris.c:321
	}
	refresh();
400003c5:	e8 76 fe ff ff       	call   40000240 <_refresh>
tetris.c:322
}
400003ca:	8d 65 b8             	lea    0xffffffb8(%ebp),%esp
400003cd:	5b                   	pop    %ebx
400003ce:	5e                   	pop    %esi
400003cf:	5f                   	pop    %edi
400003d0:	89 ec                	mov    %ebp,%esp
400003d2:	5d                   	pop    %ebp
400003d3:	c3                   	ret    

400003d4 <_get_key>:
_get_key():
tetris.c:330
/*****************************************************************************
*****************************************************************************/
static unsigned char get_key(void)
{
	static unsigned long timeout = 200000L;
	unsigned char ret_val;

	if(select(0, timeout) != 0)
400003d4:	55                   	push   %ebp
400003d5:	a1 7c 11 00 40       	mov    0x4000117c,%eax
400003da:	89 e5                	mov    %esp,%ebp
400003dc:	83 ec 18             	sub    $0x18,%esp
400003df:	83 c4 f8             	add    $0xfffffff8,%esp
400003e2:	50                   	push   %eax
400003e3:	6a 00                	push   $0x0
400003e5:	e8 36 05 00 00       	call   40000920 <_select>
400003ea:	83 c4 10             	add    $0x10,%esp
400003ed:	85 c0                	test   %eax,%eax
400003ef:	74 10                	je     40000401 <_get_key+0x2d>

⌨️ 快捷键说明

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