Jump to content
IGNORED

XL Translator Source...


Curt Vendel

Recommended Posts

TITLE 'The ATARI Translator ---------------------'

SUBTTL 'Program Identification and Revision History'

; ================================================================

;

; ATARI Translator

;

; Version 1

; September 20, 1983

;

; This auto-booting diskette installs an ATARI 800 Operating

; System (Revision B) in RAM "under" the ROM-based O.S. in

; an XL-line computer. It exists to allow consumers to run

; most 3rd party software which would otherwise fail to exe-

; cute on the XL computers due to "violations" of the rules

; for proper Operating System usage. It is NOT meant to en-

; courage continued disregard for the stated O.S. guidelines

; by independent software vendors.

;

; Once this disk has been loaded, the user is prompted to

; remove it and insert the application diskette (or cassette)

; and press the [sELECT] key. When this occurs the system

; undertakes a COLD START in the new, RAM-based O.S. envir-

; onment. For all intents and purposes, the machine should

; then look exactly like an ATARI 800 (with the few caveats

; outlined below) and the program should boot and run fine.

;

; In order to properly service a [RESET]-triggered WARM START,

; the RAM-based O.S. has been modified to continually "watch"

; the contents of the DOSINI vector. When/if the application

; sets this vector the O.S. saves the contents and steals it

; back so that it always points to some code which re-enables

; the soft O.S. upon [RESET]. A normal WARM START is then

; processed by the soft O.S. This [RESET] key handling only

; works for applications which do not themselves jump through

; DOSINI. Side 'B' of the TRANSLATOR diskette has been config-

; ured to allow programs of this class (ie. any which boot the

; 850 Interface Module) to run properly. However, in this case

; the [RESET] key will not reselect the RAM-based O.S.

;

; The Translator assumes the following conditions for proper

; operation:

;

; + 64K RAM system (ie. 600XL w/expansion module)

; + The application does not write to PORTB ($D301)

; + IRQs and NMIs are not permanently disabled by the

; application (or [RESET] may not function correctly)

; + On a 1450XLD, application is booted from SIO-based disk

; + Application does not alter locations $0160 thru $0170

; + Application does not expect RAM in 4K block at $C000

;

; By configuring the system as an ATARI 800, the application

; will not be able to take advantage of certain XL-specific

; features, such as function keys F1-F4, the HELP key, PBI

; peripheral devices, etc.

;

; MODS: Joe Miller Add graphics and code for [RESET] 83-09-15

; Greg Riker Original version 83-03-20

;

; ================================================================

SUBTTL 'Macro Definitions'

LIST I,-M

 

WATCH MACRO

%L LDA DOSINI+1 ;If DOSINI high byte has changed

CMP #high RAMLINK

BEQ ?X%K

STA SVDINI+1 ; Save new high byte

LDA #high RAMLINK

STA DOSINI+1 ; Replace w/WARM START trap address

;Endif

?X%K LDA DOSINI ;If DOSINI low byte has changed

CMP #low RAMLINK

BEQ ?Y%K

STA SVDINI ; Save application's low byte

LDA #low RAMLINK

STA DOSINI ; Restore WARM START trap address

?Y%K ;Endif

ENDM

 

PATCH MACRO DEST,SOURCE,COUNT

%L LDA #low %1 ;Copy 'COUNT' bytes from 'SOURCE' to 'DEST'

STA DEST

LDA #high %1

STA DEST+1

LDA #low %2

STA SOURCE

LDA #high %2

STA SOURCE+1

LDA #low %3

STA COUNT

LDY #0

 

?Z%K LDA (SOURCE),Y

STA (DEST),Y

INY

DEC COUNT

BNE ?Z%K

 

LDA #high %3

BEQ ?Q%K

 

INC SOURCE+1 ;NOTE: special case for O.S. copy

INC DEST+1

BNE ?Z%K

?Q%K

ENDM

 

ALIGN MACRO ;Page-aligned location counter

ORG [[high *]+1] shl 8

%L

ENDM

 

RESET SET *O ;Set conditional assembly parameter

INCLUDE D2:XLBOOT.ASM

INCLUDE D2:XLSCR1.ASM

INCLUDE D2:XLSCR2.ASM

INCLUDE D2:XLSCR3.ASM

INCLUDE D2:XLITES.ASM

SUBTTL 'Mainline'

 

 

; ------------------------------------------------------

; This is the TRANSLATOR mainline.

; It activates a textual prompt on the display and waits

