Mega STe differences ?

GFA, ASM, STOS, ...

Moderators: simonsunnyboy, Mug UK, Zorro 2, Moderator Team

User avatar
Orion_
Captain Atari
Captain Atari
Posts: 396
Joined: Sat Jan 10, 2004 12:20 pm
Location: France
Contact:

Mega STe differences ?

Postby Orion_ » Mon May 28, 2018 12:20 pm

Hello,
I recently got a Mega STe, and I was told and was hoping to get 100% STe compatibility, but it seems like it's not the case.
I haven't tested official games for it yet, but I'm currently making my own game, which works perfectly on my STe, on Steem and on Hatari (even with Mega STe machine emulation set)
but on my Mega STe I keep getting strange stuff happening (game doesn't start at all from harddrive when on Steem/Hatari it works, or when running from the floppy, the depacking routine output garbage, even when the floppy data was written by the Mega STe itself and is verified 100% good from my PC)
I tested the memory and it's all fine, so I was wondering if there is any compatibility issue between the STe and the Mega STe.

I tried to check for _MCH cookie so I can detect the Mega STe and set $FF8E21 to 0.
But I was wondering how you can turn On the Blitter ? (as it seems you can turn it off in the General CPX ?!)
My retro games shop including Atari ST/Falcon/Firebee games ! -- Free Atari games/demos/tools -- Free Falcon demos/tools
Atari Mega STe 4MB + SD2SCSI 1GB + NOVA ET4000 + Pico PSU + Gotek HxC // Atari STe 2MB

Dal
Administrator
Administrator
Posts: 4162
Joined: Tue Jan 18, 2011 12:31 am
Location: Cheltenham, UK
Contact:

Re: Mega STe differences ?

Postby Dal » Mon May 28, 2018 12:31 pm

Main differences are the CPU speed (switchable to 16Mhz) and the 16kB cache.
Mega"SST" 12, MegaSTE, STE: Desktopper case, IDE interface, UltraSatan (8GB + 512Mb) + HXC floppy emulator. Plus some STE's/STFM's

User avatar
christos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2403
Joined: Tue Apr 13, 2004 8:24 pm
Location: Greece
Contact:

Re: Mega STe differences ?

Postby christos » Mon May 28, 2018 12:36 pm

The hard disk driver could impact compatibility, especially if you try to write to reserved addresses.
Felix qui potuit rerum cognoscere causas.
My Atari blog

STOT Email address: stot(NoSPAM)atari(DOT)org

joska
Hardware Guru
Hardware Guru
Posts: 4187
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Mega STe differences ?

Postby joska » Mon May 28, 2018 12:37 pm

CPU speed and cache is by default set to 8MHz/off when powering on an MSTE. What happens if you test your game after a clean boot?
Jo Even

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
Arne
Captain Atari
Captain Atari
Posts: 466
Joined: Thu Nov 01, 2007 10:01 am

Re: Mega STe differences ?

Postby Arne » Mon May 28, 2018 12:41 pm

Orion_ wrote:I tried to check for _MCH cookie so I can detect the Mega STe and set $FF8E21 to 0.

Sure this 0 the right value?
According to the Compendium these values affect the systemspeed setting:

Code: Select all

Mega STe Cache/Processor Control Register as
follows:
Value Meaning
0xFF 16 MHz w/Cache
0xFE 16 MHz
0xF4 8 MHz


Orion_ wrote:But I was wondering how you can turn On the Blitter ? (as it seems you can turn it off in the General CPX ?!)

Official way should be to use XBIOS(64).
Image

joska
Hardware Guru
Hardware Guru
Posts: 4187
Joined: Tue Oct 30, 2007 2:55 pm
Location: Florø, Norway
Contact:

Re: Mega STe differences ?

Postby joska » Mon May 28, 2018 12:56 pm

Arne wrote:Sure this 0 the right value?
According to the Compendium these values affect the systemspeed setting:


I believe the Compendium is wrong here. Just checked the code for the MonSTEr MSTE alt-RAM driver (which also sets CPU & cache to speed up booting) and 0 is 8 MHz no cache. Bit 0 is cache (0 - off, 1 - on), bit 1 speed (0 - 8MHz, 1 - 16MHz).

Edit: This is basically what you say, except for the 8Mhz/no cache value. I don't know why the compendium says that bit 3 should be cleared, and I don't know if it makes any difference. But writing 0 to this register will set the CPU to 8MHz/no cache.
Jo Even

VanillaMiNT - Firebee - Falcon060 - Milan060 - Falcon040 - MIST - Mega ST - STM - STE - Amiga 600 - Sharp MZ700 - MSX - Amstrad CPC - C64

User avatar
troed
Atari God
Atari God
Posts: 1436
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: Mega STe differences ?

Postby troed » Mon May 28, 2018 1:50 pm

In short, no, the incompatibilities that exist are much smaller (setup time for blitter, autovector interrupt cycles etc). However, machines age ... and my MegaSTE indeed seems to have grown an issue that causes it to suddenly read corrupted data from both floppy and hard disk. I'm suspecting something affecting the DMA bus, but I've read others who have had issues with the actual cache.

User avatar
Orion_
Captain Atari
Captain Atari
Posts: 396
Joined: Sat Jan 10, 2004 12:20 pm
Location: France
Contact:

Re: Mega STe differences ?

Postby Orion_ » Mon May 28, 2018 2:28 pm

I made my own floppy disk routine, interrupt/dma based, maybe that is causing issues ? (althought "most" of the data seems correct, but not all, as I get corruption sometimes)
I know that, on Steem debug, I get in some case the strange message "ASSERT !(io_src_b&1)" when my floppy routine start reading a certain file
the game not starting from HDD is a mystery, I have HDdriver, I checked if the files could be found and open, but still can't really debug the game on the machine itself (my whole compiler toolchain is on PC)
I access lots of address using the $FFF8XXXX.w trick, could that cause a problem ? :/
My retro games shop including Atari ST/Falcon/Firebee games ! -- Free Atari games/demos/tools -- Free Falcon demos/tools
Atari Mega STe 4MB + SD2SCSI 1GB + NOVA ET4000 + Pico PSU + Gotek HxC // Atari STe 2MB

User avatar
christos
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2403
Joined: Tue Apr 13, 2004 8:24 pm
Location: Greece
Contact:

Re: Mega STe differences ?

Postby christos » Mon May 28, 2018 3:06 pm

Does your game start from floppy?
Felix qui potuit rerum cognoscere causas.
My Atari blog

STOT Email address: stot(NoSPAM)atari(DOT)org

User avatar
Orion_
Captain Atari
Captain Atari
Posts: 396
Joined: Sat Jan 10, 2004 12:20 pm
Location: France
Contact:

Re: Mega STe differences ?

Postby Orion_ » Mon May 28, 2018 6:06 pm

yes, I have my own boot.
Is there a DMA test program ? or a diagnostic program running from TOS, instead of from cartridge ?
My retro games shop including Atari ST/Falcon/Firebee games ! -- Free Atari games/demos/tools -- Free Falcon demos/tools
Atari Mega STe 4MB + SD2SCSI 1GB + NOVA ET4000 + Pico PSU + Gotek HxC // Atari STe 2MB

User avatar
frost
Captain Atari
Captain Atari
Posts: 357
Joined: Sun Dec 01, 2002 2:50 am
Location: Limoges
Contact:

Re: Mega STe differences ?

Postby frost » Mon May 28, 2018 6:24 pm

Orion_: a program exists, you can find it here. Edit: ah damn, it's for ASCI.. but maybe it can show up some problems.
Do you also have some gotek device to make a test ? Maybe your floppy drive is doing wrong.

Also, it's can't be the $FFFFxxxx.w trick, it works nicely on my own Mega STe.
My blog, mostly about Atari and demo stuff.

User avatar
Greenious
Hardware Guru
Hardware Guru
Posts: 1279
Joined: Sat Apr 24, 2004 5:39 pm
Location: Sweden

Re: Mega STe differences ?

Postby Greenious » Mon May 28, 2018 6:52 pm

Orion_ wrote: But I was wondering how you can turn On the Blitter ? (as it seems you can turn it off in the General CPX ?!)


Technically you can't really turn the blitter off, just tell TOS (or whatever program that respects the setting) to not use it.

Is your Mega STE by any chance equipped with a HD floppy? Are you using correct floppy type?
Your STE got 4mb and your mega got 2mb according to your sig, no potential snafu there?

As for Mega STE & DMA problems, in order to facilitate that internal acsi connector for internal scsi, they did sacrifice proper termination of the acsi bus, (just as C-Lab did with atleast some MK F030's SCSI bus), while it usually did work back then, it might be one of those designflaws that eventually comes back and bites you in the ass.
Updated my guides as of june 28th, 2016. Check'em out and feedback!
viewtopic.php?t=5040

User avatar
Greenious
Hardware Guru
Hardware Guru
Posts: 1279
Joined: Sat Apr 24, 2004 5:39 pm
Location: Sweden

Re: Mega STe differences ?

Postby Greenious » Mon May 28, 2018 7:11 pm

troed wrote:In short, no, the incompatibilities that exist are much smaller (setup time for blitter, autovector interrupt cycles etc). However, machines age ... and my MegaSTE indeed seems to have grown an issue that causes it to suddenly read corrupted data from both floppy and hard disk. I'm suspecting something affecting the DMA bus, but I've read others who have had issues with the actual cache.


That is odd, afaik the cache solution used on Mega STE invalidates the CPU cache every time the CPU releases control of the bus (dma transfer to/from floppy or blitter activity), I would reseat the cache PALs if that didn't happen.
Updated my guides as of june 28th, 2016. Check'em out and feedback!
viewtopic.php?t=5040

User avatar
Orion_
Captain Atari
Captain Atari
Posts: 396
Joined: Sat Jan 10, 2004 12:20 pm
Location: France
Contact:

Re: Mega STe differences ?

Postby Orion_ » Mon May 28, 2018 8:50 pm

OK, so, I made some progress in the understanding.
I tried the "hdd version" on a 1.4Meg HD floppy, on the Mega STe, and booting with the Alternate key so it won't load the HDD driver.
And it's working !
So, HDDriver is messing up my game somehow ?

Now, the "floppy version" is working but with some data corruption, so, maybe my floppy routine doesn't work with real floppies, and only works on "perfect" emulators, such as Steem/Hatari and Gotek HxC ?
My retro games shop including Atari ST/Falcon/Firebee games ! -- Free Atari games/demos/tools -- Free Falcon demos/tools
Atari Mega STe 4MB + SD2SCSI 1GB + NOVA ET4000 + Pico PSU + Gotek HxC // Atari STe 2MB

User avatar
Greenious
Hardware Guru
Hardware Guru
Posts: 1279
Joined: Sat Apr 24, 2004 5:39 pm
Location: Sweden

Re: Mega STe differences ?

Postby Greenious » Mon May 28, 2018 9:53 pm

Orion_ wrote:OK, so, I made some progress in the understanding.
I tried the "hdd version" on a 1.4Meg HD floppy, on the Mega STe, and booting with the Alternate key so it won't load the HDD driver.
And it's working !
So, HDDriver is messing up my game somehow ?

Now, the "floppy version" is working but with some data corruption, so, maybe my floppy routine doesn't work with real floppies, and only works on "perfect" emulators, such as Steem/Hatari and Gotek HxC ?


Actually, the boot order on atari is
1 - diagnostic cartridge
2 - floppy boot sector
3 - hdd
4 - application cartridge
5 - floppy autofolder

so unless your game starts from the floppy boot sector, it's working by design.

if the floppy isn't working after booting off the harddrive with hddriver, what is run from the hdd? something that messes with your floppy routines timing? If timing is the issue? cpu-speed settings?

btw, if your game is supposed to work from hdd aswell as floppy, why not use tos for all disk access? Otherwise I do recommend atari st diskdrives inside and out as a reference for writing your own floppy routines, but I suppose you've aldready checked it out?

https://www.dev-docs.org/docs/
Updated my guides as of june 28th, 2016. Check'em out and feedback!
viewtopic.php?t=5040

User avatar
troed
Atari God
Atari God
Posts: 1436
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: Mega STe differences ?

Postby troed » Tue May 29, 2018 6:37 am

My floppy code, direct dma, in Closure seems to work on all machines but one owned by Nicolas (of Hatari fame). I had to enable the verification bit for it to start working on his machine/drive (unreleased version).

Besides that, yes, I think the a-few-cycles-of-busy-wait needed differs between real hardware and emulators.

User avatar
Orion_
Captain Atari
Captain Atari
Posts: 396
Joined: Sat Jan 10, 2004 12:20 pm
Location: France
Contact:

Re: Mega STe differences ?

Postby Orion_ » Tue May 29, 2018 7:52 am

Greenious > I use bios read routine in the HDD version, but in the floppy version I use my own interrupt based routine because it's faster, and I can process unpacking data while the floppy is reading, it's even more faster :)

Troed > where I can find your floppy code so I can compare ?
I borrowed a floppy code from somewhere and adapted it to my floppy format

here it is:
(removed, because this version is buggy anyway)
Last edited by Orion_ on Wed May 30, 2018 2:51 pm, edited 1 time in total.
My retro games shop including Atari ST/Falcon/Firebee games ! -- Free Atari games/demos/tools -- Free Falcon demos/tools
Atari Mega STe 4MB + SD2SCSI 1GB + NOVA ET4000 + Pico PSU + Gotek HxC // Atari STe 2MB

User avatar
troed
Atari God
Atari God
Posts: 1436
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: Mega STe differences ?

Postby troed » Tue May 29, 2018 9:36 am

Orion_ wrote: bsr.s delay
...
delay: rts


That delay seems to be a bit short, also I think there needs to be more of them.

This is the best document on how to do direct dma floppy coding I know: http://info-coach.fr/atari/documents/_m ... amming.pdf

(Sorry, SYNC has no officially published demo code anywere ... :P)

regards,
Troed

User avatar
simonsunnyboy
Moderator
Moderator
Posts: 5033
Joined: Wed Oct 23, 2002 4:36 pm
Location: Friedrichshafen, Germany
Contact:

Re: Mega STe differences ?

Postby simonsunnyboy » Tue May 29, 2018 3:22 pm

Outside of the discussed topics, the MSTE does not have the Extended Joystick ports.
I noticed problems with Jagpad read attempts in the past. It is best to disable any EJP related register accesses in case a MSTE is detected.
Simon Sunnyboy/Paradize - http://paradize.atari.org/

Stay cool, stay Atari!

1x2600jr, 1x1040STFm, 1x1040STE 4MB+TOS2.06+SatanDisk, 1xF030 14MB+FPU+NetUS-Bee

User avatar
troed
Atari God
Atari God
Posts: 1436
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: Mega STe differences ?

Postby troed » Tue May 29, 2018 3:49 pm

Now home and checked my code. Sorry, no, the bsr->rts delay is sufficient. But I have loads of them compared to your code.

Code: Select all

* FDC sector register "084 in read mode, 184 in write mode"
   move.w #$184,$ffff8606.w
   bsr mad_delay
   move.w mad_sector,d0
   addq #1,d0
   move.w d0,$ffff8604.w

* DMA count register "090 in read mode, 190 in write mode"
   move.w #$90,$ffff8606.w
   bsr mad_delay
   move.w #1,$ffff8604.w   * we read one sector at a time

* FDC register control (W) status (R) "080 in read mode, 180 in write"
* $80 = read sector
   move.w #$80,$ffff8606.w
   bsr mad_delay
   move.w #$80,$ffff8604.w


Code: Select all

mad_delay
   rts


... etc. Not saying that my code is in any way supposed to be the best possible, I brushed up on old SYNC code from -89 for the demo and found a few things that surprised me if they had ever worked.

User avatar
Orion_
Captain Atari
Captain Atari
Posts: 396
Joined: Sat Jan 10, 2004 12:20 pm
Location: France
Contact:

Re: Mega STe differences ?

Postby Orion_ » Tue May 29, 2018 6:03 pm

I will add a few delays, and also I noticed (while analysing a floppy routine from a checkpoint demo) that his seek command was:
move.w #$17,$ffff8604.w
where mine was $13, missing the "verify" bit, I guess that might be an important bit I was missing :D
My retro games shop including Atari ST/Falcon/Firebee games ! -- Free Atari games/demos/tools -- Free Falcon demos/tools
Atari Mega STe 4MB + SD2SCSI 1GB + NOVA ET4000 + Pico PSU + Gotek HxC // Atari STe 2MB

User avatar
troed
Atari God
Atari God
Posts: 1436
Joined: Mon Apr 30, 2012 6:20 pm
Location: Sweden

Re: Mega STe differences ?

Postby troed » Tue May 29, 2018 6:28 pm

Orion_ wrote:I will add a few delays, and also I noticed (while analysing a floppy routine from a checkpoint demo) that his seek command was:
move.w #$17,$ffff8604.w
where mine was $13, missing the "verify" bit, I guess that might be an important bit I was missing :D


Yeah that's the one I had to add to get Closure to load on Nicolas' drive.

Code: Select all

   move.w #%00010111,$ffff8604.w      SEEK, 3ms, verify=ON

   move.w #%00000111,$ffff8604.w      RESTORE, 3ms, verify=ON

ijor
Hardware Guru
Hardware Guru
Posts: 3629
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: Mega STe differences ?

Postby ijor » Tue May 29, 2018 6:32 pm

Too busy to check the routines, but regarding the delay. TOS delays, that all of us copied, are quite paranoid. There is no need for such huge delays everywhere. Problem is that you really have to know what you are doing for deciding when you need to delay and when not, and for how long. And because it is cheap to delay (floppy is very slow anyway), then it is usually better to be safe just in case.

The critical delay is when reading or checking feedback from the FDC. e.g, if you read the status register or the interrupt bit, right after issuing a command, it might not be updated yet.

ijor
Hardware Guru
Hardware Guru
Posts: 3629
Joined: Sat May 29, 2004 7:52 pm
Contact:

Re: Mega STe differences ?

Postby ijor » Tue May 29, 2018 6:37 pm

troed wrote:
Orion_ wrote:where mine was $13, missing the "verify" bit, I guess that might be an important bit I was missing :D

Yeah that's the one I had to add to get Closure to load on Nicolas' drive.


Seek with verify it's usually not needed. It might suggest some kind of timing problem. May be you were not waiting for settle time? Also the FDC spin-up logic is a bit tricky and ill designed. It is not that difficult to get into a situation that you are trying to read a sector when the drive still didn't spin up and you don't know.

Was that on Nicolas's DRIVE, or on Nicola's computer? Yeah, I know it probably was both :) . But the question is if you could isolate the problem was on the drive and not on the computer.

User avatar
Orion_
Captain Atari
Captain Atari
Posts: 396
Joined: Sat Jan 10, 2004 12:20 pm
Location: France
Contact:

Re: Mega STe differences ?

Postby Orion_ » Wed May 30, 2018 2:49 pm

ok I finally got it working, I realised that I didn't checked for reading errors, so now I check the error flag, and if there is one, I read the sector again.
That's why I got garbage data using real floppy, because sometimes the reading was bad (where as Emulators or Gotek HxC always get the data right)
Now my routine works on my Mega STe using Floppy.
I still didn't figured out why HDDriver is messing up my game, but well, the Floppy version is what I wanted to work at least :)
My retro games shop including Atari ST/Falcon/Firebee games ! -- Free Atari games/demos/tools -- Free Falcon demos/tools
Atari Mega STe 4MB + SD2SCSI 1GB + NOVA ET4000 + Pico PSU + Gotek HxC // Atari STe 2MB


Social Media

     

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 2 guests