diff options
Diffstat (limited to 'apps/plugins/rockboy')
| -rw-r--r-- | apps/plugins/rockboy/cpu.c | 10 | ||||
| -rw-r--r-- | apps/plugins/rockboy/lcd.c | 4 | ||||
| -rw-r--r-- | apps/plugins/rockboy/sound.c | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/apps/plugins/rockboy/cpu.c b/apps/plugins/rockboy/cpu.c index 1aca06f..2fc7411 100644 --- a/apps/plugins/rockboy/cpu.c +++ b/apps/plugins/rockboy/cpu.c @@ -147,9 +147,9 @@ F = (F & (FN)) | ZFLAG(A) | daa_carry_table[LB(acc)>>2]; } (r) = swap_table[(r)]; \ F = ZFLAG((r)); } -#define BIT(n,r) { F = (F & FC) | ZFLAG(((r) & (1 << (n)))) | FH; } -#define RES(n,r) { (r) &= ~(1 << (n)); } -#define SET(n,r) { (r) |= (1 << (n)); } +#define BIT(n,r) { F = (F & FC) | ZFLAG(((r) & BIT_N(n))) | FH; } +#define RES(n,r) { (r) &= ~BIT_N(n); } +#define SET(n,r) { (r) |= BIT_N(n); } #define CB_REG_CASES(r, n) \ case 0x00|(n): RLC(r); break; \ @@ -225,7 +225,7 @@ label: op(b); break; #define PRE_INT ( DI, PUSH(PC) ) -#define THROW_INT(n) ( (IF &= ~(1<<(n))), (PC = 0x40+((n)<<3)) ) +#define THROW_INT(n) ( (IF &= ~BIT_N(n)), (PC = 0x40+((n)<<3)) ) #ifdef DYNAREC un32 reg_backup[16]; @@ -355,7 +355,7 @@ static int cpu_idle(int max) /* Figure out when the next timer interrupt will happen */ unit = ((-R_TAC) & 3) << 1; - cnt = (511 - cpu.tim + (1<<unit)) >> unit; + cnt = (511 - cpu.tim + BIT_N(unit)) >> unit; cnt += (255 - R_TIMA) << (9 - unit); if (max < cnt) diff --git a/apps/plugins/rockboy/lcd.c b/apps/plugins/rockboy/lcd.c index da3b138..372e9e0 100644 --- a/apps/plugins/rockboy/lcd.c +++ b/apps/plugins/rockboy/lcd.c @@ -216,8 +216,8 @@ static void updatepatpix(void) a = ((i<<4) | (j<<1)); for (k = 0; k < 8; k++) { - c = vram[a] & (1<<k) ? 1 : 0; - c |= vram[a+1] & (1<<k) ? 2 : 0; + c = vram[a] & BIT_N(k) ? 1 : 0; + c |= vram[a+1] & BIT_N(k) ? 2 : 0; patpix[i+1024][j][k] = c; } for (k = 0; k < 8; k++) diff --git a/apps/plugins/rockboy/sound.c b/apps/plugins/rockboy/sound.c index 041b783..6efc01b 100644 --- a/apps/plugins/rockboy/sound.c +++ b/apps/plugins/rockboy/sound.c @@ -182,7 +182,7 @@ static void gbSoundChannel1(int *r, int *l) int newfreq = 0; if(S1.swsteps) { - newfreq = freq + updown * freq / (1 << S1.swsteps); + newfreq = freq + updown * freq / BIT_N(S1.swsteps); if(newfreq == freq) newfreq = 0; } |