Atari ST cartridge port

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

ppera

Atari ST cartridge port

Postby ppera » Mon May 26, 2008 9:49 am

Usage of cartridge port on Atari ST machines as is originally intended - for fast accessing some short utilities and programs is probably little obsolete now. But, because I don't see that it is much covered, I will give here required informatons how to add applications on cartridge port. In second part HW will be covered: how to making cartridge board.

Cartridge port uses address range: $FA0000-$FBFFFF, it is 128KB, not much these days. But we may put there several short apps. especially if we compress them (SFX). Port is read only. At beginning magic long value $ABCDEF42 means that cartridge is active, and has at least 1 programm on. (For diagnostic cartridges we have different magic, but will not deal here with..) After it comes header of first program - see attached pic about header.

CA_NEXT points to header of next program, or has value 0 if no more.

CA_INIT holds address of optional init. routine. Bits 24-31 aren't used for addressing, and ensure in which moment by system init prg. will be initialized and/or started. Bits have following meanings, 1 means execution:

bit 24: Init. or start of cartridge SW after succesfull HW init. System variables and vectors are set, screen is set, Interrupts are disabled - level 7.

bit 25: As by bit 24, but right after enabling interrupts on level 3. Before GEMDOS init.

bit 26: System init is done until setting screen resolution. Otherwise as bit 24.

bit 27: After GEMDOS init. Before booting from disks.

bit 28: -

bit 29: Program is desktop accessory - ACC .

bit 30: TOS application .

bit 31: TTP .



CA_RUN: Program start address. All optional inits are done before. This is required only if program runs under GEMDOS.

CA_TIME and CA_DATE: File's time and date stamps. In GEMDOS format.

CA_SIZE: Lenght of app. in bytes. Not really used.

CA_NAME: DOS/TOS filename 8.3 format. Terminated with 0 .


Cartridge programs for GEMDOS will appear on desktop in virtual drive c: (lowcase c) .

There are some limitations: only executables are accessible on cartridge - it means that PRG with separated RSC file will not work. Programs must be written so, that run from ROM. This latest is fortunately easy to override, what is important, because we want to put there some existing programs, written to run from RAM. I will give here simple code example, which copies and relocates executables from ROM to RAM.

Code: Select all

*Multi Cartridge programm starter

*Rom cartridge

  org $FA0000
 
  dc.l $abcdef42 *magic
  dc.l second
  dc.l 0
  dc.l run1
  dc.w $a5CD *time
  dc.w $1e28 *date
  dc.l 31420
  dc.b "MONC.PRG",0
    even

second
  dc.l third
  dc.l 0
  dc.l run2
  dc.w $b149 *time
  dc.w $1e51 *date
  dc.l 7961
  dc.b "FIRDC.PRG",0
  even

third
  dc.l 0
  dc.l 0
  dc.l coac
  dc.w $a5CD *time
  dc.w $1e28 *date
  dc.l 22568
  dc.b "DISKDOCT.PRG",0
  even

*Input: a6-progbase adress, d2- len/4

coac  lea thecoac(pc),a6
  move.w #22568/4,d2
  bra.s common


run1  lea themon(pc),a6
  move.w #31420/4,d2
  bra.s common


run2  lea thefirdc(pc),a6
  move.w #7961/4,d2

*test free ram

common  move.l 4(sp),a0 *tpa begin
  move.l 4(a0),d0 *tpa end
  sub.l a0,d0 *available len
 
  moveq #0,d1
  add.l 2(a6),d1 *text len
  add.l 6(a6),d1 *data len
  add.l 10(a6),d1 *bss len
  add.l #512,d1 *for basepage+reserve
 
*d1 now holds needed ram len

  cmp.l d1,d0
  bmi.s noram

  lea 256(a0),a1
  move.l a1,8(a0)  *txt beg (startadress of prg) 

  lea -28(a1),a2
  move.l a2,a3 *store beginadr of header
     
*copy code
ccl move.l (a6)+,(a2)+ 
  dbf d2,ccl
 


*Relocation
*a0 is base page,a1 is text begin, a3 is header addr.
 
   move.l a1,a2
   add.l 2(a3),a2  *txt len
   add.l 6(a3),a2  *data len
   move.l a1,d0
   tst.l (a2)
   beq.s corrbp
   ADDA.L   (A2)+,A1
   clr.l d1
relol   ADD.L   D0,(A1)
bigd   
   MOVE.B   (A2)+,D1
   beq.s corrbp
   CMP.B   #1,D1
   bne.s   nmd
   ADDA.W   #$FE,A1
   BRA.S   bigd
nmd   ADDA.L   D1,A1
   BRA.S   relol
corrbp
   MOVE.L   2(A3),$C(A0)
   MOVE.L   6(A3),$14(A0)
   MOVE.L   $A(A3),$1C(A0)
   MOVE.L   $C(A0),D1
   ADD.L   D0,D1
   MOVE.L   D1,$10(A0)
   ADD.L   $14(A0),D1
   MOVE.L   D1,$18(A0)

   move.l d0,a1
   
   jmp (a1)
   
noram  pea mess(pc)
  move.w #9,-(sp)
  trap #1
  addq.l #6,sp
 
  move.w #1,-(sp) *wait keypress
  trap #1
  addq.l #6,sp
       
  clr.w -(sp)
  trap #1 *exit
 
mess dc.b 13,10,"Insufficient RAM !",0
  even

thecoac
  incbin DISKDOCT.PRG
 
   even
   dc.l 0,0 *gap

thefirdc
  incbin FIRDC.PRG
 
   even
   dc.l 0,0 *gap

themon
  incbin MONC.PRG

  even
   dc.l 0,0 *gap



Executables may be compressed to save space - for instance with PRG FIRDC on this cartridge example.

In attachment CART1.ZIP is this source and 64KB cartridge content - binary, and splitted to Low and High parts for EPROM burners.
You may play with binary in Hatari emulator, but first expand it to full 128KB, otherwise will not activate (for instance use DOS copy command: copy /b ca3f_1w.bin + ca3f_1w.bin cart.bin - will get 128KB ).
In Steem cartridge image file format is little different, as I see it adds four zeros at beginning... Right. Attachment CARD2.ZIP holds special cartridge SW, which creates RAMdisk C at boot. I included some disk utilities, control.acc in example. Cartridge image is in STC format, what is just regular binary with 4 zeros at start. So, you may play with it in Steem, or burn it for cartridge if strip those 4 zeros and split it...
You do not have the required permissions to view the files attached to this post.
Last edited by ppera on Thu May 29, 2008 10:07 am, edited 1 time in total.

ppera

Re: Atari ST cartridge port

Postby ppera » Mon May 26, 2008 5:16 pm

Second part: HW

Original Atari cartridge design is for 4x 32KB (27C256) EPROMs. It is not wise this days, so we go on using 2x 64KB chips.
You may DL Eagle schematics and PCB designs in attachments - there is little simpler board with max 64KB too. Thanks to popsel for board designs...

Here may DL some diagnostic cartridge ROM contents for diverse Atari machines. Sizes are usually 64KB :
http://www.hobby-electronique.com/Proje ... fault.aspx

Note for schematics: address lines are shifted by 1 - it means that you need to connect A1 from port with A0 of EPROMs. A2 with A1 of EPROMs ets... On 128K version A15 of EPROMs is connected with ROM4. Of course, it is visible in Eagle files.
You do not have the required permissions to view the files attached to this post.
Last edited by ppera on Fri May 30, 2008 8:19 am, edited 5 times in total.

User avatar
techie_alison
Administrator
Administrator
Posts: 1547
Joined: Tue Aug 23, 2005 10:06 am
Location: Cambridge, UK
Contact:

Re: Atari ST cartridge port

Postby techie_alison » Mon May 26, 2008 5:19 pm

Keep it coming Ppera. :)

The bit I'm interested in is getting PRGs onto EPROMS. As in existing programs (that I can't change or recompile). Where do they go etc. etc. I have EPROMs and a burner, just how to get the images ready etc. etc.

Edge connectors are 2mm (and difficult to source) just to chip in here. The male ones aren't a problem since you can etch them.
If I don't answer or appear to have forgotton then email again, I'm scatty! :)

http://www.logicsays.com/ = Updated Site
http://www.logicsays.com/index1 = Older Site (with more Atari)

User avatar
nativ
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 4087
Joined: Mon Jul 30, 2007 10:26 am
Location: South West, UK

Re: Atari ST cartridge port

Postby nativ » Mon May 26, 2008 5:35 pm

I do believe I had a Rom called backpack -computer concepts, that generated a Rsc or similar file. It is a vague recolection, but may be possible?

