aboutsummaryrefslogtreecommitdiffstats
path: root/demos/modules/gaudio/oscilloscope/gwinosc.c
diff options
context:
space:
mode:
Diffstat (limited to 'demos/modules/gaudio/oscilloscope/gwinosc.c')
-rw-r--r--demos/modules/gaudio/oscilloscope/gwinosc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/demos/modules/gaudio/oscilloscope/gwinosc.c b/demos/modules/gaudio/oscilloscope/gwinosc.c
index 9d095c86..6b51232b 100644
--- a/demos/modules/gaudio/oscilloscope/gwinosc.c
+++ b/demos/modules/gaudio/oscilloscope/gwinosc.c
@@ -144,10 +144,10 @@ void gwinScopeWaitForTrace(GHandle gh) {
scopemin = 0;
#endif
- for(i = paud->len/(gfxSampleFormatBits(gs->format)/8); i; i--) {
+ for(i = paud->len/((gfxSampleFormatBits(gs->format)+7)/8); i; i--) {
/* Calculate the new scope value - re-scale using simple shifts for efficiency, re-center and y-invert */
- if (gs->format <= 8)
+ if (gfxSampleFormatBits(gs->format) <= 8)
y = yoffset - (((coord_t)(*pa8++ ) << shr) >> (16-SCOPE_Y_BITS));
else
y = yoffset - (((coord_t)(*pa16++) << shr) >> (16-SCOPE_Y_BITS));