STE / STE detect using "Lower byte of the video counter"

All 680x0 related coding posts in this section please.

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

User avatar
Maartau
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2591
Joined: Thu Dec 15, 2005 2:15 am
Location: France

STE / STE detect using "Lower byte of the video counter"

Postby Maartau » Fri Jun 02, 2017 2:57 pm

Hi :D ,

Here's an excerpt of code found in DBA mag, it's done by Jedi/Sector One/The Heavy Killers.
Can someone done a test on STF and STE, I have no access to my cumputers ATM.

Cheers for your help 8) .

* STE or STFM ? Dats ye question... *
* Code: Jedi/Sector One/The Heavy Killers *

clr.l -(sp)
move #$20,-(sp)
trap #1 Supervisor mode
move.l d0,2(sp) Save user stack

move #37,-(sp)
trap #14 Wait the beginning of the next VBL
addq.l #2,sp

lea $ffff8209.w,a0 Lower byte of the video counter
moveq #74,d0 Randomized value
move.b d0,(a0) Write it
cmp.b (a0),d0 Equality test
bne.s stfm Failed ? => it's a STFM
st ste_flag Otherwise, it's a STE

stfm trap #1 User mode
addq.l #6,sp

...insert the rest of your sourcecode here...

ste_flag dc.b 0


ste_flag if filled with the byte $FF if the computer is a STE, and null
if it isn't the case...


Edit : just noticed the word "cumputer" :lol:...
Member of :
- aTaRi LeGeNd ,
- eLiTe ! ,
- NoExTrA .

Don't hesitate to visit http://www.atarimania.com/ & http://www.atarilegend.com/ :D

-> Slowed due to serious health troubles <-

AtariZoll
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2906
Joined: Mon Feb 20, 2012 4:42 pm
Contact:

Re: STE / STE detect using "Lower byte of the video counter"

Postby AtariZoll » Fri Jun 02, 2017 3:02 pm

This is known difference between ST and STE (pls. correct title) . There are some other ways to detect is it STE or just ST.
Negative feedback has usually positive effect.

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

Re: STE / STE detect using "Lower byte of the video counter"

Postby Greenious » Fri Jun 02, 2017 3:12 pm

Depending on TOS version, you can always check the cookiejar.
Updated my guides as of june 28th, 2016. Check'em out and feedback!
viewtopic.php?t=5040

User avatar
Maartau
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2591
Joined: Thu Dec 15, 2005 2:15 am
Location: France

Re: STE / STE detect using "Lower byte of the video counter"

Postby Maartau » Fri Jun 02, 2017 3:17 pm

Peter : I have this source since a moment on my HD but no access to real HW, I was wondering if it worked.

Of course, I use other ways to detect STE/ST, it was just curiousity :) .
Member of :
- aTaRi LeGeNd ,
- eLiTe ! ,
- NoExTrA .

Don't hesitate to visit http://www.atarimania.com/ & http://www.atarilegend.com/ :D

-> Slowed due to serious health troubles <-

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

Re: STE / STE detect using "Lower byte of the video counter"

Postby Greenious » Fri Jun 02, 2017 3:35 pm

Maartau wrote:Of course, I use other ways to detect STE/ST, it was just curiousity :) .


I'm curious aswell as to how many different ways you can reliably identify the machine. So don't quit on my account.

But hijacking the buserror vector and poke around at select memorylocations is one way.

Also a way to find undocumented memory locations, and I know there are some. On both STE & F030... I'm not sure about the ST though.
I did that by scanning all hw address space and simply saving any address that didn't generate a buserror.
Never got around to analyze it though, and I'm pretty certain none is of practical use, except perhaps for the config solderpad/dipswitch in STE that should be mapped in memoryspace but afaik never been nailed down to an actual address. I also suspect the STE got the Mega STE RTC mapped in memory aswell, and there is probably suitable signals to easily retrofit a compatible RTC in all STEs. etc
Updated my guides as of june 28th, 2016. Check'em out and feedback!
viewtopic.php?t=5040

czietz
Hardware Guru
Hardware Guru
Posts: 478
Joined: Tue May 24, 2016 6:47 pm

Re: STE / STE detect using "Lower byte of the video counter"

Postby czietz » Fri Jun 02, 2017 4:28 pm

TOS 2.06 decides STE/ST this way:

Code: Select all

   dbasell     equ   $ffff820d   ; addr of low byte of this reg
   dbasel      equ   $ffff8203   ; display base low
   color0      equ   $ffff8240   ; color palette #0
[...]
* We detect ST-vs-STe by seeing if the high 7 bits of dbasell are RAM.
* If so then we're an STe.
*

   move.b #$5a,dbasell    ; see if dbasell is RAM
   tst.b   dbasel         ; read another register to destroy
                          ; capacitance effects; dbasel is 00.
   move.b   dbasell,d0    ; read; don't say cmp.b because that
                          ; would put $5a on the bus.
   cmp.b   #$5a,d0        ; NOW cmp.b
   bne   memST

   clr.b   dbasell        ; try the test again using zero
   tst.w   color0         ; color0 is $FFF
   tst.b   dbasell        ; read back - should be zero.
   bne   memST

; OK, dbasell holds its value: you're an STe.

[...]

memST:   [...]            ; for ST


Greenious wrote:except perhaps for the config solderpad/dipswitch in STE that should be mapped in memoryspace but afaik never been nailed down to an actual address


