Example #1
0
UINT8 pet_64k_expansion_device::pet_bd_r(address_space &space, offs_t offset, UINT8 data, int &sel)
{
	if (BIT(m_ctrl, 7))
	{
		switch (sel)
		{
		case pet_expansion_slot_device::SEL8:
			if (!BIT(m_ctrl, 5))
			{
				data = read_ram(offset);
				sel = pet_expansion_slot_device::SEL_NONE;
			}
			break;

		case pet_expansion_slot_device::SELE:
			if (!BIT(m_ctrl, 6) || !BIT(offset, 11))
			{
				data = read_ram(offset);
				sel = pet_expansion_slot_device::SEL_NONE;
			}
			break;

		case pet_expansion_slot_device::SEL9:
		case pet_expansion_slot_device::SELA:
		case pet_expansion_slot_device::SELB:
		case pet_expansion_slot_device::SELC:
		case pet_expansion_slot_device::SELD:
		case pet_expansion_slot_device::SELF:
			data = read_ram(offset);
			break;
		}
	}

	return data;
}
Example #2
0
/*
 * Our main function we start of here...
 * we should make sure that we never return from here, or vectrex will
 * be surely bothered!
 */
int main(void)
{
  unsigned char anim_state;           /* our animation state counter */
  signed char pacman_x;               /* where is the pacman? */
  signed char pacman_y;
  pacman_x = 0;
  pacman_y = 0;
  anim_state = 0;
  setup();                            /* setup our program */

  while (true)                        /* never to return... */
  {
    start_one_vectrex_round();        /* start 'de round */
    intensity(MAX_BRIGHTNESS);        /* set some brightness */
    set_scale(MOVE_SCALE);            /* set scale factor */
    print_str(-128,100, "JOYTICK 1 TO MOVE PACMAN!"); /* a message! */
    move_to(pacman_x, pacman_y);      /* position pacman */
    set_scale(PACMAN_SCALE);          /* set scale factor for the sprite */
    draw_vector_list(pacman[anim_state]); /* draw the current pacman */
    anim_state++;                     /* next time the next animation */
    if (anim_state == MAX_ANIM)       /* could do a % MAXANIM, but this is */
       anim_state = 0;                /* more optimized */
    if (!read_ram(Vec_Music_Flag))    /* music finished? */
       play_song(SCRAMBLE_MUSIC);     /* if so ... restart */
    if (joystick1_x>0)                /* check the joystick and */
    {                                 /* update position */
      pacman_x++;
    }
    else if (joystick1_x<0)
    {
      pacman_x--;
    }
    if (joystick1_y>0)
    {
      pacman_y++;
    }
    else if (joystick1_y<0)
    {
      pacman_y--;
    }
    if (pacman_x>=100) pacman_x = 100;    /* make sure pacman is not */
    if (pacman_x<=-100) pacman_x = -100;  /* out of bounds */
    if (pacman_y>=100) pacman_y = 100;
    if (pacman_y<=-100) pacman_y = -100;
    joy_digital();                        /* call once per round, to insure */
  } /* while (true) */                    /* joystick information is up to date */
}
Example #3
0
UINT8 abc1600_state::read_user_memory(offs_t offset)
{
	int segment = (offset >> 15) & 0x1f;
	int page = (offset >> 11) & 0x0f;
	UINT16 page_data = PAGE_DATA(segment, page);

	offs_t virtual_offset = ((page_data & 0x3ff) << 11) | (offset & 0x7ff);

	//if (PAGE_NONX) BUS ERROR

	UINT8 data = 0;

	if (virtual_offset < 0x1fe000)
	{
		data = read_ram(virtual_offset);
	}
	else
	{
		data = read_io(virtual_offset);
	}

	return data;
}
Example #4
0
inline UINT8 abc1600_state::dma_mreq_r(int index, UINT16 offset)
{
	offs_t virtual_offset = get_dma_address(index, offset);

	return read_ram(virtual_offset);
}