Revision 78b2d942 main.c

View differences:

main.c
6 6
#include <avr/interrupt.h>
7 7
#include <avr/pgmspace.h>
8 8
#include "bricks.h"
9
#include "scorefont.h"
9 10

  
10 11
//let's make our lives easier :)
11 12
#define PORT_(port) PORT ## port
......
200 201
	noDot();
201 202
}
202 203

  
204
inline void printScoreFontLine(uint8_t scoreNibble, uint8_t step, uint8_t mirror){
205
	if(mirror){
206
		for(int8_t i = 7; i >=0; i--){
207
			if(score_font[scoreNibble][step] & (1<<i)){
208
				yellowDot();
209
			}
210
			else{
211
				noDot();
212
			}
213
		}
214
	}
215
	else{
216
		for(uint8_t i = 0; i < 8; i++){
217
			if(score_font[scoreNibble][step] & (1<<i)){
218
				yellowDot();
219
			}
220
			else{
221
				noDot();
222
			}
223
		}
224
	}
225
}
226

  
203 227
static inline void drawGameArea(player_t player[NUMBER_OF_PLAYERS]){
204 228
	PORT(ADDRESS_PORT) = 0;
205 229
	for(uint8_t round = 0; round < 16; /*round++*/){
......
207 231
			printLine(line, 15-round/2, (sprite_t*)&(player[1].sprite));
208 232
		}
209 233
		printGreenBar();
210
		for(int16_t line = 0; line < 7 ; line++){ //player[1].gameAreaEnd; line < player[0].gameAreaStart; line--){
234
		for(int16_t line = 0; line < 8 ; line++){ //player[1].gameAreaEnd; line < player[0].gameAreaStart; line--){
235
			if(round <=15 && round >=12){
236
				printScoreFontLine((player[1].score>>4)&0x0f,15-round, 1);
237
				break;
238
			}
239
			if(round <= 10 && round >= 7){
240
				printScoreFontLine((player[1].score)&0x0f,10-round, 1);
241
				break;
242
			}
211 243
			//printLine(line, 15-round, (sprite_t*)&(player[1].sprite));
212 244
			if(round == 5){
213 245
				printYellowBar();
......
227 259
			}
228 260
		}
229 261
		printYellowBar();
230
		for(int16_t line = 0; line < 7 ; line++){
262
		for(int16_t line = 0; line < 8 ; line++){
263
			if(round >=0 && round <= 3){
264
				printScoreFontLine((player[0].score>>4)&0x0f, round, 0);
265
				break;
266
			}
267
			if(round >=5 && round <= 8){
268
				printScoreFontLine(player[0].score&0x0f, round-5, 0);
269
				break;
270
			}
231 271
			if(round == 10){
232 272
				printYellowBar();
233 273
			}

Also available in: Unified diff