; for the [sELECT] keypress. When [sELECT] is pressed,

; The XL O.S. is swapped out and the 400/800 Rev. B. O.S.

; is copied into RAM in its place. A few key patches are

; made to the RAM-based O.S. and WARM START recovery code

; is hidden in RAM at $CFxx. When this is done, a COLD

; START is invoked by the newly installed O.S.

; ------------------------------------------------------

 

ALIGN

SWAPOS LDA DLJMP ;Move display list 'JMP' address

STA DLJ ;Into zero page (for indirect STA)

LDA DLJMP+1

STA DLJ+1

 

LDA RAMSIZ

CMP #$C0

BCC TXTON ;If Cartridge (or BASIC) not present, then

LDX #low CRTLEN

LDA #0 ; Repeat

NOCART STA CARTIN,X ; Remove 'Cart. Present' message

DEX

BPL NOCART ; Until all characters removed

;Endif

TXTON LDA #1

STA TXTFLG ;Enable prompt message (via VBL)

 

SELECT LDA #8 ;Repeat

STA CONSOL ; Convention for reading CONSOL keys

LDA CONSOL ; Read CONSOL keys

AND #2

BNE SELECT ;Until [sELECT] pressed

 

LDA #0

STA SDMCTL ;Disable screen DMA

STA DMACTL

STA NMIEN ;Disable all interrupts

STA IRQEN

 

SEI

LDA PORTB ;Load current PORTB PIA status

AND #$FE ;Disable O.S. ROM (leave BASIC unchanged)

STA PORTB

PHA ;Hold that thought for a moment

EJECT

 

; Install REV B. O.S. Patches -------------------------

 

PATCH $D800,OSOBJ,$2800 ;Copy Rev B. O.S. into RAM

PATCH RAMSCAN,PC0CODE,PC0LEN ;Copy O.S. patches to page $Cx

PATCH $F26F,PATSIZ,3 ;SPECL ram sizing patch

 

IF RESET ;If [RESET] processing enabled, then

 

PATCH $E737,PATIRQ,3 ; Low-level IRQ watchdog patch

PATCH $E7AB,PATNMI,3 ; Immediate VBLANK watchdog patch

PATCH $F173,PATROJ,3 ; Post stack-clear 'trojan horse'

PATCH $F366,PATCLD,3 ; Single boot sector fix

 

 

; Repoint the JMP (DOSINI) to our vector --------------

 

LDA #low SVDINI ; New vector for disk-booted init

STA DINI+1

LDA #high SVDINI

STA DINI+2

 

ENDIF ;Endif

 

 

; Save a few XL-O.S. WARM START descriminator bytes ----

 

PLA ;Reload current PORTB PIA status

STA SVPORTB ;Save it for WARM START restoration

 

LDA GINTLK ;Save Cartridge interlock flags

STA SVINTLK

LDA CARTCK ;Save Cartridge checksum (if needed)

STA SVCRTCK

 

LDX #2 ;Save XL O.S. power-up test bytes

RECON LDA PUPBT1,X

STA SVPUCHK,X ;for WARM START power-up check in XL

DEX ;(these are restored in TROJAN)

BPL RECON

 

 

; Finally, startup the RAM-based O.S. -----------------

 

JMP COLDSV ;Invoke Rev. B O.S. COLD START

SUBTTL 'Patches and WARM START Linkage'

 

; These 5 lines are PATCHed into the O.S. -----------+

; |

PATIRQ JMP DSCAN1 ;IRQ 'DOSINI' monitor |

PATNMI JMP DSCAN2 ;NMI 'DOSINI' monitor |

PATROJ JMP TROJAN ;Hides routine in stack |

PATSIZ JMP SIZRAM ;Limits RAMSIZ to $C0 |

PATCLD JSR COLDIN ;Special-case 'DOSINI' chk |

; |

; They are the only run-time changes to the O.S. ----+

 

 

; The following code is 'safed' in RAM at $Cxxx ----------------+

; |

; v

 

PC0CODE

LOC RAMSCAN

 

; -------------- This code, in turn, is moved into the stack,

; where (hopefully) it will remain untouched by

; normal execution of the application. It is

; needed to reselect the RAM O.S. on [RESET] --+

STKCODE ; |

SEI ;Disallow interrupts for switchback |

LDA #$FE ;Reestablish access to data at $Cxxx |

STA PORTB ;By momentarily deselecting ROM O.S. |

LDA SVPORTB ;Load previously saved PORTB status |

STA PORTB ;Reconfigure memory/disable ROM O.S. |

JMP WARMSV ;Re-invoke WARM START --> |

STKLEN EQU * - STKCODE ; |

; |

; -------------- End of Stack Usage -------------------------+

 

 

; The 'trojan' instructions are executed just after memory

; is cleared after both a COLD or WARM start in the 800 O.S.

; It deposits the above routine in the stack and restores

; some key values needed by the XL O.S. to descriminate be-

; tween a WARM and COLD start upon the user pressing [RESET].

 

TROJAN PATCH RAMLINK,STKCODE,STKLEN

LDA SVINTLK ;Restore XL-O.S. control bytes

STA GINTLK

LDA SVCRTCK

STA CARTCK

 

LDX #2 ;Restore 'magic' power-up bytes

REWARM LDA SVPUCHK,X

STA PUPBT1,X

DEX

BPL REWARM

 

LDA #2 ;Complete 'patched' code

STA LMARGN

JMP $F177 ;Return to O.S. initialization code

 

 

; Storage area for key TRANSLATOR variables --------------------+

; |

SVDINI DS 2 ;Application's DOSINI saved here |

SVPORTB DS 1 ;COLD START PORTB status saved here |

SVINTLK DS 1 ;Cartridge interlock flag saved here |

SVCRTCK DS 1 ;Cartridge checksum saved here |

SVPUCHK DS 3 ;O.S. WARM START test bytes saved here |

; |

; The above bytes should not be touched by the application -----+

 

 

; This ensures the O.S. stops sizing RAM at $C000 ---------------

 

SIZRAM CLC ;Patch to O.S. RAM sizing code

ADC #$10

STA TRAMSZ

CMP #$C0 ;Stop scan at $C000

BCS SIZRTS

JMP $F25F

SIZRTS RTS

 

 

; These routines 'WATCH' for the application stealing the

; DOSINI vector. If that happens, the new value is saved

; at SVDINI and DOSINI is re-stuffed with a vector to the

; [RESET] recovery code hidden in page 1.

 

COLDIN WATCH ;Special case for 1 boot sector disks

JMP (SVDINI)

 

 

DSCAN1 STA IRQEN ;Low-level IRQ patch

WATCH

JMP $E73A

 

DSCAN2 WATCH ;VBLANK NMI patch

JMP (VVBLKI)

 

 

CPYRT DB 'Copyright 1983 ATARI, Inc.'

DB $02,$BB,$5A,$30,$5F,$EE,$3D,$A8,$20

DB $47,$50,$52,$26,$4A,$42,$4D,$33,$20

 

ORG *O

PC0LEN EQU * - PC0CODE

; ^

; |

; This ends the code stored in $Cxxx ---------------------------+

 

ALIGN

 

INCLUDE D2:OSB800.ASM

 

SUBTTL 'End --------------------------------------'

RAMEND

END RAMLOAD

  • Like 1
Link to comment
Share on other sites

  • 1 year later...

After reading this...

 

Does anyone know why Atari decided to go with 64K on the XLs? Was this a design decision to allow for the running of OSB or marketing or? Is the Translator just in response to the issues seen with the 1200XL and software incompatabilities?

 

How is this different from the "Fix-XL" that was a 3rd party patch?

 

I always wondered what the B side of the Translator was for... =)

Edited by kheller2
Link to comment
Share on other sites

After reading this...

 

Does anyone know why Atari decided to go with 64K on the XLs? Was this a design decision to allow for the running of OSB or marketing or? Is the Translator just in response to the issues seen with the 1200XL and software incompatabilities?

 

How is this different from the "Fix-XL" that was a 3rd party patch?

 

I always wondered what the B side of the Translator was for... =)

 

Hey Karl,

 

The B side was for loading a different version of Atari 800 OS when the A side didn't work. I believe it was OS version A. I've had to use side B sometimes. Don't remember which titles though.

 

Glenn

Link to comment
Share on other sites

 

I always wondered what the B side of the Translator was for... =)

 

Hey Karl,

 

The B side was for loading a different version of Atari 800 OS when the A side didn't work. I believe it was OS version A. I've had to use side B sometimes. Don't remember which titles though.

 

Glenn

 

I always thought that too, but the above comments make me wonder:

 

"This [RESET] key handling only

; works for applications which do not themselves jump through

; DOSINI. Side 'B' of the TRANSLATOR diskette has been config-

; ured to allow programs of this class (ie. any which boot the

; 850 Interface Module) to run properly

 

"

Edited by kheller2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...