TOS patch for 1.44MB floppy support ?

General Discussion, STOS.

Moderator: troed

User avatar
exxos
Site Admin
Site Admin
Posts: 23778
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: TOS patch for 1.44MB floppy support ?

Post by exxos »

troed wrote: Thu May 26, 2022 10:04 am I was thinking though. If you have some CPLD free to do an additional address decoding you could make it work without TOS patching - just emulating so that when TOS addresses the "PAL" your CPLD output triggers the PSG bit 7..
I wouldn't need the PSG if could decode and output on the PLD directly. But like @agranlund mentioned a few posts back, the code doesn't even get run unless the STEFLAG bit is set, doing that probably would have other consequences. I thought it was but the TOS patches seem to run other bits of code which is why it works for me.

It be why my attempt 2 years ago didn't work by setting the dip switches. Even if it enabled the format option in gem it would have proven something could work.

There must have been some floppy kit out there at some point to warrant FCOPY adding that feature. Also someone went to the trouble of adding TOS patches. But who and why ? I've never seen any mention of patched TOS other than kaos and never heard of floppy kits using the PSG.
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
troed
Moderator
Moderator
Posts: 911
Joined: Mon Aug 21, 2017 10:27 pm

Re: TOS patch for 1.44MB floppy support ?

Post by troed »

exxos wrote: Thu May 26, 2022 10:37 am I wouldn't need the PSG if could decode and output on the PLD directly. But like @agranlund mentioned a few posts back, the code doesn't even get run unless the STEFLAG bit is set, doing that probably would have other consequences. I thought it was but the TOS patches seem to run other bits of code which is why it works for me.
fsck you're right. (from Thorsten's TOS sources below)

Code: Select all

#if (TOSVERSION < 0x300) | TP_50
        move.w    d0,fd_density(a1)
        tst.b     STEFlag                       /* no STE hardware available? */
        bne.s     go2trc2b                      /* (correct) */
        move.w    d0,ABSW($FFFF860E)
go2trc2b:
#else
        move.w    d0,ABSW($FFFF860E)
        move.w    d0,fd_density(a1)
#endif
I mean it does make sense of sorts - only the (Mega?) STE has that PAL. I'm sure we can put together a TSR AUTO program that'll sort it out so people won't have to flash a different TOS though.

edit: That fd_density(a1) struct is a bit interesting though. I'll take another look at that. The TP_50 define is for PAK TOS btw.
troed
Moderator
Moderator
Posts: 911
Joined: Mon Aug 21, 2017 10:27 pm

Re: TOS patch for 1.44MB floppy support ?

Post by troed »

Code: Select all

#if HD_SUPPORT & (TP_41 != 0) /* HD_BIT */
/*
 * select HD mode using bit 6 or 7 of the sound chip.
 * Bit 7 is eg. used on ST-Book
 */
hd_port:
            movem.w   d0-d1,-(a7)
            move.w    fd_density(a1),d0
            bra.s     hd_portb
hd_porta:
            movem.w   d0-d1,-(a7)
            move.w    d0,fd_density(a1)
hd_portb:
            move.w    sr,-(a7)
            ori.w     #$0700,sr
            move.b    #14,ABSW(psgsel)
            move.b    ABSW(psgrd),d1

Code: Select all

 * TP_41: HD_BIT: HD-Floppy controlling
 *
 * 0: don't change
 * 6: use sound-chip bit 6
 * 7: use sound-chip bit 7
User avatar
exxos
Site Admin
Site Admin
Posts: 23778
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: TOS patch for 1.44MB floppy support ?

Post by exxos »

troed wrote: Thu May 26, 2022 11:24 am fsck you're right. (from Thorsten's TOS sources below)
I mean it does make sense of sorts - only the (Mega?) STE has that PAL. I'm sure we can put together a TSR AUTO program that'll sort it out so people won't have to flash a different TOS though.

