Beispiel #1
0
UINT8 __fastcall md_port_r(UINT16 port)
{
    switch(port & 0xC0)
    {
    case 0x00:
        return z80_read_unmapped();

    case 0x40:
        return vdp_counter_r(port);

    case 0x80:
        return vdp_read(port);

    case 0xC0:
        switch(port)
        {
        case 0xC0:
        case 0xC1:
        case 0xDC:
        case 0xDD:
            return input_r(port);
        }
        return z80_read_unmapped();
    }

    /* Just to please the compiler */
    return 0;
}
Beispiel #2
0
uint8 ggms_port_r(uint16 port)
{
    port &= 0xFF;

    switch(port & 0xC0)
    {
        case 0x00:
            return z80_read_unmapped();

        case 0x40:
            return vdp_counter_r(port);

        case 0x80:
            return vdp_read(port);

        case 0xC0:
            switch(port)
            {
                case 0xC0:
                case 0xC1:
                case 0xDC:
                case 0xDD:
                    return input_r(port);
            }
            return z80_read_unmapped();
    }

    /* Just to please the compiler */
    return -1;
}
Beispiel #3
0
UINT8 __fastcall smsj_port_r(UINT16 port)
{
    port &= 0xFF;

    if(port == 0xF2 && !(sms.memctrl & 4))
        return fmunit_detect_r();

    switch(port & 0xC0)
    {
    case 0x00:
        return z80_read_unmapped();

    case 0x40:
        return vdp_counter_r(port);

    case 0x80:
        return vdp_read(port);

    case 0xC0:
        return input_r(port);
    }

    /* Just to please the compiler */
    return 0;
}
Beispiel #4
0
uint8 sms_port_r(uint16 port)
{
    switch(port & 0xC0)
    {
        case 0x00:
            return z80_read_unmapped();

        case 0x40:
            return vdp_counter_r(port);

        case 0x80:
            return vdp_read(port);

        case 0xC0:
            return input_r(port);
    }

    /* Just to please the compiler */
    return -1;
}