Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.apple2.programmer > #1479

Re: Method to address both Legend and Saturn RAM cards

Newsgroups comp.sys.apple2.programmer
Date 2015-01-16 09:41 -0800
References <dog_cow-1421349003@macgui.com> <crCdnUWW-uNNDCXJnZ2dnUU7-dednZ2d@earthlink.com>
Message-ID <5f4fce0f-eef3-4e51-aaef-f3929de36fbd@googlegroups.com> (permalink)
Subject Re: Method to address both Legend and Saturn RAM cards
From gids.rs@sasktel.net

Show all headers | View raw


On Thursday, January 15, 2015 at 10:21:37 PM UTC-6, Anton Treuenfels wrote:
> "D Finnigan" wrote in message 
> 
> > BANKBASE EQU $C084 ; BASE ADDRESS FOR BANK SELECT ADDR
> > RAMTYPE EQU $06 ; TYPE OF RAM CARD INSTALLED
> > *
> > *
> > * SELECT A 16K RAM BANK. DESIRED BANK NUMBER
> > * SHOULD BE PASSED IN THE A-REG.
> > *
> > BANKSEL
> > LDA RAMTYPE ; WHAT TYPE OF RAM CARD?
> > BEQ :LEGEND ; 0 = LEGEND, 1 = SATURN
> > TAX
> > STA BANKBASE,X ; SELECT BANK
> > RTS
> > :LEGEND LDX #0
> > STA BANKBASE,X ; SELECT BANK
> > RTS
> 
> I don't know squat about either card, but:
> 
> - if the bank number is passed in the A-register, doesn't the instruction
> 
> LDA RAMTYPE
> 
> wipe it out first thing?
> 
> - if the value of the X-register is zero, there is no practical difference 
> between
> 
> STA BANKBASE,X
> 
> and
> 
> STA BANKBASE
> 
> unless there's some weird hardware quirk that "notices" the address mode and 
> does something special about it.
> 
> - so how about this:
> 
> BANKSEL
>   LDX RAMTYPE
>   BEQ LEGEND
>   TAX
> LEGEND
>   STA BANKBASE,X
>   RTS
> 
> - Anton Treuenfels


No.  That doesn't quite work either.

You need to be able to store a 0-$F in the Saturns register.

So Maybe something like this

LDY #0-3 ; for Legend
LDY #0-$F; for Saturn

BANKSEL  LDX RAMTYPE        ; WHAT TYPE OF RAM CARD?
         BEQ :LEGEND        ; 0 = LEGEND, 1 = SATURN
         TYA
         STA BANKBASE,X     ; SELECT BANK
         RTS

:LEGEND  CPY #4
         BCS RETURN
         TYA
         TAX
         STA BANKBASE,X     ; SELECT BANK
RETURN   RTS

Back to comp.sys.apple2.programmer | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Method to address both Legend and Saturn RAM cards D Finnigan <dog_cow@macgui.com> - 2015-01-15 19:09 +0000
  Re: Method to address both Legend and Saturn RAM cards "Anton Treuenfels" <teamtempest@yahoo.com> - 2015-01-15 22:21 -0600
    Re: Method to address both Legend and Saturn RAM cards gids.rs@sasktel.net - 2015-01-16 09:41 -0800
      Re: Method to address both Legend and Saturn RAM cards D Finnigan <dog_cow@macgui.com> - 2015-01-16 19:08 +0000
      Re: Method to address both Legend and Saturn RAM cards qkumba <peter.ferrie@gmail.com> - 2015-01-17 21:32 -0800
        Re: Method to address both Legend and Saturn RAM cards gids.rs@sasktel.net - 2015-01-17 22:33 -0800
          Re: Method to address both Legend and Saturn RAM cards gids.rs@sasktel.net - 2015-01-17 22:54 -0800
            Re: Method to address both Legend and Saturn RAM cards Leandro Polimeno <leandro.polimeno@gmail.com> - 2015-02-10 04:53 -0800
              Re: Method to address both Legend and Saturn RAM cards gids.rs@sasktel.net - 2015-02-10 21:19 -0800
                Re: Method to address both Legend and Saturn RAM cards Leandro Polimeno <leandro.polimeno@gmail.com> - 2015-02-11 05:22 -0800
          Re: Method to address both Legend and Saturn RAM cards D Finnigan <dog_cow@macgui.com> - 2015-01-18 10:09 +0000
            Re: Method to address both Legend and Saturn RAM cards "Anton Treuenfels" <teamtempest@yahoo.com> - 2015-01-19 08:33 -0600
              Re: Method to address both Legend and Saturn RAM cards D Finnigan <dog_cow@macgui.com> - 2015-01-19 18:29 +0000
              Re: Method to address both Legend and Saturn RAM cards qkumba <peter.ferrie@gmail.com> - 2015-01-20 09:33 -0800
                Re: Method to address both Legend and Saturn RAM cards "Anton Treuenfels" <teamtempest@yahoo.com> - 2015-01-20 17:06 -0600

csiph-web