X-Received: by 10.50.12.42 with SMTP id v10mr3609191igb.0.1421430060487; Fri, 16 Jan 2015 09:41:00 -0800 (PST) X-Received: by 10.182.153.66 with SMTP id ve2mr9513obb.40.1421430060392; Fri, 16 Jan 2015 09:41:00 -0800 (PST) Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!newsswitch.lcs.mit.edu!ottix-news.ottix.net!border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!h15no4245325igd.0!news-out.google.com!qk8ni6628igc.0!nntp.google.com!h15no6587770igd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.sys.apple2.programmer Date: Fri, 16 Jan 2015 09:41:00 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=207.195.86.36; posting-account=U4TNXwoAAABP4nIJHynAJZ69O_f3LY2g NNTP-Posting-Host: 207.195.86.36 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <5f4fce0f-eef3-4e51-aaef-f3929de36fbd@googlegroups.com> Subject: Re: Method to address both Legend and Saturn RAM cards From: gids.rs@sasktel.net Injection-Date: Fri, 16 Jan 2015 17:41:00 +0000 Content-Type: text/plain; charset=ISO-8859-1 Lines: 73 Xref: csiph.com comp.sys.apple2.programmer:1479 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