本文整理汇总了C++中running_machine::system方法的典型用法代码示例。如果您正苦于以下问题:C++ running_machine::system方法的具体用法?C++ running_machine::system怎么用?C++ running_machine::system使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类running_machine
的用法示例。
在下文中一共展示了running_machine::system方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply_running_machine
void favorite_manager::apply_running_machine(running_machine &machine, T &&action)
{
bool done(false);
// TODO: this should be changed - it interacts poorly with cartslots on arcade systems
if ((machine.system().flags & machine_flags::MASK_TYPE) == machine_flags::TYPE_ARCADE)
{
action(machine.system(), nullptr, nullptr, done);
}
else
{
bool have_software(false);
for (device_image_interface &image_dev : image_interface_iterator(machine.root_device()))
{
software_info const *const sw(image_dev.software_entry());
if (image_dev.exists() && image_dev.loaded_through_softlist() && sw)
{
assert(image_dev.software_list_name());
have_software = true;
action(machine.system(), &image_dev, sw, done);
if (done)
return;
}
}
if (!have_software)
action(machine.system(), nullptr, nullptr, done);
}
}
示例2: init
void mini_osd_interface::init(running_machine &machine)
{
int gamRot=0;
osd_interface::init(machine);
our_target = machine.render().target_alloc();
initInput(machine);
write_log("machine screen orientation: %s \n", (
machine.system().flags & ORIENTATION_SWAP_XY) ? "VERTICAL" : "HORIZONTAL"
);
orient = (machine.system().flags & ORIENTATION_MASK);
vertical = (machine.system().flags & ORIENTATION_SWAP_XY);
gamRot = (ROT270 == orient) ? 1 : gamRot;
gamRot = (ROT180 == orient) ? 2 : gamRot;
gamRot = (ROT90 == orient) ? 3 : gamRot;
//prep_retro_rotation(gamRot);
our_target->compute_minimum_size(rtwi, rthe);
topw=rtwi;
//Equivalent to rtaspect=our_target->view_by_index((our_target->view()))->effective_aspect(render_layer_config layer_config())
int width,height;
our_target->compute_visible_area(1000,1000,1,ROT0,width,height);
rtaspect=(float)width/(float)height;
write_log("W:%d H:%d , aspect ratio %d/%d=%f\n",rtwi,rthe,width,height,rtaspect);
NEWGAME_FROM_OSD=1;
write_log("osd init done\n");
co_switch(mainThread);
}
示例3: image_info_astring
void ui_menu_image_info::image_info_astring(running_machine &machine, astring &string)
{
string.printf("%s\n\n", machine.system().description);
#if 0
if (mess_ram_size > 0)
{
char buf2[RAM_STRING_BUFLEN];
string.catprintf("RAM: %s\n\n", ram_string(buf2, mess_ram_size));
}
#endif
image_interface_iterator iter(machine.root_device());
for (device_image_interface *image = iter.first(); image != NULL; image = iter.next())
{
const char *name = image->filename();
if (name != NULL)
{
const char *base_filename;
const char *info;
char *base_filename_noextension;
base_filename = image->basename();
base_filename_noextension = strip_extension(base_filename);
// display device type and filename
string.catprintf("%s: %s\n", image->device().name(), base_filename);
// display long filename, if present and doesn't correspond to name
info = image->longname();
if (info && (!base_filename_noextension || core_stricmp(info, base_filename_noextension)))
string.catprintf("%s\n", info);
// display manufacturer, if available
info = image->manufacturer();
if (info != NULL)
{
string.catprintf("%s", info);
info = stripspace(image->year());
if (info && *info)
string.catprintf(", %s", info);
string.catprintf("\n");
}
// display supported information, if available
switch(image->supported()) {
case SOFTWARE_SUPPORTED_NO : string.catprintf("Not supported\n"); break;
case SOFTWARE_SUPPORTED_PARTIAL : string.catprintf("Partially supported\n"); break;
default : break;
}
if (base_filename_noextension != NULL)
free(base_filename_noextension);
}
else
{
string.catprintf("%s: ---\n", image->device().name());
}
}
}
示例4: ui_gfx_init
void ui_gfx_init(running_machine &machine)
{
ui_gfx_state *state = &ui_gfx;
uint8_t rotate = machine.system().flags & machine_flags::MASK_ORIENTATION;
// make sure we clean up after ourselves
machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(&ui_gfx_exit, &machine));
// initialize our global state
memset(state, 0, sizeof(*state));
// set up the palette state
state->palette.columns = 16;
// set up the graphics state
for (uint8_t i = 0; i < MAX_GFX_DECODERS; i++)
for (uint8_t j = 0; j < MAX_GFX_ELEMENTS; j++)
{
state->gfxdev[i].rotate[j] = rotate;
state->gfxdev[i].columns[j] = 16;
}
// set up the tilemap state
state->tilemap.rotate = rotate;
state->tilemap.flags = TILEMAP_DRAW_ALL_CATEGORIES;
}
示例5: ui_gfx_init
void ui_gfx_init(running_machine &machine)
{
ui_gfx_state *state = &ui_gfx;
UINT8 rotate = machine.system().flags & ORIENTATION_MASK;
// make sure we clean up after ourselves
machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(ui_gfx_exit), &machine));
// initialize our global state
memset(state, 0, sizeof(*state));
// set up the palette state
state->palette.columns = 16;
// set up the graphics state
for (UINT8 i = 0; i < MAX_GFX_DECODERS; i++)
for (UINT8 j = 0; j < MAX_GFX_ELEMENTS; j++)
{
state->gfxdev[i].rotate[j] = rotate;
state->gfxdev[i].columns[j] = 16;
}
// set up the tilemap state
state->tilemap.rotate = rotate;
}
示例6: a600xl_mmu
void a600xl_mmu(running_machine &machine, UINT8 new_mmu)
{
/* check if self-test ROM changed */
if ( new_mmu & 0x80 )
{
logerror("%s MMU SELFTEST RAM\n", machine.system().name);
machine.device("maincpu")->memory().space(AS_PROGRAM).nop_readwrite(0x5000, 0x57ff);
}
else
{
logerror("%s MMU SELFTEST ROM\n", machine.system().name);
machine.device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x5000, 0x57ff, "bank2");
machine.device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x5000, 0x57ff);
machine.root_device().membank("bank2")->set_base(machine.root_device().memregion("maincpu")->base() + 0x5000);
}
}
示例7: safe_to_load
/* safe_to_load checks the start and end values of each memory range */
static int safe_to_load (running_machine &machine)
{
memory_range *mem_range = state.mem_range;
address_space *srcspace;
if (strstr(machine.system().source_file,"cinemat.c") > 0)
{
srcspace = machine.cpu[mem_range->cpu]->memory().space(AS_DATA);
}
else
{
srcspace = machine.cpu[mem_range->cpu]->memory().space(AS_PROGRAM);
}
while (mem_range)
{
if (srcspace->read_byte(mem_range->addr) != mem_range->start_value)
{
return 0;
}
if (srcspace->read_byte(mem_range->addr + mem_range->num_bytes - 1) != mem_range->end_value)
{
return 0;
}
mem_range = mem_range->next;
}
return 1;
}
示例8: send_id_string
static LRESULT send_id_string(running_machine &machine, HWND hwnd, LPARAM id)
{
copydata_id_string *temp;
COPYDATASTRUCT copydata;
const char *name;
int datalen;
// id 0 is the name of the game
if (id == 0)
name = machine.system().name;
else
name = output_id_to_name(id);
// a NULL name is an empty string
if (name == NULL)
name = "";
// allocate memory for the message
datalen = sizeof(*temp) + strlen(name);
temp = (copydata_id_string *)global_alloc_array(UINT8, datalen);
temp->id = id;
strcpy(temp->string, name);
// reply by using SendMessage with WM_COPYDATA
copydata.dwData = COPYDATA_MESSAGE_ID_STRING;
copydata.cbData = datalen;
copydata.lpData = temp;
SendMessage(hwnd, WM_COPYDATA, (WPARAM)output_hwnd, (LPARAM)©data);
// free the data
global_free(temp);
return 0;
}
示例9: send_id_string
static LRESULT send_id_string(running_machine &machine, HWND hwnd, LPARAM id)
{
COPYDATASTRUCT copydata;
const char *name;
int datalen;
// id 0 is the name of the game
if (id == 0)
name = machine.system().name;
else
name = machine.output().id_to_name(id);
// a NULL name is an empty string
if (name == nullptr)
name = "";
// allocate memory for the message
datalen = sizeof(copydata_id_string) + strlen(name) + 1;
dynamic_buffer buffer(datalen);
copydata_id_string *temp = (copydata_id_string *)&buffer[0];
temp->id = id;
strcpy(temp->string, name);
// reply by using SendMessage with WM_COPYDATA
copydata.dwData = COPYDATA_MESSAGE_ID_STRING;
copydata.cbData = datalen;
copydata.lpData = temp;
SendMessage(hwnd, WM_COPYDATA, (WPARAM)output_hwnd, (LPARAM)©data);
return 0;
}
示例10: gottlieb_knocker
void gottlieb_knocker(running_machine &machine)
{
device_t *samples = space->machine().device("samples");
if (!strcmp(machine.system().name,"reactor")) /* reactor */
{
}
else if (samples != NULL) /* qbert */
sample_start(samples, 0,44,0);
}
示例11: sdloutput_exit
static void sdloutput_exit(running_machine &machine)
{
if (output != NULL)
{
fprintf(output, "MAME " PID_FMT " STOP %s\n", osd_getpid(), machine.system().name);
fflush(output);
fclose(output);
output = NULL;
mame_printf_verbose("ouput: closed output notifier file\n");
}
}
示例12: create_bitmap
static void create_bitmap(running_machine &machine, int player)
{
int x, y;
char filename[20];
rgb_t color = crosshair_colors[player];
/* if we have a bitmap and texture for this player, kill it */
if (global.bitmap[player] == NULL)
global.bitmap[player] = global_alloc(bitmap_argb32);
machine.render().texture_free(global.texture[player]);
emu_file crossfile(machine.options().crosshair_path(), OPEN_FLAG_READ);
if (global.name[player][0] != 0)
{
/* look for user specified file */
sprintf(filename, "%s.png", global.name[player]);
render_load_png(*global.bitmap[player], crossfile, NULL, filename);
}
else
{
/* look for default cross?.png in crsshair\game dir */
sprintf(filename, "cross%d.png", player + 1);
render_load_png(*global.bitmap[player], crossfile, machine.system().name, filename);
/* look for default cross?.png in crsshair dir */
if (!global.bitmap[player]->valid())
render_load_png(*global.bitmap[player], crossfile, NULL, filename);
}
/* if that didn't work, use the built-in one */
if (!global.bitmap[player]->valid())
{
/* allocate a blank bitmap to start with */
global.bitmap[player]->allocate(CROSSHAIR_RAW_SIZE, CROSSHAIR_RAW_SIZE);
global.bitmap[player]->fill(MAKE_ARGB(0x00,0xff,0xff,0xff));
/* extract the raw source data to it */
for (y = 0; y < CROSSHAIR_RAW_SIZE / 2; y++)
{
/* assume it is mirrored vertically */
UINT32 *dest0 = &global.bitmap[player]->pix32(y);
UINT32 *dest1 = &global.bitmap[player]->pix32(CROSSHAIR_RAW_SIZE - 1 - y);
/* extract to two rows simultaneously */
for (x = 0; x < CROSSHAIR_RAW_SIZE; x++)
if ((crosshair_raw_top[y * CROSSHAIR_RAW_ROWBYTES + x / 8] << (x % 8)) & 0x80)
dest0[x] = dest1[x] = MAKE_ARGB(0xff,0x00,0x00,0x00) | color;
}
}
/* create a texture to reference the bitmap */
global.texture[player] = machine.render().texture_alloc(render_texture::hq_scale);
global.texture[player]->set_bitmap(*global.bitmap[player], global.bitmap[player]->cliprect(), TEXFORMAT_ARGB32);
}
示例13: sgi_mc_init
void sgi_mc_init(running_machine &machine)
{
pMC = auto_alloc_clear(machine, MC_t);
// if Indigo2, ID appropriately
if (!strcmp(machine.system().name, "ip244415"))
{
pMC->nSysID = 0x11; // rev. B MC, EISA bus present
}
sgi_mc_timer_init(machine);
}
示例14: dump_decrypted
void dump_decrypted(running_machine& machine, UINT8* decrypt)
{
FILE *fp;
char filename[256];
sprintf(filename,"dat_%s", machine.system().name);
fp=fopen(filename, "w+b");
if (fp)
{
fwrite(decrypt, 0x10000, 1, fp);
fclose(fp);
}
}
示例15: copy_from_memory
static void copy_from_memory (running_machine &machine, int cpu, int addr, UINT8 *dest, int num_bytes)
{
address_space *targetspace;
if (strstr(machine.system().source_file,"cinemat.c") > 0)
targetspace = &machine.cpu[cpu]->memory().space(AS_DATA);
else
targetspace = &machine.cpu[cpu]->memory().space(AS_PROGRAM);
for (int i = 0; i < num_bytes; i++)
{
dest[i] = targetspace->read_byte(addr+i);
}
}