I stumbled upon a couple of FDS games that do something that seems weird while waiting for a disk to be inserted:

Code:

loop: LDA $4032 AND #$01 BEQ loop ;if a disk is currently inserted, loop (e.g wait for eject) LDA $4032 AND #$01 BNE loop ;if no disk is currently inserted, loop (e.g wait for insert, but the loop goes back to the first check!)

As far as I can tell, the first version can fail to recognize the newly inserted disk pretty often (which would force the user to eject the disk and then reinsert it). This can happen if you the "drive is empty" bit gets cleared while the code is in the first part of the loop (which loops until the disk is ejected).

My 6502 assembly skills are pretty terrible, so I could be understanding this wrong, but I can actually get this behavior several times in a row in the games (Aspic, Ao no Senritsu) that use the first version (e.g doing eject disk -> wait -> insert disk causes the execution to go back to the first loop and the game doesn't react at all)

The only way the first version would "reliably" be able to exit its loop was if the value of the "drive is empty" bit quickly toggled between 0 and 1 a number of times when physically ejecting or inserting a disk?

Which games are these Sour? Would Aspic-Majaou no Noroi be one of them? This was something that was fixed in nestopia before by martin, under better disc drive emulation. It takes multiple times to get this game to load as a lot of the time ejecting/inserting the disk does nothing.

The only way the first version would "reliably" be able to exit its loop was if the value of the "drive is empty" bit quickly toggled between 0 and 1 a number of times when physically ejecting or inserting a disk?

Switch bounce usually only happens in one direction (the "making contact" direction)..

It could probably still explain this, since the buggy loop occurs while waiting for the disk to be inserted, which would presumably push on a switch?

Also, I took a look at Nestopia's code, but it didn't look like anything special was being done for that flag. And Nestopia itself doesn't work properly with Aspic, either (need to switch the disk a bunch of times before it finally works)

Switch bounce usually only happens in one direction (the "making contact" direction)..

It could probably still explain this, since the buggy loop occurs while waiting for the disk to be inserted, which would presumably push on a switch?

I think the switch could be either... push to connect or push to break (my gut says the latter), but there's trivial ways that could either be a high or low signal by the time you read it. The Wiki's pinout says it's low when "media set" at least when coming in to the RAM adapter.

Briefly looking around for videos of people disassembling the drive itself, I think I see a big normally-closed switch on the side with yellow wires (that is opened by inserting a disk). But the people who uploaded the videos also comment on there being multiple switches inside (there's obviously also the limit switches for seeking to end and beginning), so I'm not certain if I'm both seeing that big one correctly and if it's also the one that detects insertion.

Hey Sour, sorry i prob should have clarified, this fix was seemingly implemented into nestopia 1.33. I think in subsequent versions martin may have overwrote these fixes in fds since he obviously made many fixes to fds.cpp since then.

Have you had any luck with this Sour? I tested out nestopia 1.33 and this bug is not in there. I also downloaded the source as well if you are interested in that version.

I took a look at the differences between 1.33 and 1.34 before my previous post - but there was a pretty large amount of changes in the FDS code between both versions, which makes it hard to figure out what change might have altered the behavior (esp. since Nestopia's FDS implementation is huge, ~2.5k lines)

Taking a bit of a break from Mesen at the moment, since I've spent far too much time on it in the past weeks between releasing 0.9.4 & porting it to libretro - I'll probably take another look at this at some point, though.

Who is online

Users browsing this forum: Google [Bot] and 12 guests

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum