The Atari ST completely passed me by
in the 80's... While it has the same CPU as the Amiga, it has
inferior graphics and sound , with no hardware graphics layers, and
only AY sound...
These days the ST has one major advantage... it's much easier to
emulate! Often getting Amiga games working requires messing with
different configurations, whereas the Atari ST version will run
instantly and while usually has inferior sound, will otherwise
typically be identical to the Amiga version!
Registers
Because the 68000 uses a 24 bit address bus, These can also be addressed at
$FFFFxxxx - for example $FF8004 is the same as $FFFF8004
Address
Mode
Bits
Purpose
FF8004
RW
----xxxx
Memory
Config
FF8201
RW
HHHHHHHH
Video
Base
H
FF8202
EW
LLLLLLLL
Video
Base
L
FF8205
R
HHHHHHHH
Video
Counter
H (current drawing line)
FF8207
R
MMMMMMMM
Video
Counter
M
FF8209
R
LLLLLLLL
Video
Counter
L
FF820A
RW
------SR
Sync
Mode
FF8240
RW
-----RRR
-GGG-BBB
Palette
Color
0
FF8242
RW
-----RRR
-GGG-BBB
Palette
Color
1
FF8244
RW
-----RRR
-GGG-BBB
Palette
Color
2
FF8246
RW
-----RRR
-GGG-BBB
Palette
Color
3
FF8248
RW
-----RRR
-GGG-BBB
Palette
Color
4
FF824A
RW
-----RRR
-GGG-BBB
Palette
Color
5
FF824C
RW
-----RRR
-GGG-BBB
Palette
Color
6
FF824E
RW
-----RRR
-GGG-BBB
Palette
Color
7
FF8250
RW
-----RRR
-GGG-BBB
Palette
Color
8
FF8252
RW
-----RRR
-GGG-BBB
Palette
Color
9
FF8254
RW
-----RRR
-GGG-BBB
Palette
Color
10
FF8256
RW
-----RRR
-GGG-BBB
Palette
Color
11
FF8258
RW
-----RRR
-GGG-BBB
Palette
Color
12
FF825A
RW
-----RRR
-GGG-BBB
Palette
Color
13
FF825C
RW
-----RRR
-GGG-BBB
Palette
Color
14
FF825E
RW
-----RRR
-GGG-BBB
Palette
Color
15
FF8260
RW
------SS
Screen
Mode
(00=320x240x4bpp)
FF8400
Reserved
FF8600
Reserved
FF8602
Reserved
FF8604
--------
XXXXXXXX
Disk
controler
data access
FF8606
R
--------
-----DSE
DMA
Status
Mode control
FF8606
W
-------W
FD0RGAB
DMA
Mode
Control
FF8609
RW
HHHHHHHH
Dna
Base
& Counter H
FF860B
RW
MMMMMMMM
Dna
Base
& Counter M
FF860D
RW
LLLLLLLL
Dna
Base
& Counter L
FF8800
R
DDDDDDDD
IO
Port
B Data
FF8800
W
RRRRRRRR
PSG
Register
Select
FF8802
W
RGCDRFGH
PSG
Write
Data – IO Port A
FF8802
RW
DDDDDDDD
IO
Port
B Data
FFFA01
M-IW---P
MFP
GP
IO
FFFA03
DDDDDDDD
MFP
Active
Edge
FFFA05
DDDDDDDD
MFP
Data
Direction
FFFA07
DDDDDDDD
MFP
Interrupt
Enable A
FFFA09
DDDDDDDD
MFP
Interrupt
Enable B
FFFA0B
DDDDDDDD
MFP
Interrupt
Pending A
FFFA0D
DDDDDDDD
MFP
Interrupt
Pending B
FFFA0F
DDDDDDDD
MFP
Interrupt
Interrupt In Service A
FFFA11
DDDDDDDD
MFP
Interrupt
Interrupt In Service B
FFFA13
DDDDDDDD
MFP
Interrupt
Mask A
FFFA15
DDDDDDDD
MFP
Interrupt
Mask B
FFFA17
DDDDDDDD
MFP
Vector
Base
FFFA19
DDDDDDDD
MFP
Timer
A Control
FFFA1B
DDDDDDDD
MFP
Timer
B Control
FFFA1D
DDDDDDDD
MFP
Timers
C & D Control
FFFA1F
DDDDDDDD
MFP
Timer
A data
FFFA21
DDDDDDDD
MFP
Timer
B data
FFFA23
DDDDDDDD
MFP
Timer
C data
FFFA25
DDDDDDDD
MFP
Timer
D data
FFFA27
DDDDDDDD
MFP
Sync
Character
FFFA29
DDDDDDDD
MFP
USART
control reg
FFFA2B
DDDDDDDD
MFP
receiver
status
FFFA2D
DDDDDDDD
MFP
Transmitter
status
FFFA2F
DDDDDDDD
MFP
USART
Data
FFFC00
DDDDDDDD
Keyboard
ACIA
Control
FFFC02
DDDDDDDD
Keyboard
Data
FFFC04
DDDDDDDD
Midi
ACIA
Control
FFFC06
DDDDDDDD
Midi
Data
Aline commands
Aline commands are defined by DW $A0xx - these are handled by the vectors of
the 68000 like an RST command on the Z80... see Anatomy
of
the Atari St for more details
Command
Command
Detail
$A000
Initialize
Determine address of required variable range
$A001
Put Pixel
Set point on the screen
$A002
Get Pixel
Determine color of a screen point
$A003
Line
Draw a line on the screen
$A004
Horizontal Line
Draw a horizontal line (fast)
$A005
Filled Rectangle
Fill a rectangele wit color
$A006
Filled Polygon
Fill a polygon line by line
$A007
BitBlt
Bit block transfer
$A008
TextBlt
Text block transfer
$A009
Show Mouse
enable mouse cursor
$A00A
Hide Cursor
Disable mouse cursor
$A00B
Transform Mouse
Change mouse cursor form
$A00C
Undraw Sprite
Clear sprite
$A00D
Draw Sprite
Enable sprite
$A00E
Copy Raster From
Copy raster form
Vblank!
It's possible to 'Wait for Vblank' by using the line counter at
$FF8205/7/9.
First we calculate the address of the last line of our 32k screen,
in this case by adding 320*200/2 to 'ScreenBase'
Next we wait for the line counter to point to this line - at this
point the bottom of the screen is being drawn,
Here is an example of a possible solution - this assumes memory
address 'ScreenBase' has a long pointer of the address of the first
line of the screen.
waitVBlank:
moveM.l d0-d1,-(sp)
move.l ScreenBase,d1
;Get screen pointer
add.l
#(320*200/2),d1 ;Add one full screen
WaitVblankAgain:
jsr VblankGetLine
cmp.l d1,d0
blt
WaitVblankAgain ;Wait for
last line to be drawn
WaitVblankAgain2:
jsr VblankGetLine
cmp.l d0,d1
beq
WaitVblankAgain2 ;Wait for line to end
moveM.l (sp)+,d0-d1
rts
move.l d0,ikbd_vec
; store IKBD vectors address for later
move.l d0,a0
; A0
points to IKBD vectors
move.l 24(a0),old_joy
; backup old joystick vector so we can restore it
move.l #JoystickHandler,24(a0);
Set our Joystick Handler
rts
JoystickHandler:
move.b (1,a0),joydata
; store
joy 0 data
move.b (2,a0),joydata+1
; store joy 1 data
rts
ikbd_vec: dc.l 0
; old IKBD vector storage old_joy: dc.l
0
; old joy vector storage joydata: ds.b
2
;Joypad bytes F----RLDU
AY Sound Chip:
The AY uses a series of 8 bit registers to control the 3 sound channels.
To set a register, we must first select the register number by writing a
byte to $FF8800, then send the byte of
data to $FF8802
Traps
Traps are used for firmware and OS functions... commands need to be
pushed onto the stack before the call... see Anatomy
of
the Atari St for more details
Trap
Num
Command
Details
#1 (Gemdos)
$00
Term
$01
ConIn
$02
ConOut
$03
Auxilliary
Input
$04
Auxilliary
Output
$05
Printer
Output
$06
RawConIO
$07
Direct ConIn
Without Echo
$08
ConIn Without
Echo
$09
Print Line
$0A
ReadLine
$0B
ConStat
$0E
SetDrv
$10
ConOut Stat
$11
PrtOut Stat
$12
AuxIn Stat
$13
AuxOut Stat
$19
Current Disk
$1A
Set Disk
Transfer Access
$20
Super
$2A
Get Date
$2B
Set Date
$2C
Get Time
$2D
Set Time
$2F
Get DTA
$30
Get Version
Number
$31
Keep Process
$36
Get Free Disk
Space
$39
MKDir
$3A
RmDir
$3B
ChDir
$3C
Create
$3D
Open
$3E
Close
$3F
Read
$40
Write
$41
Unlink
$42
Lseek
$43
Change Mode
(ChMod)
$45
Dup
$46
Force
$47
GetDir
$48
Malloc
$49
Mfree
$4A
SetBlock
$4B
Exec
$4C
Term
$4E
Sfirst
$4F
Snext
$56
Rename
$57
GSDTOF
#13 (Bios)
0
getmpb
Get Memory
Parameter Block
1
bconstat
Return input
device status
2
conin
Read
character from device
3
bconout
Write
character to device
4
rwabs
Read and
write disk sector
5
setexec
set exception
vectors
6
tickcal
return
millisecond per tick
7
get bpb
get BIOS
parameter block
8
bcostat
return output
device status
9
mediach
inquire media
change
10
drvmap
inquire drive
status
11
kbshift
inquire/change
keyboard
status
#14 (xbios)
0
initmous
initialize
mouse
1
ssbrk
save memory
space
2
physbase
return screen
RAM base address
3
logbase
set logical
screen base
4
getrez
return screen
resolution
5
setscreen
Set Screen
parameters
6
setpalette
set color
palette
7
setcolor
set color
palette
8
floprd
read diskette
sector
9
flopwr
write disk
sector
10
flopfmt
format
diskette
12
midiws
write string
to midi interface
13
mfpint
initilize MFP
format
14
iorec
return record
buffer
15
rsconf
set rs232
configuration
16
keytbl
set keyboard
table
17
random
return random
number
18
protobt
produce boot
sector
19
flopver
verify
diskette sector
20
scrdmp
output screen
dump
21
cursconf
set cursor
configuration
22
settime
set clock
time and date
23
gettime
return clock
time and date
24
bioskeys
restore
keyboard table
25
ikbdws
intelligent
keyboard send
26
jdisint
disable
interrupts on MFP
27
jenabint
enable
interrupts on MFP
28
giaaccess
access GI
sound chip
29
offgibit
reset Port A
GI sound chip
30
ongibit
cleart port A
of GI sound chip
31
xbtimer
start MFP
timer
32
dosound
Set sound
parameters
33
setprt
Set printer
config
34
kbdvbase
return
keyboard vector table
35
kbrate
set keyboard
repeat rate
36
prtblk
output block
to printer
37
wvbl
wait for
video
38
supexec
set
supervisor execution
39
puntaes
disable AES
KbdvBase
Xbios trap #34 returns the Keyboard vector table, this contains
7 Long addresses