Re: Detect a C128 from C64 mode

From: Greg King <greg.king5_at_verizon.net>
Date: Fri, 24 May 2013 11:53:48 -0400
Message-id: <9BD12910E6474DCD9217ADD0F9682D5D@Kaiser>
From: silverdr; on Thursday, May 23, 2013; at 11:52 AM -0400
>
> On 2013-05-23, at 16:17, Greg King wrote:
>
>>> Unfortunately, I don't think any of these work; they all set
>>> the test-mode bit (bit 1) to 1 (on)?
>>
>> Does that matter?  The original test bit (in $d016) crashed the system
>> because it disabled the dynamic RAM refresh (therefore, it was
>> removed).
>
> That was actually the question from my original post: what does the
> "test bit", AKA "test mode", do to the machine?
>
>>  But, the new test bit doesn't do that -- and, the change is momentary.
>
> What do you mean? If bit 2 can't hold the "cleared" state, then, with
> ror $d030, the "set" state will be shifted to bit 1. Meaning: no matter what
> was the state of bit 1 before the action -- after the test, this bit will be set,
> right?

Darn!  I didn't see that.  Segher and you are right.  So, my "great" solution isn't as great as I thought it is.  :-/

A little "bloat" could fix it:

_is_c64:
    lda $d030
    asl $d030
    ror $d030
    sta $d030
    lda #0
    rol a
    rts

But, I have another idea:

_is_c128:
    inc $d030
    lda $d030
    dec $d030
    eor $d030
    rts

Does that one pass peer review?  :-)

       Message was sent through the cbm-hackers mailing list
Received on 2013-05-24 19:00:08

Archive generated by hypermail 2.2.0.