Previous 15994 Revisions Next

r10475 Thursday 17th February, 2011 at 02:21:17 UTC by Angelo Salese
[PC-98]: cheap kludges for Barry (gets to another unimplemented opcode after a bunch of soft resets)
[src/mess/drivers]pc98.c

src/mess/drivers/pc98.c
r10474r10475
250250   int dma_channel;
251251   UINT8 dma_offset[2][4];
252252   UINT8 at_pages[0x10];
253   UINT8 soft_reset;
253254};
254255
255256
r10474r10475
330331   return 0;
331332}
332333
334//FIXME: kludge to get over a PPI bug (doesn't get initialized?).
333335static READ8_HANDLER( sys_port_r )
334336{
337   pc98_state *state = space->machine->driver_data<pc98_state>();
338
339   if(cpu_get_pc(space->cpu) == 0xf808c)
340      return state->soft_reset | (i8255a_r(space->machine->device("ppi8255_0"), (offset & 6) >> 1) & 0x7f);
341
335342   if(cpu_get_pc(space->cpu) == 0xf9088)
336      return 0x18; //FIXME: kludge to get over a probable PPI bug.
343      return 0x18;
337344
338345   if(cpu_get_pc(space->cpu) == 0xf90b2)
339346      return 0x38;
r10474r10475
344351   if(cpu_get_pc(space->cpu) == 0xf9233)
345352      return 0x38;
346353
354   if(cpu_get_pc(space->cpu) == 0xf926e)
355      return 0x18;
356
347357   if(offset & 1)
348358      return i8255a_r(space->machine->device("ppi8255_0"), (offset & 6) >> 1);
349359
r10474r10475
556566   pc98_state *state = space->machine->driver_data<pc98_state>();
557567   if(offset == 0x00)
558568   {
569      static UINT8 x;
570
571      state->soft_reset = 0x00;
572
573      popmessage("Press soft reset NOW! (%d pass)",x++);
559574      //cputag_set_input_line(space->machine, "maincpu", INPUT_LINE_RESET, PULSE_LINE);
560575   }
561576
r10474r10475
734749
735750#include "cpu/i386/i386priv.h"
736751
752static MACHINE_START(pc9801)
753{
754   pc98_state *state = machine->driver_data<pc98_state>();
737755
756   state->soft_reset = 0x80;
757}
738758
739759static MACHINE_RESET(pc9801)
740760{
r10474r10475
824844static READ8_DEVICE_HANDLER( pc98_portc_r )
825845{
826846   //printf("PPI Port C read\n");
827   return 0x00;
847   return 0x08;
828848}
829849
830850static WRITE8_DEVICE_HANDLER( pc98_porta_w )
r10474r10475
10161036   MCFG_CPU_PROGRAM_MAP(pc9801_mem)
10171037   MCFG_CPU_IO_MAP(pc9801_io)
10181038
1039   MCFG_MACHINE_START(pc9801)
10191040   MCFG_MACHINE_RESET(pc9801)
10201041
10211042   MCFG_I8255A_ADD( "ppi8255_0", ppi8255_intf )
r10474r10475
11131134
11141135static DRIVER_INIT( pc9801 )
11151136{
1116   #if 0
1117   UINT8 *ROM = machine->region("cpudata")->base();
1118
1119   /* patch unimplemented opcodes verr / verw */
1120   ROM[0xf90be & 0x3ffff] = 0x90;
1121   ROM[0xf90bf & 0x3ffff] = 0x90;
1122   ROM[0xf90c0 & 0x3ffff] = 0x90;
1123
1124   ROM[0xf90c3 & 0x3ffff] = 0x90;
1125   ROM[0xf90c4 & 0x3ffff] = 0x90;
1126   ROM[0xf90c5 & 0x3ffff] = 0x90;
1127
1128   ROM[0xf90d8 & 0x3ffff] = 0x90;
1129   ROM[0xf90d9 & 0x3ffff] = 0x90;
1130   ROM[0xf90da & 0x3ffff] = 0x90;
1131
1132   ROM[0xf90dd & 0x3ffff] = 0x90;
1133   ROM[0xf90de & 0x3ffff] = 0x90;
1134   ROM[0xf90df & 0x3ffff] = 0x90;
1135
1136   /* patch verr / verw checks */
1137   ROM[0xf90c1 & 0x3ffff] = 0x90;
1138   ROM[0xf90c2 & 0x3ffff] = 0x90;
1139
1140   ROM[0xf90c6 & 0x3ffff] = 0x90;
1141   ROM[0xf90c7 & 0x3ffff] = 0x90;
1142
1143   ROM[0xf90e0 & 0x3ffff] = 0x90;
1144   ROM[0xf90e1 & 0x3ffff] = 0x90;
1145
1146   /* patch lldt / sldt checks (it tests a word at 0xf8070, and it wants zeroes on bits 8-15). */
1147   ROM[0xf9103 & 0x3ffff] = 0x90;
1148   ROM[0xf9104 & 0x3ffff] = 0x90;
1149
1150   /* patch ltr / str checks (it tests a word at 0xf8060, and it wants zeroes on bits 8-15).  */
1151   ROM[0xf9118 & 0x3ffff] = 0x90;
1152   ROM[0xf9119 & 0x3ffff] = 0x90;
1153   ROM[0xf911a & 0x3ffff] = 0x90;
1154
1155   /* patch unimplemented lar opcode */
1156   ROM[0xf91f6 & 0x3ffff] = 0x90;
1157   ROM[0xf91f7 & 0x3ffff] = 0x90;
1158   ROM[0xf91f8 & 0x3ffff] = 0x90;
1159
1160   /* patch lar checks */
1161   ROM[0xf91fe & 0x3ffff] = 0x90;
1162   ROM[0xf91ff & 0x3ffff] = 0x90;
1163
1164   /* can't avoid this??? */
1165   ROM[0xf9258 & 0x3ffff] = 0xeb;
1166   ROM[0xf9259 & 0x3ffff] = 0x33;
1167
1168   /* patch ROM checksum */
1169   ROM[0xf8595 & 0x3ffff] = 0x90;
1170   ROM[0xf8596 & 0x3ffff] = 0x90;
1171   #endif
1137   // ...
11721138}
11731139
11741140

Previous 15994 Revisions Next


© 1998-2018 The MESS Team