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