From: "Segher Boessenkool"; on Wed., May 22, 2013; at 3:41 PM -0400 > >>> Any ideas to shorten it, keeping the same functionality? >> >> You want it; you got it! >> _c64_check: >> asl $d030 >> ror $d030 >> lda #0 >> rol a >> rts >> It can't get shorter than that! > > Uh-huh. :-) > > _c64_check: > asl $d030 > ror $d030 > adc #0 <-- can't work > rts GIGO (Garbage In, Garbage Out) We can't know what would be already in the accumulator; therefore, we must set it to a known value. > > Or, if you return in the carry flag instead of in .A: > > _c64_check: > asl $d030 > ror $d030 > rts I was thinking of a C-callable library function: extern bool c64_check(void); Hmm, maybe it should be renamed: extern unsigned char is_c64(void); > > 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). But, the new test bit doesn't do that -- and, the change is momentary. Message was sent through the cbm-hackers mailing listReceived on 2013-05-23 16:00:03
Archive generated by hypermail 2.2.0.