dev #2
							
								
								
									
										
											BIN
										
									
								
								SegaMouseRaw_1.1.bin
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								SegaMouseRaw_1.1.bin
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								res/fluttershy.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								res/fluttershy.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 194 B | 
							
								
								
									
										16
									
								
								src/main.c
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								src/main.c
									
									
									
									
									
								
							| @ -24,9 +24,11 @@ int main() { | ||||
| 	s16 x = 0; | ||||
| 	s16 y = 0; | ||||
| 
 | ||||
| 	u8 frame = 0; | ||||
| 
 | ||||
| 	char buf[40]; //буфер строки для вывода на экран
 | ||||
| 
 | ||||
| 	while(TRUE) {		 | ||||
| 	while(TRUE) {	 | ||||
| 		//опрос мыши
 | ||||
| 		Z80_HALT = 0x0100; | ||||
| 		*MOUSE_PORT = 0x60; delay(); | ||||
| @ -46,8 +48,9 @@ int main() { | ||||
| 		//конец опроса мыши
 | ||||
| 
 | ||||
| 		//выводим нибблы на экран
 | ||||
| 		sprintf(buf, "%X%X%X%X %X %X %X%X %X%X", nibbles[0],nibbles[1],nibbles[2],nibbles[3],nibbles[4],nibbles[5],nibbles[6],nibbles[7],nibbles[8],nibbles[9]); | ||||
| 		VDP_drawText(buf, 13,1); | ||||
| 		sprintf(buf, "+%X%X%X%X %X %X %X%X %X%X", nibbles[0],nibbles[1],nibbles[2],nibbles[3],nibbles[4],nibbles[5],nibbles[6],nibbles[7],nibbles[8],nibbles[9]); | ||||
| 		VDP_clearTextArea(12,1,1,22); | ||||
| 		VDP_drawText(buf, 12,1+frame%22); | ||||
| 
 | ||||
| 		//считаем dx dy 
 | ||||
| 		s16 dx = (nibbles[6] << 4) | nibbles[7]; | ||||
| @ -65,9 +68,12 @@ int main() { | ||||
| 
 | ||||
| 		//выводим на экран полезные данные
 | ||||
| 		sprintf(buf, "buttons: %c%c%c%c", (nibbles[5]&8&&1)+'0',(nibbles[5]&4&&1)+'0',(nibbles[5]&2&&1)+'0',(nibbles[5]&1&&1)+'0'); | ||||
| 		VDP_drawText(buf, 2, 12); | ||||
| 		VDP_drawText(buf, 2, 24); | ||||
| 		sprintf(buf, "dx: %+04d dy: %+04d x: %+05d y: %+05d", dx,dy,x,y); | ||||
| 		VDP_drawText(buf, 2, 13); | ||||
| 		VDP_drawText(buf, 2, 25); | ||||
| 
 | ||||
| 		//счётчик кадров для вывода истории нибблов
 | ||||
| 		frame++; | ||||
| 
 | ||||
| 		//конец кадра
 | ||||
| 		VDP_waitVSync(); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user