Ashley
Atari STFM 512 / STe 4MB / Mega ST+DSP / Falcon 4MB 16Mhz 68882 - DVD/CDRW/ZIP/DAT - FDI / Jaguar / Lynx 1&2 / 7800 / 2600 / XE 130+SD Card // Sega Dreamcast / Mega2+CD2 // Apple G4

http://soundcloud.com/nativ ~ http://soundcloud.com/nativ-1 ~ http://soundcloud.com/knot_music
http://soundcloud.com/push-sounds ~ http://soundcloud.com/push-records

User avatar
techie_alison
Administrator
Administrator
Posts: 1547
Joined: Tue Aug 23, 2005 10:06 am
Location: Cambridge, UK
Contact:

Re: Atari ST cartridge port

Postby techie_alison » Mon May 26, 2008 9:00 pm

This is the board from a Fast Basic Cartridge, which provides utilities on drive 'c' (lower case, cartridge port) on the desktop.

It contains two 64Kbyte EPROMS, 27C512's.
You do not have the required permissions to view the files attached to this post.
If I don't answer or appear to have forgotton then email again, I'm scatty! :)

http://www.logicsays.com/ = Updated Site
http://www.logicsays.com/index1 = Older Site (with more Atari)

User avatar
Heavy Stylus
Atari Super Hero
Atari Super Hero
Posts: 776
Joined: Wed Dec 14, 2005 12:59 pm
Location: Exeter, UK
Contact:

Re: Atari ST cartridge port

Postby Heavy Stylus » Thu Dec 18, 2008 4:51 pm

techie_alison wrote:This is the board from a Fast Basic Cartridge, which provides utilities on drive 'c' (lower case, cartridge port) on the desktop.

It contains two 64Kbyte EPROMS, 27C512's.


Ignoring the spam above, I'd be really interested to know if it is possible to create clones of this board with the 'c' drive containing your own programs. This would potentially mean that you could create a 128KB game cartridge for the ST, which although some will argue it would be pointless, I think it could be quite fun. :)

I've been selling new C64 cartridges via RGCD for a while now, and it would be great if a new game from someone like paradize could be made in cartridge form for the STE - it would be really collectable IMO.

Do any cartridges auto-boot their contents?
http://www.rgcd.co.uk
The Essential Discmag for Retro Gamers!

http://www.myspace.com/heavystylus
Usual myspace crap.

http://tinyurl.com/heavystylus
Facebook

User avatar
PaulB
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2168
Joined: Tue Jun 11, 2002 10:56 pm
Location: You Kay

Re: Atari ST cartridge port

Postby PaulB » Thu Dec 18, 2008 6:13 pm

AFAIK the cartridge port is checked before the floppy or hard drive. If you have an auto folder on c and your program is in it, it can auto boot. Although the same problems exist with GEM not being booted so early so is has to be a TOS program that doesn't use GEM.

ppera

Re: Atari ST cartridge port

Postby ppera » Thu Dec 18, 2008 8:08 pm

Heavy Stylus wrote:...really interested to know if it is possible to create clones of this board with the 'c' drive containing your own programs. This would potentially mean that you could create a 128KB game cartridge for the ST, which although some will argue it would be pointless, I think it could be quite fun. :)
I've been selling new C64 cartridges via RGCD for a while now, and it would be great if a new game from someone like paradize could be made in cartridge form for the STE - it would be really collectable IMO.
Do any cartridges auto-boot their contents?


Autoboot is possible in several points at system startup. As is described here at top. If game uses not GEM, may easily autoboot. With little compression you may put more than 128KB on cartridge.
But I think that autoboot is not so relevant. Actually, it will practically block machine from regular usage. Except that game can be exited to Desktop.

simbo

Re: Atari ST cartridge port

Postby simbo » Fri Jan 22, 2010 9:46 pm

you can very easily make banks of 512k and use this for apps

you can have quite a few
you just need a small auto folder program that runs after an inital load
the cart supplies a magic number on boot and setup up a few events
and the auto program creates a menu by reseting to another section of the bootup rom on your cart
an mcu on the cart is setup to now decode which app is required
becouse while the banks and roms signals are being decoded also by the mcu
it decides which chips are read and when

and running the second part of the cart app {triggered by the now resident auto app}
this way you can load several big multiblocks
the block's of which are reloaded also by the auto folder prg
will work with some things even games ...
ive seen a guide to do this on vezz site..

User avatar
olivierg
Atari nerd
Atari nerd
Posts: 49
Joined: Wed Jul 27, 2016 2:10 pm
Location: Belgium
Contact:

