Programowanie: Jak stwierdzić obecność SpartaDOS X oraz jego konfigurację pamięci

From Atariki

Revision as of 21:09, 30 wrz 2006; view current revision
←Older revision | Newer revision→
Jump to: navigation, search

Nalezy wywolac ponizsza procedure. Wynik w akumulatorze, znaczenie poszczególnych wartości podane w komentarzach na końcu.

; sparta_detect.asm
; (c) idea by KMK, code: mikey
;
; $Id: sparta_detect.asm,v 1.2 2006/09/27 22:59:27 mikey Exp $
; 

p0              equ $f0
                   
sparta_detect   equ *

; if peek($700) = 'S' and bit($701) sets V then we're SDX

                lda $700
                cmp #$53         ; 'S'
                bne no_sparta
                bit $701
                bvc no_sparta

; we're running SDX, find  (DOSVEC)-$150 


                lda $a
                sec
                sbc <$150
                sta p0
                lda $b
                sbc >$150
                sta p0+1

; ok, hopefully we have established the address. 
; now peek at it. return the value. 

                ldy #0
                lda (p0),y
                rts
no_sparta       lda #$ff 
                rts

; if A=$FF -> No SDX :(
; if A=$FE -> SDX is in OSROM mode
; if A=$00 -> SDX doesn't use any XMS banks
; if A=anything else -> BANKED mode, and A is the bank number 
Personal tools