At 10:39 AM 06/21/98 +0200, you wrote:

>out (c),value or any register exept F.

Note: there is no opcode for 'out (c),value'.

>out (#98),a or another register

Similar problem: only 'out (nn),a' exists.

>;Input: HL
>;
>Set_Vdp_Write:
>        ld    a,l
>        di
>        out   (#99),a
>        ld    a,h
>        and   %00111111
>        or    64
>        ei
>        out   (#99),a
>        ret

Note that 'ei' before 'out (#99),a' will work correctly only because the
Z80 won't allow interrupts until after one instruction after 'ei'. This means
        ei
        nop
        out     (#99),a
is a horrible bug. Horrible because it depends on when an interrupt occurs
and is therefore very difficult to trace.
Also, some emulators enable interrupts directly after 'ei' and the code
above won't work. Ofcourse this is a fault of the emulators and should be
corrected, but I though you might want to know anyway.

>;Input: AHL
>;
>Set_Vdp_Write:
>        rlc   h
>        rla
>        rlc   h
>        rla
>        srl   h
>        srl   h
>        di
>        out   (#99),a
>        ld    a,14+128
>        out   (#99),a
>        ld    a,l
>        nop
>        out   (#99),a
>        ld    a,h
>        or    64
>        ei
>        out   (#99),a
>        ret

Clever bit manipulation! (faster than my routine)
But you can do it even faster: move the two 'srl h' statements to where the
'nop' is. The srl statements now form a delay so you can get rid of the 'nop'!

>From adress #4000 in page 1 of screen 5:
>
>xor a
>ld hl,#4000
>call Set_Vdp_Read
>in (#98),any register

This code reads from address #4000 in page 0. For page 1, you need 'ld
hl,#C000' (a screen 5 page is #8000 bytes).

Bye,
                Maarten

****
MSX Mailinglist. To unsubscribe, send an email to [EMAIL PROTECTED] and put
in the body (not subject) "unsubscribe msx [EMAIL PROTECTED]" (without the
quotes :-) Problems? contact [EMAIL PROTECTED] (www.stack.nl/~wiebe/mailinglist/)
****

Reply via email to