From: Alan Cox Date: Thu, 8 Oct 2015 19:55:58 +0000 (+0100) Subject: dragon-nx-32: tighten MPI detection X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=beecbca58d6c18109f1efabf95acc20b833068b7;p=FUZIX.git dragon-nx-32: tighten MPI detection --- diff --git a/Kernel/platform-dragon-nx32/dragon.s b/Kernel/platform-dragon-nx32/dragon.s index 18f0f710..7f1d92b3 100644 --- a/Kernel/platform-dragon-nx32/dragon.s +++ b/Kernel/platform-dragon-nx32/dragon.s @@ -133,13 +133,23 @@ _mpi_set_slot: ; _mpi_present: lda 0xff7f ; Save bits + tfr a,b + lsrb + lsrb + lsrb + lsrb + eorb 0xff7f + andb #0x03 ; We expect to see the bits 5-4 and 1-0 matching + bne nompi ; not guaranteed but a good rule of thumb for us ldb #0xff ; Will get back 33 from an MPI cartridge stb 0xff7f ; if the emulator is right on this ldb 0xff7f + andb #0x33 cmpb #0x33 bne nompi clr 0xff7f ; Switch to slot 0 ldb 0xff7f + andb #0x33 ; We can't trust the high bits bne nompi incb sta 0xff7f ; Our becker port for debug will be on the default