I've been persuaded that rather than messing about with mode 2 
interrupts,
since I can on the SAM, it would be better to put the screen into 32768+, get
rid of the ROM and use the low 32kb for program and data. Though Andrew
Collier did post some example to do this ages ago when I asked some other
questions, I lost it similarly ages ago, but came up with this :

                code
                org     0

                di

; now, to load the current ram page into the bottom half of memory

                in      a, (251)
                and     31
                or      32
                out     (250), a

                jp      tophalf

; load page 0 into the top half (pc is now in the bottom half thanks to jp)

tophalf         ld      a, 4
                out     (251), a

; put the screen at page 4, and switch to mode 4

                ld      a, 100
                out     (252), a

; do some stuff to check if I did it all right

lstart          ld      bc, $fefe
                in      a, (c)
                bit     0, a
                jp      nz, bgreen

                ld      a, 2
                out     (254), a
                jp      lstart

bgreen          ld      a, 4
                out     (254), a
                jp      lstart

        Which as far as I'm concerned should be turning the border green, but
changing it to red (using the default palette) whenever shift is held down.
What it actually does it change the border to green and then do nothing. I've
tried some other stuff after the init code including writing r register
rubbish to the screen, and it seems that the code functions for a very short
while but then just stops.

        So then . . . what stupid mistake am I making? And I'll assume for now 
with
an example this easy that it isn't 'only testing on SIM Coupé'.

                -Thomas

Reply via email to