MCPcopy Create free account
hub / github.com/TASEmulators/fceux / DrawNSF

Function DrawNSF

src/nsf.cpp:484–627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

482static int special=0;
483
484void DrawNSF(uint8 *XBuf)
485{
486 char snbuf[16];
487 int x;
488
489 if(vismode==0) return;
490
491 memset(XBuf,0,256*240);
492 memset(XDBuf,0,256*240);
493
494
495 {
496 int32 *Bufpl;
497 int32 mul=0;
498
499 int l;
500 l=GetSoundBuffer(&Bufpl);
501
502 if(special==0)
503 {
504 if(FSettings.SoundVolume)
505 mul=8192*240/(16384*FSettings.SoundVolume/50);
506 for(x=0;x<256;x++)
507 {
508 uint32 y;
509 y=142+((Bufpl[(x*l)>>8]*mul)>>14);
510 if(y<240)
511 XBuf[x+y*256]=3;
512 }
513 }
514 else if(special==1)
515 {
516 if(FSettings.SoundVolume)
517 mul=8192*240/(8192*FSettings.SoundVolume/50);
518 for(x=0;x<256;x++)
519 {
520 double r;
521 uint32 xp,yp;
522
523 r=(Bufpl[(x*l)>>8]*mul)>>14;
524 xp=128+r*cos(x*M_PI*2/256);
525 yp=120+r*sin(x*M_PI*2/256);
526 xp&=255;
527 yp%=240;
528 XBuf[xp+yp*256]=3;
529 }
530 }
531 else if(special==2)
532 {
533 static double theta=0;
534 if(FSettings.SoundVolume)
535 mul=8192*240/(16384*FSettings.SoundVolume/50);
536 for(x=0;x<128;x++)
537 {
538 double xc,yc;
539 double r,t;
540 uint32 m,n;
541

Callers 1

FCEU_PutImageFunction · 0.85

Calls 3

GetSoundBufferFunction · 0.85
DrawTextTransFunction · 0.85
FCEU_GetJoyJoyFunction · 0.85

Tested by

no test coverage detected