Beispiel #1
0
void a2232_device::autoconfig_base_address(offs_t address)
{
	if (VERBOSE)
		logerror("%s('%s'): autoconfig_base_address received: 0x%06x\n", shortname(), basetag(), address);

	if (VERBOSE)
		logerror("-> installing a2232\n");

	// stop responding to default autoconfig
	m_slot->m_space->unmap_readwrite(0xe80000, 0xe8007f);

	m_slot->m_space->install_readwrite_handler(address, address + 0x3fff,
		read16_delegate(FUNC(a2232_device::shared_ram_r), this),
		write16_delegate(FUNC(a2232_device::shared_ram_w), this), 0xffff);

	m_slot->m_space->install_readwrite_handler(address + 0x4000, address + 0x4001,
		read16_delegate(FUNC(a2232_device::irq_ack_r), this),
		write16_delegate(FUNC(a2232_device::irq_ack_w), this), 0xffff);

	m_slot->m_space->install_readwrite_handler(address + 0x8000, address + 0x8001,
		read16_delegate(FUNC(a2232_device::reset_low_r), this),
		write16_delegate(FUNC(a2232_device::reset_low_w), this), 0xffff);

	m_slot->m_space->install_readwrite_handler(address + 0xa000, address + 0xa001,
		read16_delegate(FUNC(a2232_device::irq_r), this),
		write16_delegate(FUNC(a2232_device::irq_w), this), 0xffff);

	m_slot->m_space->install_readwrite_handler(address + 0xc000, address + 0xc001,
		read16_delegate(FUNC(a2232_device::reset_high_r), this),
		write16_delegate(FUNC(a2232_device::reset_high_w), this), 0xffff);

	// we're done
	m_slot->cfgout_w(0);
}
Beispiel #2
0
static int istype (lua_State* L, int lo, int tag)
{
 int otag = lua_tag(L,lo);
 if (tag==otag)		/* check simplest case */
  return 1;
 else if (lua_isnil(L,lo) && 
          tag!=LUA_TNUMBER &&
          tag!=LUA_TTABLE &&
          tag!=LUA_TFUNCTION
         )
  return 1;
 else if ((tag==LUA_TSTRING && lua_isstring(L,lo)) || /* check convertions */
          (tag==LUA_TNUMBER && lua_isnumber(L,lo))
         )
  return 1;
 else if (tag==LUA_TUSERDATA && lua_isuserdata(L,lo)) /* pointer to void* */
  return 1;
 else if (tag==toluaI_tt_gettag(L,"bool") && otag==LUA_TNUMBER)
  return 1;
 else
 {
  /* if requested type is const, the non-const is an alternative type */
  int tag2;
  int tbl_hierarchy;
  toluaI_getregistry(L,"tolua_tbl_const");
  lua_pushnumber(L,tag);
  lua_gettable(L,-2);
  tag2 = (int)lua_tonumber(L,-1);
  lua_pop(L,2);
  if (tag2 && tag2==otag)
   return 1;
  /* check for base classes */
  toluaI_getregistry(L,"tolua_tbl_hierarchy");
  tbl_hierarchy = lua_gettop(L);
  otag = basetag(L,tbl_hierarchy,otag);  
  while (otag)
  {
   if (tag==otag || (tag2 && tag2==otag))
    break;
   otag = basetag(L,tbl_hierarchy,otag);
  }
  lua_pop(L,1);
  return otag!=0;
 }
}
Beispiel #3
0
void buddha_device::autoconfig_base_address(offs_t address)
{
	if (VERBOSE)
		logerror("%s('%s'): autoconfig_base_address received: 0x%06x\n", shortname(), basetag(), address);

	if (VERBOSE)
		logerror("-> installing buddha\n");

	// stop responding to default autoconfig
	m_slot->m_space->unmap_readwrite(0xe80000, 0xe8007f);

	// install autoconfig handler to new location
	m_slot->m_space->install_readwrite_handler(address, address + 0x7f,
		read16_delegate(FUNC(amiga_autoconfig::autoconfig_read), static_cast<amiga_autoconfig *>(this)),
		write16_delegate(FUNC(amiga_autoconfig::autoconfig_write), static_cast<amiga_autoconfig *>(this)), 0xffff);

	// buddha registers
	m_slot->m_space->install_readwrite_handler(address + 0x7fe, address + 0x7ff,
		read16_delegate(FUNC(buddha_device::speed_r), this),
		write16_delegate(FUNC(buddha_device::speed_w), this), 0xffff);

	m_slot->m_space->install_readwrite_handler(address + 0x800, address + 0x8ff,
		read16_delegate(FUNC(buddha_device::ide_0_cs0_r), this),
		write16_delegate(FUNC(buddha_device::ide_0_cs0_w), this), 0xffff);

	m_slot->m_space->install_readwrite_handler(address + 0x900, address + 0x9ff,
		read16_delegate(FUNC(buddha_device::ide_0_cs1_r), this),
		write16_delegate(FUNC(buddha_device::ide_0_cs1_w), this), 0xffff);

	m_slot->m_space->install_readwrite_handler(address + 0xa00, address + 0xaff,
		read16_delegate(FUNC(buddha_device::ide_0_cs0_r), this),
		write16_delegate(FUNC(buddha_device::ide_0_cs0_w), this), 0xffff);

	m_slot->m_space->install_readwrite_handler(address + 0xb00, address + 0xbff,
		read16_delegate(FUNC(buddha_device::ide_0_cs1_r), this),
		write16_delegate(FUNC(buddha_device::ide_0_cs1_w), this), 0xffff);

	m_slot->m_space->install_read_handler(address + 0xf00, address + 0xf3f,
		read16_delegate(FUNC(buddha_device::ide_0_interrupt_r), this), 0xffff);

	m_slot->m_space->install_read_handler(address + 0xf40, address + 0xf7f,
		read16_delegate(FUNC(buddha_device::ide_1_interrupt_r), this), 0xffff);

	m_slot->m_space->install_write_handler(address + 0xfc0, address + 0xfff,
		write16_delegate(FUNC(buddha_device::ide_interrupt_enable_w), this), 0xffff);

	// install access to the rom space
	m_slot->m_space->install_rom(address + 0x1000, address + 0xffff, memregion("bootrom")->base() + 0x1000);

	// we're done
	m_slot->cfgout_w(0);
}
Beispiel #4
0
void dmac_device::autoconfig_base_address(offs_t address)
{
	if (VERBOSE)
		logerror("%s('%s'): autoconfig_base_address received: 0x%06x\n", shortname(), basetag(), address);

	if (!m_configured && m_ram_size > 0)
	{
		if (VERBOSE)
			logerror("-> installing ram (%d bytes)\n", m_ram_size);

		// install access to the ram space
		if (address)
			m_space->install_ram(address, address + (m_ram_size - 1), m_ram);

		// prepare autoconfig for main device
		autoconfig_board_size(BOARD_SIZE_64K);
		autoconfig_product(0x03); // or 0x02 for rev 1
		autoconfig_rom_vector(0x2000);
		autoconfig_rom_vector_valid(true);
		autoconfig_link_into_memory(false);
		autoconfig_multi_device(false);

		// first device configured
		m_configured = true;
	}
	else
	{
		if (VERBOSE)
			logerror("-> installing dmac\n");

		// internal dmac registers
		m_space->install_readwrite_handler(address, address + 0xff,
			read16_delegate(FUNC(dmac_device::register_read), this),
			write16_delegate(FUNC(dmac_device::register_write), this), 0xffff);

		// install access to the rom space
		if (m_rom)
		{
			m_space->install_rom(address + 0x2000, address + 0x7fff, m_rom + 0x2000);
			m_space->install_rom(address + 0x8000, address + 0xffff, m_rom);
		}

		// stop responding to autoconfig
		m_space->unmap_readwrite(0xe80000, 0xe8007f);

		// we're done
		m_cfgout_handler(0);
	}
}
Beispiel #5
0
void k057714_device::device_stop()
{
#if DUMP_VRAM
	char filename[200];
	sprintf(filename, "%s_vram.bin", basetag());
	printf("dumping %s\n", filename);
	FILE *file = fopen(filename, "wb");
	int i;

	for (i=0; i < 0x2000000/4; i++)
	{
		fputc((m_vram[i] >> 24) & 0xff, file);
		fputc((m_vram[i] >> 16) & 0xff, file);
		fputc((m_vram[i] >> 8) & 0xff, file);
		fputc((m_vram[i] >> 0) & 0xff, file);
	}

	fclose(file);
#endif
}