mirror of
https://github.com/holub/mame
synced 2025-05-23 22:20:01 +03:00
Most of the rest of the drivers converted.
This commit is contained in:
parent
73fb264753
commit
484da94b18
@ -968,6 +968,8 @@ void dcs2_init(running_machine *machine, int dram_in_mb, offs_t polling_offset)
|
|||||||
dcs.rev = 4;
|
dcs.rev = 4;
|
||||||
soundbank_words = 0x800;
|
soundbank_words = 0x800;
|
||||||
}
|
}
|
||||||
|
dcs.program = cpu_get_address_space(dcs.cpu, ADDRESS_SPACE_PROGRAM);
|
||||||
|
dcs.data = cpu_get_address_space(dcs.cpu, ADDRESS_SPACE_DATA);
|
||||||
dcs.channels = 2;
|
dcs.channels = 2;
|
||||||
|
|
||||||
/* initialize the ADSP Tx and timer callbacks */
|
/* initialize the ADSP Tx and timer callbacks */
|
||||||
|
@ -421,12 +421,13 @@ static WRITE8_HANDLER(at_page8_w)
|
|||||||
|
|
||||||
static DMA8237_MEM_READ( pc_dma_read_byte )
|
static DMA8237_MEM_READ( pc_dma_read_byte )
|
||||||
{
|
{
|
||||||
|
const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
||||||
UINT8 result;
|
UINT8 result;
|
||||||
offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
|
offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
|
||||||
& 0xFF0000;
|
& 0xFF0000;
|
||||||
|
|
||||||
cpu_push_context(device->machine->cpu[0]);
|
cpu_push_context(space->cpu);
|
||||||
result = program_read_byte(page_offset + offset);
|
result = memory_read_byte(space, page_offset + offset);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -435,11 +436,12 @@ static DMA8237_MEM_READ( pc_dma_read_byte )
|
|||||||
|
|
||||||
static DMA8237_MEM_WRITE( pc_dma_write_byte )
|
static DMA8237_MEM_WRITE( pc_dma_write_byte )
|
||||||
{
|
{
|
||||||
|
const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
||||||
offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
|
offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
|
||||||
& 0xFF0000;
|
& 0xFF0000;
|
||||||
|
|
||||||
cpu_push_context(device->machine->cpu[0]);
|
cpu_push_context(space->cpu);
|
||||||
program_write_byte(page_offset + offset, data);
|
memory_write_byte(space, page_offset + offset, data);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3710,12 +3710,12 @@ static READ32_HANDLER( rddsp32_speedup_r )
|
|||||||
if (cpu_get_pc(space->cpu) == rddsp32_speedup_pc && (*rddsp32_speedup >> 16) == 0)
|
if (cpu_get_pc(space->cpu) == rddsp32_speedup_pc && (*rddsp32_speedup >> 16) == 0)
|
||||||
{
|
{
|
||||||
UINT32 r14 = cpu_get_reg(space->cpu, DSP32_R14);
|
UINT32 r14 = cpu_get_reg(space->cpu, DSP32_R14);
|
||||||
UINT32 r1 = program_read_word(r14 - 0x14);
|
UINT32 r1 = memory_read_word(space, r14 - 0x14);
|
||||||
int cycles_to_burn = 17 * 4 * (0x2bc - r1 - 2);
|
int cycles_to_burn = 17 * 4 * (0x2bc - r1 - 2);
|
||||||
if (cycles_to_burn > 20 * 4)
|
if (cycles_to_burn > 20 * 4)
|
||||||
{
|
{
|
||||||
cpu_eat_cycles(space->cpu, cycles_to_burn);
|
cpu_eat_cycles(space->cpu, cycles_to_burn);
|
||||||
program_write_word(r14 - 0x14, r1 + cycles_to_burn / 17);
|
memory_write_word(space, r14 - 0x14, r1 + cycles_to_burn / 17);
|
||||||
}
|
}
|
||||||
msp_speedup_count[0]++;
|
msp_speedup_count[0]++;
|
||||||
}
|
}
|
||||||
|
@ -644,7 +644,7 @@ static READ32_HANDLER( hng64_port_read )
|
|||||||
|
|
||||||
/* preliminary dma code, dma is used to copy program code -> ram */
|
/* preliminary dma code, dma is used to copy program code -> ram */
|
||||||
static int hng_dma_start,hng_dma_dst,hng_dma_len;
|
static int hng_dma_start,hng_dma_dst,hng_dma_len;
|
||||||
static void hng64_do_dma (void)
|
static void hng64_do_dma (const address_space *space)
|
||||||
{
|
{
|
||||||
logerror("Performing DMA Start %08x Len %08x Dst %08x\n",hng_dma_start, hng_dma_len, hng_dma_dst);
|
logerror("Performing DMA Start %08x Len %08x Dst %08x\n",hng_dma_start, hng_dma_len, hng_dma_dst);
|
||||||
|
|
||||||
@ -652,8 +652,8 @@ static void hng64_do_dma (void)
|
|||||||
{
|
{
|
||||||
UINT32 dat;
|
UINT32 dat;
|
||||||
|
|
||||||
dat = program_read_dword(hng_dma_start);
|
dat = memory_read_dword(space,hng_dma_start);
|
||||||
program_write_dword(hng_dma_dst,dat);
|
memory_write_dword(space,hng_dma_dst,dat);
|
||||||
hng_dma_start+=4;
|
hng_dma_start+=4;
|
||||||
hng_dma_dst+=4;
|
hng_dma_dst+=4;
|
||||||
hng_dma_len--;
|
hng_dma_len--;
|
||||||
@ -680,7 +680,7 @@ static WRITE32_HANDLER( hng_dma_len_w )
|
|||||||
{
|
{
|
||||||
logerror ("DMA Len Write %08x\n",data);
|
logerror ("DMA Len Write %08x\n",data);
|
||||||
hng_dma_len = data;
|
hng_dma_len = data;
|
||||||
hng64_do_dma();
|
hng64_do_dma(space);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -634,13 +634,14 @@ static WRITE16_HANDLER( urashima_dma_w )
|
|||||||
{
|
{
|
||||||
UINT32 i;
|
UINT32 i;
|
||||||
for(i=0;i<0x200;i+=2)
|
for(i=0;i<0x200;i+=2)
|
||||||
program_write_word(0x88200+i,program_read_word(0x88400+i));
|
memory_write_word(space,0x88200+i,memory_read_word(space,0x88400+i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*same as $f00c0 sub-routine,but with additional work-around,to remove from here...*/
|
/*same as $f00c0 sub-routine,but with additional work-around,to remove from here...*/
|
||||||
static void daireika_palette_dma(running_machine *machine,UINT16 val)
|
static void daireika_palette_dma(running_machine *machine,UINT16 val)
|
||||||
{
|
{
|
||||||
|
const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
||||||
UINT32 index_1,index_2,src_addr,tmp_addr;
|
UINT32 index_1,index_2,src_addr,tmp_addr;
|
||||||
/*a0=301c0+jm_shared_ram[0x540/2] & 0xf00 */
|
/*a0=301c0+jm_shared_ram[0x540/2] & 0xf00 */
|
||||||
/*a1=88000*/
|
/*a1=88000*/
|
||||||
@ -649,10 +650,10 @@ static void daireika_palette_dma(running_machine *machine,UINT16 val)
|
|||||||
for(index_1=0;index_1<0x200;index_1+=0x20)
|
for(index_1=0;index_1<0x200;index_1+=0x20)
|
||||||
{
|
{
|
||||||
tmp_addr = src_addr;
|
tmp_addr = src_addr;
|
||||||
src_addr = program_read_dword(src_addr);
|
src_addr = memory_read_dword(space,src_addr);
|
||||||
|
|
||||||
for(index_2=0;index_2<0x20;index_2+=2)
|
for(index_2=0;index_2<0x20;index_2+=2)
|
||||||
program_write_word(0x88000+index_2+index_1,program_read_word(src_addr+index_2));
|
memory_write_word(space,0x88000+index_2+index_1,memory_read_word(space,src_addr+index_2));
|
||||||
|
|
||||||
src_addr = tmp_addr + 4;
|
src_addr = tmp_addr + 4;
|
||||||
}
|
}
|
||||||
|
@ -203,7 +203,7 @@ static struct sprite_entry {
|
|||||||
UINT32 adr;
|
UINT32 adr;
|
||||||
} sprites[0x100];
|
} sprites[0x100];
|
||||||
|
|
||||||
static void generate_sprites(UINT32 src, UINT32 spr, int count)
|
static void generate_sprites(const address_space *space, UINT32 src, UINT32 spr, int count)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int scount;
|
int scount;
|
||||||
@ -214,9 +214,9 @@ static void generate_sprites(UINT32 src, UINT32 spr, int count)
|
|||||||
for(i=0; i<count; i++) {
|
for(i=0; i<count; i++) {
|
||||||
UINT32 adr = src + 0x100*i;
|
UINT32 adr = src + 0x100*i;
|
||||||
int pri;
|
int pri;
|
||||||
if(!program_read_word(adr+2))
|
if(!memory_read_word(space, adr+2))
|
||||||
continue;
|
continue;
|
||||||
pri = program_read_word(adr+28);
|
pri = memory_read_word(space, adr+28);
|
||||||
|
|
||||||
if(pri < 256) {
|
if(pri < 256) {
|
||||||
sprites[ecount].pri = pri;
|
sprites[ecount].pri = pri;
|
||||||
@ -229,39 +229,39 @@ static void generate_sprites(UINT32 src, UINT32 spr, int count)
|
|||||||
for(i=0; i<ecount; i++) {
|
for(i=0; i<ecount; i++) {
|
||||||
UINT32 adr = sprites[i].adr;
|
UINT32 adr = sprites[i].adr;
|
||||||
if(adr) {
|
if(adr) {
|
||||||
UINT32 set =(program_read_word(adr) << 16)|program_read_word(adr+2);
|
UINT32 set =(memory_read_word(space, adr) << 16)|memory_read_word(space, adr+2);
|
||||||
UINT16 glob_x = program_read_word(adr+4);
|
UINT16 glob_x = memory_read_word(space, adr+4);
|
||||||
UINT16 glob_y = program_read_word(adr+8);
|
UINT16 glob_y = memory_read_word(space, adr+8);
|
||||||
UINT16 flip_x = program_read_word(adr+12) ? 0x1000 : 0x0000;
|
UINT16 flip_x = memory_read_word(space, adr+12) ? 0x1000 : 0x0000;
|
||||||
UINT16 flip_y = program_read_word(adr+14) ? 0x2000 : 0x0000;
|
UINT16 flip_y = memory_read_word(space, adr+14) ? 0x2000 : 0x0000;
|
||||||
UINT16 glob_f = flip_x | (flip_y ^ 0x2000);
|
UINT16 glob_f = flip_x | (flip_y ^ 0x2000);
|
||||||
UINT16 zoom_x = program_read_word(adr+20);
|
UINT16 zoom_x = memory_read_word(space, adr+20);
|
||||||
UINT16 zoom_y = program_read_word(adr+22);
|
UINT16 zoom_y = memory_read_word(space, adr+22);
|
||||||
UINT16 color_val = 0x0000;
|
UINT16 color_val = 0x0000;
|
||||||
UINT16 color_mask = 0xffff;
|
UINT16 color_mask = 0xffff;
|
||||||
UINT16 color_set = 0x0000;
|
UINT16 color_set = 0x0000;
|
||||||
UINT16 color_rotate = 0x0000;
|
UINT16 color_rotate = 0x0000;
|
||||||
UINT16 v;
|
UINT16 v;
|
||||||
|
|
||||||
v = program_read_word(adr+24);
|
v = memory_read_word(space, adr+24);
|
||||||
if(v & 0x8000) {
|
if(v & 0x8000) {
|
||||||
color_mask = 0xf3ff;
|
color_mask = 0xf3ff;
|
||||||
color_val |= (v & 3) << 10;
|
color_val |= (v & 3) << 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
v = program_read_word(adr+26);
|
v = memory_read_word(space, adr+26);
|
||||||
if(v & 0x8000) {
|
if(v & 0x8000) {
|
||||||
color_mask &= 0xfcff;
|
color_mask &= 0xfcff;
|
||||||
color_val |= (v & 3) << 8;
|
color_val |= (v & 3) << 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
v = program_read_word(adr+18);
|
v = memory_read_word(space, adr+18);
|
||||||
if(v & 0x8000) {
|
if(v & 0x8000) {
|
||||||
color_mask &= 0xff1f;
|
color_mask &= 0xff1f;
|
||||||
color_val |= v & 0xe0;
|
color_val |= v & 0xe0;
|
||||||
}
|
}
|
||||||
|
|
||||||
v = program_read_word(adr+16);
|
v = memory_read_word(space, adr+16);
|
||||||
if(v & 0x8000)
|
if(v & 0x8000)
|
||||||
color_set = v & 0x1f;
|
color_set = v & 0x1f;
|
||||||
if(v & 0x4000)
|
if(v & 0x4000)
|
||||||
@ -274,14 +274,14 @@ static void generate_sprites(UINT32 src, UINT32 spr, int count)
|
|||||||
|
|
||||||
if(set >= 0x200000 && set < 0xd00000)
|
if(set >= 0x200000 && set < 0xd00000)
|
||||||
{
|
{
|
||||||
UINT16 count2 = program_read_word(set);
|
UINT16 count2 = memory_read_word(space, set);
|
||||||
set += 2;
|
set += 2;
|
||||||
while(count2) {
|
while(count2) {
|
||||||
UINT16 idx = program_read_word(set);
|
UINT16 idx = memory_read_word(space, set);
|
||||||
UINT16 flip = program_read_word(set+2);
|
UINT16 flip = memory_read_word(space, set+2);
|
||||||
UINT16 col = program_read_word(set+4);
|
UINT16 col = memory_read_word(space, set+4);
|
||||||
short y = program_read_word(set+6);
|
short y = memory_read_word(space, set+6);
|
||||||
short x = program_read_word(set+8);
|
short x = memory_read_word(space, set+8);
|
||||||
|
|
||||||
if(idx == 0xffff) {
|
if(idx == 0xffff) {
|
||||||
set = (flip<<16) | col;
|
set = (flip<<16) | col;
|
||||||
@ -316,13 +316,13 @@ static void generate_sprites(UINT32 src, UINT32 spr, int count)
|
|||||||
if(color_rotate)
|
if(color_rotate)
|
||||||
col = (col & 0xffe0) | ((col + color_rotate) & 0x1f);
|
col = (col & 0xffe0) | ((col + color_rotate) & 0x1f);
|
||||||
|
|
||||||
program_write_word(spr , (flip ^ glob_f) | sprites[i].pri);
|
memory_write_word(space, spr , (flip ^ glob_f) | sprites[i].pri);
|
||||||
program_write_word(spr+ 2, idx);
|
memory_write_word(space, spr+ 2, idx);
|
||||||
program_write_word(spr+ 4, y);
|
memory_write_word(space, spr+ 4, y);
|
||||||
program_write_word(spr+ 6, x);
|
memory_write_word(space, spr+ 6, x);
|
||||||
program_write_word(spr+ 8, zoom_y);
|
memory_write_word(space, spr+ 8, zoom_y);
|
||||||
program_write_word(spr+10, zoom_x);
|
memory_write_word(space, spr+10, zoom_x);
|
||||||
program_write_word(spr+12, col);
|
memory_write_word(space, spr+12, col);
|
||||||
spr += 16;
|
spr += 16;
|
||||||
scount++;
|
scount++;
|
||||||
if(scount == 256)
|
if(scount == 256)
|
||||||
@ -335,45 +335,45 @@ static void generate_sprites(UINT32 src, UINT32 spr, int count)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
while(scount < 256) {
|
while(scount < 256) {
|
||||||
program_write_word(spr, scount);
|
memory_write_word(space, spr, scount);
|
||||||
scount++;
|
scount++;
|
||||||
spr += 16;
|
spr += 16;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tkmmpzdm_esc(UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
|
static void tkmmpzdm_esc(const address_space *space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
|
||||||
{
|
{
|
||||||
konamigx_esc_alert(gx_workram, 0x0142, 0x100, 0);
|
konamigx_esc_alert(gx_workram, 0x0142, 0x100, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dragoonj_esc(UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
|
static void dragoonj_esc(const address_space *space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
|
||||||
{
|
{
|
||||||
konamigx_esc_alert(gx_workram, 0x5c00, 0x100, 0);
|
konamigx_esc_alert(gx_workram, 0x5c00, 0x100, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sal2_esc(UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
|
static void sal2_esc(const address_space *space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
|
||||||
{
|
{
|
||||||
konamigx_esc_alert(gx_workram, 0x1c8c, 0x172, 1);
|
konamigx_esc_alert(gx_workram, 0x1c8c, 0x172, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sexyparo_esc(UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
|
static void sexyparo_esc(const address_space *space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
|
||||||
{
|
{
|
||||||
// The d20000 should probably be p3
|
// The d20000 should probably be p3
|
||||||
generate_sprites(0xc00604, 0xd20000, 0xfc);
|
generate_sprites(space, 0xc00604, 0xd20000, 0xfc);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tbyahhoo_esc(UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
|
static void tbyahhoo_esc(const address_space *space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
|
||||||
{
|
{
|
||||||
generate_sprites(0xc00000, 0xd20000, 0x100);
|
generate_sprites(space, 0xc00000, 0xd20000, 0x100);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void daiskiss_esc(UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
|
static void daiskiss_esc(const address_space *space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4)
|
||||||
{
|
{
|
||||||
generate_sprites(0xc00000, 0xd20000, 0x100);
|
generate_sprites(space, 0xc00000, 0xd20000, 0x100);
|
||||||
}
|
}
|
||||||
|
|
||||||
static UINT8 esc_program[4096];
|
static UINT8 esc_program[4096];
|
||||||
static void (*esc_cb)(UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4);
|
static void (*esc_cb)(const address_space *space, UINT32 p1, UINT32 p2, UINT32 p3, UINT32 p4);
|
||||||
|
|
||||||
static WRITE32_HANDLER( esc_w )
|
static WRITE32_HANDLER( esc_w )
|
||||||
{
|
{
|
||||||
@ -393,7 +393,7 @@ static WRITE32_HANDLER( esc_w )
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* the master opcode can be at an unaligned address, so get it "safely" */
|
/* the master opcode can be at an unaligned address, so get it "safely" */
|
||||||
opcode = (program_read_word(data+2))|(program_read_word(data)<<16);
|
opcode = (memory_read_word(space, data+2))|(memory_read_word(space, data)<<16);
|
||||||
|
|
||||||
/* if there's an OBJECT_MAGIC_ID, that means
|
/* if there's an OBJECT_MAGIC_ID, that means
|
||||||
there is a valid ESC command packet. */
|
there is a valid ESC command packet. */
|
||||||
@ -401,15 +401,15 @@ static WRITE32_HANDLER( esc_w )
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
/* get the subop now */
|
/* get the subop now */
|
||||||
opcode = program_read_byte(data+8);
|
opcode = memory_read_byte(space, data+8);
|
||||||
params = (program_read_word(data+12) << 16) | program_read_word(data+14);
|
params = (memory_read_word(space, data+12) << 16) | memory_read_word(space, data+14);
|
||||||
|
|
||||||
switch(opcode) {
|
switch(opcode) {
|
||||||
case 5: // Reset
|
case 5: // Reset
|
||||||
break;
|
break;
|
||||||
case 2: // Load program
|
case 2: // Load program
|
||||||
for(i=0; i<4096; i++)
|
for(i=0; i<4096; i++)
|
||||||
esc_program[i] = program_read_byte(params+i);
|
esc_program[i] = memory_read_byte(space, params+i);
|
||||||
/*
|
/*
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
@ -424,18 +424,18 @@ static WRITE32_HANDLER( esc_w )
|
|||||||
break;
|
break;
|
||||||
case 1: // Run program
|
case 1: // Run program
|
||||||
if(esc_cb) {
|
if(esc_cb) {
|
||||||
UINT32 p1 = (program_read_word(params+0)<<16) | program_read_word(params+2);
|
UINT32 p1 = (memory_read_word(space, params+0)<<16) | memory_read_word(space, params+2);
|
||||||
UINT32 p2 = (program_read_word(params+4)<<16) | program_read_word(params+6);
|
UINT32 p2 = (memory_read_word(space, params+4)<<16) | memory_read_word(space, params+6);
|
||||||
UINT32 p3 = (program_read_word(params+8)<<16) | program_read_word(params+10);
|
UINT32 p3 = (memory_read_word(space, params+8)<<16) | memory_read_word(space, params+10);
|
||||||
UINT32 p4 = (program_read_word(params+12)<<16) | program_read_word(params+14);
|
UINT32 p4 = (memory_read_word(space, params+12)<<16) | memory_read_word(space, params+14);
|
||||||
esc_cb(p1, p2, p3, p4);
|
esc_cb(space, p1, p2, p3, p4);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// logerror("Unknown ESC opcode %d\n", opcode);
|
// logerror("Unknown ESC opcode %d\n", opcode);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
program_write_byte(data+9, ESTATE_END);
|
memory_write_byte(space, data+9, ESTATE_END);
|
||||||
|
|
||||||
if (konamigx_wrport1_1 & 0x10)
|
if (konamigx_wrport1_1 & 0x10)
|
||||||
{
|
{
|
||||||
@ -1052,15 +1052,15 @@ static WRITE32_HANDLER( type4_prot_w )
|
|||||||
// memcpy from c01000 to c01400 for 0x400 bytes (startup check for type 4 games)
|
// memcpy from c01000 to c01400 for 0x400 bytes (startup check for type 4 games)
|
||||||
for (i = 0; i < 0x400; i += 2)
|
for (i = 0; i < 0x400; i += 2)
|
||||||
{
|
{
|
||||||
program_write_word(0xc01400+i, program_read_word(0xc01000+i));
|
memory_write_word(space, 0xc01400+i, memory_read_word(space, 0xc01000+i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(last_prot_op == 0x57a) // winspike
|
else if(last_prot_op == 0x57a) // winspike
|
||||||
{
|
{
|
||||||
program_write_dword(0xc10f00, program_read_dword(0xc00f10));
|
memory_write_dword(space, 0xc10f00, memory_read_dword(space, 0xc00f10));
|
||||||
program_write_dword(0xc10f04, program_read_dword(0xc00f14));
|
memory_write_dword(space, 0xc10f04, memory_read_dword(space, 0xc00f14));
|
||||||
program_write_dword(0xc0fe00, program_read_dword(0xc00f30));
|
memory_write_dword(space, 0xc0fe00, memory_read_dword(space, 0xc00f30));
|
||||||
program_write_dword(0xc0fe04, program_read_dword(0xc00f34));
|
memory_write_dword(space, 0xc0fe04, memory_read_dword(space, 0xc00f34));
|
||||||
}
|
}
|
||||||
else if(last_prot_op == 0xd97) // rushhero
|
else if(last_prot_op == 0xd97) // rushhero
|
||||||
{
|
{
|
||||||
@ -1072,7 +1072,7 @@ static WRITE32_HANDLER( type4_prot_w )
|
|||||||
{
|
{
|
||||||
for (i = 0; i <= 0x10; i += 4)
|
for (i = 0; i <= 0x10; i += 4)
|
||||||
{
|
{
|
||||||
program_write_dword(dst + i, program_read_dword(src+i));
|
memory_write_dword(space, dst + i, memory_read_dword(space, src+i));
|
||||||
}
|
}
|
||||||
|
|
||||||
src -= 0x10;
|
src -= 0x10;
|
||||||
|
@ -71,10 +71,11 @@ static WRITE16_HANDLER( adrst_w )
|
|||||||
|
|
||||||
static READ16_HANDLER( main_gnd_r )
|
static READ16_HANDLER( main_gnd_r )
|
||||||
{
|
{
|
||||||
|
const address_space *gndspace = cpu_get_address_space(space->machine->cpu[GROUND_CPU], ADDRESS_SPACE_PROGRAM);
|
||||||
UINT16 result;
|
UINT16 result;
|
||||||
|
|
||||||
cpu_push_context(space->machine->cpu[GROUND_CPU]);
|
cpu_push_context(gndspace->cpu);
|
||||||
result = program_read_word(V30_GND_ADDR | offset * 2);
|
result = memory_read_word(gndspace, V30_GND_ADDR | offset * 2);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -82,22 +83,24 @@ static READ16_HANDLER( main_gnd_r )
|
|||||||
|
|
||||||
static WRITE16_HANDLER( main_gnd_w )
|
static WRITE16_HANDLER( main_gnd_w )
|
||||||
{
|
{
|
||||||
cpu_push_context(space->machine->cpu[GROUND_CPU]);
|
const address_space *gndspace = cpu_get_address_space(space->machine->cpu[GROUND_CPU], ADDRESS_SPACE_PROGRAM);
|
||||||
|
cpu_push_context(gndspace->cpu);
|
||||||
|
|
||||||
if (ACCESSING_BITS_0_7)
|
if (ACCESSING_BITS_0_7)
|
||||||
program_write_byte(V30_GND_ADDR | (offset * 2 + 0), data);
|
memory_write_byte(gndspace, V30_GND_ADDR | (offset * 2 + 0), data);
|
||||||
if (ACCESSING_BITS_8_15)
|
if (ACCESSING_BITS_8_15)
|
||||||
program_write_byte(V30_GND_ADDR | (offset * 2 + 1), data >> 8);
|
memory_write_byte(gndspace, V30_GND_ADDR | (offset * 2 + 1), data >> 8);
|
||||||
|
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
}
|
}
|
||||||
|
|
||||||
static READ16_HANDLER( main_obj_r )
|
static READ16_HANDLER( main_obj_r )
|
||||||
{
|
{
|
||||||
|
const address_space *objspace = cpu_get_address_space(space->machine->cpu[OBJECT_CPU], ADDRESS_SPACE_PROGRAM);
|
||||||
UINT16 result;
|
UINT16 result;
|
||||||
|
|
||||||
cpu_push_context(space->machine->cpu[OBJECT_CPU]);
|
cpu_push_context(objspace->cpu);
|
||||||
result = program_read_word(V30_OBJ_ADDR | offset * 2);
|
result = memory_read_word(objspace, V30_OBJ_ADDR | offset * 2);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -105,12 +108,13 @@ static READ16_HANDLER( main_obj_r )
|
|||||||
|
|
||||||
static WRITE16_HANDLER( main_obj_w )
|
static WRITE16_HANDLER( main_obj_w )
|
||||||
{
|
{
|
||||||
cpu_push_context(space->machine->cpu[OBJECT_CPU]);
|
const address_space *objspace = cpu_get_address_space(space->machine->cpu[OBJECT_CPU], ADDRESS_SPACE_PROGRAM);
|
||||||
|
cpu_push_context(objspace->cpu);
|
||||||
|
|
||||||
if (ACCESSING_BITS_0_7)
|
if (ACCESSING_BITS_0_7)
|
||||||
program_write_byte(V30_OBJ_ADDR | (offset * 2 + 0), data);
|
memory_write_byte(objspace, V30_OBJ_ADDR | (offset * 2 + 0), data);
|
||||||
if (ACCESSING_BITS_8_15)
|
if (ACCESSING_BITS_8_15)
|
||||||
program_write_byte(V30_OBJ_ADDR | (offset * 2 + 1), data >> 8);
|
memory_write_byte(objspace, V30_OBJ_ADDR | (offset * 2 + 1), data >> 8);
|
||||||
|
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
}
|
}
|
||||||
@ -119,28 +123,32 @@ static WRITE16_HANDLER( tst_w )
|
|||||||
{
|
{
|
||||||
if (offset < 0x800)
|
if (offset < 0x800)
|
||||||
{
|
{
|
||||||
cpu_push_context(space->machine->cpu[GROUND_CPU]);
|
const address_space *gndspace = cpu_get_address_space(space->machine->cpu[GROUND_CPU], ADDRESS_SPACE_PROGRAM);
|
||||||
|
const address_space *objspace = cpu_get_address_space(space->machine->cpu[OBJECT_CPU], ADDRESS_SPACE_PROGRAM);
|
||||||
|
|
||||||
|
cpu_push_context(gndspace->cpu);
|
||||||
if (ACCESSING_BITS_0_7)
|
if (ACCESSING_BITS_0_7)
|
||||||
program_write_byte(V30_GND_ADDR | (offset * 2 + 0), data);
|
memory_write_byte(gndspace, V30_GND_ADDR | (offset * 2 + 0), data);
|
||||||
if (ACCESSING_BITS_8_15)
|
if (ACCESSING_BITS_8_15)
|
||||||
program_write_byte(V30_GND_ADDR | (offset * 2 + 1), data >> 8);
|
memory_write_byte(gndspace, V30_GND_ADDR | (offset * 2 + 1), data >> 8);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
|
|
||||||
cpu_push_context(space->machine->cpu[OBJECT_CPU]);
|
cpu_push_context(objspace->cpu);
|
||||||
if (ACCESSING_BITS_0_7)
|
if (ACCESSING_BITS_0_7)
|
||||||
program_write_byte(V30_OBJ_ADDR | (offset * 2 + 0), data);
|
memory_write_byte(objspace, V30_OBJ_ADDR | (offset * 2 + 0), data);
|
||||||
if (ACCESSING_BITS_8_15)
|
if (ACCESSING_BITS_8_15)
|
||||||
program_write_byte(V30_OBJ_ADDR | (offset * 2 + 1), data >> 8);
|
memory_write_byte(objspace, V30_OBJ_ADDR | (offset * 2 + 1), data >> 8);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static READ16_HANDLER( main_z80_r )
|
static READ16_HANDLER( main_z80_r )
|
||||||
{
|
{
|
||||||
|
const address_space *sndspace = cpu_get_address_space(space->machine->cpu[SOUND_CPU], ADDRESS_SPACE_PROGRAM);
|
||||||
UINT16 val;
|
UINT16 val;
|
||||||
|
|
||||||
cpu_push_context(space->machine->cpu[SOUND_CPU]);
|
cpu_push_context(sndspace->cpu);
|
||||||
val = program_read_byte(offset);
|
val = memory_read_byte(sndspace, offset);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
|
|
||||||
return 0xff00 | val;
|
return 0xff00 | val;
|
||||||
@ -148,8 +156,9 @@ static READ16_HANDLER( main_z80_r )
|
|||||||
|
|
||||||
static WRITE16_HANDLER( main_z80_w )
|
static WRITE16_HANDLER( main_z80_w )
|
||||||
{
|
{
|
||||||
cpu_push_context(space->machine->cpu[SOUND_CPU]);
|
const address_space *sndspace = cpu_get_address_space(space->machine->cpu[SOUND_CPU], ADDRESS_SPACE_PROGRAM);
|
||||||
program_write_byte(offset, data);
|
cpu_push_context(sndspace->cpu);
|
||||||
|
memory_write_byte(sndspace, offset, data);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,10 +127,11 @@ static const z80dma_interface mario_dma =
|
|||||||
|
|
||||||
static READ8_DEVICE_HANDLER(mario_dma_read_byte)
|
static READ8_DEVICE_HANDLER(mario_dma_read_byte)
|
||||||
{
|
{
|
||||||
|
const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
||||||
UINT8 result;
|
UINT8 result;
|
||||||
|
|
||||||
cpu_push_context(device->machine->cpu[0]);
|
cpu_push_context(space->cpu);
|
||||||
result = program_read_byte(offset);
|
result = memory_read_byte(space, offset);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -138,8 +139,9 @@ static READ8_DEVICE_HANDLER(mario_dma_read_byte)
|
|||||||
|
|
||||||
static WRITE8_DEVICE_HANDLER(mario_dma_write_byte)
|
static WRITE8_DEVICE_HANDLER(mario_dma_write_byte)
|
||||||
{
|
{
|
||||||
cpu_push_context(device->machine->cpu[0]);
|
const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
||||||
program_write_byte(offset, data);
|
cpu_push_context(space->cpu);
|
||||||
|
memory_write_byte(space, offset, data);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -772,12 +772,13 @@ static WRITE8_HANDLER(at_page8_w)
|
|||||||
|
|
||||||
static DMA8237_MEM_READ( pc_dma_read_byte )
|
static DMA8237_MEM_READ( pc_dma_read_byte )
|
||||||
{
|
{
|
||||||
|
const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
||||||
UINT8 result;
|
UINT8 result;
|
||||||
offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
|
offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
|
||||||
& 0xFF0000;
|
& 0xFF0000;
|
||||||
|
|
||||||
cpu_push_context(device->machine->cpu[0]);
|
cpu_push_context(space->cpu);
|
||||||
result = program_read_byte(page_offset + offset);
|
result = memory_read_byte(space, page_offset + offset);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -786,11 +787,12 @@ static DMA8237_MEM_READ( pc_dma_read_byte )
|
|||||||
|
|
||||||
static DMA8237_MEM_WRITE( pc_dma_write_byte )
|
static DMA8237_MEM_WRITE( pc_dma_write_byte )
|
||||||
{
|
{
|
||||||
|
const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
||||||
offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
|
offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
|
||||||
& 0xFF0000;
|
& 0xFF0000;
|
||||||
|
|
||||||
cpu_push_context(device->machine->cpu[0]);
|
cpu_push_context(space->cpu);
|
||||||
program_write_byte(page_offset + offset, data);
|
memory_write_byte(space, page_offset + offset, data);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,7 +178,7 @@ static bitmap_t* render_bitmap;
|
|||||||
#ifdef UNUSED_FUNCTION
|
#ifdef UNUSED_FUNCTION
|
||||||
/* taken from segaic16.c */
|
/* taken from segaic16.c */
|
||||||
/* doesn't seem to meet my needs, not used */
|
/* doesn't seem to meet my needs, not used */
|
||||||
static UINT16 read_next_instruction(void)
|
static UINT16 read_next_instruction(const address_space *space)
|
||||||
{
|
{
|
||||||
static UINT8 recurse = 0;
|
static UINT8 recurse = 0;
|
||||||
UINT16 result;
|
UINT16 result;
|
||||||
@ -197,7 +197,7 @@ static UINT16 read_next_instruction(void)
|
|||||||
|
|
||||||
/* read original encrypted memory at that address */
|
/* read original encrypted memory at that address */
|
||||||
recurse = 1;
|
recurse = 1;
|
||||||
result = program_read_word_16be(cpu_get_pc(machine->activecpu));
|
result = memory_read_word(space, cpu_get_pc(space->cpu));
|
||||||
recurse = 0;
|
recurse = 0;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -2288,7 +2288,7 @@ static READ16_HANDLER( megadriv_68k_check_z80_bus )
|
|||||||
the value is never zero. Time Killers is the most fussy, and doesn't like the
|
the value is never zero. Time Killers is the most fussy, and doesn't like the
|
||||||
read_next_instruction function from system16, so I just return a random value
|
read_next_instruction function from system16, so I just return a random value
|
||||||
in the unused bits */
|
in the unused bits */
|
||||||
UINT16 nextvalue = mame_rand(space->machine);//read_next_instruction()&0xff00;
|
UINT16 nextvalue = mame_rand(space->machine);//read_next_instruction(space)&0xff00;
|
||||||
|
|
||||||
|
|
||||||
/* Check if the 68k has the z80 bus */
|
/* Check if the 68k has the z80 bus */
|
||||||
|
@ -767,8 +767,9 @@ static WRITE64_HANDLER(scsi_w)
|
|||||||
|
|
||||||
static UINT32 scsi_fetch(UINT32 dsp)
|
static UINT32 scsi_fetch(UINT32 dsp)
|
||||||
{
|
{
|
||||||
|
const address_space *space = cpu_get_address_space(Machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
||||||
UINT32 result;
|
UINT32 result;
|
||||||
result = program_read_dword_64be(dsp);
|
result = memory_read_dword(space, dsp);
|
||||||
return FLIPENDIAN_INT32(result);
|
return FLIPENDIAN_INT32(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -283,11 +283,11 @@ static WRITE16_HANDLER( moo_prot_w )
|
|||||||
|
|
||||||
while (length)
|
while (length)
|
||||||
{
|
{
|
||||||
a = program_read_word(src1);
|
a = memory_read_word(space, src1);
|
||||||
b = program_read_word(src2);
|
b = memory_read_word(space, src2);
|
||||||
res = a+2*b;
|
res = a+2*b;
|
||||||
|
|
||||||
program_write_word(dst, res);
|
memory_write_word(space, dst, res);
|
||||||
|
|
||||||
src1 += 2;
|
src1 += 2;
|
||||||
src2 += 2;
|
src2 += 2;
|
||||||
|
@ -392,7 +392,7 @@ READ16_HANDLER( neogeo_unmapped_r )
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
recurse = 1;
|
recurse = 1;
|
||||||
ret = program_read_word(cpu_get_pc(space->cpu));
|
ret = memory_read_word(space, cpu_get_pc(space->cpu));
|
||||||
recurse = 0;
|
recurse = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ static READ16_HANDLER( bankrom_r )
|
|||||||
ROM bank area, we need to return the correct value to give the proper checksum */
|
ROM bank area, we need to return the correct value to give the proper checksum */
|
||||||
if ((offset == 0x3000 || offset == 0x3001) && cpu_get_previouspc(space->cpu) > 0x37000)
|
if ((offset == 0x3000 || offset == 0x3001) && cpu_get_previouspc(space->cpu) > 0x37000)
|
||||||
{
|
{
|
||||||
UINT32 checksum = (program_read_word(0x3fd210) << 16) | program_read_word(0x3fd212);
|
UINT32 checksum = (memory_read_word(space, 0x3fd210) << 16) | memory_read_word(space, 0x3fd212);
|
||||||
UINT32 us = 0xaaaa5555 - checksum;
|
UINT32 us = 0xaaaa5555 - checksum;
|
||||||
if (offset == 0x3001)
|
if (offset == 0x3001)
|
||||||
return us & 0xffff;
|
return us & 0xffff;
|
||||||
|
@ -173,10 +173,10 @@ static READ8_HANDLER( spunchout_prot_r ) {
|
|||||||
switch ( offset ) {
|
switch ( offset ) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
if ( prot_mode_sel == 0x0a )
|
if ( prot_mode_sel == 0x0a )
|
||||||
return program_read_byte(0xd012);
|
return memory_read_byte(space, 0xd012);
|
||||||
|
|
||||||
if ( prot_mode_sel == 0x0b || prot_mode_sel == 0x23 )
|
if ( prot_mode_sel == 0x0b || prot_mode_sel == 0x23 )
|
||||||
return program_read_byte(0xd7c1);
|
return memory_read_byte(space, 0xd7c1);
|
||||||
|
|
||||||
return prot_mem[offset];
|
return prot_mem[offset];
|
||||||
break;
|
break;
|
||||||
@ -248,12 +248,12 @@ static WRITE8_HANDLER( spunchout_prot_w ) {
|
|||||||
switch ( offset ) {
|
switch ( offset ) {
|
||||||
case 0x00:
|
case 0x00:
|
||||||
if ( prot_mode_sel == 0x0a ) {
|
if ( prot_mode_sel == 0x0a ) {
|
||||||
program_write_byte(0xd012, data);
|
memory_write_byte(space, 0xd012, data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( prot_mode_sel == 0x0b || prot_mode_sel == 0x23 ) {
|
if ( prot_mode_sel == 0x0b || prot_mode_sel == 0x23 ) {
|
||||||
program_write_byte(0xd7c1, data);
|
memory_write_byte(space, 0xd7c1, data);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -472,7 +472,7 @@ static void vblank_assert(const device_config *device, int state);
|
|||||||
static void update_vblank_irq(running_machine *machine);
|
static void update_vblank_irq(running_machine *machine);
|
||||||
static void galileo_reset(void);
|
static void galileo_reset(void);
|
||||||
static TIMER_CALLBACK( galileo_timer_callback );
|
static TIMER_CALLBACK( galileo_timer_callback );
|
||||||
static void galileo_perform_dma(running_machine *machine, int which);
|
static void galileo_perform_dma(const address_space *space, int which);
|
||||||
static void voodoo_stall(const device_config *device, int stall);
|
static void voodoo_stall(const device_config *device, int stall);
|
||||||
static void widget_reset(running_machine *machine);
|
static void widget_reset(running_machine *machine);
|
||||||
static void update_widget_irq(running_machine *machine);
|
static void update_widget_irq(running_machine *machine);
|
||||||
@ -936,7 +936,7 @@ static TIMER_CALLBACK( galileo_timer_callback )
|
|||||||
*
|
*
|
||||||
*************************************/
|
*************************************/
|
||||||
|
|
||||||
static int galileo_dma_fetch_next(running_machine *machine, int which)
|
static int galileo_dma_fetch_next(const address_space *space, int which)
|
||||||
{
|
{
|
||||||
offs_t address = 0;
|
offs_t address = 0;
|
||||||
UINT32 data;
|
UINT32 data;
|
||||||
@ -951,32 +951,32 @@ static int galileo_dma_fetch_next(running_machine *machine, int which)
|
|||||||
if (galileo.reg[GREG_DMA0_CONTROL + which] & 0x400)
|
if (galileo.reg[GREG_DMA0_CONTROL + which] & 0x400)
|
||||||
{
|
{
|
||||||
galileo.reg[GREG_INT_STATE] |= 1 << (GINT_DMA0COMP_SHIFT + which);
|
galileo.reg[GREG_INT_STATE] |= 1 << (GINT_DMA0COMP_SHIFT + which);
|
||||||
update_galileo_irqs(machine);
|
update_galileo_irqs(space->machine);
|
||||||
}
|
}
|
||||||
galileo.reg[GREG_DMA0_CONTROL + which] &= ~0x5000;
|
galileo.reg[GREG_DMA0_CONTROL + which] &= ~0x5000;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* fetch the byte count */
|
/* fetch the byte count */
|
||||||
data = program_read_dword(address); address += 4;
|
data = memory_read_dword(space, address); address += 4;
|
||||||
galileo.reg[GREG_DMA0_COUNT + which] = data;
|
galileo.reg[GREG_DMA0_COUNT + which] = data;
|
||||||
|
|
||||||
/* fetch the source address */
|
/* fetch the source address */
|
||||||
data = program_read_dword(address); address += 4;
|
data = memory_read_dword(space, address); address += 4;
|
||||||
galileo.reg[GREG_DMA0_SOURCE + which] = data;
|
galileo.reg[GREG_DMA0_SOURCE + which] = data;
|
||||||
|
|
||||||
/* fetch the dest address */
|
/* fetch the dest address */
|
||||||
data = program_read_dword(address); address += 4;
|
data = memory_read_dword(space, address); address += 4;
|
||||||
galileo.reg[GREG_DMA0_DEST + which] = data;
|
galileo.reg[GREG_DMA0_DEST + which] = data;
|
||||||
|
|
||||||
/* fetch the next record address */
|
/* fetch the next record address */
|
||||||
data = program_read_dword(address); address += 4;
|
data = memory_read_dword(space, address); address += 4;
|
||||||
galileo.reg[GREG_DMA0_NEXT + which] = data;
|
galileo.reg[GREG_DMA0_NEXT + which] = data;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void galileo_perform_dma(running_machine *machine, int which)
|
static void galileo_perform_dma(const address_space *space, int which)
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@ -1027,7 +1027,7 @@ static void galileo_perform_dma(running_machine *machine, int which)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* write the data and advance */
|
/* write the data and advance */
|
||||||
voodoo_w(voodoo_device, (dstaddr & 0xffffff) / 4, program_read_dword(srcaddr), 0xffffffff);
|
voodoo_w(voodoo_device, (dstaddr & 0xffffff) / 4, memory_read_dword(space, srcaddr), 0xffffffff);
|
||||||
srcaddr += srcinc;
|
srcaddr += srcinc;
|
||||||
dstaddr += dstinc;
|
dstaddr += dstinc;
|
||||||
bytesleft -= 4;
|
bytesleft -= 4;
|
||||||
@ -1039,7 +1039,7 @@ static void galileo_perform_dma(running_machine *machine, int which)
|
|||||||
{
|
{
|
||||||
while (bytesleft > 0)
|
while (bytesleft > 0)
|
||||||
{
|
{
|
||||||
program_write_byte(dstaddr, program_read_byte(srcaddr));
|
memory_write_byte(space, dstaddr, memory_read_byte(space, srcaddr));
|
||||||
srcaddr += srcinc;
|
srcaddr += srcinc;
|
||||||
dstaddr += dstinc;
|
dstaddr += dstinc;
|
||||||
bytesleft--;
|
bytesleft--;
|
||||||
@ -1060,9 +1060,9 @@ static void galileo_perform_dma(running_machine *machine, int which)
|
|||||||
if (!(galileo.reg[GREG_DMA0_CONTROL + which] & 0x400))
|
if (!(galileo.reg[GREG_DMA0_CONTROL + which] & 0x400))
|
||||||
{
|
{
|
||||||
galileo.reg[GREG_INT_STATE] |= 1 << (GINT_DMA0COMP_SHIFT + which);
|
galileo.reg[GREG_INT_STATE] |= 1 << (GINT_DMA0COMP_SHIFT + which);
|
||||||
update_galileo_irqs(machine);
|
update_galileo_irqs(space->machine);
|
||||||
}
|
}
|
||||||
} while (galileo_dma_fetch_next(machine, which));
|
} while (galileo_dma_fetch_next(space, which));
|
||||||
|
|
||||||
galileo.reg[GREG_DMA0_CONTROL + which] &= ~0x5000;
|
galileo.reg[GREG_DMA0_CONTROL + which] &= ~0x5000;
|
||||||
}
|
}
|
||||||
@ -1186,12 +1186,12 @@ static WRITE32_HANDLER( galileo_w )
|
|||||||
|
|
||||||
/* fetch next record */
|
/* fetch next record */
|
||||||
if (data & 0x2000)
|
if (data & 0x2000)
|
||||||
galileo_dma_fetch_next(space->machine, which);
|
galileo_dma_fetch_next(space, which);
|
||||||
galileo.reg[offset] &= ~0x2000;
|
galileo.reg[offset] &= ~0x2000;
|
||||||
|
|
||||||
/* if enabling, start the DMA */
|
/* if enabling, start the DMA */
|
||||||
if (!(oldata & 0x1000) && (data & 0x1000))
|
if (!(oldata & 0x1000) && (data & 0x1000))
|
||||||
galileo_perform_dma(space->machine, which);
|
galileo_perform_dma(space, which);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1358,14 +1358,15 @@ static void voodoo_stall(const device_config *device, int stall)
|
|||||||
for (which = 0; which < 4; which++)
|
for (which = 0; which < 4; which++)
|
||||||
if (galileo.dma_stalled_on_voodoo[which])
|
if (galileo.dma_stalled_on_voodoo[which])
|
||||||
{
|
{
|
||||||
|
const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
||||||
if (LOG_DMA) logerror("Resuming DMA%d on voodoo\n", which);
|
if (LOG_DMA) logerror("Resuming DMA%d on voodoo\n", which);
|
||||||
|
|
||||||
/* mark this DMA as no longer stalled */
|
/* mark this DMA as no longer stalled */
|
||||||
galileo.dma_stalled_on_voodoo[which] = FALSE;
|
galileo.dma_stalled_on_voodoo[which] = FALSE;
|
||||||
|
|
||||||
/* resume execution */
|
/* resume execution */
|
||||||
cpu_push_context(device->machine->cpu[0]);
|
cpu_push_context(space->cpu);
|
||||||
galileo_perform_dma(device->machine, which);
|
galileo_perform_dma(space, which);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -183,29 +183,23 @@ static MACHINE_RESET( pignewt )
|
|||||||
*
|
*
|
||||||
*************************************/
|
*************************************/
|
||||||
|
|
||||||
static offs_t decrypt_offset(running_machine *machine, offs_t offset)
|
static offs_t decrypt_offset(const address_space *space, offs_t offset)
|
||||||
{
|
{
|
||||||
offs_t pc;
|
|
||||||
|
|
||||||
/* if no active CPU, don't do anything */
|
|
||||||
if (cpunum_get_active() == -1)
|
|
||||||
return offset;
|
|
||||||
|
|
||||||
/* ignore anything but accesses via opcode $32 (LD $(XXYY),A) */
|
/* ignore anything but accesses via opcode $32 (LD $(XXYY),A) */
|
||||||
pc = cpu_get_previouspc(machine->activecpu);
|
offs_t pc = cpu_get_previouspc(space->cpu);
|
||||||
if ((UINT16)pc == 0xffff || program_read_byte(pc) != 0x32)
|
if ((UINT16)pc == 0xffff || memory_read_byte(space, pc) != 0x32)
|
||||||
return offset;
|
return offset;
|
||||||
|
|
||||||
/* fetch the low byte of the address and munge it */
|
/* fetch the low byte of the address and munge it */
|
||||||
return (offset & 0xff00) | (*sega_decrypt)(pc, program_read_byte(pc + 1));
|
return (offset & 0xff00) | (*sega_decrypt)(pc, memory_read_byte(space, pc + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
static WRITE8_HANDLER( mainram_w ) { mainram[decrypt_offset(space->machine, offset)] = data; }
|
static WRITE8_HANDLER( mainram_w ) { mainram[decrypt_offset(space, offset)] = data; }
|
||||||
static WRITE8_HANDLER( vidram_w ) { segag80r_videoram_w(space, decrypt_offset(space->machine, offset), data); }
|
static WRITE8_HANDLER( vidram_w ) { segag80r_videoram_w(space, decrypt_offset(space, offset), data); }
|
||||||
static WRITE8_HANDLER( monsterb_vidram_w ) { monsterb_videoram_w(space, decrypt_offset(space->machine, offset), data); }
|
static WRITE8_HANDLER( monsterb_vidram_w ) { monsterb_videoram_w(space, decrypt_offset(space, offset), data); }
|
||||||
static WRITE8_HANDLER( pignewt_vidram_w ) { pignewt_videoram_w(space, decrypt_offset(space->machine, offset), data); }
|
static WRITE8_HANDLER( pignewt_vidram_w ) { pignewt_videoram_w(space, decrypt_offset(space, offset), data); }
|
||||||
static WRITE8_HANDLER( sindbadm_vidram_w ) { sindbadm_videoram_w(space, decrypt_offset(space->machine, offset), data); }
|
static WRITE8_HANDLER( sindbadm_vidram_w ) { sindbadm_videoram_w(space, decrypt_offset(space, offset), data); }
|
||||||
static WRITE8_HANDLER( usb_ram_w ) { sega_usb_ram_w(space, decrypt_offset(space->machine, offset), data); }
|
static WRITE8_HANDLER( usb_ram_w ) { sega_usb_ram_w(space, decrypt_offset(space, offset), data); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -212,26 +212,20 @@ static MACHINE_RESET( g80v )
|
|||||||
*
|
*
|
||||||
*************************************/
|
*************************************/
|
||||||
|
|
||||||
static offs_t decrypt_offset(running_machine *machine, offs_t offset)
|
static offs_t decrypt_offset(const address_space *space, offs_t offset)
|
||||||
{
|
{
|
||||||
offs_t pc;
|
|
||||||
|
|
||||||
/* if no active CPU, don't do anything */
|
|
||||||
if (machine->activecpu == NULL)
|
|
||||||
return offset;
|
|
||||||
|
|
||||||
/* ignore anything but accesses via opcode $32 (LD $(XXYY),A) */
|
/* ignore anything but accesses via opcode $32 (LD $(XXYY),A) */
|
||||||
pc = cpu_get_previouspc(machine->activecpu);
|
offs_t pc = cpu_get_previouspc(space->cpu);
|
||||||
if ((UINT16)pc == 0xffff || program_read_byte(pc) != 0x32)
|
if ((UINT16)pc == 0xffff || memory_read_byte(space, pc) != 0x32)
|
||||||
return offset;
|
return offset;
|
||||||
|
|
||||||
/* fetch the low byte of the address and munge it */
|
/* fetch the low byte of the address and munge it */
|
||||||
return (offset & 0xff00) | (*sega_decrypt)(pc, program_read_byte(pc + 1));
|
return (offset & 0xff00) | (*sega_decrypt)(pc, memory_read_byte(space, pc + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
static WRITE8_HANDLER( mainram_w ) { mainram[decrypt_offset(space->machine, offset)] = data; }
|
static WRITE8_HANDLER( mainram_w ) { mainram[decrypt_offset(space, offset)] = data; }
|
||||||
static WRITE8_HANDLER( usb_ram_w ) { sega_usb_ram_w(space, decrypt_offset(space->machine, offset), data); }
|
static WRITE8_HANDLER( usb_ram_w ) { sega_usb_ram_w(space, decrypt_offset(space, offset), data); }
|
||||||
static WRITE8_HANDLER( vectorram_w ) { vectorram[decrypt_offset(space->machine, offset)] = data; }
|
static WRITE8_HANDLER( vectorram_w ) { vectorram[decrypt_offset(space, offset)] = data; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -364,7 +364,7 @@ static UINT8 analog_bank;
|
|||||||
static UINT8 analog_value[4];
|
static UINT8 analog_value[4];
|
||||||
static UINT8 sonic_last[6];
|
static UINT8 sonic_last[6];
|
||||||
|
|
||||||
static void (*system32_prot_vblank)(void);
|
static void (*system32_prot_vblank)(const device_config *device);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -573,7 +573,7 @@ static INTERRUPT_GEN( start_of_vblank_int )
|
|||||||
system32_set_vblank(1);
|
system32_set_vblank(1);
|
||||||
timer_set(video_screen_get_time_until_pos(device->machine->primary_screen, 0, 0), NULL, 0, end_of_vblank_int);
|
timer_set(video_screen_get_time_until_pos(device->machine->primary_screen, 0, 0), NULL, 0, end_of_vblank_int);
|
||||||
if (system32_prot_vblank)
|
if (system32_prot_vblank)
|
||||||
(*system32_prot_vblank)();
|
(*system32_prot_vblank)(device);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -679,7 +679,7 @@ ADDRESS_MAP_END
|
|||||||
The offset to use is stored in RAM at address 0x20BA16 */
|
The offset to use is stored in RAM at address 0x20BA16 */
|
||||||
static READ16_HANDLER( pzlbowl_protection_r )
|
static READ16_HANDLER( pzlbowl_protection_r )
|
||||||
{
|
{
|
||||||
UINT32 address = (program_read_word(0x20ba16) << 16) | program_read_word(0x20ba18);
|
UINT32 address = (memory_read_word(space, 0x20ba16) << 16) | memory_read_word(space, 0x20ba18);
|
||||||
return memory_region(space->machine, "main")[address - 2];
|
return memory_region(space->machine, "main")[address - 2];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -61,10 +61,10 @@ static WRITE16_HANDLER( soundcmd_w )
|
|||||||
/* The protection of the japanese version */
|
/* The protection of the japanese version */
|
||||||
/* I'd love to see someone dump the 68705 rom */
|
/* I'd love to see someone dump the 68705 rom */
|
||||||
|
|
||||||
static void write_dword(offs_t offset,UINT32 data)
|
static void write_dword(const address_space *space,offs_t offset,UINT32 data)
|
||||||
{
|
{
|
||||||
program_write_word(offset,data >> 16);
|
memory_write_word(space, offset,data >> 16);
|
||||||
program_write_word(offset+2,data);
|
memory_write_word(space, offset+2,data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static WRITE16_HANDLER( protection_w )
|
static WRITE16_HANDLER( protection_w )
|
||||||
@ -78,31 +78,31 @@ static WRITE16_HANDLER( protection_w )
|
|||||||
int map;
|
int map;
|
||||||
|
|
||||||
map = maplist
|
map = maplist
|
||||||
[program_read_byte(0xffc006)]
|
[memory_read_byte(space, 0xffc006)]
|
||||||
[(program_read_byte(0xffc003)<<1) + (program_read_word(0xffc004)>>8)];
|
[(memory_read_byte(space, 0xffc003)<<1) + (memory_read_word(space, 0xffc004)>>8)];
|
||||||
|
|
||||||
switch(program_read_byte(0xffc684)) {
|
switch(memory_read_byte(space, 0xffc684)) {
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
int base;
|
int base;
|
||||||
|
|
||||||
base = 0x1b6e8+0x300e*map;
|
base = 0x1b6e8+0x300e*map;
|
||||||
|
|
||||||
write_dword(0xffc01c, 0x16bfc+0x270*map);
|
write_dword(space, 0xffc01c, 0x16bfc+0x270*map);
|
||||||
write_dword(0xffc020, base+0x80);
|
write_dword(space, 0xffc020, base+0x80);
|
||||||
write_dword(0xffc024, base);
|
write_dword(space, 0xffc024, base);
|
||||||
write_dword(0xffc028, base+0x86);
|
write_dword(space, 0xffc028, base+0x86);
|
||||||
write_dword(0xffc02c, base+0x8e);
|
write_dword(space, 0xffc02c, base+0x8e);
|
||||||
write_dword(0xffc030, base+0x20e);
|
write_dword(space, 0xffc030, base+0x20e);
|
||||||
write_dword(0xffc034, base+0x30e);
|
write_dword(space, 0xffc034, base+0x30e);
|
||||||
write_dword(0xffc038, base+0x38e);
|
write_dword(space, 0xffc038, base+0x38e);
|
||||||
write_dword(0xffc03c, base+0x40e);
|
write_dword(space, 0xffc03c, base+0x40e);
|
||||||
write_dword(0xffc040, base+0x80e);
|
write_dword(space, 0xffc040, base+0x80e);
|
||||||
write_dword(0xffc044, base+0xc0e);
|
write_dword(space, 0xffc044, base+0xc0e);
|
||||||
write_dword(0xffc048, base+0x180e);
|
write_dword(space, 0xffc048, base+0x180e);
|
||||||
write_dword(0xffc04c, base+0x240e);
|
write_dword(space, 0xffc04c, base+0x240e);
|
||||||
write_dword(0xffc050, 0x19548+0x60*map);
|
write_dword(space, 0xffc050, 0x19548+0x60*map);
|
||||||
write_dword(0xffc054, 0x19578+0x60*map);
|
write_dword(space, 0xffc054, 0x19578+0x60*map);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 2:
|
case 2:
|
||||||
@ -117,10 +117,10 @@ static WRITE16_HANDLER( protection_w )
|
|||||||
int d1 = delta1[map] + 0xc0;
|
int d1 = delta1[map] + 0xc0;
|
||||||
int d2 = delta2[map];
|
int d2 = delta2[map];
|
||||||
|
|
||||||
program_write_word(0xffc680, d1);
|
memory_write_word(space, 0xffc680, d1);
|
||||||
program_write_word(0xffc682, d2);
|
memory_write_word(space, 0xffc682, d2);
|
||||||
program_write_word(0xffc00c, 0xc0);
|
memory_write_word(space, 0xffc00c, 0xc0);
|
||||||
program_write_word(0xffc00e, 0);
|
memory_write_word(space, 0xffc00e, 0);
|
||||||
|
|
||||||
sf_fg_scroll_w(space, 0, d1, 0xffff);
|
sf_fg_scroll_w(space, 0, d1, 0xffff);
|
||||||
sf_bg_scroll_w(space, 0, d2, 0xffff);
|
sf_bg_scroll_w(space, 0, d2, 0xffff);
|
||||||
@ -128,12 +128,12 @@ static WRITE16_HANDLER( protection_w )
|
|||||||
}
|
}
|
||||||
case 4:
|
case 4:
|
||||||
{
|
{
|
||||||
int pos = program_read_byte(0xffc010);
|
int pos = memory_read_byte(space, 0xffc010);
|
||||||
pos = (pos+1) & 3;
|
pos = (pos+1) & 3;
|
||||||
program_write_byte(0xffc010, pos);
|
memory_write_byte(space, 0xffc010, pos);
|
||||||
if(!pos) {
|
if(!pos) {
|
||||||
int d1 = program_read_word(0xffc682);
|
int d1 = memory_read_word(space, 0xffc682);
|
||||||
int off = program_read_word(0xffc00e);
|
int off = memory_read_word(space, 0xffc00e);
|
||||||
if(off!=512) {
|
if(off!=512) {
|
||||||
off++;
|
off++;
|
||||||
d1++;
|
d1++;
|
||||||
@ -141,8 +141,8 @@ static WRITE16_HANDLER( protection_w )
|
|||||||
off = 0;
|
off = 0;
|
||||||
d1 -= 512;
|
d1 -= 512;
|
||||||
}
|
}
|
||||||
program_write_word(0xffc682, d1);
|
memory_write_word(space, 0xffc682, d1);
|
||||||
program_write_word(0xffc00e, off);
|
memory_write_word(space, 0xffc00e, off);
|
||||||
sf_bg_scroll_w(space, 0, d1, 0xffff);
|
sf_bg_scroll_w(space, 0, d1, 0xffff);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -150,7 +150,7 @@ static WRITE16_HANDLER( protection_w )
|
|||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
logerror("Write protection at %06x (%04x)\n", cpu_get_pc(space->cpu), data&0xffff);
|
logerror("Write protection at %06x (%04x)\n", cpu_get_pc(space->cpu), data&0xffff);
|
||||||
logerror("*** Unknown protection %d\n", program_read_byte(0xffc684));
|
logerror("*** Unknown protection %d\n", memory_read_byte(space, 0xffc684));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -236,12 +236,12 @@ struct
|
|||||||
UINT8 abus;
|
UINT8 abus;
|
||||||
}stv_irq;
|
}stv_irq;
|
||||||
|
|
||||||
static void dma_direct_lv0(running_machine *machine); /*DMA level 0 direct transfer function*/
|
static void dma_direct_lv0(const address_space *space); /*DMA level 0 direct transfer function*/
|
||||||
static void dma_direct_lv1(running_machine *machine); /*DMA level 1 direct transfer function*/
|
static void dma_direct_lv1(const address_space *space); /*DMA level 1 direct transfer function*/
|
||||||
static void dma_direct_lv2(running_machine *machine); /*DMA level 2 direct transfer function*/
|
static void dma_direct_lv2(const address_space *space); /*DMA level 2 direct transfer function*/
|
||||||
static void dma_indirect_lv0(running_machine *machine); /*DMA level 0 indirect transfer function*/
|
static void dma_indirect_lv0(const address_space *space); /*DMA level 0 indirect transfer function*/
|
||||||
static void dma_indirect_lv1(running_machine *machine); /*DMA level 1 indirect transfer function*/
|
static void dma_indirect_lv1(const address_space *space); /*DMA level 1 indirect transfer function*/
|
||||||
static void dma_indirect_lv2(running_machine *machine); /*DMA level 2 indirect transfer function*/
|
static void dma_indirect_lv2(const address_space *space); /*DMA level 2 indirect transfer function*/
|
||||||
|
|
||||||
|
|
||||||
int minit_boost,sinit_boost;
|
int minit_boost,sinit_boost;
|
||||||
@ -1160,8 +1160,8 @@ static WRITE32_HANDLER( stv_scu_w32 )
|
|||||||
*/
|
*/
|
||||||
if(stv_scu[4] & 1 && ((stv_scu[5] & 7) == 7) && stv_scu[4] & 0x100)
|
if(stv_scu[4] & 1 && ((stv_scu[5] & 7) == 7) && stv_scu[4] & 0x100)
|
||||||
{
|
{
|
||||||
if(DIRECT_MODE(0)) { dma_direct_lv0(space->machine); }
|
if(DIRECT_MODE(0)) { dma_direct_lv0(space); }
|
||||||
else { dma_indirect_lv0(space->machine); }
|
else { dma_indirect_lv0(space); }
|
||||||
|
|
||||||
stv_scu[4]^=1;//disable starting bit.
|
stv_scu[4]^=1;//disable starting bit.
|
||||||
|
|
||||||
@ -1221,8 +1221,8 @@ static WRITE32_HANDLER( stv_scu_w32 )
|
|||||||
case 12:
|
case 12:
|
||||||
if(stv_scu[12] & 1 && ((stv_scu[13] & 7) == 7) && stv_scu[12] & 0x100)
|
if(stv_scu[12] & 1 && ((stv_scu[13] & 7) == 7) && stv_scu[12] & 0x100)
|
||||||
{
|
{
|
||||||
if(DIRECT_MODE(1)) { dma_direct_lv1(space->machine); }
|
if(DIRECT_MODE(1)) { dma_direct_lv1(space); }
|
||||||
else { dma_indirect_lv1(space->machine); }
|
else { dma_indirect_lv1(space); }
|
||||||
|
|
||||||
stv_scu[12]^=1;
|
stv_scu[12]^=1;
|
||||||
|
|
||||||
@ -1271,8 +1271,8 @@ static WRITE32_HANDLER( stv_scu_w32 )
|
|||||||
case 20:
|
case 20:
|
||||||
if(stv_scu[20] & 1 && ((stv_scu[21] & 7) == 7) && stv_scu[20] & 0x100)
|
if(stv_scu[20] & 1 && ((stv_scu[21] & 7) == 7) && stv_scu[20] & 0x100)
|
||||||
{
|
{
|
||||||
if(DIRECT_MODE(2)) { dma_direct_lv2(space->machine); }
|
if(DIRECT_MODE(2)) { dma_direct_lv2(space); }
|
||||||
else { dma_indirect_lv2(space->machine); }
|
else { dma_indirect_lv2(space); }
|
||||||
|
|
||||||
stv_scu[20]^=1;
|
stv_scu[20]^=1;
|
||||||
|
|
||||||
@ -1301,7 +1301,7 @@ static WRITE32_HANDLER( stv_scu_w32 )
|
|||||||
/*DSP section*/
|
/*DSP section*/
|
||||||
/*Use functions so it is easier to work out*/
|
/*Use functions so it is easier to work out*/
|
||||||
case 32:
|
case 32:
|
||||||
dsp_prg_ctrl(space->machine, data);
|
dsp_prg_ctrl(space, data);
|
||||||
if(LOG_SCU) logerror("SCU DSP: Program Control Port Access %08x\n",data);
|
if(LOG_SCU) logerror("SCU DSP: Program Control Port Access %08x\n",data);
|
||||||
break;
|
break;
|
||||||
case 33:
|
case 33:
|
||||||
@ -1417,7 +1417,7 @@ static TIMER_CALLBACK( dma_lv2_ended )
|
|||||||
D2MV_0;
|
D2MV_0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dma_direct_lv0(running_machine *machine)
|
static void dma_direct_lv0(const address_space *space)
|
||||||
{
|
{
|
||||||
static UINT32 tmp_src,tmp_dst,tmp_size;
|
static UINT32 tmp_src,tmp_dst,tmp_size;
|
||||||
if(LOG_SCU) logerror("DMA lv 0 transfer START\n"
|
if(LOG_SCU) logerror("DMA lv 0 transfer START\n"
|
||||||
@ -1491,18 +1491,18 @@ static void dma_direct_lv0(running_machine *machine)
|
|||||||
for (; scu_size_0 > 0; scu_size_0-=scu_dst_add_0)
|
for (; scu_size_0 > 0; scu_size_0-=scu_dst_add_0)
|
||||||
{
|
{
|
||||||
if(scu_dst_add_0 == 2)
|
if(scu_dst_add_0 == 2)
|
||||||
program_write_word(scu_dst_0,program_read_word(scu_src_0));
|
memory_write_word(space,scu_dst_0,memory_read_word(space,scu_src_0));
|
||||||
else if(scu_dst_add_0 == 8)
|
else if(scu_dst_add_0 == 8)
|
||||||
{
|
{
|
||||||
program_write_word(scu_dst_0,program_read_word(scu_src_0));
|
memory_write_word(space,scu_dst_0,memory_read_word(space,scu_src_0));
|
||||||
program_write_word(scu_dst_0+2,program_read_word(scu_src_0));
|
memory_write_word(space,scu_dst_0+2,memory_read_word(space,scu_src_0));
|
||||||
program_write_word(scu_dst_0+4,program_read_word(scu_src_0+2));
|
memory_write_word(space,scu_dst_0+4,memory_read_word(space,scu_src_0+2));
|
||||||
program_write_word(scu_dst_0+6,program_read_word(scu_src_0+2));
|
memory_write_word(space,scu_dst_0+6,memory_read_word(space,scu_src_0+2));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
program_write_word(scu_dst_0,program_read_word(scu_src_0));
|
memory_write_word(space,scu_dst_0,memory_read_word(space,scu_src_0));
|
||||||
program_write_word(scu_dst_0+2,program_read_word(scu_src_0+2));
|
memory_write_word(space,scu_dst_0+2,memory_read_word(space,scu_src_0+2));
|
||||||
}
|
}
|
||||||
|
|
||||||
scu_dst_0+=scu_dst_add_0;
|
scu_dst_0+=scu_dst_add_0;
|
||||||
@ -1526,7 +1526,7 @@ static void dma_direct_lv0(running_machine *machine)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dma_direct_lv1(running_machine *machine)
|
static void dma_direct_lv1(const address_space *space)
|
||||||
{
|
{
|
||||||
static UINT32 tmp_src,tmp_dst,tmp_size;
|
static UINT32 tmp_src,tmp_dst,tmp_size;
|
||||||
if(LOG_SCU) logerror("DMA lv 1 transfer START\n"
|
if(LOG_SCU) logerror("DMA lv 1 transfer START\n"
|
||||||
@ -1600,11 +1600,11 @@ static void dma_direct_lv1(running_machine *machine)
|
|||||||
for (; scu_size_1 > 0; scu_size_1-=scu_dst_add_1)
|
for (; scu_size_1 > 0; scu_size_1-=scu_dst_add_1)
|
||||||
{
|
{
|
||||||
if(scu_dst_add_1 == 2)
|
if(scu_dst_add_1 == 2)
|
||||||
program_write_word(scu_dst_1,program_read_word(scu_src_1));
|
memory_write_word(space,scu_dst_1,memory_read_word(space,scu_src_1));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
program_write_word(scu_dst_1,program_read_word(scu_src_1));
|
memory_write_word(space,scu_dst_1,memory_read_word(space,scu_src_1));
|
||||||
program_write_word(scu_dst_1+2,program_read_word(scu_src_1+2));
|
memory_write_word(space,scu_dst_1+2,memory_read_word(space,scu_src_1+2));
|
||||||
}
|
}
|
||||||
|
|
||||||
scu_dst_1+=scu_dst_add_1;
|
scu_dst_1+=scu_dst_add_1;
|
||||||
@ -1627,7 +1627,7 @@ static void dma_direct_lv1(running_machine *machine)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dma_direct_lv2(running_machine *machine)
|
static void dma_direct_lv2(const address_space *space)
|
||||||
{
|
{
|
||||||
static UINT32 tmp_src,tmp_dst,tmp_size;
|
static UINT32 tmp_src,tmp_dst,tmp_size;
|
||||||
if(LOG_SCU) logerror("DMA lv 2 transfer START\n"
|
if(LOG_SCU) logerror("DMA lv 2 transfer START\n"
|
||||||
@ -1701,11 +1701,11 @@ static void dma_direct_lv2(running_machine *machine)
|
|||||||
for (; scu_size_2 > 0; scu_size_2-=scu_dst_add_2)
|
for (; scu_size_2 > 0; scu_size_2-=scu_dst_add_2)
|
||||||
{
|
{
|
||||||
if(scu_dst_add_2 == 2)
|
if(scu_dst_add_2 == 2)
|
||||||
program_write_word(scu_dst_2,program_read_word(scu_src_2));
|
memory_write_word(space,scu_dst_2,memory_read_word(space,scu_src_2));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
program_write_word(scu_dst_2,program_read_word(scu_src_2));
|
memory_write_word(space,scu_dst_2,memory_read_word(space,scu_src_2));
|
||||||
program_write_word(scu_dst_2+2,program_read_word(scu_src_2+2));
|
memory_write_word(space,scu_dst_2+2,memory_read_word(space,scu_src_2+2));
|
||||||
}
|
}
|
||||||
|
|
||||||
scu_dst_2+=scu_dst_add_2;
|
scu_dst_2+=scu_dst_add_2;
|
||||||
@ -1728,7 +1728,7 @@ static void dma_direct_lv2(running_machine *machine)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dma_indirect_lv0(running_machine *machine)
|
static void dma_indirect_lv0(const address_space *space)
|
||||||
{
|
{
|
||||||
/*Helper to get out of the cycle*/
|
/*Helper to get out of the cycle*/
|
||||||
UINT8 job_done = 0;
|
UINT8 job_done = 0;
|
||||||
@ -1745,9 +1745,9 @@ static void dma_indirect_lv0(running_machine *machine)
|
|||||||
tmp_src = scu_index_0;
|
tmp_src = scu_index_0;
|
||||||
|
|
||||||
/*Thanks for Runik of Saturnin for pointing this out...*/
|
/*Thanks for Runik of Saturnin for pointing this out...*/
|
||||||
scu_size_0 = program_read_dword(scu_index_0);
|
scu_size_0 = memory_read_dword(space,scu_index_0);
|
||||||
scu_src_0 = program_read_dword(scu_index_0+8);
|
scu_src_0 = memory_read_dword(space,scu_index_0+8);
|
||||||
scu_dst_0 = program_read_dword(scu_index_0+4);
|
scu_dst_0 = memory_read_dword(space,scu_index_0+4);
|
||||||
|
|
||||||
/*Indirect Mode end factor*/
|
/*Indirect Mode end factor*/
|
||||||
if(scu_src_0 & 0x80000000)
|
if(scu_src_0 & 0x80000000)
|
||||||
@ -1771,7 +1771,7 @@ static void dma_indirect_lv0(running_machine *machine)
|
|||||||
for (; scu_size_0 > 0; scu_size_0-=scu_dst_add_0)
|
for (; scu_size_0 > 0; scu_size_0-=scu_dst_add_0)
|
||||||
{
|
{
|
||||||
if(scu_dst_add_0 == 2)
|
if(scu_dst_add_0 == 2)
|
||||||
program_write_word(scu_dst_0,program_read_word(scu_src_0));
|
memory_write_word(space,scu_dst_0,memory_read_word(space,scu_src_0));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* some games, eg columns97 are a bit weird, I'm not sure this is correct
|
/* some games, eg columns97 are a bit weird, I'm not sure this is correct
|
||||||
@ -1779,15 +1779,15 @@ static void dma_indirect_lv0(running_machine *machine)
|
|||||||
can't access 2 byte boundaries, and the end of the sprite list never gets marked,
|
can't access 2 byte boundaries, and the end of the sprite list never gets marked,
|
||||||
the length of the transfer is also set to a 2 byte boundary, maybe the add values
|
the length of the transfer is also set to a 2 byte boundary, maybe the add values
|
||||||
should be different, I don't know */
|
should be different, I don't know */
|
||||||
program_write_word(scu_dst_0,program_read_word(scu_src_0));
|
memory_write_word(space,scu_dst_0,memory_read_word(space,scu_src_0));
|
||||||
program_write_word(scu_dst_0+2,program_read_word(scu_src_0+2));
|
memory_write_word(space,scu_dst_0+2,memory_read_word(space,scu_src_0+2));
|
||||||
}
|
}
|
||||||
scu_dst_0+=scu_dst_add_0;
|
scu_dst_0+=scu_dst_add_0;
|
||||||
scu_src_0+=scu_src_add_0;
|
scu_src_0+=scu_src_add_0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if(DRUP(0)) program_write_dword(tmp_src+8,scu_src_0|job_done ? 0x80000000 : 0);
|
//if(DRUP(0)) memory_write_dword(space,tmp_src+8,scu_src_0|job_done ? 0x80000000 : 0);
|
||||||
//if(DWUP(0)) program_write_dword(tmp_src+4,scu_dst_0);
|
//if(DWUP(0)) memory_write_dword(space,tmp_src+4,scu_dst_0);
|
||||||
|
|
||||||
scu_index_0 = tmp_src+0xc;
|
scu_index_0 = tmp_src+0xc;
|
||||||
|
|
||||||
@ -1796,7 +1796,7 @@ static void dma_indirect_lv0(running_machine *machine)
|
|||||||
timer_set(ATTOTIME_IN_USEC(300), NULL, 0, dma_lv0_ended);
|
timer_set(ATTOTIME_IN_USEC(300), NULL, 0, dma_lv0_ended);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dma_indirect_lv1(running_machine *machine)
|
static void dma_indirect_lv1(const address_space *space)
|
||||||
{
|
{
|
||||||
/*Helper to get out of the cycle*/
|
/*Helper to get out of the cycle*/
|
||||||
UINT8 job_done = 0;
|
UINT8 job_done = 0;
|
||||||
@ -1812,9 +1812,9 @@ static void dma_indirect_lv1(running_machine *machine)
|
|||||||
do{
|
do{
|
||||||
tmp_src = scu_index_1;
|
tmp_src = scu_index_1;
|
||||||
|
|
||||||
scu_size_1 = program_read_dword(scu_index_1);
|
scu_size_1 = memory_read_dword(space,scu_index_1);
|
||||||
scu_src_1 = program_read_dword(scu_index_1+8);
|
scu_src_1 = memory_read_dword(space,scu_index_1+8);
|
||||||
scu_dst_1 = program_read_dword(scu_index_1+4);
|
scu_dst_1 = memory_read_dword(space,scu_index_1+4);
|
||||||
|
|
||||||
/*Indirect Mode end factor*/
|
/*Indirect Mode end factor*/
|
||||||
if(scu_src_1 & 0x80000000)
|
if(scu_src_1 & 0x80000000)
|
||||||
@ -1840,7 +1840,7 @@ static void dma_indirect_lv1(running_machine *machine)
|
|||||||
{
|
{
|
||||||
|
|
||||||
if(scu_dst_add_1 == 2)
|
if(scu_dst_add_1 == 2)
|
||||||
program_write_word(scu_dst_1,program_read_word(scu_src_1));
|
memory_write_word(space,scu_dst_1,memory_read_word(space,scu_src_1));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* some games, eg columns97 are a bit weird, I'm not sure this is correct
|
/* some games, eg columns97 are a bit weird, I'm not sure this is correct
|
||||||
@ -1848,15 +1848,15 @@ static void dma_indirect_lv1(running_machine *machine)
|
|||||||
can't access 2 byte boundaries, and the end of the sprite list never gets marked,
|
can't access 2 byte boundaries, and the end of the sprite list never gets marked,
|
||||||
the length of the transfer is also set to a 2 byte boundary, maybe the add values
|
the length of the transfer is also set to a 2 byte boundary, maybe the add values
|
||||||
should be different, I don't know */
|
should be different, I don't know */
|
||||||
program_write_word(scu_dst_1,program_read_word(scu_src_1));
|
memory_write_word(space,scu_dst_1,memory_read_word(space,scu_src_1));
|
||||||
program_write_word(scu_dst_1+2,program_read_word(scu_src_1+2));
|
memory_write_word(space,scu_dst_1+2,memory_read_word(space,scu_src_1+2));
|
||||||
}
|
}
|
||||||
scu_dst_1+=scu_dst_add_1;
|
scu_dst_1+=scu_dst_add_1;
|
||||||
scu_src_1+=scu_src_add_1;
|
scu_src_1+=scu_src_add_1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if(DRUP(1)) program_write_dword(tmp_src+8,scu_src_1|job_done ? 0x80000000 : 0);
|
//if(DRUP(1)) memory_write_dword(space,tmp_src+8,scu_src_1|job_done ? 0x80000000 : 0);
|
||||||
//if(DWUP(1)) program_write_dword(tmp_src+4,scu_dst_1);
|
//if(DWUP(1)) memory_write_dword(space,tmp_src+4,scu_dst_1);
|
||||||
|
|
||||||
scu_index_1 = tmp_src+0xc;
|
scu_index_1 = tmp_src+0xc;
|
||||||
|
|
||||||
@ -1865,7 +1865,7 @@ static void dma_indirect_lv1(running_machine *machine)
|
|||||||
timer_set(ATTOTIME_IN_USEC(300), NULL, 0, dma_lv1_ended);
|
timer_set(ATTOTIME_IN_USEC(300), NULL, 0, dma_lv1_ended);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dma_indirect_lv2(running_machine *machine)
|
static void dma_indirect_lv2(const address_space *space)
|
||||||
{
|
{
|
||||||
/*Helper to get out of the cycle*/
|
/*Helper to get out of the cycle*/
|
||||||
UINT8 job_done = 0;
|
UINT8 job_done = 0;
|
||||||
@ -1881,9 +1881,9 @@ static void dma_indirect_lv2(running_machine *machine)
|
|||||||
do{
|
do{
|
||||||
tmp_src = scu_index_2;
|
tmp_src = scu_index_2;
|
||||||
|
|
||||||
scu_size_2 = program_read_dword(scu_index_2);
|
scu_size_2 = memory_read_dword(space,scu_index_2);
|
||||||
scu_src_2 = program_read_dword(scu_index_2+8);
|
scu_src_2 = memory_read_dword(space,scu_index_2+8);
|
||||||
scu_dst_2 = program_read_dword(scu_index_2+4);
|
scu_dst_2 = memory_read_dword(space,scu_index_2+4);
|
||||||
|
|
||||||
/*Indirect Mode end factor*/
|
/*Indirect Mode end factor*/
|
||||||
if(scu_src_2 & 0x80000000)
|
if(scu_src_2 & 0x80000000)
|
||||||
@ -1907,7 +1907,7 @@ static void dma_indirect_lv2(running_machine *machine)
|
|||||||
for (; scu_size_2 > 0; scu_size_2-=scu_dst_add_2)
|
for (; scu_size_2 > 0; scu_size_2-=scu_dst_add_2)
|
||||||
{
|
{
|
||||||
if(scu_dst_add_2 == 2)
|
if(scu_dst_add_2 == 2)
|
||||||
program_write_word(scu_dst_2,program_read_word(scu_src_2));
|
memory_write_word(space,scu_dst_2,memory_read_word(space,scu_src_2));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* some games, eg columns97 are a bit weird, I'm not sure this is correct
|
/* some games, eg columns97 are a bit weird, I'm not sure this is correct
|
||||||
@ -1915,16 +1915,16 @@ static void dma_indirect_lv2(running_machine *machine)
|
|||||||
can't access 2 byte boundaries, and the end of the sprite list never gets marked,
|
can't access 2 byte boundaries, and the end of the sprite list never gets marked,
|
||||||
the length of the transfer is also set to a 2 byte boundary, maybe the add values
|
the length of the transfer is also set to a 2 byte boundary, maybe the add values
|
||||||
should be different, I don't know */
|
should be different, I don't know */
|
||||||
program_write_word(scu_dst_2,program_read_word(scu_src_2));
|
memory_write_word(space,scu_dst_2,memory_read_word(space,scu_src_2));
|
||||||
program_write_word(scu_dst_2+2,program_read_word(scu_src_2+2));
|
memory_write_word(space,scu_dst_2+2,memory_read_word(space,scu_src_2+2));
|
||||||
}
|
}
|
||||||
|
|
||||||
scu_dst_2+=scu_dst_add_2;
|
scu_dst_2+=scu_dst_add_2;
|
||||||
scu_src_2+=scu_src_add_2;
|
scu_src_2+=scu_src_add_2;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if(DRUP(2)) program_write_dword(tmp_src+8,scu_src_2|job_done ? 0x80000000 : 0);
|
//if(DRUP(2)) memory_write_dword(space,tmp_src+8,scu_src_2|job_done ? 0x80000000 : 0);
|
||||||
//if(DWUP(2)) program_write_dword(tmp_src+4,scu_dst_2);
|
//if(DWUP(2)) memory_write_dword(space,tmp_src+4,scu_dst_2);
|
||||||
|
|
||||||
scu_index_2 = tmp_src+0xc;
|
scu_index_2 = tmp_src+0xc;
|
||||||
|
|
||||||
|
@ -366,12 +366,13 @@ static WRITE8_HANDLER(at_page8_w)
|
|||||||
|
|
||||||
static DMA8237_MEM_READ( pc_dma_read_byte )
|
static DMA8237_MEM_READ( pc_dma_read_byte )
|
||||||
{
|
{
|
||||||
|
const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
||||||
UINT8 result;
|
UINT8 result;
|
||||||
offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
|
offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
|
||||||
& 0xFF0000;
|
& 0xFF0000;
|
||||||
|
|
||||||
cpu_push_context(device->machine->cpu[0]);
|
cpu_push_context(space->cpu);
|
||||||
result = program_read_byte(page_offset + offset);
|
result = memory_read_byte(space, page_offset + offset);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -380,11 +381,12 @@ static DMA8237_MEM_READ( pc_dma_read_byte )
|
|||||||
|
|
||||||
static DMA8237_MEM_WRITE( pc_dma_write_byte )
|
static DMA8237_MEM_WRITE( pc_dma_write_byte )
|
||||||
{
|
{
|
||||||
|
const address_space *space = cpu_get_address_space(device->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
||||||
offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
|
offs_t page_offset = (((offs_t) dma_offset[0][channel]) << 16)
|
||||||
& 0xFF0000;
|
& 0xFF0000;
|
||||||
|
|
||||||
cpu_push_context(device->machine->cpu[0]);
|
cpu_push_context(space->cpu);
|
||||||
program_write_byte(page_offset + offset, data);
|
memory_write_byte(space, page_offset + offset, data);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -163,7 +163,7 @@ static READ16_HANDLER( thunderj_atarivc_r )
|
|||||||
/* Use these lines to detect when things go south: */
|
/* Use these lines to detect when things go south: */
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (program_read_word(0x163482) > 0xfff)
|
if (memory_read_word(space, 0x163482) > 0xfff)
|
||||||
mame_printf_debug("You're screwed!");
|
mame_printf_debug("You're screwed!");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -350,8 +350,8 @@ static READ16_HANDLER( punkshot_kludge_r )
|
|||||||
/* protection simulation derived from a bootleg */
|
/* protection simulation derived from a bootleg */
|
||||||
static READ16_HANDLER( ssriders_protection_r )
|
static READ16_HANDLER( ssriders_protection_r )
|
||||||
{
|
{
|
||||||
int data = program_read_word(0x105a0a);
|
int data = memory_read_word(space, 0x105a0a);
|
||||||
int cmd = program_read_word(0x1058fc);
|
int cmd = memory_read_word(space, 0x1058fc);
|
||||||
|
|
||||||
switch (cmd)
|
switch (cmd)
|
||||||
{
|
{
|
||||||
@ -378,9 +378,9 @@ static READ16_HANDLER( ssriders_protection_r )
|
|||||||
|
|
||||||
case 0x8abc:
|
case 0x8abc:
|
||||||
/* collision table */
|
/* collision table */
|
||||||
data = -program_read_word(0x105818);
|
data = -memory_read_word(space, 0x105818);
|
||||||
data = ((data / 8 - 4) & 0x1f) * 0x40;
|
data = ((data / 8 - 4) & 0x1f) * 0x40;
|
||||||
data += ((program_read_word(0x105cb0) +
|
data += ((memory_read_word(space, 0x105cb0) +
|
||||||
256*K052109_r(space,0x1a01) + K052109_r(space,0x1a00) - 6) / 8 + 12) & 0x3f;
|
256*K052109_r(space,0x1a01) + K052109_r(space,0x1a00) - 6) / 8 + 12) & 0x3f;
|
||||||
return data;
|
return data;
|
||||||
|
|
||||||
@ -405,7 +405,7 @@ static WRITE16_HANDLER( ssriders_protection_w )
|
|||||||
|
|
||||||
for (i = 0;i < 128;i++)
|
for (i = 0;i < 128;i++)
|
||||||
{
|
{
|
||||||
if ((program_read_word(0x180006 + 128*i) >> 8) == logical_pri)
|
if ((memory_read_word(space, 0x180006 + 128*i) >> 8) == logical_pri)
|
||||||
{
|
{
|
||||||
K053245_word_w(space,8*i,hardware_pri,0x00ff);
|
K053245_word_w(space,8*i,hardware_pri,0x00ff);
|
||||||
hardware_pri++;
|
hardware_pri++;
|
||||||
@ -1012,9 +1012,9 @@ static WRITE16_HANDLER( tmnt2_1c0800_w )
|
|||||||
|
|
||||||
CellVar >>= 1;
|
CellVar >>= 1;
|
||||||
|
|
||||||
cpu_writemem24bew_word(dst+0x00, 0x8000 | ((src[1] & 0xfc00) >> 2)); /* size, flip xy */
|
memory_write_word(space,dst+0x00, 0x8000 | ((src[1] & 0xfc00) >> 2)); /* size, flip xy */
|
||||||
cpu_writemem24bew_word(dst+0x04, src[0]); /* code */
|
memory_write_word(space,dst+0x04, src[0]); /* code */
|
||||||
cpu_writemem24bew_word(dst+0x18, (src[1] & 0x3ff) ^ /* color, mirror, priority */
|
memory_write_word(space,dst+0x18, (src[1] & 0x3ff) ^ /* color, mirror, priority */
|
||||||
(sunset_104000[CellVar + 0x00] & 0x0060));
|
(sunset_104000[CellVar + 0x00] & 0x0060));
|
||||||
|
|
||||||
/* base color modifier */
|
/* base color modifier */
|
||||||
@ -1024,24 +1024,24 @@ static WRITE16_HANDLER( tmnt2_1c0800_w )
|
|||||||
/* Also, the bosses don't blink when they are about to die - don't know */
|
/* Also, the bosses don't blink when they are about to die - don't know */
|
||||||
/* if this is correct or not. */
|
/* if this is correct or not. */
|
||||||
// if (sunset_104000[CellVar + 0x15] & 0x001f)
|
// if (sunset_104000[CellVar + 0x15] & 0x001f)
|
||||||
// cpu_writemem24bew_word(dst+0x18,(program_read_word(dst+0x18) & 0xffe0) |
|
// memory_write_word(dst+0x18,(memory_read_word(space, dst+0x18) & 0xffe0) |
|
||||||
// (sunset_104000[CellVar + 0x15] & 0x001f));
|
// (sunset_104000[CellVar + 0x15] & 0x001f));
|
||||||
|
|
||||||
x = src[2];
|
x = src[2];
|
||||||
if (sunset_104000[CellVar + 0x00] & 0x4000)
|
if (sunset_104000[CellVar + 0x00] & 0x4000)
|
||||||
{
|
{
|
||||||
/* flip x */
|
/* flip x */
|
||||||
cpu_writemem24bew_word(dst+0x00,program_read_word(dst+0x00) ^ 0x1000);
|
memory_write_word(space,dst+0x00,memory_read_word(space, dst+0x00) ^ 0x1000);
|
||||||
x = -x;
|
x = -x;
|
||||||
}
|
}
|
||||||
x += sunset_104000[CellVar + 0x06];
|
x += sunset_104000[CellVar + 0x06];
|
||||||
cpu_writemem24bew_word(dst+0x0c,x);
|
memory_write_word(space,dst+0x0c,x);
|
||||||
y = src[3];
|
y = src[3];
|
||||||
y += sunset_104000[CellVar + 0x07];
|
y += sunset_104000[CellVar + 0x07];
|
||||||
/* don't do second offset for shadows */
|
/* don't do second offset for shadows */
|
||||||
if ((tmnt2_1c0800[0x08] & 0x00ff) != 0x01)
|
if ((tmnt2_1c0800[0x08] & 0x00ff) != 0x01)
|
||||||
y += sunset_104000[CellVar + 0x08];
|
y += sunset_104000[CellVar + 0x08];
|
||||||
cpu_writemem24bew_word(dst+0x08,y);
|
memory_write_word(space,dst+0x08,y);
|
||||||
#if 0
|
#if 0
|
||||||
logerror("copy command %04x sprite %08x data %08x: %04x%04x %04x%04x modifiers %08x:%04x%04x %04x%04x %04x%04x %04x%04x %04x%04x %04x%04x %04x%04x %04x%04x %04x%04x %04x%04x %04x%04x %04x%04x\n",
|
logerror("copy command %04x sprite %08x data %08x: %04x%04x %04x%04x modifiers %08x:%04x%04x %04x%04x %04x%04x %04x%04x %04x%04x %04x%04x %04x%04x %04x%04x %04x%04x %04x%04x %04x%04x %04x%04x\n",
|
||||||
tmnt2_1c0800[0x05],
|
tmnt2_1c0800[0x05],
|
||||||
|
@ -97,10 +97,11 @@ static INTERRUPT_GEN( z80_irq )
|
|||||||
|
|
||||||
static READ16_HANDLER( z80_shared_r )
|
static READ16_HANDLER( z80_shared_r )
|
||||||
{
|
{
|
||||||
|
const address_space *cpu2space = cpu_get_address_space(space->machine->cpu[2], ADDRESS_SPACE_PROGRAM);
|
||||||
UINT16 result = 0xffff;
|
UINT16 result = 0xffff;
|
||||||
|
|
||||||
cpu_push_context(space->machine->cpu[2]);
|
cpu_push_context(cpu2space->cpu);
|
||||||
result = program_read_byte(offset);
|
result = memory_read_byte(cpu2space, offset);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -108,8 +109,9 @@ static READ16_HANDLER( z80_shared_r )
|
|||||||
|
|
||||||
static WRITE16_HANDLER( z80_shared_w )
|
static WRITE16_HANDLER( z80_shared_w )
|
||||||
{
|
{
|
||||||
cpu_push_context(space->machine->cpu[2]);
|
const address_space *cpu2space = cpu_get_address_space(space->machine->cpu[2], ADDRESS_SPACE_PROGRAM);
|
||||||
program_write_byte(offset, data & 0xff);
|
cpu_push_context(cpu2space->cpu);
|
||||||
|
memory_write_byte(cpu2space, offset, data & 0xff);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -490,7 +490,7 @@ static WRITE16_HANDLER( blitter_w )
|
|||||||
for ( ; size > 0 ; size--)
|
for ( ; size > 0 ; size--)
|
||||||
{
|
{
|
||||||
/* maybe slower than a memcpy but safer (and errors are logged) */
|
/* maybe slower than a memcpy but safer (and errors are logged) */
|
||||||
program_write_word(dest,program_read_word(src));
|
memory_write_word(space, dest, memory_read_word(space, src));
|
||||||
src += 2;
|
src += 2;
|
||||||
dest += 2;
|
dest += 2;
|
||||||
}
|
}
|
||||||
@ -503,23 +503,23 @@ static WRITE16_HANDLER( blitter_w )
|
|||||||
int i, j, destptr;
|
int i, j, destptr;
|
||||||
|
|
||||||
/* Read offset of source from the list of blits */
|
/* Read offset of source from the list of blits */
|
||||||
i = src + program_read_word(list+2);
|
i = src + memory_read_word(space, list+2);
|
||||||
j = i + (size<<1);
|
j = i + (size<<1);
|
||||||
destptr = dest;
|
destptr = dest;
|
||||||
|
|
||||||
for (; i<j; destptr+=2, i+=2)
|
for (; i<j; destptr+=2, i+=2)
|
||||||
program_write_word(destptr, program_read_word(i));
|
memory_write_word(space, destptr, memory_read_word(space, i));
|
||||||
|
|
||||||
destptr = dest + 14;
|
destptr = dest + 14;
|
||||||
i = program_read_word(list) + spr_color_offs;
|
i = memory_read_word(space, list) + spr_color_offs;
|
||||||
program_write_word(destptr, i);
|
memory_write_word(space, destptr, i);
|
||||||
|
|
||||||
dest += 16;
|
dest += 16;
|
||||||
list += 4;
|
list += 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* hack for the blit to Sprites RAM - Sprite list end-marker */
|
/* hack for the blit to Sprites RAM - Sprite list end-marker */
|
||||||
program_write_word(dest,0xFFFF);
|
memory_write_word(space, dest, 0xFFFF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@ WRITE16_HANDLER( brival_protection_w );
|
|||||||
|
|
||||||
READ16_HANDLER( darkedge_protection_r );
|
READ16_HANDLER( darkedge_protection_r );
|
||||||
WRITE16_HANDLER( darkedge_protection_w );
|
WRITE16_HANDLER( darkedge_protection_w );
|
||||||
void darkedge_fd1149_vblank(void);
|
void darkedge_fd1149_vblank(const device_config *device);
|
||||||
WRITE16_HANDLER( jleague_protection_w );
|
WRITE16_HANDLER( jleague_protection_w );
|
||||||
|
|
||||||
READ16_HANDLER( dbzvrvs_protection_r );
|
READ16_HANDLER( dbzvrvs_protection_r );
|
||||||
|
@ -498,7 +498,7 @@ static void akiko_start_dma( void )
|
|||||||
timer_adjust_oneshot( akiko.dma_timer, ATTOTIME_IN_USEC( CD_SECTOR_TIME / akiko.cdrom_speed ), 0 );
|
timer_adjust_oneshot( akiko.dma_timer, ATTOTIME_IN_USEC( CD_SECTOR_TIME / akiko.cdrom_speed ), 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
static void akiko_setup_response( int len, UINT8 *r1 )
|
static void akiko_setup_response( const address_space *space, int len, UINT8 *r1 )
|
||||||
{
|
{
|
||||||
int resp_addr = akiko.cdrom_address[1];
|
int resp_addr = akiko.cdrom_address[1];
|
||||||
UINT8 resp_csum = 0xff;
|
UINT8 resp_csum = 0xff;
|
||||||
@ -517,7 +517,7 @@ static void akiko_setup_response( int len, UINT8 *r1 )
|
|||||||
|
|
||||||
for( i = 0; i < len; i++ )
|
for( i = 0; i < len; i++ )
|
||||||
{
|
{
|
||||||
program_write_byte( resp_addr + ((akiko.cdrom_cmd_resp + i) & 0xff), resp_buffer[i] );
|
memory_write_byte( space, resp_addr + ((akiko.cdrom_cmd_resp + i) & 0xff), resp_buffer[i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
akiko.cdrom_cmd_resp = (akiko.cdrom_cmd_resp+len) & 0xff;
|
akiko.cdrom_cmd_resp = (akiko.cdrom_cmd_resp+len) & 0xff;
|
||||||
@ -545,6 +545,7 @@ static TIMER_CALLBACK( akiko_cd_delayed_cmd )
|
|||||||
|
|
||||||
if ( param == 0x05 )
|
if ( param == 0x05 )
|
||||||
{
|
{
|
||||||
|
const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
||||||
if (LOG_AKIKO_CD) logerror( "AKIKO: Completing Command %d\n", param );
|
if (LOG_AKIKO_CD) logerror( "AKIKO: Completing Command %d\n", param );
|
||||||
|
|
||||||
resp[0] = 0x06;
|
resp[0] = 0x06;
|
||||||
@ -552,7 +553,7 @@ static TIMER_CALLBACK( akiko_cd_delayed_cmd )
|
|||||||
if ( akiko.cdrom == NULL || akiko.cdrom_numtracks == 0 )
|
if ( akiko.cdrom == NULL || akiko.cdrom_numtracks == 0 )
|
||||||
{
|
{
|
||||||
resp[1] = 0x80;
|
resp[1] = 0x80;
|
||||||
akiko_setup_response( 15, resp );
|
akiko_setup_response( space, 15, resp );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -561,12 +562,12 @@ static TIMER_CALLBACK( akiko_cd_delayed_cmd )
|
|||||||
|
|
||||||
akiko.cdrom_track_index = ( akiko.cdrom_track_index + 1 ) % akiko.cdrom_numtracks;
|
akiko.cdrom_track_index = ( akiko.cdrom_track_index + 1 ) % akiko.cdrom_numtracks;
|
||||||
|
|
||||||
akiko_setup_response( 15, resp );
|
akiko_setup_response( space, 15, resp );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void akiko_update_cdrom( void )
|
static void akiko_update_cdrom(const address_space *space)
|
||||||
{
|
{
|
||||||
UINT8 resp[32], cmdbuf[32];
|
UINT8 resp[32], cmdbuf[32];
|
||||||
|
|
||||||
@ -576,7 +577,7 @@ static void akiko_update_cdrom( void )
|
|||||||
while ( akiko.cdrom_cmd_start != akiko.cdrom_cmd_end )
|
while ( akiko.cdrom_cmd_start != akiko.cdrom_cmd_end )
|
||||||
{
|
{
|
||||||
UINT32 cmd_addr = akiko.cdrom_address[1] + 0x200 + akiko.cdrom_cmd_start;
|
UINT32 cmd_addr = akiko.cdrom_address[1] + 0x200 + akiko.cdrom_cmd_start;
|
||||||
int cmd = program_read_byte( cmd_addr );
|
int cmd = memory_read_byte( space, cmd_addr );
|
||||||
|
|
||||||
memset( resp, 0, sizeof( resp ) );
|
memset( resp, 0, sizeof( resp ) );
|
||||||
resp[0] = cmd;
|
resp[0] = cmd;
|
||||||
@ -596,7 +597,7 @@ static void akiko_update_cdrom( void )
|
|||||||
|
|
||||||
akiko.cdrom_cmd_start = (akiko.cdrom_cmd_start+2) & 0xff;
|
akiko.cdrom_cmd_start = (akiko.cdrom_cmd_start+2) & 0xff;
|
||||||
|
|
||||||
akiko_setup_response( 2, resp );
|
akiko_setup_response( space, 2, resp );
|
||||||
}
|
}
|
||||||
else if ( cmd == 0x03 ) /* unpause audio (and check audiocd playing status) */
|
else if ( cmd == 0x03 ) /* unpause audio (and check audiocd playing status) */
|
||||||
{
|
{
|
||||||
@ -609,7 +610,7 @@ static void akiko_update_cdrom( void )
|
|||||||
|
|
||||||
akiko.cdrom_cmd_start = (akiko.cdrom_cmd_start+2) & 0xff;
|
akiko.cdrom_cmd_start = (akiko.cdrom_cmd_start+2) & 0xff;
|
||||||
|
|
||||||
akiko_setup_response( 2, resp );
|
akiko_setup_response( space, 2, resp );
|
||||||
}
|
}
|
||||||
else if ( cmd == 0x04 ) /* seek/read/play cd multi command */
|
else if ( cmd == 0x04 ) /* seek/read/play cd multi command */
|
||||||
{
|
{
|
||||||
@ -618,7 +619,7 @@ static void akiko_update_cdrom( void )
|
|||||||
|
|
||||||
for( i = 0; i < 13; i++ )
|
for( i = 0; i < 13; i++ )
|
||||||
{
|
{
|
||||||
cmdbuf[i] = program_read_byte( cmd_addr );
|
cmdbuf[i] = memory_read_byte( space, cmd_addr );
|
||||||
cmd_addr &= 0xffffff00;
|
cmd_addr &= 0xffffff00;
|
||||||
cmd_addr += ( akiko.cdrom_cmd_start + i + 1 ) & 0xff;
|
cmd_addr += ( akiko.cdrom_cmd_start + i + 1 ) & 0xff;
|
||||||
}
|
}
|
||||||
@ -628,7 +629,7 @@ static void akiko_update_cdrom( void )
|
|||||||
if ( akiko.cdrom == NULL || akiko.cdrom_numtracks == 0 )
|
if ( akiko.cdrom == NULL || akiko.cdrom_numtracks == 0 )
|
||||||
{
|
{
|
||||||
resp[1] = 0x80;
|
resp[1] = 0x80;
|
||||||
akiko_setup_response( 2, resp );
|
akiko_setup_response( space, 2, resp );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -671,7 +672,7 @@ static void akiko_update_cdrom( void )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
akiko_setup_response( 2, resp );
|
akiko_setup_response( space, 2, resp );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( cmd == 0x05 ) /* read toc */
|
else if ( cmd == 0x05 ) /* read toc */
|
||||||
@ -724,7 +725,7 @@ static void akiko_update_cdrom( void )
|
|||||||
resp[1] = 0x80;
|
resp[1] = 0x80;
|
||||||
}
|
}
|
||||||
|
|
||||||
akiko_setup_response( 15, resp );
|
akiko_setup_response( space, 15, resp );
|
||||||
}
|
}
|
||||||
else if ( cmd == 0x07 ) /* check door status */
|
else if ( cmd == 0x07 ) /* check door status */
|
||||||
{
|
{
|
||||||
@ -735,7 +736,7 @@ static void akiko_update_cdrom( void )
|
|||||||
if ( akiko.cdrom == NULL || akiko.cdrom_numtracks == 0 )
|
if ( akiko.cdrom == NULL || akiko.cdrom_numtracks == 0 )
|
||||||
resp[1] = 0x80;
|
resp[1] = 0x80;
|
||||||
|
|
||||||
akiko_setup_response( 20, resp );
|
akiko_setup_response( space, 20, resp );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -773,7 +774,7 @@ READ32_HANDLER(amiga_akiko32_r)
|
|||||||
return akiko.cdrom_address[1];
|
return akiko.cdrom_address[1];
|
||||||
|
|
||||||
case 0x18/4: /* CDROM COMMAND 1 */
|
case 0x18/4: /* CDROM COMMAND 1 */
|
||||||
akiko_update_cdrom();
|
akiko_update_cdrom(space);
|
||||||
retval = akiko.cdrom_cmd_start;
|
retval = akiko.cdrom_cmd_start;
|
||||||
retval <<= 8;
|
retval <<= 8;
|
||||||
retval |= akiko.cdrom_cmd_resp;
|
retval |= akiko.cdrom_cmd_resp;
|
||||||
@ -781,7 +782,7 @@ READ32_HANDLER(amiga_akiko32_r)
|
|||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
case 0x1C/4: /* CDROM COMMAND 2 */
|
case 0x1C/4: /* CDROM COMMAND 2 */
|
||||||
akiko_update_cdrom();
|
akiko_update_cdrom(space);
|
||||||
retval = akiko.cdrom_cmd_end;
|
retval = akiko.cdrom_cmd_end;
|
||||||
retval <<= 16;
|
retval <<= 16;
|
||||||
return retval;
|
return retval;
|
||||||
@ -840,14 +841,14 @@ WRITE32_HANDLER(amiga_akiko32_w)
|
|||||||
if ( ACCESSING_BITS_8_15 )
|
if ( ACCESSING_BITS_8_15 )
|
||||||
akiko.cdrom_cmd_resp = ( data >> 8 ) & 0xff;
|
akiko.cdrom_cmd_resp = ( data >> 8 ) & 0xff;
|
||||||
|
|
||||||
akiko_update_cdrom();
|
akiko_update_cdrom(space);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x1C/4: /* CDROM COMMAND 2 */
|
case 0x1C/4: /* CDROM COMMAND 2 */
|
||||||
if ( ACCESSING_BITS_16_23 )
|
if ( ACCESSING_BITS_16_23 )
|
||||||
akiko.cdrom_cmd_end = ( data >> 16 ) & 0xff;
|
akiko.cdrom_cmd_end = ( data >> 16 ) & 0xff;
|
||||||
|
|
||||||
akiko_update_cdrom();
|
akiko_update_cdrom(space);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x20/4: /* CDROM DMA SECTOR READ REQUEST WRITE */
|
case 0x20/4: /* CDROM DMA SECTOR READ REQUEST WRITE */
|
||||||
|
@ -1864,7 +1864,7 @@ WRITE16_HANDLER( K055550_word_w )
|
|||||||
|
|
||||||
lim = adr+bsize*count;
|
lim = adr+bsize*count;
|
||||||
for(i=adr; i<lim; i+=2)
|
for(i=adr; i<lim; i+=2)
|
||||||
program_write_word(i, prot_data[0x1a/2]);
|
memory_write_word(space, i, prot_data[0x1a/2]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// WARNING: The following cases are speculation based with questionable accuracy!(AAT)
|
// WARNING: The following cases are speculation based with questionable accuracy!(AAT)
|
||||||
@ -1895,41 +1895,41 @@ WRITE16_HANDLER( K055550_word_w )
|
|||||||
// let's hope GCC will inline the mem24bew calls
|
// let's hope GCC will inline the mem24bew calls
|
||||||
for (src=adr; src<srcend; src+=bsize)
|
for (src=adr; src<srcend; src+=bsize)
|
||||||
{
|
{
|
||||||
cx1 = (short)program_read_word(src);
|
cx1 = (short)memory_read_word(space, src);
|
||||||
sx1 = (short)program_read_word(src + 2);
|
sx1 = (short)memory_read_word(space, src + 2);
|
||||||
wx1 = (short)program_read_word(src + 4);
|
wx1 = (short)memory_read_word(space, src + 4);
|
||||||
|
|
||||||
cy1 = (short)program_read_word(src + 6);
|
cy1 = (short)memory_read_word(space, src + 6);
|
||||||
sy1 = (short)program_read_word(src + 8);
|
sy1 = (short)memory_read_word(space, src + 8);
|
||||||
wy1 = (short)program_read_word(src +10);
|
wy1 = (short)memory_read_word(space, src +10);
|
||||||
|
|
||||||
cz1 = (short)program_read_word(src +12);
|
cz1 = (short)memory_read_word(space, src +12);
|
||||||
sz1 = (short)program_read_word(src +14);
|
sz1 = (short)memory_read_word(space, src +14);
|
||||||
wz1 = (short)program_read_word(src +16);
|
wz1 = (short)memory_read_word(space, src +16);
|
||||||
|
|
||||||
count = i = src + skip;
|
count = i = src + skip;
|
||||||
tgt = src + bsize;
|
tgt = src + bsize;
|
||||||
|
|
||||||
for (; count<tgt; count++) program_write_byte(count, 0);
|
for (; count<tgt; count++) memory_write_byte(space, count, 0);
|
||||||
|
|
||||||
for (; tgt<tgtend; i++, tgt+=bsize)
|
for (; tgt<tgtend; i++, tgt+=bsize)
|
||||||
{
|
{
|
||||||
c2 = (short)program_read_word(tgt);
|
c2 = (short)memory_read_word(space, tgt);
|
||||||
s2 = (short)program_read_word(tgt + 2);
|
s2 = (short)memory_read_word(space, tgt + 2);
|
||||||
w2 = (short)program_read_word(tgt + 4);
|
w2 = (short)memory_read_word(space, tgt + 4);
|
||||||
if (abs((cx1+sx1)-(c2+s2))>=wx1+w2) continue; // X rejection
|
if (abs((cx1+sx1)-(c2+s2))>=wx1+w2) continue; // X rejection
|
||||||
|
|
||||||
c2 = (short)program_read_word(tgt + 6);
|
c2 = (short)memory_read_word(space, tgt + 6);
|
||||||
s2 = (short)program_read_word(tgt + 8);
|
s2 = (short)memory_read_word(space, tgt + 8);
|
||||||
w2 = (short)program_read_word(tgt +10);
|
w2 = (short)memory_read_word(space, tgt +10);
|
||||||
if (abs((cy1+sy1)-(c2+s2))>=wy1+w2) continue; // Y rejection
|
if (abs((cy1+sy1)-(c2+s2))>=wy1+w2) continue; // Y rejection
|
||||||
|
|
||||||
c2 = (short)program_read_word(tgt +12);
|
c2 = (short)memory_read_word(space, tgt +12);
|
||||||
s2 = (short)program_read_word(tgt +14);
|
s2 = (short)memory_read_word(space, tgt +14);
|
||||||
w2 = (short)program_read_word(tgt +16);
|
w2 = (short)memory_read_word(space, tgt +16);
|
||||||
if (abs((cz1+sz1)-(c2+s2))>=wz1+w2) continue; // Z rejection
|
if (abs((cz1+sz1)-(c2+s2))>=wz1+w2) continue; // Z rejection
|
||||||
|
|
||||||
program_write_byte(i, 0x80); // collision confirmed
|
memory_write_byte(space, i, 0x80); // collision confirmed
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -2003,13 +2003,13 @@ WRITE16_HANDLER( K053990_martchmp_word_w )
|
|||||||
if (element_size == 1)
|
if (element_size == 1)
|
||||||
for (i=src_count; i; i--)
|
for (i=src_count; i; i--)
|
||||||
{
|
{
|
||||||
program_write_byte(dst_addr, program_read_byte(src_addr));
|
memory_write_byte(space, dst_addr, memory_read_byte(space, src_addr));
|
||||||
src_addr += src_skip;
|
src_addr += src_skip;
|
||||||
dst_addr += dst_skip;
|
dst_addr += dst_skip;
|
||||||
}
|
}
|
||||||
else for (i=src_count; i; i--)
|
else for (i=src_count; i; i--)
|
||||||
{
|
{
|
||||||
program_write_word(dst_addr, program_read_word(src_addr));
|
memory_write_word(space, dst_addr, memory_read_word(space, src_addr));
|
||||||
src_addr += src_skip;
|
src_addr += src_skip;
|
||||||
dst_addr += dst_skip;
|
dst_addr += dst_skip;
|
||||||
}
|
}
|
||||||
@ -2034,15 +2034,15 @@ WRITE16_HANDLER( K053990_martchmp_word_w )
|
|||||||
|
|
||||||
for (i=mod_count; i; i--)
|
for (i=mod_count; i; i--)
|
||||||
{
|
{
|
||||||
mod_val = program_read_word(mod_addr);
|
mod_val = memory_read_word(space, mod_addr);
|
||||||
mod_addr += mod_skip;
|
mod_addr += mod_skip;
|
||||||
|
|
||||||
mod_data = program_read_word(src_addr);
|
mod_data = memory_read_word(space, src_addr);
|
||||||
src_addr += src_skip;
|
src_addr += src_skip;
|
||||||
|
|
||||||
mod_data += mod_val;
|
mod_data += mod_val;
|
||||||
|
|
||||||
program_write_word(dst_addr, mod_data);
|
memory_write_word(space, dst_addr, mod_data);
|
||||||
dst_addr += dst_skip;
|
dst_addr += dst_skip;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -96,7 +96,7 @@ WRITE16_HANDLER( midyunit_cmos_enable_w )
|
|||||||
{
|
{
|
||||||
if (data == 0x500)
|
if (data == 0x500)
|
||||||
{
|
{
|
||||||
prot_result = program_read_word(TOBYTE(0x10a4390)) << 4;
|
prot_result = memory_read_word(space, TOBYTE(0x10a4390)) << 4;
|
||||||
logerror(" desired result = %04X\n", prot_result);
|
logerror(" desired result = %04X\n", prot_result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -978,8 +978,8 @@ WRITE32_HANDLER( n64_pi_reg_w )
|
|||||||
{
|
{
|
||||||
for (i=0; i < dma_length; i++)
|
for (i=0; i < dma_length; i++)
|
||||||
{
|
{
|
||||||
UINT8 b = program_read_byte_32be(pi_dram_addr);
|
UINT8 b = memory_read_byte(space, pi_dram_addr);
|
||||||
program_write_byte_32be(pi_cart_addr, b);
|
memory_write_byte(space, pi_cart_addr, b);
|
||||||
pi_cart_addr += 1;
|
pi_cart_addr += 1;
|
||||||
pi_dram_addr += 1;
|
pi_dram_addr += 1;
|
||||||
}
|
}
|
||||||
@ -1005,13 +1005,13 @@ WRITE32_HANDLER( n64_pi_reg_w )
|
|||||||
{
|
{
|
||||||
for (i=0; i < dma_length; i++)
|
for (i=0; i < dma_length; i++)
|
||||||
{
|
{
|
||||||
/*UINT32 d = program_read_dword_32be(pi_cart_addr);
|
/*UINT32 d = memory_read_dword(space, pi_cart_addr);
|
||||||
program_write_dword_32be(pi_dram_addr, d);
|
memory_write_dword(space, pi_dram_addr, d);
|
||||||
pi_cart_addr += 4;
|
pi_cart_addr += 4;
|
||||||
pi_dram_addr += 4;*/
|
pi_dram_addr += 4;*/
|
||||||
|
|
||||||
UINT8 b = program_read_byte_32be(pi_cart_addr);
|
UINT8 b = memory_read_byte(space, pi_cart_addr);
|
||||||
program_write_byte_32be(pi_dram_addr, b);
|
memory_write_byte(space, pi_dram_addr, b);
|
||||||
pi_cart_addr += 1;
|
pi_cart_addr += 1;
|
||||||
pi_dram_addr += 1;
|
pi_dram_addr += 1;
|
||||||
}
|
}
|
||||||
@ -1021,8 +1021,8 @@ WRITE32_HANDLER( n64_pi_reg_w )
|
|||||||
if (pi_first_dma)
|
if (pi_first_dma)
|
||||||
{
|
{
|
||||||
// TODO: CIC-6105 has different address...
|
// TODO: CIC-6105 has different address...
|
||||||
program_write_dword_32be(0x00000318, 0x400000);
|
memory_write_dword(space, 0x00000318, 0x400000);
|
||||||
program_write_dword_32be(0x000003f0, 0x800000);
|
memory_write_dword(space, 0x000003f0, 0x800000);
|
||||||
pi_first_dma = 0;
|
pi_first_dma = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,6 +106,7 @@ static TIMER_CALLBACK( pitnrun_mcu_status_real_w )
|
|||||||
|
|
||||||
WRITE8_HANDLER( pitnrun_68705_portB_w )
|
WRITE8_HANDLER( pitnrun_68705_portB_w )
|
||||||
{
|
{
|
||||||
|
const address_space *cpu0space = cpu_get_address_space(space->machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
||||||
if (~data & 0x02)
|
if (~data & 0x02)
|
||||||
{
|
{
|
||||||
/* 68705 is going to read data from the Z80 */
|
/* 68705 is going to read data from the Z80 */
|
||||||
@ -120,14 +121,14 @@ WRITE8_HANDLER( pitnrun_68705_portB_w )
|
|||||||
}
|
}
|
||||||
if (~data & 0x10)
|
if (~data & 0x10)
|
||||||
{
|
{
|
||||||
cpu_push_context(space->machine->cpu[0]);
|
cpu_push_context(cpu0space->cpu);
|
||||||
program_write_byte(address, portA_out);
|
memory_write_byte(cpu0space, address, portA_out);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
}
|
}
|
||||||
if (~data & 0x20)
|
if (~data & 0x20)
|
||||||
{
|
{
|
||||||
cpu_push_context(space->machine->cpu[0]);
|
cpu_push_context(cpu0space->cpu);
|
||||||
portA_in = program_read_byte(address);
|
portA_in = memory_read_byte(cpu0space, address);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
}
|
}
|
||||||
if (~data & 0x40)
|
if (~data & 0x40)
|
||||||
|
@ -166,12 +166,12 @@ static WRITE8_HANDLER( cavelon_banksw_w )
|
|||||||
|
|
||||||
READ8_HANDLER( hunchbks_mirror_r )
|
READ8_HANDLER( hunchbks_mirror_r )
|
||||||
{
|
{
|
||||||
return program_read_byte(0x1000+offset);
|
return memory_read_byte(space, 0x1000+offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
WRITE8_HANDLER( hunchbks_mirror_w )
|
WRITE8_HANDLER( hunchbks_mirror_w )
|
||||||
{
|
{
|
||||||
program_write_byte(0x1000+offset,data);
|
memory_write_byte(space, 0x1000+offset,data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static WRITE8_DEVICE_HANDLER( sound_latch_w )
|
static WRITE8_DEVICE_HANDLER( sound_latch_w )
|
||||||
|
@ -313,12 +313,12 @@ static UINT32 dsp_get_mem_source_dma( UINT32 memcode, UINT32 counter )
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void dsp_prg_ctrl(running_machine *machine, UINT32 data)
|
void dsp_prg_ctrl(const address_space *space, UINT32 data)
|
||||||
{
|
{
|
||||||
if(LEF) dsp_reg.pc = (data & 0xff);
|
if(LEF) dsp_reg.pc = (data & 0xff);
|
||||||
if(EXF) dsp_execute_program();
|
if(EXF) dsp_execute_program(space);
|
||||||
if(EF && (!(stv_scu[40] & 0x0020)))
|
if(EF && (!(stv_scu[40] & 0x0020)))
|
||||||
cpu_set_input_line_and_vector(machine->cpu[0], 0xa, HOLD_LINE , 0x45);
|
cpu_set_input_line_and_vector(space->machine->cpu[0], 0xa, HOLD_LINE , 0x45);
|
||||||
}
|
}
|
||||||
|
|
||||||
void dsp_prg_data(UINT32 data)
|
void dsp_prg_data(UINT32 data)
|
||||||
@ -591,7 +591,7 @@ static void dsp_move_immediate( void )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void dsp_dma( void )
|
static void dsp_dma( const address_space *space )
|
||||||
{
|
{
|
||||||
UINT8 hold = (opcode & 0x4000) >> 14;
|
UINT8 hold = (opcode & 0x4000) >> 14;
|
||||||
UINT32 add = (opcode & 0x38000) >> 15;
|
UINT32 add = (opcode & 0x38000) >> 15;
|
||||||
@ -650,7 +650,7 @@ static void dsp_dma( void )
|
|||||||
|
|
||||||
if ( source >= 0x06000000 && source <= 0x060fffff )
|
if ( source >= 0x06000000 && source <= 0x060fffff )
|
||||||
{
|
{
|
||||||
data = program_read_dword(source );
|
data = memory_read_dword(space, source );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -688,7 +688,7 @@ static void dsp_dma( void )
|
|||||||
#endif
|
#endif
|
||||||
for ( counter = 0; counter < transfer_cnt; counter++ )
|
for ( counter = 0; counter < transfer_cnt; counter++ )
|
||||||
{
|
{
|
||||||
program_write_dword(dest, dsp_get_mem_source_dma( dsp_mem, counter ) );
|
memory_write_dword(space, dest, dsp_get_mem_source_dma( dsp_mem, counter ) );
|
||||||
dest += add;
|
dest += add;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -787,7 +787,7 @@ static void dsp_dump_mem( FILE *f )
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void dsp_execute_program()
|
void dsp_execute_program(const address_space *dmaspace)
|
||||||
{
|
{
|
||||||
UINT32 cycles_run = 0;
|
UINT32 cycles_run = 0;
|
||||||
UINT8 cont = 1;
|
UINT8 cont = 1;
|
||||||
@ -837,7 +837,7 @@ void dsp_execute_program()
|
|||||||
switch( (opcode & 0x30000000) >> 28 )
|
switch( (opcode & 0x30000000) >> 28 )
|
||||||
{
|
{
|
||||||
case 0x00:
|
case 0x00:
|
||||||
dsp_dma();
|
dsp_dma(dmaspace);
|
||||||
break;
|
break;
|
||||||
case 0x01:
|
case 0x01:
|
||||||
dsp_jump();
|
dsp_jump();
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
/*SCU DSP stuff*/
|
/*SCU DSP stuff*/
|
||||||
|
|
||||||
extern void dsp_prg_ctrl(running_machine *machine, UINT32 data);
|
extern void dsp_prg_ctrl(const address_space *space, UINT32 data);
|
||||||
extern void dsp_prg_data(UINT32 data);
|
extern void dsp_prg_data(UINT32 data);
|
||||||
extern void dsp_ram_addr_ctrl(UINT32 data);
|
extern void dsp_ram_addr_ctrl(UINT32 data);
|
||||||
extern void dsp_ram_addr_w(UINT32 data);
|
extern void dsp_ram_addr_w(UINT32 data);
|
||||||
extern UINT32 dsp_ram_addr_r(void);
|
extern UINT32 dsp_ram_addr_r(void);
|
||||||
extern void dsp_execute_program(void);
|
extern void dsp_execute_program(const address_space *dmaspace);
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ READ16_HANDLER( segaic16_open_bus_r )
|
|||||||
|
|
||||||
/* read original encrypted memory at that address */
|
/* read original encrypted memory at that address */
|
||||||
recurse = 1;
|
recurse = 1;
|
||||||
result = program_read_word_16be(cpu_get_pc(space->cpu));
|
result = memory_read_word_16be(space, cpu_get_pc(space->cpu));
|
||||||
recurse = 0;
|
recurse = 0;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -238,17 +238,19 @@ static void memory_mapper_w(const address_space *space, struct memory_mapper_chi
|
|||||||
/* 02 - read data into latches 00,01 from 2 * (address in 07,08,09) */
|
/* 02 - read data into latches 00,01 from 2 * (address in 07,08,09) */
|
||||||
if (data == 0x01)
|
if (data == 0x01)
|
||||||
{
|
{
|
||||||
|
const address_space *targetspace = cpu_get_address_space(chip->cpu, ADDRESS_SPACE_PROGRAM);
|
||||||
offs_t addr = (chip->regs[0x0a] << 17) | (chip->regs[0x0b] << 9) | (chip->regs[0x0c] << 1);
|
offs_t addr = (chip->regs[0x0a] << 17) | (chip->regs[0x0b] << 9) | (chip->regs[0x0c] << 1);
|
||||||
cpu_push_context(chip->cpu);
|
cpu_push_context(targetspace->cpu);
|
||||||
program_write_word_16be(addr, (chip->regs[0x00] << 8) | chip->regs[0x01]);
|
memory_write_word(targetspace, addr, (chip->regs[0x00] << 8) | chip->regs[0x01]);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
}
|
}
|
||||||
else if (data == 0x02)
|
else if (data == 0x02)
|
||||||
{
|
{
|
||||||
|
const address_space *targetspace = cpu_get_address_space(chip->cpu, ADDRESS_SPACE_PROGRAM);
|
||||||
offs_t addr = (chip->regs[0x07] << 17) | (chip->regs[0x08] << 9) | (chip->regs[0x09] << 1);
|
offs_t addr = (chip->regs[0x07] << 17) | (chip->regs[0x08] << 9) | (chip->regs[0x09] << 1);
|
||||||
UINT16 result;
|
UINT16 result;
|
||||||
cpu_push_context(chip->cpu);
|
cpu_push_context(targetspace->cpu);
|
||||||
result = program_read_word_16be(addr);
|
result = memory_read_word(targetspace, addr);
|
||||||
cpu_pop_context();
|
cpu_pop_context();
|
||||||
chip->regs[0x00] = result >> 8;
|
chip->regs[0x00] = result >> 8;
|
||||||
chip->regs[0x01] = result;
|
chip->regs[0x01] = result;
|
||||||
|
@ -228,17 +228,19 @@ WRITE16_HANDLER(brival_protection_w)
|
|||||||
******************************************************************************
|
******************************************************************************
|
||||||
******************************************************************************/
|
******************************************************************************/
|
||||||
|
|
||||||
void darkedge_fd1149_vblank(void)
|
void darkedge_fd1149_vblank(const device_config *device)
|
||||||
{
|
{
|
||||||
program_write_word(0x20f072, 0);
|
const address_space *space = cpu_get_address_space(device, ADDRESS_SPACE_PROGRAM);
|
||||||
program_write_word(0x20f082, 0);
|
|
||||||
|
memory_write_word(space, 0x20f072, 0);
|
||||||
|
memory_write_word(space, 0x20f082, 0);
|
||||||
|
|
||||||
if( program_read_byte(0x20a12c) != 0 )
|
if( memory_read_byte(space, 0x20a12c) != 0 )
|
||||||
{
|
{
|
||||||
program_write_byte(0x20a12c, program_read_byte(0x20a12c)-1 );
|
memory_write_byte(space, 0x20a12c, memory_read_byte(space, 0x20a12c)-1 );
|
||||||
|
|
||||||
if( program_read_byte(0x20a12c) == 0 )
|
if( memory_read_byte(space, 0x20a12c) == 0 )
|
||||||
program_write_byte(0x20a12e, 1);
|
memory_write_byte(space, 0x20a12e, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -267,7 +269,7 @@ READ16_HANDLER( darkedge_protection_r )
|
|||||||
|
|
||||||
WRITE16_HANDLER( dbzvrvs_protection_w )
|
WRITE16_HANDLER( dbzvrvs_protection_w )
|
||||||
{
|
{
|
||||||
program_write_word( 0x2080c8, program_read_word( 0x200044 ) );
|
memory_write_word( space, 0x2080c8, memory_read_word( space, 0x200044 ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -331,12 +333,12 @@ WRITE16_HANDLER( jleague_protection_w )
|
|||||||
// Map team browser selection to opponent browser selection
|
// Map team browser selection to opponent browser selection
|
||||||
// using same lookup table that V60 uses for sound sample mapping.
|
// using same lookup table that V60 uses for sound sample mapping.
|
||||||
case 0:
|
case 0:
|
||||||
program_write_byte( 0x20f708, program_read_word( 0x7bbc0 + data*2 ) );
|
memory_write_byte( space, 0x20f708, memory_read_word( space, 0x7bbc0 + data*2 ) );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// move on to team browser
|
// move on to team browser
|
||||||
case 4/2:
|
case 4/2:
|
||||||
program_write_byte( 0x200016, data & 0xff );
|
memory_write_byte( space, 0x200016, data & 0xff );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
Loading…
Reference in New Issue
Block a user