📄 eluosi.lst
字号:
283 1 j=y%8;
284 1 k|=1<<j;
285 1
286 1 if(tidu[x][i]&k) return 1;//have point
287 1 else return 0;//no point
288 1 }
289
290 ////////////////////////////generate a box
291 void Box_Generate()
292 {
293 1 static unsigned char box_no=5;
294 1
295 1 this.x=0;this.y=20;
*** ERROR C202 IN LINE 295 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 295 OF ELUOSI.C: 'this': undefined identifier
296 1 this.BlckIndex = (box_no++)%7;
*** ERROR C202 IN LINE 296 OF ELUOSI.C: 'this': undefined identifier
297 1 this.Status = 0;
*** ERROR C202 IN LINE 297 OF ELUOSI.C: 'this': undefined identifier
298 1
299 1 this.pPIC = TtrsBlck
*** ERROR C202 IN LINE 299 OF ELUOSI.C: 'this': undefined identifier
300 1 + TtrsBlckPoint[this.BlckIndex]
301 1 + (this.Status) * 4;
302 1 }
303
304 ////////////////////////////if there is the game line
305 unsigned char Check_Box_gameline()
306 {
307 1 for(i=0;i<4;i++)
308 1 {
309 2 //if(this.pPIC[i]&0x08){if((this.x+i>30)||((this.y+1)>40)||((this.y+1)<1)) return 1;}//have point
310 2 //if(this.pPIC[i]&0x04){if((this.x+i>30)||((this.y+2)>40)||((this.y+2)<1)) return 1;}//have point
311 2 //if(this.pPIC[i]&0x02){if((this.x+i>30)||((this.y+3)>40)||((this.y+3)<1)) return 1;}//have point
312 2 //if(this.pPIC[i]&0x01){if((this.x+i>30)||((this.y+4)>40)||((this.y+4)<1)) return 1;}//have point
313 2
314 2 if(this.pPIC[i]&0x08){if((this.x+i>30)||((this.y+1)>40)) return 1;}//have point
*** ERROR C202 IN LINE 314 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 314 OF ELUOSI.C: 'this': undefined identifier
315 2 if(this.pPIC[i]&0x04){if((this.x+i>30)||((this.y+2)>40)) return 1;}//have point
*** ERROR C202 IN LINE 315 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 315 OF ELUOSI.C: 'this': undefined identifier
316 2 if(this.pPIC[i]&0x02){if((this.x+i>30)||((this.y+3)>40)) return 1;}//have point
*** ERROR C202 IN LINE 316 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 316 OF ELUOSI.C: 'this': undefined identifier
317 2 if(this.pPIC[i]&0x01){if((this.x+i>30)||((this.y+4)>40)) return 1;}//have point
*** ERROR C202 IN LINE 317 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 317 OF ELUOSI.C: 'this': undefined identifier
318 2 }
319 1 return 0;//no point
320 1 }
321
322 ////////////////////////////if there hava box
323 unsigned char Check_Box_ditu()
324 {
325 1 for(i=0;i<4;i++)
326 1 {
C51 COMPILER V7.06 ELUOSI 09/02/2008 17:59:01 PAGE 7
327 2 if(this.pPIC[i]&0x08){if(read_ditu(this.x+i,this.y+1)) return 1;}//have point
*** ERROR C202 IN LINE 327 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 327 OF ELUOSI.C: 'this': undefined identifier
328 2 if(this.pPIC[i]&0x04){if(read_ditu(this.x+i,this.y+2))return 1;}//have point
*** ERROR C202 IN LINE 328 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 328 OF ELUOSI.C: 'this': undefined identifier
329 2 if(this.pPIC[i]&0x02){if(read_ditu(this.x+i,this.y+3))return 1;}//have point
*** ERROR C202 IN LINE 329 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 329 OF ELUOSI.C: 'this': undefined identifier
330 2 if(this.pPIC[i]&0x01){if(read_ditu(this.x+i,this.y+4))return 1;}//have point
*** ERROR C202 IN LINE 330 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 330 OF ELUOSI.C: 'this': undefined identifier
331 2 }
332 1 return 0;//no point
333 1 }
334 //////////////////////////////////
335 //if it can ratation
336 //////////////////////////////////
337 unsigned char Check_Box_ditu_ratation()
338 {
339 1 for(i=0;i<4;i++)
340 1 {
341 2 {if(read_ditu(this.x+i,this.y+1)) return 1;}//have point
*** ERROR C202 IN LINE 341 OF ELUOSI.C: 'this': undefined identifier
342 2 {if(read_ditu(this.x+i,this.y+2))return 1;}//have point
*** ERROR C202 IN LINE 342 OF ELUOSI.C: 'this': undefined identifier
343 2 {if(read_ditu(this.x+i,this.y+3))return 1;}//have point
*** ERROR C202 IN LINE 343 OF ELUOSI.C: 'this': undefined identifier
344 2 {if(read_ditu(this.x+i,this.y+4))return 1;}//have point
*** ERROR C202 IN LINE 344 OF ELUOSI.C: 'this': undefined identifier
345 2 if(this.x>27)return 1;//bottom line
*** ERROR C202 IN LINE 345 OF ELUOSI.C: 'this': undefined identifier
346 2 if(this.y>37)return 1;//right line
*** ERROR C202 IN LINE 346 OF ELUOSI.C: 'this': undefined identifier
347 2 }
348 1 return 0;//no point
349 1 }
350
351
352 ////////////////////////////write a box
353 void Write_Box_ditu()
354 {
355 1 for(i=0;i<4;i++)
356 1 {
357 2 if(this.pPIC[i]&0x08) { onepoint(this.x+i,this.y+1); write_ditu(this.x+i,this.y+1,1);}
*** ERROR C202 IN LINE 357 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 357 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 357 OF ELUOSI.C: 'this': undefined identifier
358 2 if(this.pPIC[i]&0x04) { onepoint(this.x+i,this.y+2); write_ditu(this.x+i,this.y+2,1);}
*** ERROR C202 IN LINE 358 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 358 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 358 OF ELUOSI.C: 'this': undefined identifier
359 2 if(this.pPIC[i]&0x02) { onepoint(this.x+i,this.y+3); write_ditu(this.x+i,this.y+3,1);}
*** ERROR C202 IN LINE 359 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 359 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 359 OF ELUOSI.C: 'this': undefined identifier
360 2 if(this.pPIC[i]&0x01) { onepoint(this.x+i,this.y+4); write_ditu(this.x+i,this.y+4,1);}
*** ERROR C202 IN LINE 360 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 360 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 360 OF ELUOSI.C: 'this': undefined identifier
361 2 }
362 1
C51 COMPILER V7.06 ELUOSI 09/02/2008 17:59:01 PAGE 8
363 1 }
364
365 ////////////////////////////clear a box
366 void Clr_Box_ditu()
367 {
368 1 for(i=0;i<4;i++)
369 1 {
370 2 if(this.pPIC[i]&0x08) { clr_onepoint(this.x+i,this.y+1); write_ditu(this.x+i,this.y+1,0);}
*** ERROR C202 IN LINE 370 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 370 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 370 OF ELUOSI.C: 'this': undefined identifier
371 2 if(this.pPIC[i]&0x04) { clr_onepoint(this.x+i,this.y+2); write_ditu(this.x+i,this.y+2,0);}
*** ERROR C202 IN LINE 371 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 371 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 371 OF ELUOSI.C: 'this': undefined identifier
372 2 if(this.pPIC[i]&0x02) { clr_onepoint(this.x+i,this.y+3); write_ditu(this.x+i,this.y+3,0);}
*** ERROR C202 IN LINE 372 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 372 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 372 OF ELUOSI.C: 'this': undefined identifier
373 2 if(this.pPIC[i]&0x01) { clr_onepoint(this.x+i,this.y+4); write_ditu(this.x+i,this.y+4,0);}
*** ERROR C202 IN LINE 373 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 373 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 373 OF ELUOSI.C: 'this': undefined identifier
374 2 }
375 1
376 1 }
377
378 void game_line()
379 {
380 1 for(i=0;i<32;i++)
381 1 {onepoint(i,0);
382 2 onepoint(i,41);}
383 1 for(i=0;i<42;i++)
384 1 {onepoint(31,i);}
385 1 }
386
387
388 void mov_left()
389 {
390 1 Clr_Box_ditu();
391 1 this.y--;
*** ERROR C202 IN LINE 391 OF ELUOSI.C: 'this': undefined identifier
392 1
393 1 if((Check_Box_ditu())||(Check_Box_gameline()))//crack
394 1 this.y++;
*** ERROR C202 IN LINE 394 OF ELUOSI.C: 'this': undefined identifier
395 1
396 1 Write_Box_ditu();
397 1 }
398
399 void mov_right()
400 {
401 1 Clr_Box_ditu();
402 1 this.y++;
*** ERROR C202 IN LINE 402 OF ELUOSI.C: 'this': undefined identifier
403 1
404 1 if((Check_Box_ditu())||(Check_Box_gameline()))//crack
405 1 this.y--;
*** ERROR C202 IN LINE 405 OF ELUOSI.C: 'this': undefined identifier
406 1
407 1 Write_Box_ditu();
408 1 }
C51 COMPILER V7.06 ELUOSI 09/02/2008 17:59:01 PAGE 9
409
410
411 void mov_ratation()
412 {
413 1 Clr_Box_ditu();
414 1
415 1 if(Check_Box_ditu_ratation()==0) ///////////////////////////////////////
416 1 {
417 2 //状态转变
418 2 this.Status ++;
*** ERROR C202 IN LINE 418 OF ELUOSI.C: 'this': undefined identifier
419 2 if(this.Status >= TtrsBlckStsNum[this.BlckIndex]) this.Status = 0;
*** ERROR C202 IN LINE 419 OF ELUOSI.C: 'this': undefined identifier
*** ERROR C202 IN LINE 419 OF ELUOSI.C: 'this': undefined identifier
420 2
421 2 this.pPIC = TtrsBlck
*** ERROR C202 IN LINE 421 OF ELUOSI.C: 'this': undefined identifier
422 2 + TtrsBlckPoint[this.BlckIndex]
423 2 + (this.Status) * 4;
424 2 }
425 1 Write_Box_ditu();
426 1
427 1 }
428
429 //////////////////////////////////
430 //crack_state=0;can move down
431 //crack_state=1;can not move down check is have full lines then delete it
432 //////////////////////////////////
433
434 void mov_down()
435 {
436 1 down_time=0;
437 1 Clr_Box_ditu();
438 1 this.x++;
*** ERROR C202 IN LINE 438 OF ELUOSI.C: 'this': undefined identifier
439 1 if((Check_Box_ditu())||(Check_Box_gameline()))//crack
440 1 {this.x--; crack_state=1;}
*** ERROR C202 IN LINE 440 OF ELUOSI.C: 'this': undefined identifier
441 1 else crack_state=0;
442 1 Write_Box_ditu();
443 1 if(crack_state==1)check_ditu();
444 1 }
445
446
447 ////////////////////////////////////////////////////延时
448 void delay_us(unsigned int a)
449 {
450 1 while(a>0)a--;
451 1 }
452
453 void delay_ms(unsigned int a)
454 {
455 1 while(a>0)
456 1 {a--;delay_us(250);}
457 1 }
458 //////////////////////////////////////////////////////////
459 //
460 //////////////////////////////////////////////////////////
461 ////////////////////////////////////////////////////液晶基本函数
462 char RdStateLcd( )
463 {
464 1 unsigned char state;
C51 COMPILER V7.06 ELUOSI 09/02/2008 17:59:01 PAGE 10
465 1
466 1 Rs_Lcd=0;
*** ERROR C202 IN LINE 466 OF ELUOSI.C: 'Rs_Lcd': undefined identifier
467 1 Rw_Lcd=1;
*** ERROR C202 IN LINE 467 OF ELUOSI.C: 'Rw_Lcd': undefined identifier
468 1 En_Lcd=1;
*** ERROR C202 IN LINE 468 OF ELUOSI.C: 'En_Lcd': undefined identifier
469 1
470 1 state=DataBuss;
471 1 En_Lcd=0;
*** ERROR C202 IN LINE 471 OF ELUOSI.C: 'En_Lcd': undefined identifier
472 1
473 1 return(state);
474 1 }
475
476
477 char WrCommandIc(unsigned char Command)
478 {
479 1 unsigned char state,tmp;
480 1
481 1 state=0;
482 1 for(tmp=0xFF;(RdStateLcd( )&0x80)&&(tmp>0x00);tmp--)
483 1 { ; }
484 1 if(tmp==0)
485 1 { state=0xFF; }
486 1 else
487 1 {
488 2 Rs_Lcd=0;
*** ERROR C202 IN LINE 488 OF ELUOSI.C: 'Rs_Lcd': undefined identifier
489 2 Rw_Lcd=0;
*** ERROR C202 IN LINE 489 OF ELUOSI.C: 'Rw_Lcd': undefined identifier
490 2 DataBuss=Command;
491 2 En_Lcd=1;
*** ERROR C202 IN LINE 491 OF ELUOSI.C: 'En_Lcd': undefined identifier
492 2 En_Lcd=0;
*** ERROR C202 IN LINE 492 OF ELUOSI.C: 'En_Lcd': undefined identifier
493 2 }
494 1 return(state);
495 1 }
496
497 char WrCommandLcd(unsigned char Command)
498 {
499 1 unsigned char state;
500 1
501 1 Cs1_Lcd=1;
*** ERROR C202 IN LINE 501 OF ELUOSI.C: 'Cs1_Lcd': undefined identifier
502 1 Cs2_Lcd=0;
*** ERROR C202 IN LINE 502 OF ELUOSI.C: 'Cs2_Lcd': undefined identifier
503 1 state=WrCommandIc(Command);
504 1 if(state==0)
505 1 {
506 2 Cs1_Lcd=0;
*** ERROR C202 IN LINE 506 OF ELUOSI.C: 'Cs1_Lcd': undefined identifier
507 2 Cs2_Lcd=1;
*** ERROR C202 IN LINE 507 OF ELUOSI.C: 'Cs2_Lcd': undefined identifier
508 2 state=WrCommandIc(Command);
509 2 }
510 1 return(state);
511 1 }
512
513 char WrDataLcd(unsigned char dat)
514 {
C51 COMPILER V7.06 ELUOSI 09/02/2008 17:59:01 PAGE 11
515 1 unsigned char state,tmp;
516 1
517 1 state=0;
518 1 for(tmp=0xFF;(RdStateLcd( )&0x80)&&(tmp>0x00);tmp--)//ban mang ?
519 1 { ; }
520 1 if(tmp==0)
521 1 { state=0xFF; }
522 1 else
523 1 {
524 2 Rw_Lcd=0;
*** ERROR C202 IN LINE 524 OF ELUOSI.C: 'Rw_Lcd': undefined identifier
525 2 Rs_Lcd=1;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -