Previous 15994 Revisions Next

r3706 Friday 28th November, 2008 at 14:53:37 UTC by Nathan Woods
Removed usage of machine->activecpu
[src/mess/drivers]psx.c
[src/mess/machine]3do.c 6530miot.c bbc.c bebox.c ins8154.c microtan.c nec765.c sym1.c trs80.c
[src/mess/video]dgn_beta.c

src/mess/video/dgn_beta.c
r3705r3706
230230                 data & GCtrlHiLo      ? "Hi" : "Lo",
231231                 data & GCtrlSWChar      ? "C0" : "C1",
232232                 data & GCtrlWI      ? "Wi" : "  ",
233                 cpu_get_pc( Machine->activecpu ));
233                 cpu_get_pc( Machine->cpu[0] ));
234234}
235235
236236// called when the 6845 changes the character row
src/mess/machine/3do.c
r3705r3706
1717
1818
1919READ32_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 );
2121   return 0;
2222}
2323
2424WRITE32_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 );
2626}
2727
2828
r3705r3706
6969   several groups of 16 write actions or 16 read actions
7070*/
7171READ32_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 );
7373#if 0
7474   switch( offset ) {
7575   case 0:      /* Boot ROM checks here and expects to read 1, 0, 1, 0 in the lowest bit */
r3705r3706
8282
8383WRITE32_HANDLER( unk_318_w )
8484{
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 );
8686
8787   switch( offset )
8888   {
r3705r3706
9898
9999
100100READ32_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 );
102102   switch( offset ) {
103103   case 0x1840:   /* 03206100 - ?? */
104104      break;
r3705r3706
109109}
110110
111111WRITE32_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 );
113113   switch( offset ) {
114114   case 0x0800:   /* 03202000 - ?? during boot 00190019 gets written */
115115      break;
r3705r3706
121121
122122
123123READ32_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 );
125125   switch( offset ) {
126126   case 0:      /* 03300000 - Revision */
127127      return madam.revision;
r3705r3706
132132}
133133
134134WRITE32_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 );
136136   switch( offset ) {
137137   case 0x01:   /* 03300004 - Memory configuration 29 = 2MB DRAM, 1MB VRAM */
138138      madam.memory_configuration = data;
r3705r3706
153153
154154READ32_HANDLER( clio_r )
155155{
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 );
157157
158158   switch( offset )
159159   {
r3705r3706
172172
173173WRITE32_HANDLER( clio_w )
174174{
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 );
176176
177177   switch( offset )
178178   {
src/mess/machine/ins8154.c
r3705r3706
8888   if (offset > 0x24)
8989   {
9090      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);
9292      return 0xff;
9393   }
9494   
r3705r3706
138138         i->intf->out_a_func(device, 0, (data & i->odra) | (i->odra ^ 0xff));
139139      else
140140         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] ) );
142142   }
143143}
144144
r3705r3706
156156         i->intf->out_b_func(device, 0, (data & i->odrb) | (i->odrb ^ 0xff));
157157      else
158158         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] ) );
160160   }
161161}
162162
r3705r3706
168168   if (offset > 0x24)
169169   {
170170      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);
172172      return;
173173   }
174174   
r3705r3706
184184     
185185   case 0x22:
186186      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));
188188      i->odra = data;
189189      break;
190190     
191191   case 0x23:
192192      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));
194194      i->odrb = data;
195195      break;
196196     
197197   case 0x24:
198198      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));
200200      i->mdr = data;
201201      break;
202202     
src/mess/machine/6530miot.c
r3705r3706
227227         if (port->out_func != NULL)
228228            (*port->out_func)(device, data, olddata);
229229         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);
231231      }
232232   }
233233}
r3705r3706
289289            port->in = (*port->in_func)(device, port->in);
290290         }
291291         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]));
293293
294294         /* apply the DDR to the result */
295295         val = (out & port->ddr) | (port->in & ~port->ddr);
src/mess/machine/microtan.c
r3705r3706
699699    LOG(("microtan_snapshot_copy: PC:%02X%02X P:%02X A:%02X X:%02X Y:%02X SP:1%02X",
700700        snapshot_buff[base+1], snapshot_buff[base+0], snapshot_buff[base+2], snapshot_buff[base+3],
701701        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]);
708708}
709709
710710static void microtan_snapshot_copy(running_machine *machine, UINT8 *snapshot_buff, int snapshot_size)
src/mess/machine/trs80.c
r3705r3706
130130         quickload_size--;
131131      }
132132   }
133   cpu_set_reg(image->machine->activecpu, Z80_PC, entry);
133   cpu_set_reg(image->machine->cpu[0], Z80_PC, entry);
134134
135135   free(cmd_buff);
136136   return INIT_PASS;
src/mess/machine/nec765.c
r3705r3706
16211621      fdc.FDC_main |= 0x10;                      /* set BUSY */
16221622
16231623      if (LOG_VERBOSE)
1624         logerror("nec765(): pc=0x%08x command=0x%02x\n", cpu_get_pc(machine->activecpu), fdc.nec765_data_reg);
1624         logerror("nec765(): pc=0x%08x command=0x%02x\n", cpu_get_pc(machine->cpu[0]), fdc.nec765_data_reg);
16251625
16261626      /* seek in progress? */
16271627      if (fdc.nec765_flags & NEC765_SEEK_ACTIVE)
r3705r3706
16521652
16531653    case NEC765_COMMAND_PHASE_BYTES:
16541654      if (LOG_VERBOSE)
1655         logerror("nec765(): pc=0x%08x command=0x%02x\n", cpu_get_pc(machine->activecpu), fdc.nec765_data_reg);
1655         logerror("nec765(): pc=0x%08x command=0x%02x\n", cpu_get_pc(machine->cpu[0]), fdc.nec765_data_reg);
16561656
16571657      fdc.nec765_command_bytes[fdc.nec765_transfer_bytes_count] = fdc.nec765_data_reg;
16581658      fdc.nec765_transfer_bytes_count++;
src/mess/machine/sym1.c
r3705r3706
123123
124124static void sym1_riot_a_w(const device_config *device, UINT8 newdata, UINT8 data)
125125{
126   logerror("%x: riot_a_w 0x%02x\n", cpu_get_pc( device->machine->activecpu ), data);
126   logerror("%x: riot_a_w 0x%02x\n", cpu_get_pc( device->machine->cpu[0] ), data);
127127
128128   /* save for later use */
129129   riot_port_a = data;
r3705r3706
132132
133133static void sym1_riot_b_w(const device_config *device, UINT8 newdata, UINT8 data)
134134{
135   logerror("%x: riot_b_w 0x%02x\n", cpu_get_pc( device->machine->activecpu ), data);
135   logerror("%x: riot_b_w 0x%02x\n", cpu_get_pc( device->machine->cpu[0] ), data);
136136
137137   /* save for later use */
138138   riot_port_b = data;
src/mess/machine/bebox.c
r3705r3706
194194{
195195   UINT32 result;
196196   result = bebox_crossproc_interrupts;
197   /* TODO: This test needs to be really fixed */
198   if ( space->machine->activecpu != space->machine->cpu[0] )
197
198   /* return a different result depending on which CPU is accessing this handler */
199   if (space != cpu_get_address_space(space->machine->cpu[0], ADDRESS_SPACE_PROGRAM))
199200      result |= 0x02000000;
200201   else
201202      result &= ~0x02000000;
203
202204   return ((UINT64) result) << 32;
203205}
204206
src/mess/machine/bbc.c
r3705r3706
154154   PC is in the range c000 to dfff
155155   or if pagedRAM set and PC is in the range a000 to afff
156156*/
157static int vdudriverset(void)
157static int vdudriverset(running_machine *machine)
158158{
159159   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
161161   return (((PC>=0xc000) && (PC<=0xdfff)) || ((pagedRAM) && ((PC>=0xa000) && (PC<=0xafff))));
162162}
163163
r3705r3706
228228      // not in shadow ram mode so just read normal ram
229229      memory_set_bankptr(space->machine, 2, ram+0x3000);
230230   } else {
231      if (vdudriverset())
231      if (vdudriverset(space->machine))
232232      {
233233         // if VDUDriver set then read from shadow ram
234234         memory_set_bankptr(space->machine, 2, ram+0xb000);
r3705r3706
250250      ram[offset+0x3000]=data;
251251      vidmem[offset+0x3000]=1;
252252   } else {
253      if (vdudriverset())
253      if (vdudriverset(space->machine))
254254      {
255255         // if VDUDriver set then write to shadow ram
256256         ram[offset+0xb000]=data;
r3705r3706
434434}
435435
436436
437static int bbcm_vdudriverset(void)
437static int bbcm_vdudriverset(running_machine *machine)
438438{
439439   int PC;
440   PC=cpu_get_pc( Machine->activecpu );
440   PC=cpu_get_pc( machine->cpu[0] );
441441   return ((PC>=0xc000) && (PC<=0xdfff));
442442}
443443
r3705r3706
472472   {
473473      memory_set_bankptr( space->machine, 2, memory_region( space->machine, "main" ) + 0xb000 );
474474   } else {
475      if (ACCCON_E && bbcm_vdudriverset())
475      if (ACCCON_E && bbcm_vdudriverset(space->machine))
476476      {
477477         memory_set_bankptr( space->machine, 2, memory_region( space->machine, "main" ) + 0xb000 );
478478      } else {
r3705r3706
493493      ram[offset+0xb000]=data;
494494      vidmem[offset+0xb000]=1;
495495   } else {
496      if (ACCCON_E && bbcm_vdudriverset())
496      if (ACCCON_E && bbcm_vdudriverset(space->machine))
497497      {
498498         ram[offset+0xb000]=data;
499499         vidmem[offset+0xb000]=1;
src/mess/drivers/psx.c
r3705r3706
8181
8282      free( m_p_psxexe );
8383
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 );
8686      n_stack = m_psxexe_header.s_addr + m_psxexe_header.s_size;
8787      if( n_stack != 0 )
8888      {
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 );
9191      }
9292
9393      memory_set_direct_update_handler( 0, NULL );

Previous 15994 Revisions Next


© 1998-2018 The MESS Team