Previous 199869 Revisions Next

r34697 Wednesday 28th January, 2015 at 13:37:46 UTC by MetalliC
JVS host: real fix for "CRC errors"

(case of last message byte is special 0xD0 value)
[src/emu/cpu/m6502]m6502.c om65ce02.lst
[src/emu/machine]jvshost.c
[src/mame/drivers]cabal.c shanghai.c
[src/mame/machine]mie.c mie.h

trunk/src/emu/cpu/m6502/m6502.c
r243208r243209
579579      break;
580580
581581   case DASM_rw2:
582      sprintf(buffer, " $%04x", (pc & 0xf0000) | UINT16(pc + 2 + INT16((opram[2] << 8) | opram[1])));
582      sprintf(buffer, " $%04x", (pc & 0xf0000) | UINT16(pc + 3 + INT16((opram[2] << 8) | opram[1])));
583583      flags |= 3;
584584      break;
585585
trunk/src/emu/cpu/m6502/om65ce02.lst
r243208r243209
245245   TMP = read_pc();
246246   TMP = set_h(TMP, read_pc());
247247   if(!(P & F_C))
248      PC += TMP-1;
248      PC += TMP;
249249   prefetch();
250250
251251bcs_ce_rel
r243208r243209
258258   TMP = read_pc();
259259   TMP = set_h(TMP, read_pc());
260260   if(P & F_C)
261      PC += TMP-1;
261      PC += TMP;
262262   prefetch();
263263
264264beq_ce_rel
r243208r243209
271271   TMP = read_pc();
272272   TMP = set_h(TMP, read_pc());
273273   if(P & F_Z)
274      PC += TMP-1;
274      PC += TMP;
275275   prefetch();
276276
277277bit_ce_abx
r243208r243209
307307   TMP = read_pc();
308308   TMP = set_h(TMP, read_pc());
309309   if(P & F_N)
310      PC += TMP-1;
310      PC += TMP;
311311   prefetch();
312312
313313bne_ce_rel
r243208r243209
320320   TMP = read_pc();
321321   TMP = set_h(TMP, read_pc());
322322   if(!(P & F_Z))
323      PC += TMP-1;
323      PC += TMP;
324324   prefetch();
325325
326326bpl_ce_rel
r243208r243209
333333   TMP = read_pc();
334334   TMP = set_h(TMP, read_pc());
335335   if(!(P & F_N))
336      PC += TMP-1;
336      PC += TMP;
337337   prefetch();
338338
339339bra_ce_rel
r243208r243209
379379   write(SP, PC);
380380   dec_SP_ce();
381381   TMP = set_h(TMP, read_pc());
382   PC += TMP-1;
382   PC += TMP;
383383   prefetch();
384384
385385bvc_ce_rel
r243208r243209
392392   TMP = read_pc();
393393   TMP = set_h(TMP, read_pc());
394394   if(!(P & F_V))
395      PC += TMP-1;
395      PC += TMP;
396396   prefetch();
397397
398398bvs_ce_rel
r243208r243209
405405   TMP = read_pc();
406406   TMP = set_h(TMP, read_pc());
407407   if(P & F_V)
408      PC += TMP-1;
408      PC += TMP;
409409   prefetch();
410410
411411clc_ce_imp
trunk/src/emu/machine/jvshost.c
r243208r243209
4848   // - have the message length without the two header bytes but with the checksum byte in the second byte
4949   // - have at least one command byte
5050   if(send_size < 3 || send_buffer[0] == 0x00 || send_buffer[1] != send_size-1) {
51      logerror("JVS checksum error\n");
52   } /*
53        Naomi suchie3 have bad working controls with this
54
55        // "This message is crap" doesn't exist so call it checksum error
56        recv_buffer[0] = 0x00;
57        recv_buffer[1] = 0x02;
58        recv_buffer[2] = 0x03;
59        recv_size = 3;
60
61    } else */ {
51                logerror("JVS checksum error\n");
52                // "This message is crap" doesn't exist so call it checksum error
53                recv_buffer[0] = 0x00;
54                recv_buffer[1] = 0x02;
55                recv_buffer[2] = 0x03;
56                recv_size = 3;
57        } else {
6258      if(first_device) {
6359         first_device->message(send_buffer[0], send_buffer+2, send_size-2, recv_buffer+2, recv_size);
6460         recv_is_encoded = false;
r243208r243209
146142   if(!size)
147143      return;
148144   UINT32 pos = 0;
149   for(UINT32 i=0; i<size-1; i++) {
145   for(UINT32 i=0; i<size; i++) {
150146      UINT8 t = buffer[i];
151147      if(!i && t == 0xe0)
152148         continue;
r243208r243209
156152      }
157153      buffer[pos++] = t;
158154   }
159   size = pos;
155   size = pos ? pos - 1 : 0;
160156}
trunk/src/mame/drivers/cabal.c
r243208r243209
484484   MCFG_SPEAKER_STANDARD_MONO("mono")
485485
486486   MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz) /* verified on pcb */
487   MCFG_YM2151_IRQ_HANDLER(DEVWRITELINE("seibu_sound", seibu_sound_device, ym2151_irqhandler))
487   MCFG_YM2151_IRQ_HANDLER(DEVWRITELINE("seibu_sound", seibu_sound_device, fm_irqhandler))
488488   MCFG_SOUND_ROUTE(ALL_OUTPUTS,"mono", 0.80)
489489
490490   MCFG_SOUND_ADD("adpcm1", SEIBU_ADPCM, 8000) /* it should use the msm5205 */
trunk/src/mame/drivers/shanghai.c
r243208r243209
514514
515515   /* same as standard seibu ym2203, but "ym1" also reads "DSW" */
516516   MCFG_SOUND_ADD("ym1", YM2203, XTAL_16MHz/4)
517   MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("seibu_sound", seibu_sound_device, ym2203_irqhandler))
517   MCFG_YM2203_IRQ_HANDLER(DEVWRITELINE("seibu_sound", seibu_sound_device, fm_irqhandler))
518518   MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW"))
519519   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.15)
520520
trunk/src/mame/machine/mie.c
r243208r243209
3333   AM_RANGE(0x00, 0x07) AM_READWRITE(gpio_r, gpio_w)
3434   AM_RANGE(0x08, 0x08) AM_READWRITE(gpiodir_r, gpiodir_w)
3535   AM_RANGE(0x0f, 0x0f) AM_READWRITE(adc_r, adc_w)
36   AM_RANGE(0x10, 0x10) AM_READWRITE(jvs_r, jvs_w)
36   AM_RANGE(0x10, 0x10) AM_READWRITE(jvs_r, jvs_w)      // ports 1x and 2x is standard UARTs, TODO handle it properly
3737   AM_RANGE(0x12, 0x12) AM_WRITE(jvs_dest_w)
38   AM_RANGE(0x13, 0x13) AM_WRITE(jvs_lcr_w)
3839   AM_RANGE(0x15, 0x15) AM_READ(jvs_status_r)
3940   AM_RANGE(0x30, 0x30) AM_READWRITE(irq_enable_r, irq_enable_w)
4041   AM_RANGE(0x50, 0x50) AM_READWRITE(maple_irqlevel_r, maple_irqlevel_w)
r243208r243209
319320
320321READ8_MEMBER(mie_device::jvs_r)
321322{
323   if (jvs_lcr & 0x80)
324      return 0;
325
322326   const UINT8 *buf;
323327   UINT32 size;
324328   jvs->get_encoded_reply(buf, size);
r243208r243209
329333
330334WRITE8_MEMBER(mie_device::jvs_w)
331335{
332   // Hack until the ports are better understood
333   if(jvs_dest == 2)
334      jvs->push(data);
336   if (jvs_lcr & 0x80)
337      return;
338
339   jvs->push(data);
335340}
336341
337342WRITE8_MEMBER(mie_device::jvs_dest_w)
r243208r243209
359364   jvs_control = data;
360365}
361366
367WRITE8_MEMBER(mie_device::jvs_lcr_w)
368{
369   jvs_lcr = data;
370}
371
362372READ8_MEMBER(mie_device::jvs_sense_r)
363373{
364374   return 0x8c | (jvs->get_address_set_line() ? 2 : 0) | (jvs->get_presence_line() ? 0 : 1);
trunk/src/mame/machine/mie.h
r243208r243209
6161   DECLARE_READ8_MEMBER(jvs_status_r);
6262   DECLARE_WRITE8_MEMBER(jvs_control_w);
6363   DECLARE_READ8_MEMBER(jvs_sense_r);
64   DECLARE_WRITE8_MEMBER(jvs_lcr_w);
6465
6566   DECLARE_READ8_MEMBER(read_ff);
6667   DECLARE_READ8_MEMBER(read_00);
r243208r243209
106107   UINT8 gpiodir, gpio_val[8];
107108   UINT8 irq_enable, irq_pending, maple_irqlevel;
108109   UINT8 jvs_control, jvs_dest;
110   UINT8 jvs_lcr;
109111
110112   void raise_irq(int level);
111113   void recalc_irq();


Previous 199869 Revisions Next


© 1997-2024 The MAME Team