src/mess/machine/3do.c
| r3705 | r3706 | |
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | READ32_HANDLER( nvarea_r ) { |
| 20 | | logerror( "%08X: NVRAM read offset = %08X\n", cpu_get_pc(space->machine->activecpu), offset ); |
| 20 | logerror( "%08X: NVRAM read offset = %08X\n", cpu_get_pc(space->machine->cpu[0]), offset ); |
| 21 | 21 | return 0; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | WRITE32_HANDLER( nvarea_w ) { |
| 25 | | logerror( "%08X: NVRAM write offset = %08X, data = %08X, mask = %08X\n", cpu_get_pc(space->machine->activecpu), offset, data, mem_mask ); |
| 25 | logerror( "%08X: NVRAM write offset = %08X, data = %08X, mask = %08X\n", cpu_get_pc(space->machine->cpu[0]), offset, data, mem_mask ); |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | |
| r3705 | r3706 | |
| 69 | 69 | several groups of 16 write actions or 16 read actions |
| 70 | 70 | */ |
| 71 | 71 | READ32_HANDLER( unk_318_r ) { |
| 72 | | logerror( "%08X: UNK_318 read offset = %08X\n", cpu_get_pc(space->machine->activecpu), offset ); |
| 72 | logerror( "%08X: UNK_318 read offset = %08X\n", cpu_get_pc(space->machine->cpu[0]), offset ); |
| 73 | 73 | #if 0 |
| 74 | 74 | switch( offset ) { |
| 75 | 75 | case 0: /* Boot ROM checks here and expects to read 1, 0, 1, 0 in the lowest bit */ |
| r3705 | r3706 | |
| 82 | 82 | |
| 83 | 83 | WRITE32_HANDLER( unk_318_w ) |
| 84 | 84 | { |
| 85 | | logerror( "%08X: UNK_318 write offset = %08X, data = %08X, mask = %08X\n", cpu_get_pc(space->machine->activecpu), offset, data, mem_mask ); |
| 85 | logerror( "%08X: UNK_318 write offset = %08X, data = %08X, mask = %08X\n", cpu_get_pc(space->machine->cpu[0]), offset, data, mem_mask ); |
| 86 | 86 | |
| 87 | 87 | switch( offset ) |
| 88 | 88 | { |
| r3705 | r3706 | |
| 98 | 98 | |
| 99 | 99 | |
| 100 | 100 | READ32_HANDLER( vram_sport_r ) { |
| 101 | | logerror( "%08X: VRAM SPORT read offset = %08X\n", cpu_get_pc(space->machine->activecpu), offset ); |
| 101 | logerror( "%08X: VRAM SPORT read offset = %08X\n", cpu_get_pc(space->machine->cpu[0]), offset ); |
| 102 | 102 | switch( offset ) { |
| 103 | 103 | case 0x1840: /* 03206100 - ?? */ |
| 104 | 104 | break; |
| r3705 | r3706 | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | WRITE32_HANDLER( vram_sport_w ) { |
| 112 | | logerror( "%08X: VRAM SPORT write offset = %08X, data = %08X, mask = %08X\n", cpu_get_pc(space->machine->activecpu), offset, data, mem_mask ); |
| 112 | logerror( "%08X: VRAM SPORT write offset = %08X, data = %08X, mask = %08X\n", cpu_get_pc(space->machine->cpu[0]), offset, data, mem_mask ); |
| 113 | 113 | switch( offset ) { |
| 114 | 114 | case 0x0800: /* 03202000 - ?? during boot 00190019 gets written */ |
| 115 | 115 | break; |
| r3705 | r3706 | |
| 121 | 121 | |
| 122 | 122 | |
| 123 | 123 | READ32_HANDLER( madam_r ) { |
| 124 | | logerror( "%08X: MADAM read offset = %08X\n", cpu_get_pc(space->machine->activecpu), offset ); |
| 124 | logerror( "%08X: MADAM read offset = %08X\n", cpu_get_pc(space->machine->cpu[0]), offset ); |
| 125 | 125 | switch( offset ) { |
| 126 | 126 | case 0: /* 03300000 - Revision */ |
| 127 | 127 | return madam.revision; |
| r3705 | r3706 | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | WRITE32_HANDLER( madam_w ) { |
| 135 | | logerror( "%08X: MADAM write offset = %08X, data = %08X, mask = %08X\n", cpu_get_pc(space->machine->activecpu), offset, data, mem_mask ); |
| 135 | logerror( "%08X: MADAM write offset = %08X, data = %08X, mask = %08X\n", cpu_get_pc(space->machine->cpu[0]), offset, data, mem_mask ); |
| 136 | 136 | switch( offset ) { |
| 137 | 137 | case 0x01: /* 03300004 - Memory configuration 29 = 2MB DRAM, 1MB VRAM */ |
| 138 | 138 | madam.memory_configuration = data; |
| r3705 | r3706 | |
| 153 | 153 | |
| 154 | 154 | READ32_HANDLER( clio_r ) |
| 155 | 155 | { |
| 156 | | logerror( "%08X: CLIO read offset = %08X\n", cpu_get_pc(space->machine->activecpu), offset ); |
| 156 | logerror( "%08X: CLIO read offset = %08X\n", cpu_get_pc(space->machine->cpu[0]), offset ); |
| 157 | 157 | |
| 158 | 158 | switch( offset ) |
| 159 | 159 | { |
| r3705 | r3706 | |
| 172 | 172 | |
| 173 | 173 | WRITE32_HANDLER( clio_w ) |
| 174 | 174 | { |
| 175 | | logerror( "%08X: CLIO write offset = %08X, data = %08X, mask = %08X\n", cpu_get_pc(space->machine->activecpu), offset, data, mem_mask ); |
| 175 | logerror( "%08X: CLIO write offset = %08X, data = %08X, mask = %08X\n", cpu_get_pc(space->machine->cpu[0]), offset, data, mem_mask ); |
| 176 | 176 | |
| 177 | 177 | switch( offset ) |
| 178 | 178 | { |
src/mess/machine/ins8154.c
| r3705 | r3706 | |
| 88 | 88 | if (offset > 0x24) |
| 89 | 89 | { |
| 90 | 90 | logerror("INS8154 (%08x): Read from unknown offset %02x!\n", |
| 91 | | safe_cpu_get_pc( device->machine->activecpu ), offset); |
| 91 | safe_cpu_get_pc( device->machine->cpu[0] ), offset); |
| 92 | 92 | return 0xff; |
| 93 | 93 | } |
| 94 | 94 | |
| r3705 | r3706 | |
| 138 | 138 | i->intf->out_a_func(device, 0, (data & i->odra) | (i->odra ^ 0xff)); |
| 139 | 139 | else |
| 140 | 140 | logerror("INS8154 (%08x): Write to port A but no write handler defined!\n", |
| 141 | | safe_cpu_get_pc( device->machine->activecpu ) ); |
| 141 | safe_cpu_get_pc( device->machine->cpu[0] ) ); |
| 142 | 142 | } |
| 143 | 143 | } |
| 144 | 144 | |
| r3705 | r3706 | |
| 156 | 156 | i->intf->out_b_func(device, 0, (data & i->odrb) | (i->odrb ^ 0xff)); |
| 157 | 157 | else |
| 158 | 158 | logerror("INS8154 (%08x): Write to port B but no write handler defined!\n", |
| 159 | | safe_cpu_get_pc( device->machine->activecpu ) ); |
| 159 | safe_cpu_get_pc( device->machine->cpu[0] ) ); |
| 160 | 160 | } |
| 161 | 161 | } |
| 162 | 162 | |
| r3705 | r3706 | |
| 168 | 168 | if (offset > 0x24) |
| 169 | 169 | { |
| 170 | 170 | logerror("INS8154 (%04x): Write %02x to invalid offset %02x!\n", |
| 171 | | safe_cpu_get_pc( device->machine->activecpu ), data, offset); |
| 171 | safe_cpu_get_pc( device->machine->cpu[0] ), data, offset); |
| 172 | 172 | return; |
| 173 | 173 | } |
| 174 | 174 | |
| r3705 | r3706 | |
| 184 | 184 | |
| 185 | 185 | case 0x22: |
| 186 | 186 | LOG(("INS8154 (%04x): ODR for port A set to %02x\n", |
| 187 | | safe_cpu_get_pc( device->machine->activecpu ), data)); |
| 187 | safe_cpu_get_pc( device->machine->cpu[0] ), data)); |
| 188 | 188 | i->odra = data; |
| 189 | 189 | break; |
| 190 | 190 | |
| 191 | 191 | case 0x23: |
| 192 | 192 | LOG(("INS8154 (%04x): ODR for port B set to %02x\n", |
| 193 | | safe_cpu_get_pc( device->machine->activecpu ), data)); |
| 193 | safe_cpu_get_pc( device->machine->cpu[0] ), data)); |
| 194 | 194 | i->odrb = data; |
| 195 | 195 | break; |
| 196 | 196 | |
| 197 | 197 | case 0x24: |
| 198 | 198 | LOG(("INS8154 (%04x): MDR set to %02x\n", |
| 199 | | safe_cpu_get_pc( device->machine->activecpu ), data)); |
| 199 | safe_cpu_get_pc( device->machine->cpu[0] ), data)); |
| 200 | 200 | i->mdr = data; |
| 201 | 201 | break; |
| 202 | 202 | |
src/mess/machine/6530miot.c
| r3705 | r3706 | |
| 227 | 227 | if (port->out_func != NULL) |
| 228 | 228 | (*port->out_func)(device, data, olddata); |
| 229 | 229 | else |
| 230 | | logerror("6530MIOT chip %s: Port %c is being written to but has no handler. PC: %08X - %02X\n", device->tag, 'A' + (offset & 1), safe_cpu_get_pc(device->machine->activecpu), data); |
| 230 | logerror("6530MIOT chip %s: Port %c is being written to but has no handler. PC: %08X - %02X\n", device->tag, 'A' + (offset & 1), safe_cpu_get_pc(device->machine->cpu[0]), data); |
| 231 | 231 | } |
| 232 | 232 | } |
| 233 | 233 | } |
| r3705 | r3706 | |
| 289 | 289 | port->in = (*port->in_func)(device, port->in); |
| 290 | 290 | } |
| 291 | 291 | else |
| 292 | | logerror("6530MIOT chip %s: Port %c is being read but has no handler. PC: %08X\n", device->tag, 'A' + (offset & 1), safe_cpu_get_pc(device->machine->activecpu)); |
| 292 | logerror("6530MIOT chip %s: Port %c is being read but has no handler. PC: %08X\n", device->tag, 'A' + (offset & 1), safe_cpu_get_pc(device->machine->cpu[0])); |
| 293 | 293 | |
| 294 | 294 | /* apply the DDR to the result */ |
| 295 | 295 | val = (out & port->ddr) | (port->in & ~port->ddr); |
src/mess/machine/microtan.c
| r3705 | r3706 | |
| 699 | 699 | LOG(("microtan_snapshot_copy: PC:%02X%02X P:%02X A:%02X X:%02X Y:%02X SP:1%02X", |
| 700 | 700 | snapshot_buff[base+1], snapshot_buff[base+0], snapshot_buff[base+2], snapshot_buff[base+3], |
| 701 | 701 | snapshot_buff[base+4], snapshot_buff[base+5], snapshot_buff[base+6]); |
| 702 | | cpu_set_reg(machine->activecpu, M6502_PC, snapshot_buff[base+0] + 256 * snapshot_buff[base+1])); |
| 703 | | cpu_set_reg(machine->activecpu, M6502_P, snapshot_buff[base+2]); |
| 704 | | cpu_set_reg(machine->activecpu, M6502_A, snapshot_buff[base+3]); |
| 705 | | cpu_set_reg(machine->activecpu, M6502_X, snapshot_buff[base+4]); |
| 706 | | cpu_set_reg(machine->activecpu, M6502_Y, snapshot_buff[base+5]); |
| 707 | | cpu_set_reg(machine->activecpu, M6502_S, snapshot_buff[base+6]); |
| 702 | cpu_set_reg(machine->cpu[0], M6502_PC, snapshot_buff[base+0] + 256 * snapshot_buff[base+1])); |
| 703 | cpu_set_reg(machine->cpu[0], M6502_P, snapshot_buff[base+2]); |
| 704 | cpu_set_reg(machine->cpu[0], M6502_A, snapshot_buff[base+3]); |
| 705 | cpu_set_reg(machine->cpu[0], M6502_X, snapshot_buff[base+4]); |
| 706 | cpu_set_reg(machine->cpu[0], M6502_Y, snapshot_buff[base+5]); |
| 707 | cpu_set_reg(machine->cpu[0], M6502_S, snapshot_buff[base+6]); |
| 708 | 708 | } |
| 709 | 709 | |
| 710 | 710 | static void microtan_snapshot_copy(running_machine *machine, UINT8 *snapshot_buff, int snapshot_size) |
src/mess/machine/bbc.c
| r3705 | r3706 | |
| 154 | 154 | PC is in the range c000 to dfff |
| 155 | 155 | or if pagedRAM set and PC is in the range a000 to afff |
| 156 | 156 | */ |
| 157 | | static int vdudriverset(void) |
| 157 | static int vdudriverset(running_machine *machine) |
| 158 | 158 | { |
| 159 | 159 | int PC; |
| 160 | | PC=cpu_get_pc( Machine->activecpu ); // this needs to be set to the 6502 program counter |
| 160 | PC=cpu_get_pc( machine->cpu[0] ); // this needs to be set to the 6502 program counter |
| 161 | 161 | return (((PC>=0xc000) && (PC<=0xdfff)) || ((pagedRAM) && ((PC>=0xa000) && (PC<=0xafff)))); |
| 162 | 162 | } |
| 163 | 163 | |
| r3705 | r3706 | |
| 228 | 228 | // not in shadow ram mode so just read normal ram |
| 229 | 229 | memory_set_bankptr(space->machine, 2, ram+0x3000); |
| 230 | 230 | } else { |
| 231 | | if (vdudriverset()) |
| 231 | if (vdudriverset(space->machine)) |
| 232 | 232 | { |
| 233 | 233 | // if VDUDriver set then read from shadow ram |
| 234 | 234 | memory_set_bankptr(space->machine, 2, ram+0xb000); |
| r3705 | r3706 | |
| 250 | 250 | ram[offset+0x3000]=data; |
| 251 | 251 | vidmem[offset+0x3000]=1; |
| 252 | 252 | } else { |
| 253 | | if (vdudriverset()) |
| 253 | if (vdudriverset(space->machine)) |
| 254 | 254 | { |
| 255 | 255 | // if VDUDriver set then write to shadow ram |
| 256 | 256 | ram[offset+0xb000]=data; |
| r3705 | r3706 | |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 | |
| 437 | | static int bbcm_vdudriverset(void) |
| 437 | static int bbcm_vdudriverset(running_machine *machine) |
| 438 | 438 | { |
| 439 | 439 | int PC; |
| 440 | | PC=cpu_get_pc( Machine->activecpu ); |
| 440 | PC=cpu_get_pc( machine->cpu[0] ); |
| 441 | 441 | return ((PC>=0xc000) && (PC<=0xdfff)); |
| 442 | 442 | } |
| 443 | 443 | |
| r3705 | r3706 | |
| 472 | 472 | { |
| 473 | 473 | memory_set_bankptr( space->machine, 2, memory_region( space->machine, "main" ) + 0xb000 ); |
| 474 | 474 | } else { |
| 475 | | if (ACCCON_E && bbcm_vdudriverset()) |
| 475 | if (ACCCON_E && bbcm_vdudriverset(space->machine)) |
| 476 | 476 | { |
| 477 | 477 | memory_set_bankptr( space->machine, 2, memory_region( space->machine, "main" ) + 0xb000 ); |
| 478 | 478 | } else { |
| r3705 | r3706 | |
| 493 | 493 | ram[offset+0xb000]=data; |
| 494 | 494 | vidmem[offset+0xb000]=1; |
| 495 | 495 | } else { |
| 496 | | if (ACCCON_E && bbcm_vdudriverset()) |
| 496 | if (ACCCON_E && bbcm_vdudriverset(space->machine)) |
| 497 | 497 | { |
| 498 | 498 | ram[offset+0xb000]=data; |
| 499 | 499 | vidmem[offset+0xb000]=1; |
src/mess/drivers/psx.c
| r3705 | r3706 | |
| 81 | 81 | |
| 82 | 82 | free( m_p_psxexe ); |
| 83 | 83 | |
| 84 | | cpu_set_reg(machine->activecpu, MIPS_PC, m_psxexe_header.pc0 ); |
| 85 | | cpu_set_reg(machine->activecpu, MIPS_R28, m_psxexe_header.gp0 ); |
| 84 | cpu_set_reg(machine->cpu[0], MIPS_PC, m_psxexe_header.pc0 ); |
| 85 | cpu_set_reg(machine->cpu[0], MIPS_R28, m_psxexe_header.gp0 ); |
| 86 | 86 | n_stack = m_psxexe_header.s_addr + m_psxexe_header.s_size; |
| 87 | 87 | if( n_stack != 0 ) |
| 88 | 88 | { |
| 89 | | cpu_set_reg(machine->activecpu, MIPS_R29, n_stack ); |
| 90 | | cpu_set_reg(machine->activecpu, MIPS_R30, n_stack ); |
| 89 | cpu_set_reg(machine->cpu[0], MIPS_R29, n_stack ); |
| 90 | cpu_set_reg(machine->cpu[0], MIPS_R30, n_stack ); |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | memory_set_direct_update_handler( 0, NULL ); |