void pet_64k_expansion_device::pet_bd_w(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)) { write_ram(offset, data); sel = pet_expansion_slot_device::SEL_NONE; } break; case pet_expansion_slot_device::SELE: if (!BIT(m_ctrl, 6) || !BIT(offset, 11)) { write_ram(offset, data); 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: write_ram(offset, data); break; } } if (offset == 0xfff0) { m_ctrl = data; } }
void abc1600_state::write_user_memory(offs_t offset, UINT8 data) { 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_WP) return; //if (PAGE_NONX) BUS ERROR if (virtual_offset < 0x1fe000) { write_ram(virtual_offset, data); } else { write_io(virtual_offset, data); } }
/* * Inlined static... insures this is 'really' inlined completely... * * Process one dot... * */ static inline void do_shot(struct shot *current_shot) { zero_beam(); /* reset beam to middle of screen */ if (current_shot->shot_counter > 0) /* is this shot active? */ { current_shot->shot_counter--; /* no?, than reduce counter... */ if (current_shot->shot_counter == 0) /* if 0... make active and set up */ { init_shot(current_shot); } return; /* next time shot will be active, */ } /* for now... return */ else { switch (current_shot->direction) /* process direction flag */ { case TO_HALF_THREE: { /* is dot out of bounds? */ if ((current_shot->x > 120) || (current_shot->y > 120) ) { /* yep, than make inactive and reset 'timer' */ current_shot->shot_counter = SHOT_INTERVALL; /* and bye */ return; } current_shot->x += current_shot->speed; current_shot->y += current_shot->speed; break; } case TO_THREE: { /* is dot out of bounds? */ if (current_shot->x > 120) { /* yep, than make inactive and reset 'timer' */ current_shot->shot_counter = SHOT_INTERVALL; /* and bye */ return; } /* otherwise process coordinated according to direction and speed */ current_shot->x += current_shot->speed; break; } case TO_HALF_SIX: { /* is dot out of bounds? */ if ((current_shot->x > 120) || (current_shot->y < -120) ) { /* yep, than make inactive and reset 'timer' */ current_shot->shot_counter = SHOT_INTERVALL; /* and bye */ return; } /* otherwise process coordinated according to direction and speed */ current_shot->x += current_shot->speed; current_shot->y -= current_shot->speed; break; } case TO_SIX: { /* is dot out of bounds? */ if (current_shot->y < -120) { /* yep, than make inactive and reset 'timer' */ current_shot->shot_counter = SHOT_INTERVALL; /* and bye */ return; } /* otherwise process coordinated according to direction and speed */ current_shot->y -= current_shot->speed; break; } case TO_HALF_NINE: { /* is dot out of bounds? */ if ((current_shot->x < -120) || (current_shot->y < -120) ) { /* yep, than make inactive and reset 'timer' */ current_shot->shot_counter = SHOT_INTERVALL; /* and bye */ return; } /* otherwise process coordinated according to direction and speed */ current_shot->x -= current_shot->speed; current_shot->y -= current_shot->speed; break; } case TO_NINE: { /* is dot out of bounds? */ if (current_shot->x < -120) { /* yep, than make inactive and reset 'timer' */ current_shot->shot_counter = SHOT_INTERVALL; /* and bye */ return; } /* otherwise process coordinated according to direction and speed */ current_shot->x -= current_shot->speed; break; } case TO_HALF_TWELF: { /* is dot out of bounds? */ if ((current_shot->x < -120) || (current_shot->y > 120) ) { /* yep, than make inactive and reset 'timer' */ current_shot->shot_counter = SHOT_INTERVALL; /* and bye */ return; } /* otherwise process coordinated according to direction and speed */ current_shot->x -= current_shot->speed; current_shot->y += current_shot->speed; break; } case TO_TWELF: { /* is dot out of bounds? */ if (current_shot->y > 120) { /* yep, than make inactive and reset 'timer' */ current_shot->shot_counter = SHOT_INTERVALL; /* and bye */ return; } /* otherwise process coordinated according to direction and speed */ current_shot->y += current_shot->speed; break; } default: { /* oops... something wrong... make this false dot inactive ... */ current_shot->shot_counter = SHOT_INTERVALL; return; } } } /* now draw the dot */ write_ram(Vec_Dot_Dwell, DOT_BRIGHTNESS); /* first set up the dot dwell time */ set_scale(SHOT_SCALE); /* set scale for positioning */ draw_dot(current_shot->x, current_shot->y); /* position and draw the dot */ }
/* * This function sets up a piece of music to be played from the start * of the next round on onward... */ static inline void play_song(unsigned char *song) { write_ram(Vec_Music_Flag, 1); /* A makro to write to a specific memory */ current_song = song; /* address */ }
inline void abc1600_state::dma_mreq_w(int index, UINT16 offset, UINT8 data) { offs_t virtual_offset = get_dma_address(index, offset); write_ram(virtual_offset, data); }