Exemplo n.º 1
0
Arquivo: c128.c Projeto: RobinDX/xmame
static int c128_dma_read_color (int offset)
{
    UINT8 c64_port6510 = (UINT8) cpunum_get_info_int(0, CPUINFO_INT_M6510_PORT);

    if (c64mode)
        return c64_colorram[offset & 0x3ff] & 0xf;
    else
        return c64_colorram[(offset & 0x3ff)|((c64_port6510&0x3)<<10)] & 0xf;
}
Exemplo n.º 2
0
static void sp_set_status(UINT32 status)
{
	if (status & 0x1)
	{
		//cpu_trigger(6789);

		cpunum_set_input_line(1, INPUT_LINE_HALT, ASSERT_LINE);
        cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_HALT);
		//rsp_sp_status |= SP_STATUS_HALT;
	}
	if (status & 0x2)
	{
		//rsp_sp_status |= SP_STATUS_BROKE;
        cpunum_set_info_int(1, CPUINFO_INT_REGISTER + RSP_SR, cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) | RSP_STATUS_BROKE);

        if (cpunum_get_info_int(1, CPUINFO_INT_REGISTER + RSP_SR) & RSP_STATUS_INTR_BREAK)
		{
			signal_rcp_interrupt(SP_INTERRUPT);
		}
	}
}
Exemplo n.º 3
0
Arquivo: c128.c Projeto: RobinDX/xmame
/*
 * only 14 address lines
 * a15 and a14 portlines
 * 0x1000-0x1fff, 0x9000-0x9fff char rom
 */
static int c128_dma_read(int offset)
{
    UINT8 c64_port6510 = (UINT8) cpunum_get_info_int(0, CPUINFO_INT_M6510_PORT);

    /* main memory configuration to include */
    if (c64mode)
    {
        if (!c64_game && c64_exrom)
        {
            if (offset < 0x3000)
                return c64_memory[offset];
            return c64_romh[offset & 0x1fff];
        }
        if (((c64_vicaddr - c64_memory + offset) & 0x7000) == 0x1000)
            return c64_chargen[offset & 0xfff];
        return c64_vicaddr[offset];
    }
    if ( !(c64_port6510&4)
            && (((c128_vicaddr - c64_memory + offset) & 0x7000) == 0x1000) )
        return c128_chargen[offset & 0xfff];
    return c128_vicaddr[offset];
}
Exemplo n.º 4
0
Arquivo: c128.c Projeto: RobinDX/xmame
void c128_bankswitch_64 (int reset)
{
    static int old, exrom, game;
    int data, loram, hiram, charen;
    read8_handler rh;

    if (!c64mode)
        return;

    data = (UINT8) cpunum_get_info_int(0, CPUINFO_INT_M6510_PORT) & 7;
    if ((data == old)&&(exrom==c64_exrom)&&(game==c64_game)&&!reset)
        return;

    DBG_LOG (1, "bankswitch", ("%d\n", data & 7));
    loram = (data & 1) ? 1 : 0;
    hiram = (data & 2) ? 1 : 0;
    charen = (data & 4) ? 1 : 0;

    if ((!c64_game && c64_exrom)
            || (loram && hiram && !c64_exrom))
    {
        memory_set_bankptr(8, c64_roml);
    }
    else
    {
        memory_set_bankptr(8, c64_memory + 0x8000);
    }

    if ((!c64_game && c64_exrom && hiram)
            || (!c64_exrom))
    {
        memory_set_bankptr(9, c64_romh);
    }
    else if (loram && hiram)
    {
        memory_set_bankptr(9, c64_basic);
    }
    else
    {
        memory_set_bankptr(9, c64_memory + 0xa000);
    }

    if ((!c64_game && c64_exrom)
            || (charen && (loram || hiram)))
    {
        rh = c128_read_io;
        c128_write_io = 1;
    }
    else
    {
        rh = MRA8_BANK5;
        c128_write_io = 0;
        if ((!charen && (loram || hiram)))
            memory_set_bankptr(13, c64_chargen);
        else
            memory_set_bankptr(13, c64_memory + 0xd000);
    }
    c128_set_m8502_read_handler(0xd000, 0xdfff, rh);

    if (!c64_game && c64_exrom)
    {
        memory_set_bankptr(14, c64_romh);
        memory_set_bankptr(15, c64_romh+0x1f00);
        memory_set_bankptr(16, c64_romh+0x1f05);
    }
    else
    {
        if (hiram)
        {
            memory_set_bankptr(14, c64_kernal);
            memory_set_bankptr(15, c64_kernal+0x1f00);
            memory_set_bankptr(16, c64_kernal+0x1f05);
        }
        else
        {
            memory_set_bankptr(14, c64_memory + 0xe000);
            memory_set_bankptr(15, c64_memory + 0xff00);
            memory_set_bankptr(16, c64_memory + 0xff05);
        }
    }
    old = data;
    exrom= c64_exrom;
    game=c64_game;
}