summaryrefslogtreecommitdiff
path: root/apps/plugins/rockboy
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/rockboy')
-rw-r--r--apps/plugins/rockboy/cpu.c10
-rw-r--r--apps/plugins/rockboy/lcd.c4
-rw-r--r--apps/plugins/rockboy/sound.c2
3 files changed, 8 insertions, 8 deletions
diff --git a/apps/plugins/rockboy/cpu.c b/apps/plugins/rockboy/cpu.c
index 1aca06f337..2fc7411411 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]; }
147(r) = swap_table[(r)]; \ 147(r) = swap_table[(r)]; \
148F = ZFLAG((r)); } 148F = ZFLAG((r)); }
149 149
150#define BIT(n,r) { F = (F & FC) | ZFLAG(((r) & (1 << (n)))) | FH; } 150#define BIT(n,r) { F = (F & FC) | ZFLAG(((r) & BIT_N(n))) | FH; }
151#define RES(n,r) { (r) &= ~(1 << (n)); } 151#define RES(n,r) { (r) &= ~BIT_N(n); }
152#define SET(n,r) { (r) |= (1 << (n)); } 152#define SET(n,r) { (r) |= BIT_N(n); }
153 153
154#define CB_REG_CASES(r, n) \ 154#define CB_REG_CASES(r, n) \
155case 0x00|(n): RLC(r); break; \ 155case 0x00|(n): RLC(r); break; \
@@ -225,7 +225,7 @@ label: op(b); break;
225 225
226 226
227#define PRE_INT ( DI, PUSH(PC) ) 227#define PRE_INT ( DI, PUSH(PC) )
228#define THROW_INT(n) ( (IF &= ~(1<<(n))), (PC = 0x40+((n)<<3)) ) 228#define THROW_INT(n) ( (IF &= ~BIT_N(n)), (PC = 0x40+((n)<<3)) )
229 229
230#ifdef DYNAREC 230#ifdef DYNAREC
231un32 reg_backup[16]; 231un32 reg_backup[16];
@@ -355,7 +355,7 @@ static int cpu_idle(int max)
355 355
356 /* Figure out when the next timer interrupt will happen */ 356 /* Figure out when the next timer interrupt will happen */
357 unit = ((-R_TAC) & 3) << 1; 357 unit = ((-R_TAC) & 3) << 1;
358 cnt = (511 - cpu.tim + (1<<unit)) >> unit; 358 cnt = (511 - cpu.tim + BIT_N(unit)) >> unit;
359 cnt += (255 - R_TIMA) << (9 - unit); 359 cnt += (255 - R_TIMA) << (9 - unit);
360 360
361 if (max < cnt) 361 if (max < cnt)
diff --git a/apps/plugins/rockboy/lcd.c b/apps/plugins/rockboy/lcd.c
index da3b138e51..372e9e0736 100644
--- a/apps/plugins/rockboy/lcd.c
+++ b/apps/plugins/rockboy/lcd.c
@@ -216,8 +216,8 @@ static void updatepatpix(void)
216 a = ((i<<4) | (j<<1)); 216 a = ((i<<4) | (j<<1));
217 for (k = 0; k < 8; k++) 217 for (k = 0; k < 8; k++)
218 { 218 {
219 c = vram[a] & (1<<k) ? 1 : 0; 219 c = vram[a] & BIT_N(k) ? 1 : 0;
220 c |= vram[a+1] & (1<<k) ? 2 : 0; 220 c |= vram[a+1] & BIT_N(k) ? 2 : 0;
221 patpix[i+1024][j][k] = c; 221 patpix[i+1024][j][k] = c;
222 } 222 }
223 for (k = 0; k < 8; k++) 223 for (k = 0; k < 8; k++)
diff --git a/apps/plugins/rockboy/sound.c b/apps/plugins/rockboy/sound.c
index 041b7831d3..6efc01b11c 100644
--- a/apps/plugins/rockboy/sound.c
+++ b/apps/plugins/rockboy/sound.c
@@ -182,7 +182,7 @@ static void gbSoundChannel1(int *r, int *l)
182 int newfreq = 0; 182 int newfreq = 0;
183 if(S1.swsteps) 183 if(S1.swsteps)
184 { 184 {
185 newfreq = freq + updown * freq / (1 << S1.swsteps); 185 newfreq = freq + updown * freq / BIT_N(S1.swsteps);
186 if(newfreq == freq) 186 if(newfreq == freq)
187 newfreq = 0; 187 newfreq = 0;
188 } 188 }