Added back software list support in emu core, and update 6510 and SM8500 cpu cores with calls needed by MESS (no whatsnew)

This commit is contained in:
Miodrag Milanovic 2010-06-13 11:43:42 +00:00
parent 84788f50af
commit 4353b40864
6 changed files with 98 additions and 14 deletions

View File

@ -355,8 +355,9 @@ static CPU_RESET( m6510 )
cpustate->ddr = 0x00;
}
static UINT8 m6510_get_port(m6502_Regs *cpustate)
int m6510_get_port(cpu_device *device)
{
m6502_Regs *cpustate = get_safe_token(device);
return (cpustate->port & cpustate->ddr) | (cpustate->ddr ^ 0xff);
}
@ -797,8 +798,6 @@ static CPU_SET_INFO( m6510 )
CPU_GET_INFO( m6510 )
{
m6502_Regs *cpustate = (device != NULL && device->token() != NULL) ? get_safe_token(device) : NULL;
switch (state)
{
/* --- the following bits of info are returned as pointers to data or functions --- */
@ -811,9 +810,6 @@ CPU_GET_INFO( m6510 )
/* --- the following bits of info are returned as NULL-terminated strings --- */
case DEVINFO_STR_NAME: strcpy(info->s, "M6510"); break;
/* --- the following bits of info are set as 64-bit signed integers --- */
case CPUINFO_INT_M6510_PORT: info->i = m6510_get_port(cpustate); break;
default: CPU_GET_INFO_CALL(m6502); break;
}
}

View File

@ -97,6 +97,7 @@ extern CPU_GET_INFO( m6510 );
extern CPU_DISASSEMBLE( m6510 );
int m6510_get_port(cpu_device *device);
#define M6510T_A M6502_A
#define M6510T_X M6502_X

View File

@ -384,6 +384,12 @@ static void sm8500_set_irq_line( sm8500_state *cpustate, int irqline, int state
}
}
UINT8 *sm8500_get_internal_ram(cpu_device *device)
{
sm8500_state *cpustate = get_safe_token(device);
return cpustate->internal_ram;
}
static CPU_SET_INFO( sm8500 )
{
sm8500_state *cpustate = get_safe_token(device);
@ -514,8 +520,7 @@ CPU_GET_INFO( sm8500 )
case CPUINFO_FCT_EXECUTE: info->execute = CPU_EXECUTE_NAME(sm8500); break;
case CPUINFO_FCT_BURN: info->burn = CPU_BURN_NAME(sm8500); break;
case CPUINFO_FCT_DISASSEMBLE: info->disassemble = CPU_DISASSEMBLE_NAME(sm8500); break;
case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break;
case CPUINFO_PTR_SM8500_INTERNAL_RAM: info->p = cpustate->internal_ram; break;
case CPUINFO_PTR_INSTRUCTION_COUNTER: info->icount = &cpustate->icount; break;
case DEVINFO_STR_NAME: strcpy( info->s, "sm8500" ); break;
case DEVINFO_STR_FAMILY: strcpy( info->s, "Sharp SM8500" ); break;

View File

@ -22,12 +22,6 @@ typedef struct {
#define WDT_INT 9
#define NMI_INT 10
enum
{
CPUINFO_PTR_SM8500_INTERNAL_RAM = CPUINFO_PTR_CPU_SPECIFIC
};
enum
{
/* "main" 16 bit register */
@ -43,4 +37,6 @@ extern CPU_GET_INFO( sm8500 );
extern CPU_DISASSEMBLE( sm8500 );
UINT8 *sm8500_get_internal_ram(cpu_device *device);
#endif /* __SM8500_H__ */

View File

@ -1264,6 +1264,88 @@ static UINT32 normalize_flags_for_device(running_machine *machine, UINT32 startf
}
#ifdef MESS
/*-------------------------------------------------
load_software_part_region - load a software part
This is used by MESS when loading a piece of
software. The code should be merged with
process_region_list or updated to use a slight
more general process_region_list.
-------------------------------------------------*/
void load_software_part_region(running_device *device, char *swlist, char *swname, rom_entry *start_region)
{
astring *regiontag = astring_alloc();
astring *locationtag = astring_alloc();
const rom_entry *region;
rom_load_data *romdata = device->machine->romload_data;
/* Make sure we are passed a device */
assert(device!=NULL);
astring_assemble_3( locationtag, swlist, PATH_SEPARATOR, swname );
romdata->errorstring.reset();
/* loop until we hit the end */
for (region = start_region; region != NULL; region = rom_next_region(region))
{
UINT32 regionlength = ROMREGION_GETLENGTH(region);
UINT32 regionflags = ROMREGION_GETFLAGS(region);
astring_assemble_3( regiontag, device->tag(), ":", ROMREGION_GETTAG(region) );
LOG(("Processing region \"%s\" (length=%X)\n", astring_c(regiontag), regionlength));
/* the first entry must be a region */
assert(ROMENTRY_ISREGION(region));
/* if this is a device region, override with the device width and endianness */
if (devtag_get_device(romdata->machine, astring_c(regiontag)) != NULL)
regionflags = normalize_flags_for_device(romdata->machine, regionflags, astring_c(regiontag));
/* clear old region (todo: should be moved to an image unload function) */
if (memory_region(romdata->machine, astring_c(regiontag)) != NULL)
memory_region_free(romdata->machine, astring_c(regiontag));
/* remember the base and length */
romdata->region = memory_region_alloc(romdata->machine, astring_c(regiontag), regionlength, regionflags);
LOG(("Allocated %X bytes @ %p\n", romdata->region->length, romdata->region->base.v));
/* clear the region if it's requested */
if (ROMREGION_ISERASE(region))
memset(romdata->region->base.v, ROMREGION_GETERASEVAL(region), romdata->region->length);
/* or if it's sufficiently small (<= 4MB) */
else if (romdata->region->length <= 0x400000)
memset(romdata->region->base.v, 0, romdata->region->length);
#ifdef MAME_DEBUG
/* if we're debugging, fill region with random data to catch errors */
else
fill_random(romdata->machine, romdata->region->base.u8, romdata->region->length);
#endif
/* now process the entries in the region */
if (ROMREGION_ISROMDATA(region))
process_rom_entries(romdata, astring_c(locationtag), region + 1);
else if (ROMREGION_ISDISKDATA(region))
process_disk_entries(romdata, astring_c(locationtag), region + 1);
}
/* now go back and post-process all the regions */
for (region = start_region; region != NULL; region = rom_next_region(region))
region_post_process(romdata, ROMREGION_GETTAG(region));
astring_free(regiontag);
astring_free(locationtag);
/* display the results and exit */
display_rom_load_results(romdata);
}
#endif
/*-------------------------------------------------
process_region_list - process a region list
-------------------------------------------------*/

View File

@ -325,4 +325,8 @@ chd_file *get_disk_handle(running_machine *machine, const char *region);
void set_disk_handle(running_machine *machine, const char *region, mame_file *file, chd_file *chd);
#ifdef MESS
void load_software_part_region(running_device *device, char *swlist, char *swname, rom_entry *start_region);
#endif
#endif /* __ROMLOAD_H__ */