About msx Floppy Disk - Low level access?

Page 1/3
| 2 | 3

By PingPong

Prophet (3339)

PingPong's picture

26-10-2007, 20:37

Msx basically consider floppy drives a non-msx feature.
Msx floppy disk drives are basically of two categories:

I/O mapped
memory mapped.

there are also variations in mapped addresses.

Some games, in disk format have their access methods, so basically the floppy are not MSX-DOS formatted, but the game start itself from the floppy boot sector, then while running, read directly from disk the needed data.

What is not clear to me is this: while it's easy to access without BIOS, say , the psg, (because we all know PSG mechanics or addresses), how about direct floppy disk management?

Are there some games that directly access the floppy hw without bios?

Login or register to post comments

By cax

Prophet (3721)

cax's picture

26-10-2007, 21:13

I don't know about games, but I believe that tools like fast format or fast copy that use non-standard placement of sectors on the track probably use direct access. Of course, these tools cannot work on all kinds of drives.

By dvik

Prophet (2200)

dvik's picture

26-10-2007, 21:47

SymbOS has its own implementation of disk access and supports different kinds of disk drives. I believe it can even do some auto detection to figure out what disk drive is present.

By PingPong

Prophet (3339)

PingPong's picture

26-10-2007, 21:49

I ask this, because i'm thinking about floppy emulation via a hw that emulates in SW at low-level a floppy disk.

By turbor

Champion (424)

turbor's picture

26-10-2007, 22:11

There are standard methods of accessing the sectors from the BDOS, so those games read the sectors and do not use the file-access interface of bdos.
Most likely they will have a custom made infrastructure that acts like a simplified filesystem.
A nice thing is that reading sectors is easy, while creating tracks is a whole lot harder, most diskprotection schemes use this to their advantage by creating disks with a non standard number of sectors/tracks etc etc that all systems can read but can (maybe) not create.

If you want to emaulte a floppy then you can opt to stay at the sector level(like most emulators do that use dsk files) or go really lowlevel and then you need to emulate a FDC at the level of the tracks and also implement the start of sector syncs etc etc.
In openMSX this is partially done in the emulation of the FDC to enable a correct _FORMAT working, without the need of patched or intercepted bios calls.

By flyguille

Prophet (3029)

flyguille's picture

26-10-2007, 22:13

I remember some type of anti-pirate protection that some PIRATE HOUSE does!, so if you go to buy them thouse wonderful games, they put it in a BOOT-LOADER with MENU way, and not just the files....

The trick was that the SECTOR #1 wasn't available, so, the copy protection check if the SECTOR #1 is readable or not.

Imagine you, I, triying to do DSKO$(1,0) or something and opening the DISK DOOR at half of save.!!!!!!

The code at boot sector was protected with a XORed &HAA and others values several times, so if you desencript the first XOR manually, then you see another part of the code that does another type of xOR, and then, another.... and another, and then, voilá, the SECTOR #1 call to test the protection...

the real code of the menu is where the DIRECTORY normaly IS, there is a table with the name of each game and the number of the first logical sector that where the game is store, the game is loaded then in each page on an MSX2 or MSX1, so the table also contains the PAGES number where the 16K block goes and the RUN addr PAGE/addr.

By PingPong

Prophet (3339)

PingPong's picture

27-10-2007, 19:52

My idea is to make a cart with the less amount of electronic stuff as possible, an do the job on SW. I think about a cart that plugged on the msx on one side can be connected to a PC on the other. As soon as the z80 send data to the emulated port, the PC send back a response or data through the USB driver.
My question is about i/o ports. In order to make the emulated floppy device trasparent to the reall one i need to manage the same I/O addresses. However what happens if the cartridge is plugged on a real msx that has also the real floppy disk?

When the cpu addressed the floppy, both devices could reply... I think this could results in a short - circuit...
On the other hand, choosing another address will break the compatibility, forcing to write a new msxbios, or patching an existing one...
What solution? And which are the unused port addresses available?

By Manuel

Ascended (15551)

Manuel's picture

28-10-2007, 14:12

Sounds a lot like what the NoWind USB can do...

By PingPong

Prophet (3339)

PingPong's picture

28-10-2007, 15:43

@manuel:
there are differences:
-nowind, patch the bios (or rewrite it).
-nowind have built in memory.

Today, the floppy media is disappearing also from pc's.
Maybe tomorrow we cannot play on real msx because we do not have a true replacement for the msx floppy.
What i trying to create is a most-durable-solution to the 'floppy problem'.
My idea should be a cheap possible, no flash memory, only a virtual device emulated in SW on a PC.

What i need to know about is mainly:
1) In order to make the emulated floppy device trasparent to the reall one i need to manage the same I/O addresses. However what happens if the cartridge is plugged on a real msx that has also the real floppy disk?
2) choosing other addresses will break the compatibility, forcing to write a new msxbios, or patching an existing one... which are the unused port addresses available?

thx

By Manuel

Ascended (15551)

Manuel's picture

28-10-2007, 15:56

Only Brazillian FDC's use I/O based communication for the floppy drive. So, most are memory based, which means no compatibility issues at all. (Besides, most people do use the BIOS...)

NoWind has its own built in disk ROM, so, it's like inserting an external floppy drive (AFAIK). That's quite standard.

Most software will just use the NoWind disk ROM as if it's a normal disk ROM.

By PingPong

Prophet (3339)

PingPong's picture

28-10-2007, 16:07

That's quite standard.
Most software will just use the NoWind disk ROM as if it's a normal disk ROM.

the point is: are there sw that work skipping bios? If all msx sw uses bios there is no need to emulate the floppy.
This is not clear to me. Game like aleste load directly on disk and appear to manage directly the floppy HW. If this is true i think those games will not work until you emulate at a lower level (->HW) the floppy device.

Page 1/3
| 2 | 3