本文整理汇总了C++中running_machine::region方法的典型用法代码示例。如果您正苦于以下问题:C++ running_machine::region方法的具体用法?C++ running_machine::region怎么用?C++ running_machine::region使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类running_machine
的用法示例。
在下文中一共展示了running_machine::region方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: decode_bg
static void decode_bg(running_machine &machine, const char * region)
{
tceptor_state *state = machine.driver_data<tceptor_state>();
static const gfx_layout bg_layout =
{
8, 8,
2048,
3,
{ 0x40000+4, 0, 4 },
{ 0, 1, 2, 3, 8, 9, 10, 11 },
{ 0, 16, 32, 48, 64, 80, 96, 112 },
128
};
int gfx_index = state->m_bg;
UINT8 *src = machine.region(region)->base() + 0x8000;
UINT8 *buffer;
int len = 0x8000;
int i;
buffer = auto_alloc_array(machine, UINT8, len);
/* expand rom tc2-19.10d */
for (i = 0; i < len / 2; i++)
{
buffer[i*2+1] = src[i] & 0x0f;
buffer[i*2] = (src[i] & 0xf0) >> 4;
}
memcpy(src, buffer, len);
auto_free(machine, buffer);
/* decode the graphics */
machine.gfx[gfx_index] = gfx_element_alloc(machine, &bg_layout, machine.region(region)->base(), 64, 2048);
}
示例2: arcadia_init
static void arcadia_init(running_machine &machine)
{
arcadia_state *state = machine.driver_data<arcadia_state>();
static const amiga_machine_interface arcadia_intf =
{
ANGUS_CHIP_RAM_MASK,
NULL, NULL, NULL,
NULL,
NULL, arcadia_reset_coins,
NULL,
0
};
UINT16 *biosrom;
/* configure our Amiga setup */
amiga_machine_config(machine, &arcadia_intf);
/* set up memory */
memory_configure_bank(machine, "bank1", 0, 1, state->m_chip_ram, 0);
memory_configure_bank(machine, "bank1", 1, 1, machine.region("user1")->base(), 0);
/* OnePlay bios is encrypted, TenPlay is not */
biosrom = (UINT16 *)machine.region("user2")->base();
if (biosrom[0] != 0x4afc)
generic_decode(machine, "user2", 6, 1, 0, 2, 3, 4, 5, 7);
}
示例3:
static void update_ti86_memory (running_machine &machine)
{
ti85_state *state = machine.driver_data<ti85_state>();
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
if (state->m_ti8x_memory_page_1 & 0x40)
{
memory_set_bankptr(machine, "bank2", state->m_ti8x_ram + 0x004000*(state->m_ti8x_memory_page_1&0x07));
space->install_write_bank(0x4000, 0x7fff, "bank2");
}
else
{
memory_set_bankptr(machine, "bank2", machine.region("maincpu")->base() + 0x010000 + 0x004000*(state->m_ti8x_memory_page_1&0x0f));
space->unmap_write(0x4000, 0x7fff);
}
if (state->m_ti8x_memory_page_2 & 0x40)
{
memory_set_bankptr(machine, "bank3", state->m_ti8x_ram + 0x004000*(state->m_ti8x_memory_page_2&0x07));
space->install_write_bank(0x8000, 0xbfff, "bank3");
}
else
{
memory_set_bankptr(machine, "bank3", machine.region("maincpu")->base() + 0x010000 + 0x004000*(state->m_ti8x_memory_page_2&0x0f));
space->unmap_write(0x8000, 0xbfff);
}
}
示例4:
ROM_END
/***************************************************************************
Split even/odd bytes from ROMs in 16 bit mode to different memory areas
***************************************************************************/
static void glass_ROM16_split_gfx( running_machine &machine, const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2 )
{
int i;
/* get a pointer to the source data */
UINT8 *src = (UINT8 *)machine.region(src_reg)->base();
/* get a pointer to the destination data */
UINT8 *dst = (UINT8 *)machine.region(dst_reg)->base();
/* fill destination areas with the proper data */
for (i = 0; i < length / 2; i++)
{
dst[dest1 + i] = src[start + i * 2 + 0];
dst[dest2 + i] = src[start + i * 2 + 1];
}
}
示例5: cclimber_play_sample
static void cclimber_play_sample(running_machine &machine, int start,int freq,int volume)
{
int len;
int romlen = machine.region("samples")->bytes();
const UINT8 *rom = machine.region("samples")->base();
device_t *samples = machine.device("samples");
if (!rom) return;
/* decode the rom samples */
len = 0;
while (start + len < romlen && rom[start+len] != 0x70)
{
int sample;
sample = (rom[start + len] & 0xf0) >> 4;
samplebuf[2*len] = SAMPLE_CONV4(sample) * volume / 31;
sample = rom[start + len] & 0x0f;
samplebuf[2*len + 1] = SAMPLE_CONV4(sample) * volume / 31;
len++;
}
sample_start_raw(samples,0,samplebuf,2 * len,freq,0);
}
示例6: decrypt_bios
static void decrypt_bios( running_machine &machine, int b15, int b14, int b13, int b12, int b11, int b10, int b9, int b8,
int b7, int b6, int b5, int b4, int b3, int b2, int b1, int b0 )
{
UINT16 *BIOS = (UINT16 *)machine.region( "user1" )->base();
int len = machine.region( "user1" )->bytes() / 2;
int i;
for( i = 0; i < len; i++ )
{
BIOS[ i ] = BITSWAP16( BIOS[ i ] ^ 0xaaaa,
b15, b14, b13, b12, b11, b10, b9, b8, b7, b6, b5, b4, b3, b2, b1, b0 );
}
}
示例7:
// fix sprite order
static void decode_sprite32(running_machine &machine, const char * region)
{
tceptor_state *state = machine.driver_data<tceptor_state>();
static const gfx_layout spr32_layout =
{
32, 32,
1024,
4,
{ 0x000000, 0x000004, 0x200000, 0x200004 },
{
0*8, 0*8+1, 0*8+2, 0*8+3, 1*8, 1*8+1, 1*8+2, 1*8+3,
2*8, 2*8+1, 2*8+2, 2*8+3, 3*8, 3*8+1, 3*8+2, 3*8+3,
4*8, 4*8+1, 4*8+2, 4*8+3, 5*8, 5*8+1, 5*8+2, 5*8+3,
6*8, 6*8+1, 6*8+2, 6*8+3, 7*8, 7*8+1, 7*8+2, 7*8+3
},
{
0*2*32, 1*2*32, 2*2*32, 3*2*32, 4*2*32, 5*2*32, 6*2*32, 7*2*32,
8*2*32, 9*2*32, 10*2*32, 11*2*32, 12*2*32, 13*2*32, 14*2*32, 15*2*32,
16*2*32, 17*2*32, 18*2*32, 19*2*32, 20*2*32, 21*2*32, 22*2*32, 23*2*32,
24*2*32, 25*2*32, 26*2*32, 27*2*32, 28*2*32, 29*2*32, 30*2*32, 31*2*32
},
2*32*32
};
UINT8 *src = machine.region(region)->base();
int len = machine.region(region)->bytes();
int total = spr32_layout.total;
int size = spr32_layout.charincrement / 8;
UINT8 *dst;
int i;
dst = auto_alloc_array(machine, UINT8, len);
memset(dst, 0, len);
for (i = 0; i < total; i++)
{
int code;
code = (i & 0x07f) | ((i & 0x180) << 1) | 0x80;
code &= ~((i & 0x200) >> 2);
memcpy(&dst[size * (i + 0)], &src[size * (code + 0)], size);
memcpy(&dst[size * (i + total)], &src[size * (code + total)], size);
}
decode_sprite(machine, state->m_sprite32, &spr32_layout, dst);
}
示例8: acitya_decrypt_rom_A
static void acitya_decrypt_rom_A(running_machine &machine)
{
int oldbyte,inverted_oldbyte,newbyte;
int mem;
UINT8 *RAM;
RAM = machine.region("maincpu")->base();
for (mem=0;mem<0x4000;mem++)
{
oldbyte = RAM[mem];
inverted_oldbyte = ~oldbyte;
/* Note: D2 is inverted and connected to D1, D5 is inverted and
connected to D0. The other six data bits are converted by a
PAL10H8 driven by the counter. */
newbyte = 0;
newbyte = (inverted_oldbyte & 0x80) >> 2;
newbyte |= (inverted_oldbyte & 0x40) >> 2;
newbyte |= (inverted_oldbyte & 0x20) >> 5;
newbyte |= (inverted_oldbyte & 0x10) >> 1;
newbyte |= (inverted_oldbyte & 0x08) >> 1;
newbyte |= (inverted_oldbyte & 0x04) >> 1;
newbyte |= (oldbyte & 0x02) << 6;
newbyte |= (oldbyte & 0x01) << 6;
RAM[mem + 0x18000] = newbyte;
}
return;
}
示例9:
static void gaelco2_ROM16_split_gfx(running_machine &machine, const char *src_reg, const char *dst_reg, int start, int length, int dest1, int dest2)
{
int i;
/* get a pointer to the source data */
UINT8 *src = (UINT8 *)machine.region(src_reg)->base();
/* get a pointer to the destination data */
UINT8 *dst = (UINT8 *)machine.region(dst_reg)->base();
/* fill destination areas with the proper data */
for (i = 0; i < length/2; i++){
dst[dest1 + i] = src[start + i*2 + 0];
dst[dest2 + i] = src[start + i*2 + 1];
}
}
示例10: blit_gfx
static void blit_gfx(running_machine &machine)
{
sliver_state *state = machine.driver_data<sliver_state>();
int tmpptr=0;
const UINT8 *rom = machine.region("user1")->base();
while (tmpptr < state->m_fptr)
{
int x,y,romdata;
int w,h;
int romoffs=state->m_fifo[tmpptr+0]+(state->m_fifo[tmpptr+1] << 8)+(state->m_fifo[tmpptr+2] << 16);
w=state->m_fifo[tmpptr+3]+1;
h=state->m_fifo[tmpptr+4]+1;
if (state->m_fifo[tmpptr+7] == 0)
{
for (y=0; y < h; y++)
{
for (x=0; x < w; x++)
{
romdata = rom[romoffs&0x1fffff];
if (romdata)
{
plot_pixel_pal(machine, state->m_fifo[tmpptr+5]+state->m_fifo[tmpptr+3]-x, state->m_fifo[tmpptr+6]+state->m_fifo[tmpptr+4]-y, romdata);
}
romoffs++;
}
}
}
tmpptr+=COMMAND_SIZE;
}
}
示例11: mato_update_memory
static void mato_update_memory(running_machine &machine)
{
pmd85_state *state = machine.driver_data<pmd85_state>();
address_space* space = machine.device("maincpu")->memory().space(AS_PROGRAM);
UINT8 *ram = ram_get_ptr(machine.device(RAM_TAG));
if (state->m_startup_mem_map)
{
UINT8 *mem = machine.region("maincpu")->base();
space->unmap_write(0x0000, 0x3fff);
memory_set_bankptr(machine, "bank1", mem + 0x010000);
memory_set_bankptr(machine, "bank2", ram + 0xc000);
memory_set_bankptr(machine, "bank3", mem + 0x010000);
memory_set_bankptr(machine, "bank4", ram + 0xc000);
}
else
{
space->install_write_bank(0x0000, 0x3fff, "bank1");
memory_set_bankptr(machine, "bank1", ram);
memory_set_bankptr(machine, "bank2", ram + 0x4000);
}
}
示例12: starwars_mproc_init
void starwars_mproc_init(running_machine &machine)
{
starwars_state *state = machine.driver_data<starwars_state>();
UINT8 *src = machine.region("user2")->base();
int cnt, val;
state->m_PROM_STR = auto_alloc_array(machine, UINT8, 1024);
state->m_PROM_MAS = auto_alloc_array(machine, UINT8, 1024);
state->m_PROM_AM = auto_alloc_array(machine, UINT8, 1024);
for (cnt = 0; cnt < 1024; cnt++)
{
/* translate PROMS into 16 bit code */
val = (src[0x0c00 + cnt] ) & 0x000f; /* Set LS nibble */
val |= (src[0x0800 + cnt] << 4) & 0x00f0;
val |= (src[0x0400 + cnt] << 8) & 0x0f00;
val |= (src[0x0000 + cnt] << 12) & 0xf000; /* Set MS nibble */
/* perform pre-decoding */
state->m_PROM_STR[cnt] = (val >> 8) & 0x00ff;
state->m_PROM_MAS[cnt] = val & 0x007f;
state->m_PROM_AM[cnt] = (val >> 7) & 0x0001;
}
state->m_math_timer = machine.scheduler().timer_alloc(FUNC(math_run_clear));
}
示例13: decrypt_snd
static void decrypt_snd(running_machine &machine)
{
int i;
UINT8 *ROM = machine.region("t5182")->base();
for(i=0x8000;i<0x10000;i++)
ROM[i] = BITSWAP8(ROM[i], 7,1,2,3,4,5,6,0);
}
示例14:
/* 80 column card init */
static void svi318_80col_init(running_machine &machine)
{
svi318_state *state = machine.driver_data<svi318_state>();
/* 2K RAM, but allocating 4KB to make banking easier */
/* The upper 2KB will be set to FFs and will never be written to */
state->m_svi.svi806_ram = machine.region_alloc("gfx2", 0x1000, 1, ENDIANNESS_LITTLE );
memset( state->m_svi.svi806_ram->base(), 0x00, 0x800 );
memset( state->m_svi.svi806_ram->base() + 0x800, 0xFF, 0x800 );
state->m_svi.svi806_gfx = machine.region("gfx1")->base();
}
示例15: G
//.........这里部分代码省略.........
1A - 5A : Intel Flash DA28F640J5 64MBit Flash EEPROM (SSOP56)
1D - 7E : Samsung Electronics K3N9V1000A-YC 128MBit MASK ROM (TSOP48) (see note 3)
6 pin header: (purpose unknown, probably for programming the CPLD)
This PCB is used on:
Software MEM PCB
Game Revision Sticker KEYCUS ROMs Populated
------------------------------------------------------------------------------------
Mr Driller 2 DR21/VER.A3 DR21 Ver.A KC001A DR21VERA.1A, DR21MA1.1D, DR21MA2.2D
Mr Driller 2 DR22/VER.A3 DR22 Ver.A KC001A DR22VERA.1A, DR21MA1.1D, DR21MA2.2D
Note
1. The ROM PCB has locations for 4x 64MBit program ROMs, but only 1A is populated.
2. The ROM PCB has locations for 14x 128MBit GFX ROMs (Total capacity = 2048MBits) but only 1D and 2D are populated.
3. These ROMs are only 18mm long, dumping them requires a special custom adapter
********
*Type 2*
********
System10 MEM(N) PCB 8906961402 (8906971402)
|-------------------------------------|
| |
| |---------| +-
| | | +-
| |CY37256 | +-
| 8E 8D |VP208 | +-
| | | +-
| 7E 7D |---------| +-
| |
| 6E 6D |
| |
| 5E 5D CY7C1019 |
| |
| 4E 4D |
| |
| 3E 3D |
| |
| 2E 2D |
| |
| 1E 1D |
| |
|-------------------------------------|
Notes:
CY37256VP208: Cypress CY37256VP208 Complex Programmable Logic Device (TQFP208)
CY7C1019 : Cypress CY7C1019BV33-15VC or Samsung Electronics K6R1008V1C-JC15 128k x8 bit 3.3V High Speed CMOS Static Ram (SOJ32)
1D - 8E : Samsung Electronics K9F2808U0B-YCBO 128MBit NAND Flash EEPROM (TSOP48)
6 pin header: (purpose unknown, probably for programming the CPLD)
This PCB is used on:
MEM PCB
Game Sticker KEYCUS ROMs Populated
---------------------------------------------------------------------------
Gamshara 10021 Ver.A KC020A 8E, 8D
Gekitoride-Jong Space 10011 Ver.A KC003A 8E, 8D, 7E, 7D
Mr.Driller G DRG1 Ver.A KC007A 8E, 8D, 7E
Kotoba no Puzzle Mojipittan KPM1 Ver.A KC012A 8E, 8D, 7E
Panicuru Panekuru PPA1 Ver.A KC017A 8E, 8D, 7E
Star Trigon STT1 Ver.A KC019A 8E, 8D
Utyuu Daisakusen Chocovader Contactee CVC1 Ver.A KC022A
Note
1. The ROM PCB has locations for 16x 128MBit FlashROMs (Total capacity = 2048MBits) but usually only a few are populated.
*/
#include "emu.h"
#include "cpu/psx/psx.h"
#include "video/psx.h"
#include "includes/psx.h"
WRITE32_HANDLER( namcos10_bank_w )
{
memory_set_bank( space->machine(), "bank1", data & 0xf );
}
class namcos10_state : public psx_state
{
public:
namcos10_state(const machine_config &mconfig, device_type type, const char *tag)
: psx_state(mconfig, type, tag) { }
};
static ADDRESS_MAP_START( namcos10_map, AS_PROGRAM, 32 )
AM_RANGE(0x00000000, 0x00ffffff) AM_RAM AM_SHARE("share1") /* ram */
AM_RANGE(0x1fc00000, 0x1fffffff) AM_ROM AM_SHARE("share2") AM_REGION("user1", 0) /* bios */
AM_RANGE(0x80000000, 0x80ffffff) AM_RAM AM_SHARE("share1") /* ram mirror */
AM_RANGE(0x9fc00000, 0x9fffffff) AM_ROM AM_SHARE("share2") /* bios mirror */
AM_RANGE(0xa0000000, 0xa0ffffff) AM_RAM AM_SHARE("share1") /* ram mirror */
AM_RANGE(0xbfc00000, 0xbfffffff) AM_ROM AM_SHARE("share2") /* bios mirror */
AM_RANGE(0xfffe0130, 0xfffe0133) AM_WRITENOP
ADDRESS_MAP_END
static void memm_driver_init( running_machine &machine )
{
psx_driver_init(machine);
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_legacy_write_handler( 0x1f300000, 0x1f300003, FUNC(namcos10_bank_w) );
machine.device("maincpu")->memory().space(AS_PROGRAM)->install_read_bank( 0x1f400000, 0x1f7fffff, "bank1" );
memory_configure_bank( machine, "bank1", 0, 16, machine.region( "user2" )->base(), 4 * 1024 * 1024 );
}