Re: Detect a C128 from C64 mode

From: Ted <ejohnson.ed_at_gmail.com>
Date: Tue, 21 May 2013 07:41:55 -0400
Message-ID: <519B5D83.80206@gmail.com>
How about this...
     lda #$01
c128_check:
     lda $d030
     cmp #$ff
     beq c64
     jmp done
c64:
     lda #$00
done:
     rts


On 5/20/2013 4:50 PM, silverdr@wfmh.org.pl wrote:
>>>> lda $d030
>>>> cmp #$ff
>>>> beq c64
>> MM> What if the test mode and the 2 MHz mode are enabled upon
>> MM> executing that code?
>>
>> Then the machine is in a seriously fscked up state and probably
>> shouldn't be running C code anyway :)
> Probably very much right ;-)
>
> But in case..
>
> ; Checks for the output of the additional C128 VIC register
> ; at $d030. In a 64 it reads $ff. In a C128 in 64 mode
> ; it outputs other values as it has the two bits controlling
> ; "test" and "clock speed" modes
> ;
> ;	INPUTS: none
> ;	RETURNS: C128 flag in A
> ;	REGISTERS AFFECTED: A
>
> c128_check:
> 	lda $d030
> 	cmp #$ff
> 	beq c64
> 	bne done_c128
> c128:
> 	lda #$ff
> 	sta $d030
> done_c128:
> 	lda #$01
> 	rts
>
> c64:
> 	lda #$fc
> 	sta $d030
> 	eor $d030
> 	beq c128
> done_c64:
> 	lda #$00
> 	rts
>
> Any ideas to shorten it, keeping the same functionality?
>
> P. S. What is - BTW - the "test mode" of the 128?
>
>
>         Message was sent through the cbm-hackers mailing list


       Message was sent through the cbm-hackers mailing list
Received on 2013-05-21 12:01:03

Archive generated by hypermail 2.2.0.