summaryrefslogtreecommitdiff
path: root/apps/plugins/rockboy
diff options
context:
space:
mode:
Diffstat (limited to 'apps/plugins/rockboy')
-rw-r--r--apps/plugins/rockboy/cpu.c3
-rw-r--r--apps/plugins/rockboy/lcd.c33
-rw-r--r--apps/plugins/rockboy/sound.c5
3 files changed, 20 insertions, 21 deletions
diff --git a/apps/plugins/rockboy/cpu.c b/apps/plugins/rockboy/cpu.c
index f1926fe421..1aca06f337 100644
--- a/apps/plugins/rockboy/cpu.c
+++ b/apps/plugins/rockboy/cpu.c
@@ -333,6 +333,8 @@ void cpu_timers(int cnt)
333 333
334static int cpu_idle(int max) 334static int cpu_idle(int max)
335{ 335{
336 int cnt, unit;
337
336 if (!(cpu.halt && IME)) return 0; 338 if (!(cpu.halt && IME)) return 0;
337 if (R_IF & R_IE) 339 if (R_IF & R_IE)
338 { 340 {
@@ -351,7 +353,6 @@ static int cpu_idle(int max)
351 return max; 353 return max;
352 } 354 }
353 355
354 int cnt, unit;
355 /* Figure out when the next timer interrupt will happen */ 356 /* Figure out when the next timer interrupt will happen */
356 unit = ((-R_TAC) & 3) << 1; 357 unit = ((-R_TAC) & 3) << 1;
357 cnt = (511 - cpu.tim + (1<<unit)) >> unit; 358 cnt = (511 - cpu.tim + (1<<unit)) >> unit;
diff --git a/apps/plugins/rockboy/lcd.c b/apps/plugins/rockboy/lcd.c
index f62e3a9ce3..da3b138e51 100644
--- a/apps/plugins/rockboy/lcd.c
+++ b/apps/plugins/rockboy/lcd.c
@@ -64,7 +64,7 @@ fb_data *vdest;
64static void updatepatpix(void) ICODE_ATTR; 64static void updatepatpix(void) ICODE_ATTR;
65static void updatepatpix(void) 65static void updatepatpix(void)
66{ 66{
67 int i; 67 int i, j;
68#if ((CONFIG_CPU != SH7034) && !defined(CPU_COLDFIRE)) 68#if ((CONFIG_CPU != SH7034) && !defined(CPU_COLDFIRE))
69 int k, a, c; 69 int k, a, c;
70#endif 70#endif
@@ -73,12 +73,10 @@ static void updatepatpix(void)
73 if (!anydirty) return; 73 if (!anydirty) return;
74 for (i = 0; i < 1024; i++) 74 for (i = 0; i < 1024; i++)
75 { 75 {
76 int j;
77 if (i == 384) i = 512; 76 if (i == 384) i = 512;
78 if (i == 896) break; 77 if (i == 896) break;
79 if (!patdirty[i]) continue; 78 if (!patdirty[i]) continue;
80 patdirty[i] = 0; 79 patdirty[i] = 0;
81
82 for (j = 0; j < 8; j++) 80 for (j = 0; j < 8; j++)
83 { 81 {
84#if CONFIG_CPU == SH7034 82#if CONFIG_CPU == SH7034
@@ -378,8 +376,8 @@ static void tilebuf(void)
378 int base; 376 int base;
379 byte *tilemap, *attrmap; 377 byte *tilemap, *attrmap;
380 int *tilebuf; 378 int *tilebuf;
381 const int *wrap; 379 int *wrap;
382 static const int wraptable[64] ICONST_ATTR = 380 static int wraptable[64] =
383 { 381 {
384 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 382 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,
385 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,-32 383 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,-32
@@ -780,11 +778,11 @@ static void spr_enum(void)
780static void spr_scan(void) ICODE_ATTR; 778static void spr_scan(void) ICODE_ATTR;
781static void spr_scan(void) 779static void spr_scan(void)
782{ 780{
783 int i; 781 int i, x;
784 byte ns = NS; 782 byte pal, b, ns = NS;
785 byte *src, *dest; 783 byte *src, *dest, *bg, *pri;
786 struct vissprite *vs; 784 struct vissprite *vs;
787 static byte bgdup[256] IBSS_ATTR; 785 static byte bgdup[256];
788 786
789 if (!ns) return; 787 if (!ns) return;
790 788
@@ -793,8 +791,7 @@ static void spr_scan(void)
793 791
794 for (; ns; ns--, vs--) 792 for (; ns; ns--, vs--)
795 { 793 {
796 int x = vs->x; 794 x = vs->x;
797
798 if (x > 159) continue; 795 if (x > 159) continue;
799 if (x < -7) continue; 796 if (x < -7) continue;
800 if (x < 0) 797 if (x < 0)
@@ -810,25 +807,23 @@ static void spr_scan(void)
810 if (x > 152) i = 160 - x; 807 if (x > 152) i = 160 - x;
811 else i = 8; 808 else i = 8;
812 } 809 }
813 810 pal = vs->pal;
814 byte pal = vs->pal;
815
816 if (vs->pri) 811 if (vs->pri)
817 { 812 {
818 byte *bg = bgdup + (dest - BUF); 813 bg = bgdup + (dest - BUF);
819 while (i--) 814 while (i--)
820 { 815 {
821 byte b = src[i]; 816 b = src[i];
822 if (b && !(bg[i]&3)) dest[i] = pal|b; 817 if (b && !(bg[i]&3)) dest[i] = pal|b;
823 } 818 }
824 } 819 }
825 else if (hw.cgb) 820 else if (hw.cgb)
826 { 821 {
827 byte *bg = bgdup + (dest - BUF); 822 bg = bgdup + (dest - BUF);
828 byte *pri = PRI + (dest - BUF); 823 pri = PRI + (dest - BUF);
829 while (i--) 824 while (i--)
830 { 825 {
831 byte b = src[i]; 826 b = src[i];
832 if (b && (!pri[i] || !(bg[i]&3))) 827 if (b && (!pri[i] || !(bg[i]&3)))
833 dest[i] = pal|b; 828 dest[i] = pal|b;
834 } 829 }
diff --git a/apps/plugins/rockboy/sound.c b/apps/plugins/rockboy/sound.c
index c1b06a1bd7..041b7831d3 100644
--- a/apps/plugins/rockboy/sound.c
+++ b/apps/plugins/rockboy/sound.c
@@ -116,6 +116,9 @@ struct snd snd IBSS_ATTR;
116static void gbSoundChannel1(int *r, int *l) 116static void gbSoundChannel1(int *r, int *l)
117{ 117{
118 int vol = S1.envol; 118 int vol = S1.envol;
119
120 int freq = 0;
121
119 int value = 0; 122 int value = 0;
120 123
121 if(S1.on && (S1.len || !S1.cont)) 124 if(S1.on && (S1.len || !S1.cont))
@@ -169,7 +172,7 @@ static void gbSoundChannel1(int *r, int *l)
169 172
170 if(S1.swlen<=0) 173 if(S1.swlen<=0)
171 { 174 {
172 int freq = (((int)(R_NR14&7) << 8) | R_NR13); 175 freq = (((int)(R_NR14&7) << 8) | R_NR13);
173 176
174 int updown = 1; 177 int updown = 1;
175 178