I think it is quite well known -- for example from the STE schematic -- that these are accessed in the high byte of $FF9200. Note that you have to use a word access move.w to read them, move.b won't work.

Greenious wrote:I also suspect the STE got the Mega STE RTC mapped in memory aswell


There's nothing to suspect, STE and MegaSTE share the same GSTMCU, so both generate the required signals for the RTC.

EDIT: Typo fixed dbasell vs. dbasel in the code above.
Last edited by czietz on Fri Jun 02, 2017 6:53 pm, edited 1 time in total.

User avatar
Maartau
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2591
Joined: Thu Dec 15, 2005 2:15 am
Location: France

Re: STE / STE detect using "Lower byte of the video counter"

Postby Maartau » Fri Jun 02, 2017 4:44 pm

Greenious wrote:I'm curious aswell as to how many different ways you can reliably identify the machine. So don't quit on my account.

That was one question of the moment, got methods from here & there.

Hum... That's all in mess in my sources, and I'm interested by rebuidling a shell to ID computers.

Anyway, seriously interested by this topic 8) .
Member of :
- aTaRi LeGeNd ,
- eLiTe ! ,
- NoExTrA .

Don't hesitate to visit http://www.atarimania.com/ & http://www.atarilegend.com/ :D

-> Slowed due to serious health troubles <-

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

Re: STE / STE detect using "Lower byte of the video counter"

Postby troed » Fri Jun 02, 2017 6:15 pm

My way is the most reliable ;) The same code that detects which wakestate an ST is in can detect whether the GLUE/GSTMCU is STE or ST. Basically the "heart" of the machine.

https://github.com/troed/WSDETECT

/Troed

FedePede04
Atari Super Hero
Atari Super Hero
Posts: 951
Joined: Fri Feb 04, 2011 12:14 am
Location: Denmark
Contact:

Re: STE / STE detect using "Lower byte of the video counter"

Postby FedePede04 » Fri Jun 02, 2017 6:46 pm

to see if the shifter is one from a STE write a color greater then $777 to $ff8240 or one of the other color reg. and read it back, if it still the same then it is an STE shifter.
Atari will rule the world, long after man has disappeared

sometime my English is a little weird, Google translate is my best friend :)

FedePede04
Atari Super Hero
Atari Super Hero
Posts: 951
Joined: Fri Feb 04, 2011 12:14 am
Location: Denmark
Contact:

Re: STE / STE detect using "Lower byte of the video counter"

Postby FedePede04 » Fri Jun 02, 2017 6:49 pm

I did not see this code example, but it does what i describe.
i had a discussion with npomarede long ago, and he told me that the shifter of the ST did not save the hole word only up to value $777, so i you write a number that is greater, and ask for it again when it would not be the same.

czietz wrote:TOS 2.06 decides STE/ST this way:

Code: Select all

   dbasel      equ   $ffff820d   ; addr of low byte of this reg
   dbasel      equ   $ffff8203   ; display base low
   color0      equ   $ffff8240   ; color palette #0
[...]
* We detect ST-vs-STe by seeing if the high 7 bits of dbasell are RAM.
* If so then we're an STe.
*

   move.b #$5a,dbasell    ; see if dbasell is RAM
   tst.b   dbasel         ; read another register to destroy
                          ; capacitance effects; dbasel is 00.
   move.b   dbasell,d0    ; read; don't say cmp.b because that
                          ; would put $5a on the bus.
   cmp.b   #$5a,d0        ; NOW cmp.b
   bne   memST

   clr.b   dbasell        ; try the test again using zero
   tst.w   color0         ; color0 is $FFF
   tst.b   dbasell        ; read back - should be zero.
   bne   memST

; OK, dbasell holds its value: you're an STe.

[...]

memST:   [...]            ; for ST


Greenious wrote:except perhaps for the config solderpad/dipswitch in STE that should be mapped in memoryspace but afaik never been nailed down to an actual address


I think it is quite well known -- for example from the STE schematic -- that these are accessed in the high byte of $FF9200. Note that you have to use a word access move.w to read them, move.b won't work.

Greenious wrote:I also suspect the STE got the Mega STE RTC mapped in memory aswell


There's nothing to suspect, STE and MegaSTE share the same GSTMCU, so both generate the required signals for the RTC.
Atari will rule the world, long after man has disappeared

sometime my English is a little weird, Google translate is my best friend :)

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

Re: ST / STE detection, "Lower byte of the video counter"

Postby Greenious » Fri Jun 02, 2017 7:03 pm

czietz wrote:
Greenious wrote:I also suspect the STE got the Mega STE RTC mapped in memory aswell


There's nothing to suspect, STE and MegaSTE share the same GSTMCU, so both generate the required signals for the RTC.

EDIT: Typo fixed dbasell vs. dbasel in the code above.


Actually it's not a given. the Mega STE FPU for example, relies on external logic to generate dtack/CS. I admit I haven't looked at the schematics, but it is a solution they might have chosen for the RTC aswell. Anyway, it's mostly from a curiosity standpoint more than anything else.

Oh, another thing, any objections to me adjusting the topic a bit to reflect the direction this discussion has taken?
Updated my guides as of june 28th, 2016. Check'em out and feedback!
viewtopic.php?t=5040


Social Media

     

Return to “680x0”

Who is online

Users browsing this forum: No registered users and 1 guest