infoprint, FDS moviefix, alignment bugfixing
[fceu.git] / nsf.c
diff --git a/nsf.c b/nsf.c
index cff242b..ea77c6a 100644 (file)
--- a/nsf.c
+++ b/nsf.c
@@ -100,7 +100,7 @@ static NSF_HEADER NSFHeader;
 void NSFMMC5_Close(void);\r
 static uint8 *ExWRAM=0;\r
 \r
-void NSFGI(int h)\r
+void NSFGI(int h, void *param)\r
 {\r
  switch(h)\r
  {\r
@@ -123,6 +123,9 @@ void NSFGI(int h)
   break;\r
  case GI_RESETM2:\r
  case GI_POWER: NSF_init();break;\r
+ case GI_INFOSTRING:\r
+  sprintf(param, "NSF, %s", PAL?"PAL":"NTSC");\r
+  break;\r
  }\r
 }\r
 \r
@@ -403,6 +406,7 @@ static int special=0;
 void DrawNSF(uint8 *XBuf)\r
 {\r
  char snbuf[16];\r
+ int32 mul=0;\r
  int x;\r
 \r
  if(vismode==0) return;\r
@@ -410,17 +414,17 @@ void DrawNSF(uint8 *XBuf)
  for (x=0;x<240;x++)\r
   memset(XBuf+SCREEN_OFFS+x*SCREEN_WIDTH,0,256);\r
 \r
+ if(FSettings.SoundVolume)\r
+  mul=8192*240/(16384*FSettings.SoundVolume/50)/8;\r
+\r
  {\r
-  int32 *Bufpl;\r
-  int32 mul=0;\r
+  int16 *Bufpl;\r
 \r
   int l;\r
   l=GetSoundBuffer(&Bufpl);\r
 \r
   if(special==0)\r
   {\r
-   if(FSettings.SoundVolume)\r
-    mul=8192*240/(16384*FSettings.SoundVolume/50);\r
    for(x=0;x<256;x++)\r
    {\r
     uint32 y;\r
@@ -431,8 +435,6 @@ void DrawNSF(uint8 *XBuf)
   }\r
   else if(special==1)\r
   {\r
-   if(FSettings.SoundVolume)\r
-    mul=8192*240/(8192*FSettings.SoundVolume/50);\r
    for(x=0;x<256;x++)\r
    {\r
     double r;\r
@@ -449,8 +451,6 @@ void DrawNSF(uint8 *XBuf)
   else if(special==2)\r
   {\r
    static double theta=0;\r
-   if(FSettings.SoundVolume)\r
-    mul=8192*240/(16384*FSettings.SoundVolume/50);\r
    for(x=0;x<128;x++)\r
    {\r
     double xc,yc;\r