本文整理汇总了C++中required_memory_region类的典型用法代码示例。如果您正苦于以下问题:C++ required_memory_region类的具体用法?C++ required_memory_region怎么用?C++ required_memory_region使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了required_memory_region类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: remap
void telestrat_state::remap()
{
// Theorically, these are cartridges. There's no real point to
// making them configurable, when only 4 existed and there are 7
// slots.
switch(m_via2_a & 7) {
case 0:
m_bank_c000_r->set_base(m_ram+0xc000);
m_bank_c000_w->set_base(m_ram+0xc000);
break;
case 1:
case 2:
case 3:
m_bank_c000_r->set_base(m_junk_read);
m_bank_c000_w->set_base(m_junk_write);
break;
case 4:
m_bank_c000_r->set_base(m_telmatic->base());
m_bank_c000_w->set_base(m_junk_write);
break;
case 5:
m_bank_c000_r->set_base(m_teleass->base());
m_bank_c000_w->set_base(m_junk_write);
break;
case 6:
m_bank_c000_r->set_base(m_hyperbas->base());
m_bank_c000_w->set_base(m_junk_write);
break;
case 7:
m_bank_c000_r->set_base(m_telmon24->base());
m_bank_c000_w->set_base(m_junk_write);
break;
}
}
示例2: machine_start
void gimix_state::machine_start()
{
UINT8* ROM = m_rom->base();
m_rombank1->configure_entries(0,4,ROM,0x800);
m_rombank2->configure_entries(0,4,ROM,0x800);
m_fixedrombank->configure_entries(0,4,ROM+0x700,0x800);
m_rombank1->set_entry(0); // RAM banks are undefined on startup
m_rombank2->set_entry(1);
m_fixedrombank->set_entry(0);
// install any extra RAM
if(m_ram->size() > 65536)
{
m_bank1->space(AS_PROGRAM).install_readwrite_bank(0x10000,m_ram->size()-1,"upper_ram");
m_bank2->space(AS_PROGRAM).install_readwrite_bank(0x10000,m_ram->size()-1,"upper_ram");
m_bank3->space(AS_PROGRAM).install_readwrite_bank(0x10000,m_ram->size()-1,"upper_ram");
m_bank4->space(AS_PROGRAM).install_readwrite_bank(0x10000,m_ram->size()-1,"upper_ram");
m_bank5->space(AS_PROGRAM).install_readwrite_bank(0x10000,m_ram->size()-1,"upper_ram");
m_bank6->space(AS_PROGRAM).install_readwrite_bank(0x10000,m_ram->size()-1,"upper_ram");
m_bank7->space(AS_PROGRAM).install_readwrite_bank(0x10000,m_ram->size()-1,"upper_ram");
m_bank8->space(AS_PROGRAM).install_readwrite_bank(0x10000,m_ram->size()-1,"upper_ram");
m_bank9->space(AS_PROGRAM).install_readwrite_bank(0x10000,m_ram->size()-1,"upper_ram");
m_bank10->space(AS_PROGRAM).install_readwrite_bank(0x10000,m_ram->size()-1,"upper_ram");
m_bank11->space(AS_PROGRAM).install_readwrite_bank(0x10000,m_ram->size()-1,"upper_ram");
m_bank12->space(AS_PROGRAM).install_readwrite_bank(0x10000,m_ram->size()-1,"upper_ram");
m_bank13->space(AS_PROGRAM).install_readwrite_bank(0x10000,m_ram->size()-1,"upper_ram");
m_bank14->space(AS_PROGRAM).install_readwrite_bank(0x10000,m_ram->size()-1,"upper_ram");
m_bank15->space(AS_PROGRAM).install_readwrite_bank(0x10000,m_ram->size()-1,"upper_ram");
m_bank16->space(AS_PROGRAM).install_readwrite_bank(0x10000,m_ram->size()-1,"upper_ram");
}
m_floppy0->get_device()->set_rpm(300);
m_floppy1->get_device()->set_rpm(300);
}
示例3: machine_start
void decstation_state::machine_start()
{
m_vrom_ptr = m_vrom->base();
save_item(NAME(m_vram));
save_item(NAME(m_sfb));
save_item(NAME(m_copy_src));
}
示例4: nightgal_gfx_nibble
UINT8 nightgal_state::nightgal_gfx_nibble( int niboffset )
{
UINT8 *blit_rom = m_region_gfx1->base();
if (niboffset & 1)
{
return (blit_rom[(niboffset >> 1) & 0x1ffff] & 0xf0) >> 4;
}
else
{
return (blit_rom[(niboffset >> 1) & 0x1ffff] & 0x0f);
示例5: machine_reset
void nanos_state::machine_reset()
{
address_space &space = m_maincpu->space(AS_PROGRAM);
space.install_write_bank(0x0000, 0x0fff, "bank3");
space.install_write_bank(0x1000, 0xffff, "bank2");
m_bank1->set_base(m_region_maincpu->base());
m_bank2->set_base(m_ram->pointer() + 0x1000);
m_bank3->set_base(m_ram->pointer());
machine().device<floppy_connector>("upd765:0")->get_device()->mon_w(false);
}
示例6: machine_start
INPUT_PORTS_END
void cms_state::machine_start()
{
m_bank1->configure_entries(0, 16, m_rom->base(), 0x4000);
memset(&m_rtc_data, 0, sizeof(m_rtc_data));
m_rtc_reg = 0;
m_rtc_state = 0;
m_rtc_data[0xf] = 1;
m_rtc_timer = timer_alloc();
m_rtc_timer->adjust(attotime::zero, 0, attotime(1, 0));
}
示例7:
void svi3x8_state::reset_memory_configuration()
{
m_maincpu->space(AS_PROGRAM).install_rom(0x0000, 0x7fff, m_basic->base());
if (m_ram->size() == 64 * 1024)
{
// SVI-328
m_maincpu->space(AS_PROGRAM).install_ram(0x8000, 0xffff, m_ram->pointer());
}
else
{
// SVI-318
m_maincpu->space(AS_PROGRAM).unmap_readwrite(0x8000, 0xbfff);
m_maincpu->space(AS_PROGRAM).install_ram(0xc000, 0xffff, m_ram->pointer());
}
}
示例8:
void csplayh5_state::general_init(int patchaddress, int patchvalue)
{
#if !USE_H8
uint16_t *MAINROM = (uint16_t *)m_region_maincpu->base();
/* patch DVD comms check */
MAINROM[patchaddress] = patchvalue;
#endif
//uint8_t *SNDROM = m_region_:nichisnd:audiorom->base();
/* initialize sound rom bank */
//soundbank_w(0);
/* patch sound program */
//SNDROM[0x0213] = 0x00; // DI -> NOP
}
示例9: machine_start
void beezer_state::machine_start()
{
// configure rom banks
for (int i = 0; i < 7; i++)
m_rombank[i]->configure_entries(0, 2, m_banked_roms->base() + (i * 0x2000), 0x1000);
// allocate timers
m_timer_count = timer_alloc(0);
// register for state saving
save_pointer(NAME(m_ch_sign), 4);
save_pointer(NAME(m_dac_data), 4);
save_item(NAME(m_count));
save_item(NAME(m_noise));
save_item(NAME(m_pbus));
save_item(NAME(m_x));
save_item(NAME(m_y));
save_item(NAME(m_z));
}
示例10:
UINT32 bcs3_state::screen_update_bcs3c(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
UINT8 y,ra,chr,gfx,rat;
UINT16 sy=0,ma=0xb4,x;
UINT16 cursor = (m_p_videoram[0x08] | (m_p_videoram[0x09] << 8)) - 0x3c80; // get cursor relative position
rat = cursor / 30;
if (rat > 11) ma = (rat-11) * 30 + 0xb4;
for (y = 0; y < 12; y++)
{
for (ra = 0; ra < 10; ra++)
{
UINT16 *p = &bitmap.pix16(sy++);
rat = (ra + 1) & 7;
for (x = ma; x < ma + 29; x++)
{
if (ra < 8)
{
chr = m_p_videoram[x] & 0x7f;
/* get pattern of pixels for that character scanline */
gfx = m_p_chargen->base()[(chr<<3) | rat ] ^ 0xff;
}
else
gfx = 0xff;
/* Display a scanline of a character (8 pixels) */
*p++ = BIT(gfx, 7);
*p++ = BIT(gfx, 6);
*p++ = BIT(gfx, 5);
*p++ = BIT(gfx, 4);
*p++ = BIT(gfx, 3);
*p++ = BIT(gfx, 2);
*p++ = BIT(gfx, 1);
*p++ = BIT(gfx, 0);
}
}
ma+=30;
}
return 0;
}
示例11:
/* Hacks: When it starts, it has 4 lines of data. Pressing enter causes it to allocate 100 lines.
I'm assuming that it only shows a portion of this, with the cursor always in sight. */
uint32_t bcs3_state::screen_update_bcs3a(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
uint8_t y,ra,chr,gfx,rat;
uint16_t sy = 0, ma = s_init, x;
uint16_t cursor = (m_p_videoram[s_curs] | (m_p_videoram[s_curs+1] << 8)) - 0x3c00 - ma; // get cursor relative position
rat = cursor / (s_cols+1);
if (rat > (s_rows-1)) ma += (rat-(s_rows-1)) * (s_cols+1);
for (y = 0; y < s_rows; y++)
{
for (ra = 0; ra < 10; ra++)
{
uint16_t *p = &bitmap.pix16(sy++);
rat = (ra + 1) & 7;
for (x = ma; x < ma + s_cols; x++)
{
if (ra < 8)
{
chr = m_p_videoram[x] & 0x7f;
/* get pattern of pixels for that character scanline */
gfx = m_p_chargen->base()[(chr<<3) | rat ] ^ 0xff;
}
else
gfx = 0xff;
/* Display a scanline of a character (8 pixels) */
*p++ = BIT(gfx, 7);
*p++ = BIT(gfx, 6);
*p++ = BIT(gfx, 5);
*p++ = BIT(gfx, 4);
*p++ = BIT(gfx, 3);
*p++ = BIT(gfx, 2);
*p++ = BIT(gfx, 1);
*p++ = BIT(gfx, 0);
}
}
ma+=(s_cols+1);
}
return 0;
}
示例12:
void mc1000_state::machine_start()
{
address_space &program = m_maincpu->space(AS_PROGRAM);
/* setup memory banking */
uint8_t *rom = m_rom->base();
program.install_readwrite_bank(0x0000, 0x1fff, "bank1");
membank("bank1")->configure_entry(0, rom);
membank("bank1")->configure_entry(1, rom + 0xc000);
membank("bank1")->set_entry(1);
m_rom0000 = 1;
program.install_readwrite_bank(0x2000, 0x27ff, "bank2");
membank("bank2")->configure_entry(0, rom + 0x2000);
membank("bank2")->configure_entry(1, m_mc6845_video_ram);
membank("bank2")->set_entry(0);
membank("bank3")->configure_entry(0, rom + 0x4000);
membank("bank3")->set_entry(0);
membank("bank4")->configure_entry(0, m_mc6847_video_ram);
membank("bank4")->configure_entry(1, rom + 0x8000);
membank("bank4")->set_entry(0);
membank("bank5")->configure_entry(0, rom + 0x9800);
membank("bank5")->set_entry(0);
bankswitch();
/* register for state saving */
save_item(NAME(m_rom0000));
save_item(NAME(m_mc6845_bank));
save_item(NAME(m_mc6847_bank));
save_item(NAME(m_keylatch));
save_item(NAME(m_hsync));
save_item(NAME(m_vsync));
}
示例13:
void mc1000_state::machine_start()
{
/* setup memory banking */
m_banked_ram = make_unique_clear<uint8_t[]>(0xc000);
membank("bank1")->configure_entry(0, m_banked_ram.get());
membank("bank1")->configure_entry(1, m_rom->base());
membank("bank1")->set_entry(1);
m_rom0000 = 1;
membank("bank2")->configure_entry(0, m_banked_ram.get() + 0x2000);
membank("bank2")->configure_entry(1, m_mc6845_video_ram);
membank("bank2")->set_entry(0);
membank("bank3")->configure_entry(0, m_banked_ram.get() + 0x4000);
membank("bank3")->set_entry(0);
membank("bank4")->configure_entry(0, m_mc6847_video_ram);
membank("bank4")->configure_entry(1, m_banked_ram.get() + 0x8000);
membank("bank4")->set_entry(0);
membank("bank5")->configure_entry(0, m_banked_ram.get() + 0x9800);
membank("bank5")->set_entry(0);
bankswitch();
/* register for state saving */
save_pointer(NAME(m_banked_ram), 0xc000);
save_item(NAME(m_rom0000));
save_item(NAME(m_mc6845_bank));
save_item(NAME(m_mc6847_bank));
save_item(NAME(m_keylatch));
save_item(NAME(m_hsync));
save_item(NAME(m_vsync));
}
示例14: screen_update_scv
UINT32 scv_state::screen_update_scv(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
int x, y;
UINT8 fg = m_videoram[0x1403] >> 4;
UINT8 bg = m_videoram[0x1403] & 0x0f;
UINT8 gr_fg = m_videoram[0x1401] >> 4;
UINT8 gr_bg = m_videoram[0x1401] & 0x0f;
int clip_x = ( m_videoram[0x1402] & 0x0f ) * 2;
int clip_y = m_videoram[0x1402] >> 4;
/* Clear the screen */
bitmap.fill(gr_bg , cliprect);
/* Draw background */
for ( y = 0; y < 16; y++ )
{
int text_y = 0;
if ( y < clip_y )
{
text_y = ( m_videoram[0x1400] & 0x80 ) ? 0 : 1;
}
else
{
text_y = ( m_videoram[0x1400] & 0x80 ) ? 1 : 0;
}
for ( x = 0; x < 32; x++ )
{
int text_x = 0;
UINT8 d = m_videoram[ 0x1000 + y * 32 + x ];
if ( x < clip_x )
{
text_x = ( m_videoram[0x1400] & 0x40 ) ? 0 : 1;
}
else
{
text_x = ( m_videoram[0x1400] & 0x40 ) ? 1 : 0;
}
if ( text_x && text_y )
{
/* Text mode */
UINT8 *char_data = m_charrom->base() + ( d & 0x7f ) * 8;
draw_text( bitmap, x * 8, y * 16, char_data, fg, bg );
}
else
{
switch ( m_videoram[0x1400] & 0x03 )
{
case 0x01: /* Semi graphics mode */
draw_semi_graph( bitmap, x * 8 , y * 16 , d & 0x80, gr_fg );
draw_semi_graph( bitmap, x * 8 + 4, y * 16 , d & 0x40, gr_fg );
draw_semi_graph( bitmap, x * 8 , y * 16 + 4, d & 0x20, gr_fg );
draw_semi_graph( bitmap, x * 8 + 4, y * 16 + 4, d & 0x10, gr_fg );
draw_semi_graph( bitmap, x * 8 , y * 16 + 8, d & 0x08, gr_fg );
draw_semi_graph( bitmap, x * 8 + 4, y * 16 + 8, d & 0x04, gr_fg );
draw_semi_graph( bitmap, x * 8 , y * 16 + 12, d & 0x02, gr_fg );
draw_semi_graph( bitmap, x * 8 + 4, y * 16 + 12, d & 0x01, gr_fg );
break;
case 0x03: /* Block graphics mode */
draw_block_graph( bitmap, x * 8, y * 16 , d >> 4 );
draw_block_graph( bitmap, x * 8, y * 16 + 8, d & 0x0f );
break;
default: /* Otherwise draw nothing? */
break;
}
}
}
}
/* Draw sprites if enabled */
if ( m_videoram[0x1400] & 0x10 )
{
UINT8 screen_start_sprite_line = ( ( ( m_videoram[0x1400] & 0xf7 ) == 0x17 ) && ( ( m_videoram[0x1402] & 0xef ) == 0x4f ) ) ? 21 + 32 : 0 ;
int i;
for ( i = 0; i < 128; i++ )
{
UINT8 spr_y = m_videoram[ 0x1200 + i * 4 ] & 0xfe;
UINT8 y_32 = m_videoram[ 0x1200 + i * 4 ] & 0x01; /* Xx32 sprite */
UINT8 clip = m_videoram[ 0x1201 + i * 4 ] >> 4;
UINT8 col = m_videoram[ 0x1201 + i * 4 ] & 0x0f;
UINT8 spr_x = m_videoram[ 0x1202 + i * 4 ] & 0xfe;
UINT8 x_32 = m_videoram[ 0x1202 + i * 4 ] & 0x01; /* 32xX sprite */
UINT8 tile_idx = m_videoram[ 0x1203 + i * 4 ] & 0x7f;
UINT8 half = m_videoram[ 0x1203 + i * 4] & 0x80;
UINT8 left = 1;
UINT8 right = 1;
UINT8 top = 1;
UINT8 bottom = 1;
if ( !col )
{
continue;
}
//.........这里部分代码省略.........
示例15:
// it is presumed that writing to rom will go nowhere
void hunter2_state::init_hunter2()
{
uint8_t *ram = m_ram->base();
m_nvram->set_base(ram,m_ram->bytes());
}