Previous Thread
Next Thread
Print Thread
Page 6 of 55 1 2 4 5 6 7 8 54 55
Joined: Mar 2001
Posts: 17,215
Likes: 234
R
Very Senior Member
OP Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 17,215
Likes: 234
I don't hear anything wrong with either of those songs compared to the Windows reference player.

Joined: Mar 2004
Posts: 698
Likes: 2
Senior Member
Offline
Senior Member
Joined: Mar 2004
Posts: 698
Likes: 2
Ahh, right. Something really bad happened to my headphones...

Joined: Sep 2007
Posts: 56
K
Member
Offline
Member
K
Joined: Sep 2007
Posts: 56
I just discovered two lines that aren't necessary in the FM code. More importantly, removing these two lines fixes some problems resulting from me not sanity-checking the cycle length (I don't advise playing Guardian Force in the 0.122u5 version of MAME - it has a tendency to enter an infinite loop after pressing start on the title screen).

Patch:
Code
diff -Nru aosdk_base/eng_ssf/scsp.c aosdk/eng_ssf/scsp.c
--- aosdk_base/eng_ssf/scsp.c	2008-01-13 00:54:50.000000000 -0800
+++ aosdk/eng_ssf/scsp.c	2008-01-13 00:54:35.000000000 -0800
@@ -1122,11 +1122,9 @@
 	if(MDL(slot)!=0 || MDXSL(slot)!=0 || MDYSL(slot)!=0)
 	{
 		INT32 smp=(SCSP->RINGBUF[(SCSP->BUFPTR+MDXSL(slot))&63]+SCSP->RINGBUF[(SCSP->BUFPTR+MDYSL(slot))&63])/2;
-		INT32 cycle=LEA(slot)-LSA(slot); // cycle corresponds to 2 pi
 
 		smp<<=0xA; // associate cycle with 1024
 		smp>>=0x1A-MDL(slot); // ex. for MDL=0xF, sample range corresponds to +/- 64 pi (32=2^5 cycles) so shift by 11 (16-5 == 0x1A-0xF)
-		while(smp<0) smp+=cycle; smp%=cycle; // keep modulation sampler within a single cycle
 		if(!PCM8B(slot)) smp<<=1;
 		
 		addr1+=smp; addr2+=smp;


Sorry about that.

Joined: Mar 2001
Posts: 17,215
Likes: 234
R
Very Senior Member
OP Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 17,215
Likes: 234
Thanks, submitted.

Joined: Mar 2001
Posts: 17,215
Likes: 234
R
Very Senior Member
OP Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 17,215
Likes: 234
The SDK is updated again.

This has the latest SCSP stuff plus time and fade tag support for SSF files.

Joined: Oct 2002
Posts: 1,017
M
Senior Member
Offline
Senior Member
M
Joined: Oct 2002
Posts: 1,017
Wahey, still can't view the page, redirected to Google regardless of copy/pasting the link.

Joined: Sep 2007
Posts: 56
K
Member
Offline
Member
K
Joined: Sep 2007
Posts: 56
I've finally resolved most of the remaining pitch issues in the SCSP emulation. What was happening was that the remaining fractional play position was not being carried over upon crossing over LSA/LEA resulting in an overall lower pitch for looped samples.

Patch against AOSDK 1.3:

Code
diff -Nru aosdk_base/eng_ssf/scsp.c aosdk/eng_ssf/scsp.c
--- aosdk_base/eng_ssf/scsp.c	2008-01-13 15:33:54.000000000 -0800
+++ aosdk/eng_ssf/scsp.c	2008-01-19 03:45:38.000000000 -0800
@@ -36,7 +36,7 @@
 
 
 #define EG_SHIFT	16
-#define FM_DELAY    4    // delay in number of slots processed before samples are written to the FM ring buffer
+#define FM_DELAY    0   // delay in number of slots processed before samples are written to the FM ring buffer
 
 // include the LFO handling code
 #include "scsplfo.c"
@@ -939,6 +939,7 @@
 	
 	for (addr_select=0;addr_select<2;addr_select++)
 	{
+		INT32 rem_addr;
 		switch(LPCTL(slot))
 		{
 		case 0:	//no loop
@@ -950,26 +951,35 @@
 			break;
 		case 1: //normal loop
 			if(*addr[addr_select]>=LEA(slot))
-				*slot_addr[addr_select]=LSA(slot)<<SHIFT;
+			{
+				rem_addr = *slot_addr[addr_select] - (LEA(slot)<<SHIFT);
+				*slot_addr[addr_select]=(LSA(slot)<<SHIFT) + rem_addr;
+			}
 			break;
 		case 2:	//reverse loop
 			if((*addr[addr_select]>=LSA(slot)) && !(slot->Backwards))
 			{
-				*slot_addr[addr_select]=LEA(slot)<<SHIFT;
+				rem_addr = *slot_addr[addr_select] - (LSA(slot)<<SHIFT);
+				*slot_addr[addr_select]=(LEA(slot)<<SHIFT) - rem_addr;
 				slot->Backwards=1;
 			}
-			if((*addr[addr_select]<=LSA(slot) || (*slot_addr[addr_select]&0x80000000)) && slot->Backwards)
-				*slot_addr[addr_select]=LEA(slot)<<SHIFT;
+			else if((*addr[addr_select]<LSA(slot) || (*slot_addr[addr_select]&0x80000000)) && slot->Backwards)
+			{
+				rem_addr = (LSA(slot)<<SHIFT) - *slot_addr[addr_select];
+				*slot_addr[addr_select]=(LEA(slot)<<SHIFT) - rem_addr;
+			}
 			break;
 		case 3: //ping-pong
 			if(*addr[addr_select]>=LEA(slot)) //reached end, reverse till start
 			{
-				*slot_addr[addr_select]=LEA(slot)<<SHIFT;
+				rem_addr = *slot_addr[addr_select] - (LEA(slot)<<SHIFT); 
+				*slot_addr[addr_select]=(LEA(slot)<<SHIFT) - rem_addr;
 				slot->Backwards=1;
 			}
-			if((*addr[addr_select]<=LSA(slot) || (*slot_addr[addr_select]&0x80000000)) && slot->Backwards)//reached start or negative
+			else if((*addr[addr_select]<LSA(slot) || (*slot_addr[addr_select]&0x80000000)) && slot->Backwards)//reached start or negative
 			{
-				*slot_addr[addr_select]=LSA(slot)<<SHIFT;
+				rem_addr = (LSA(slot)<<SHIFT) - *slot_addr[addr_select];
+				*slot_addr[addr_select]=(LSA(slot)<<SHIFT) + rem_addr;
 				slot->Backwards=0;
 			}
 			break;

Joined: Mar 2001
Posts: 17,215
Likes: 234
R
Very Senior Member
OP Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 17,215
Likes: 234
Ahh, that makes sense. Did you intend to turn off FM_DELAY too?

Joined: Sep 2007
Posts: 56
K
Member
Offline
Member
K
Joined: Sep 2007
Posts: 56
Oh yeah, I did since the FM sounds better with it off. Turning the delay up causes distortion in some of the FM samples, which is strange because the driver swaps intermediate MDXSL/MDYSL values of 0x1C-0x1F with 0x3C-0x3F, indicating a delay of 4 slots.

Joined: Mar 2001
Posts: 17,215
Likes: 234
R
Very Senior Member
OP Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 17,215
Likes: 234
Weird. Ok, thanks!

Page 6 of 55 1 2 4 5 6 7 8 54 55

Moderated by  R. Belmont, Richard Bannister 

Link Copied to Clipboard
Who's Online Now
2 members (Kale, 1 invisible), 233 guests, and 1 robot.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics9,320
Posts121,923
Members5,074
Most Online1,283
Dec 21st, 2022
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com