Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: awanderin Newsgroups: comp.sys.apple2.programmer Subject: Re: code golf (do my homework) Date: Thu, 30 Aug 2018 20:36:03 -0600 Organization: A noiseless patient Spider Lines: 47 Message-ID: References: <454bbaa3-4305-4913-8f0a-e7976f4ec447@googlegroups.com> <73c8e19c-edca-49dd-bccb-fe13c041bece@googlegroups.com> <6a250c8b-92aa-46fd-a7de-eb165b884dcb@googlegroups.com> <6237b84d-1d18-4f5e-8434-5ced583bcfb3@googlegroups.com> <4f907f75-da07-4e29-b030-b79027285e04@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="4fe5f36e87179feb975709d15a36fa61"; logging-data="15282"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18PUERNXFD3UKP+dFPyPvK9AX18IkQ42t4=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:GKQ6Zvk+oO8beo4IrM7s3/89Bzg= sha1:Y1154s4YtGc5to5pZTVcd0QXfnA= Xref: csiph.com comp.sys.apple2.programmer:4740 qkumba writes: >> And for 128k, use MACHID from the ProDOS global page, > > We are expecting ProDOS to not be present at the time. > Hence the need to implement these things ourselves. > It looks like the ProDOS detection is what I need. > I'll check Lode Runner next. > Thanks. Apple's Misc Tech-Note #002 has machine-ID code and includes this aux-RAM checker: ------------------------------------------------------------ rdmainram equ $C002 ;read main ram rdcardram equ $C003 ;read aux ram wrmainram equ $C004 ;write main ram wrcardram equ $C005 ;write aux ram [...] * This is the routine run in the safe area not affected * by bank-switching the main and aux RAM. start lda #test4 ;yet another test byte sta wrcardram ;write to aux while on main zero page sta rdcardram ;read aux ram as well sta begpage2 ;check for sparse memory mapping lda begsprse ;if sparse, these will be the same cmp #test4 ;value since they're 1K apart bne auxmem ;yup, there's 128K! asl begsprse ;may have been lucky so we'll lda begpage2 ;change the value and see what happens cmp begsprse bne auxmem sec ;oops, no auxiliary memory bcs goback auxmem clc goback sta wrmainram ;write main RAM sta rdmainram ;read main RAM jmp back ;continue with program in main mem done nop ;end of relocated program marker ------------------------------------------------------------ -- -- Jerry awanderin at gmail dot com