Merge pull request #126 from Eugene8388608/master

Waveform was rotated 180 degrees and local code cleanup
This commit is contained in:
Sam Ellicott 2021-11-24 11:44:03 -05:00 committed by GitHub
commit e7c3c6c362
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -516,18 +516,15 @@ int main( int argc, char **argv )
CNFGColor( LINE_COLOR ); CNFGColor( LINE_COLOR );
// Let's draw the o-scope. // Let's draw the o-scope.
int thissoundhead = soundhead; int lasty;
thissoundhead = ( thissoundhead - 1 + SOUNDCBSIZE ) % SOUNDCBSIZE; int thissoundhead = ( soundhead - 1 + SOUNDCBSIZE ) % SOUNDCBSIZE;
int lasty = sound[ thissoundhead ] * 128 + 128; int thisy = sound[ thissoundhead ] * -128 + 128;
thissoundhead = ( thissoundhead - 1 + SOUNDCBSIZE ) % SOUNDCBSIZE; for ( int i = screenx - 1; i > 0; i-- )
int thisy = sound[ thissoundhead ] * 128 + 128;
thissoundhead = ( thissoundhead - 1 + SOUNDCBSIZE ) % SOUNDCBSIZE;
for ( int i = 0; i < screenx; i++ )
{ {
CNFGTackSegment( i, lasty, i + 1, thisy );
lasty = thisy; lasty = thisy;
thisy = sound[ thissoundhead ] * 128 + 128;
thissoundhead = ( thissoundhead - 1 + SOUNDCBSIZE ) % SOUNDCBSIZE; thissoundhead = ( thissoundhead - 1 + SOUNDCBSIZE ) % SOUNDCBSIZE;
thisy = sound[ thissoundhead ] * -128 + 128;
CNFGTackSegment( i, lasty, i - 1, thisy );
} }
} }