Perfect FDS 2C33 audio when not using actual FDS disks?

Discuss hardware-related topics, such as development cartridges, CopyNES, PowerPak, EPROMs, or whatever.

Moderators: B00daW, Moderators

Pokun
Posts: 1312
Joined: Tue May 28, 2013 5:49 am
Location: Hokkaido, Japan

Re: Perfect FDS 2C33 audio when not using actual FDS disks?

Post by Pokun » Fri Jul 31, 2015 11:42 pm

Yeah I heard the number of presses is an absolute code as opposed to relative from where you are (in other words you always press twice for side 2 no matter on which side you are). I like that.
ccovell wrote:I generally have this code so that my program doesn't suddenly reset to the FDS menu on NMI, IRQ, or reset:

Code: Select all

FDS_HOOK
...
And perhaps this will help too?

Code: Select all

	.org $DFF6
	.dw NMI_SUB
	.dw NMI_SUB
	.dw NMI_SUB
	.dw Reset_SUB
	.dw IRQ_SUB
You didn't have enough vectors in the right place.
Oh right there are three NMI vectors. Thanks!
I added them and the FDS_HOOK code (I'm not sure what you mean, would it reset to BIOS just like that?) but it still doesn't work. It seems there aren't anything FDS specific needed in the main program so maybe the problem is in the header.

Overload
Posts: 47
Joined: Mon May 30, 2011 4:38 pm
Location: Australia
Contact:

Re: Perfect FDS 2C33 audio when not using actual FDS disks?

Post by Overload » Sun Aug 02, 2015 5:21 am

Lord Nightmare wrote:
loopy wrote: The 2c33 can verify the CRC16, but you still read it off the disk like normal data. No weird tricks necessary (you can't seek backwards, btw).
So the crc16 is readable from the famicom/nes side? Interesting.
And by 'seek backward' I mean enable the motor right after it gets disabled and the head starts to swings back over the disk to the beginning, so the motor gets turned on and the gear re-engages before the head has fully retracted to the beginning, so you end up starting to read data somewhere random in the middle of the disk (I can't imagine this sort of shenanigans is good for the gears though, nor do I know if it will even work, there may be protections against the head re-engaging the motor unless it has fully retracted)

LN
The CRC check is simple :wink:

Each bit read is passed into the CRC calculator of the 2C33.
When the 2C33 is instructed to seek the start of a new block, the CRC is reset to zero (0).
Once the CRC becomes non-zero the 2C33 will begin collecting data.
Normally the 2C33 is instructed to seek the next block within a gap between blocks.
While in the gap each bit read will be zero (0) and while the CRC is zero (0) it will have no effect on it.

The first non-zero bit in the stream will determine the start of a block.
A status flag ($4030.4) will also be set if the CRC is non-zero.
Data is read until the end of the block.
The block length in all cases is determined either by the block ID or by the previous block and two data bytes will follow.
The purpose of these two bytes are to bring the CRC back to zero.
If the status flag ($4030.4) is set after these two bytes are read, the CRC is non-zero and the read has failed (error 27)

Code: Select all

PROCEDURE update_crc(bit: Byte);
ASM
        AND     AX, 01H
        XOR     crc16, AX
        SHR     crc16, 1
        SBB     DX, DX
        AND     DX, 8408H
        XOR     crc16, DX
END;
This is the correct CRC calculator.

Since there is no standard block size, it is up to the software to determine if there has been a read error.

Lord Nightmare
Posts: 129
Joined: Wed Apr 05, 2006 10:12 am
Location: PA, USA
Contact:

Re: Perfect FDS 2C33 audio when not using actual FDS disks?

Post by Lord Nightmare » Sun Aug 02, 2015 8:59 pm

Overload wrote:

Code: Select all

PROCEDURE update_crc(bit: Byte);
ASM
        AND     AX, 01H
        XOR     crc16, AX
        SHR     crc16, 1
        SBB     DX, DX
        AND     DX, 8408H
        XOR     crc16, DX
END;
This is the correct CRC calculator.

Since there is no standard block size, it is up to the software to determine if there has been a read error.
Ok so in C, that would be:

Code: Select all

int crc16 = 0; // global counter
void updatecrc(int shifterContents) // shifterContents is the most recent 8 bits shifted in by the read head, lowest bit is the 'new bit'
{
int newbit = shifterContents&1;
crc16 ^= newbit;
crc16 >>= 1;
crc16 ^= 0x8408;
}
I'm not quite sure I 'get' what you're doing with SBB and DX, it looks like subtracting something from itself with borrow, I'm assuming that is a clever way to load DX with the constant 0xFFFF? wouldn't it be simpler to just MOV the constant 0x8408 to DX?


Edit: oh wait, NOW I see what you're doing! SBB DX,DX borrows if the prior opcode carried (i.e. if the shift off to the right had a 1 bit in it), so you get 0x0000 if the carry flag is 0, or 0xFFFF if it is 1. cute!

Code: Select all

int crc16 = 0; // global counter
void updatecrc(int shifterContents) // shifterContents is the most recent 8 bits shifted in by the read head, lowest bit is the 'new bit'
{
int newbit = shifterContents&1;
crc16 ^= newbit;
if (crc16&1) {
crc16 >>= 1;
crc16 ^= 0x8408;
}
else
{
crc16 >>= 1;
}
}

LN
Last edited by Lord Nightmare on Sun Aug 02, 2015 9:19 pm, edited 1 time in total.
"When life gives you zombies... *CHA-CHIK!* ...you make zombie-ade!"

lidnariq
Posts: 8936
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: Perfect FDS 2C33 audio when not using actual FDS disks?

Post by lidnariq » Sun Aug 02, 2015 9:02 pm

Lord Nightmare wrote:I'm not quite sure I 'get' what you're doing with SBB and DX, it looks like subtracting something from itself with borrow, I'm assuming that is a clever way to load DX with the constant 0xFFFF?
SBB reg,self will set reg to 0xFFFF or 0 depending on the value of the carry/borrow flag. The whole thing is a way to avoid a branch prediction failure, which ... since this is an LFSR/CRC, the branch will be taken about 50% of the time.

Lord Nightmare
Posts: 129
Joined: Wed Apr 05, 2006 10:12 am
Location: PA, USA
Contact:

Re: Perfect FDS 2C33 audio when not using actual FDS disks?

Post by Lord Nightmare » Sun Aug 02, 2015 9:28 pm

lidnariq wrote:
Lord Nightmare wrote:I'm not quite sure I 'get' what you're doing with SBB and DX, it looks like subtracting something from itself with borrow, I'm assuming that is a clever way to load DX with the constant 0xFFFF?
SBB reg,self will set reg to 0xFFFF or 0 depending on the value of the carry/borrow flag. The whole thing is a way to avoid a branch prediction failure, which ... since this is an LFSR/CRC, the branch will be taken about 50% of the time.
Yeah, I see, I had an edit dialog up while you did your post. I've updated mine above with correct info.

LN
"When life gives you zombies... *CHA-CHIK!* ...you make zombie-ade!"

Hubz
Posts: 19
Joined: Sun May 04, 2014 4:16 pm

Re: Perfect FDS 2C33 audio when not using actual FDS disks?

Post by Hubz » Mon Aug 17, 2015 3:36 pm

I went ahead and just purchased one of these. Thanks for your hard work Loopy!

I mainly purchased it to dump games. With this I should be able to dump sealed games perfectly with the CRC and gap data correct? I've got a few sealed games already and may work on getting more picked up so we can have these FDS games preserved even better than before.

User avatar
loopy
Posts: 394
Joined: Sun Sep 19, 2004 10:52 pm
Location: UT

Re: Perfect FDS 2C33 audio when not using actual FDS disks?

Post by loopy » Tue Aug 18, 2015 6:35 am

Hubz wrote:I mainly purchased it to dump games. With this I should be able to dump sealed games perfectly with the CRC and gap data correct? I've got a few sealed games already and may work on getting more picked up so we can have these FDS games preserved even better than before.
Yes, you can get a raw dump with CRCs and all.

Tomy
Posts: 51
Joined: Sat May 06, 2006 9:19 am
Contact:

FDS Copy Master v1.1 image (non modify) (Drive speed tuning)

Post by Tomy » Sat Aug 22, 2015 6:35 am

Copy Master software original from BUNG cracked by Me. (Keep original, no any modify). This fds image is doctor format (copier format). So, you need fds copier to run it. Download from fdsstick.com

Because I'm the FDSSTICK reseller, I made a website http://www.fdsstick.com
It is unofficial fdsstick website. Loopy haven't join it yet. I'll keep release something. :D

At the moment, fdsstick not support file bigger than 64K per side. But if docter format image smaller than 64K. It is supported.
Waitting Loopy update firmware or fdsstick 8M version.

If you only need normal fds game support, fdsstick 4M version already perfect.

Hubz
Posts: 19
Joined: Sun May 04, 2014 4:16 pm

Re: Perfect FDS 2C33 audio when not using actual FDS disks?

Post by Hubz » Sat Aug 22, 2015 12:56 pm

Can anybody make a cable for me and I'll buy it? I had some AV cables but none have enough pins. I'm guessing the SCART is the only one that has them.

Hubz
Posts: 19
Joined: Sun May 04, 2014 4:16 pm

Re: Perfect FDS 2C33 audio when not using actual FDS disks?

Post by Hubz » Mon Aug 24, 2015 9:49 am

Managed to get one whipped up and I think once I'm done dumping i'll be able to salvage it for my FDS RAM Adapter.

Works great! I have gotten dumps of various brand new games in both raw and FDS. The only thing I wondered about was I keep getting wrong block types with FDS dumps a majority of the time. However loading the game up in an emulator and it seems to play fine. Is that anything I should be concerned with?

User avatar
loopy
Posts: 394
Joined: Sun Sep 19, 2004 10:52 pm
Location: UT

Re: Perfect FDS 2C33 audio when not using actual FDS disks?

Post by loopy » Mon Aug 24, 2015 5:30 pm

Hubz wrote:The only thing I wondered about was I keep getting wrong block types with FDS dumps a majority of the time. However loading the game up in an emulator and it seems to play fine. Is that anything I should be concerned with?
Nah, don't worry about it. I should get rid of that warning. It's telling you there's extra garbage at the end of the disk (which is pretty much ALWAYS the case).

Tomy
Posts: 51
Joined: Sat May 06, 2006 9:19 am
Contact:

FDSSTICK USA site down

Post by Tomy » Thu Aug 27, 2015 9:36 pm

USA customer please use this website to order.http://3dscapture.com/fdsstick/

DrDementia
Posts: 32
Joined: Thu Oct 31, 2013 4:55 pm

Re: Perfect FDS 2C33 audio when not using actual FDS disks?

Post by DrDementia » Mon Aug 31, 2015 7:00 pm

help me troubleshoot this. I can't read disks. I get this error, I may have to change the src to get some more debug info.

"Read error."
"Failed."

sounds like chris' problem from page 10, I tried different PCs and ports. I can hear the head moving.

Here's the pinout for my cinpel cable. all mine are joined except black. my cable is about 4 inch.
= equals no pin
(this is looking at the connector)

__#############__
################
### O = Blk = Y W ###
### G Bl = = Br R ###
#################
#################

User avatar
loopy
Posts: 394
Joined: Sun Sep 19, 2004 10:52 pm
Location: UT

Re: Perfect FDS 2C33 audio when not using actual FDS disks?

Post by loopy » Mon Aug 31, 2015 8:41 pm

Hmm, I'm not sure. The pinout is right. Re-check the wiring?
This is in Windows? Occasionally it does fail and the USB end needs to be reinserted. It should only take a few tries though. How does it fail? Does it exit immediately or time out?

Tomy
Posts: 51
Joined: Sat May 06, 2006 9:19 am
Contact:

Re: Perfect FDS 2C33 audio when not using actual FDS disks?

Post by Tomy » Sat Sep 05, 2015 3:47 pm

Hi Hubz,

How do you make the cable ? I make my own, but it is not work. At first, I think cable too long. Then I cut it short, it still not work.

If I connect two fdsstick on both end of cable, then put one fdsstick connect to PC. I can read other fdsstick(with game inside) with the one connected to PC. So, I beleive the cable is good. Only don't know why can not read disk.

Thank you

Post Reply