edit: That fd_density(a1) struct is a bit interesting though. I'll take another look at that. The TP_50 define is for PAK TOS btw.
Its a bit hard to follow :( Looks like the STEflag is based on the STE video shifter being tested.

HD_SUPPORT I don't know if thats part of TOS or the patches. But enabled from TOS2xx it seems.

I'm using TP_41 ( seems a totally different code branch from the MSTE code)

Code: Select all

/*
 * TP_41: HD_BIT: HD-Floppy controlling
 *
 * 0: don't change
 * 6: use sound-chip bit 6
 * 7: use sound-chip bit 7
 *
 * TP_42: HD_INVERT: Invert level
 *
 * Control HD-floppy selection via sound-chip bit 6 or 7.
 * If the HD controller expects low-level, also set TP_42 (HD_INVERT) to 1,
 * otherwise high-level will be used.
 * Note: ST-Book uses a low-level on bit 7.
 */
#ifndef TP_41
#define TP_41 7
#endif
#ifndef TP_42
#define TP_42 0
#endif
Its interesting what hardware used this method. Must have been one wayyyy back as FCOPY had it built in.

It's also why I wondered if a PRG was around to enable /add that feature without hacking TOS.
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
troed
Moderator
Moderator
Posts: 911
Joined: Mon Aug 21, 2017 10:27 pm

Re: TOS patch for 1.44MB floppy support ?

Post by troed »

Alright, the fd_density struct is purely internal and is what's used to either set mode using the PSG (ST Book) or (M)STE using ff860e. So, I think you're doing the right thing with TOS patch #41 at the moment. Besides that it would need to be a TSR in AUTO if we would want to use a regular TOS 2.06.
User avatar
exxos
Site Admin
Site Admin
Posts: 23778
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: TOS patch for 1.44MB floppy support ?

Post by exxos »

troed wrote: Thu May 26, 2022 11:39 am Besides that it would need to be a TSR in AUTO if we would want to use a regular TOS 2.06.
So is it possible to add TP_41 code into a TSR for regular TOS ? That would be the best outcome. But I have zero idea about that stuff.

I would have thought there would already be a PRG to do this, with whatever kit used the PSG switch method back in the 90s or whatever. Though don't ever remember seeing or hearing about such a kit. They all do what I did, use the HD select wire on the drive.

EDIT:

Actually a TSR while possibly could work, there is a problem, that it is whatever the YM chip defaults to as to what density floppy could be used to boot up from. Not exactly a huge "bug" but obviously the TSR PRG could only be loaded by SD or HD depending what it all defaults to on power up.

EDIT2:
Vanilla 206 seems to default to PSG bit 7 LOW. So defaults to DD (720K). So a TSR would have to be booted from a 720K floppy.
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
troed
Moderator
Moderator
Posts: 911
Joined: Mon Aug 21, 2017 10:27 pm

Re: TOS patch for 1.44MB floppy support ?

Post by troed »

For the sake of documenting what has been found:

I looked at the Hatari buserror tests from real machines, as well as looked at how the STEFlag is set by TOS, and while MSTE might be the only ST* that decodes ff860e (?) then at least the STE won't bus error on it and does run the code. So it would be possible to implement a floppy kit for TOS 2.06 STE that acts like an MSTE and needs no HD sense wire.
troed
Moderator
Moderator
Posts: 911
Joined: Mon Aug 21, 2017 10:27 pm

Re: TOS patch for 1.44MB floppy support ?

Post by troed »

I'm trying to find the manual/sw archive for the ELCO HD Floppy kit. I see some discussions on it connecting/able to connect to the PSG.
User avatar
exxos
Site Admin
Site Admin
Posts: 23778
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: TOS patch for 1.44MB floppy support ?

Post by exxos »

troed wrote: Thu May 26, 2022 1:07 pm I'm trying to find the manual/sw archive for the ELCO HD Floppy kit. I see some discussions on it connecting/able to connect to the PSG.
Got further than me as I could not find any mention or document online relating to the PSG.
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
User avatar
exxos
Site Admin
Site Admin
Posts: 23778
Joined: Wed Aug 16, 2017 11:19 pm
Location: UK
Contact:

Re: TOS patch for 1.44MB floppy support ?

Post by exxos »

I opened this up on the german forum as well. Where @czietz replied with a snippet of info.

https://forum.atari-home.de/index.php/t ... #msg260803

Mentions 10Mhz clock. I know some odd formats were used in the day, thought it was 12Mhz though.
https://www.exxosforum.co.uk/atari/ All my hardware guides - mods - games - STOS
https://www.exxosforum.co.uk/atari/store2/ - All my hardware mods for sale - Please help support by making a purchase.
viewtopic.php?f=17&t=1585 Have you done the Mandatory Fixes ?
Just because a lot of people agree on something, doesn't make it a fact. ~exxos ~
People should find solutions to problems, not find problems with solutions.
Post Reply

Return to “SOFTWARE”