Re: Atari ST cartridge port

Postby olivierg » Wed Sep 20, 2017 3:05 pm

Hi All,

I wake up this old post, because i try to understand for create software (Mac, Win) for easy create the eprom file.
The file in attachement on first post, help many but I do not understand some thing:
I have create table with the orginal file for example:

Code: Select all

First File:
$FA0000:   AB CD EF 42                = magic                   4 bytes
$FA0004:   00 FA 00 22               = pointer to next program        4 bytes
$FA0008:   00 00 00 00                = pointer to program init         4 Bytes
$FA000C:   00 FA 00 6C               = pointer to program beginning       4 Bytes
$FA0010:   A5 CD                  = File time Gemdos Format      2 Bytes
$FA0012:   1E 28                  = File date               2 Bytes
$FA0014:   00 00 7A BC               = File Lenght (31420)            4 Bytes
$FA0018:    4D 4F 4E 43 2E 50 52 47 00        = File Name 8.3 (MONC.PRG)      x Bytes max 12
$FA0021:   00                     ?
         
Next File:
$FA0022:   00 FA 00 40               = pointer to next program        4 bytes
$FA0026:   00 00 00 00                = pointer to program init         4 Bytes
$FA002A:   00 FA 00 76               = pointer to program beginning       4 Bytes
$FA002E:   B1 49                  = File time Gemdos Format      2 Bytes
$FA0030:   1E 51                  = File date               2 Bytes
$FA0032:   00 00 1F 19               = File Lenght (7961)            4 Bytes
$FA0034:   46 49 52 44 43 2E 50 52 47 00      = File Name 8.3 (FIRDC.PRG)      x Bytes max 12

Last File:
$FA0040:    00 00 00 00                   = pointer to next program        4 bytes
$FA0044:   00 00 00 00                  = pointer to program init         4 Bytes
$FA0048:   00 FA 00 62                   = pointer to program beginning       4 Bytes
$FA004C:   A5 CD                     = File time Gemdos Format      2 Bytes
$FA004E:   1E 28                      = File date               2 Bytes
$FA0050:   00 00 58 28                  = File Lenght (22568)            4 Bytes
$FA0054:   44 49 53 4B 44 4F4 3 54 2E 50 52 47 00   = File Name 8.3 (DISKDOCT.PRG)   x Bytes max 12
$FA0061:   00                        ?


My questions:
1) Why in address FA0021 and FA0061 i have 00 ?
2) The order is important ? (First @ FA 00 6C, Second @ FA 00 76, last @ FA 00 62).

Thanks
Olivier
TT030 4/32 TOS 3.06, Mega ST4, Mega ST2, 1040 STE, 2 x 1040STFM, 2 x 1040STF, MegaFile 30, Lynx 1

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

Re: Atari ST cartridge port

Postby AtariZoll » Wed Sep 20, 2017 4:32 pm

0-os are there because headers of files in cartridge must be on even address.
Since you have pointers to programs in headers, order of programs self in cartridge ROM is irrelevant.
Actually, even header order can be mixed - only first header must be at $FA0004 . But of course it is better to put all it in normal order.
English language is like bad boss on workplace: it expecting from you to strictly follow all, numerous rules, but self bending rules as much likes :mrgreen:

User avatar
olivierg
Atari nerd
Atari nerd
Posts: 49
Joined: Wed Jul 27, 2016 2:10 pm
Location: Belgium
Contact:

Re: Atari ST cartridge port

Postby olivierg » Wed Sep 20, 2017 6:29 pm

Ok, it's logic.

Now the pointer beginning send to :
$FA0062: 4D FA 00 D0 34 3C 16 0A 60 12 ' for DISKDOCT.PRG
$FA006C: 4D FA 78 18 34 3C 1E AF 60 08 ' for MONC.PRG
$FA0076: 4D FA 58 EC 34 3C 07 C6 20 6F ' for FIRDC.PRG

Why Start 4D ?
OK for : FA 00 D0 = start storage address of file
after 34 3C 16 0A 60 12 why ?

Thanks
Olivier
Ps: i read on web is not possible to store program with .RSC it's true ?
TT030 4/32 TOS 3.06, Mega ST4, Mega ST2, 1040 STE, 2 x 1040STFM, 2 x 1040STF, MegaFile 30, Lynx 1


Social Media

     

Return to “Guides”

Who is online

Users browsing this forum: No registered users and 2 guests