Previous 199869 Revisions Next

r19457 Monday 10th December, 2012 at 22:01:37 UTC by Angelo Salese
Various fixes for Brandish 2
[src/mess/drivers]pc9801.c

trunk/src/mess/drivers/pc9801.c
r19456r19457
2929    - Dies on ARTIC check;
3030    - Presumably one ROM is undumped?
3131
32   floppy issues TODO (certain fail, even with a stock F version)
33   - Bokosuka Wars (perhaps not 2hd?)
32   floppy issues TODO (certain fail)
33   - Bokosuka Wars
3434   - Dokkin Minako Sensei (2dd image)
3535
3636   List of per-game TODO:
37   - 4D Boxing: tries to format User Disk;
37   - 4D Boxing: inputs are unresponsive
3838   - 4D Driving: accesses some undefined ports (guess that it accesses the low part of them with word opcodes ...)
39   - Absolutely Mahjong: Epson splash screen doesn't appear at all, why?
40   - Brandish 2: has some annoying strips at the main menu, also no selection seems to work;
39   - Absolutely Mahjong: Kanji data doesn't appear at the Epson logo. Transitions are too fast.
40   - Brandish 2: Intro needs some window masking effects;
4141   - Dragon Buster: missing bitplanes for the PCG, slight issue with window masking;
4242   - Far Side Moon: doesn't detect neither mouse nor sound board;
4343   - First Queen: has broken text display;
r19456r19457
397397   DECLARE_WRITE8_MEMBER(pc9801_gvram_w);
398398   DECLARE_READ8_MEMBER(pc9801_mouse_r);
399399   DECLARE_WRITE8_MEMBER(pc9801_mouse_w);
400   DECLARE_WRITE8_MEMBER(pc9801rs_mouse_freq_w);
400401   inline UINT8 m_pc9801rs_grcg_r(UINT32 offset,int vbank);
401402   inline void m_pc9801rs_grcg_w(UINT32 offset,int vbank,UINT8 data);
402403   DECLARE_READ8_MEMBER(pc9801_opn_r);
r19456r19457
542543      UINT8 control;
543544      UINT8 lx;
544545      UINT8 ly;
546      UINT8 freq_reg;
547      UINT8 freq_index;
545548   }m_mouse;
546549   TIMER_DEVICE_CALLBACK_MEMBER( mouse_irq_cb );
547550
r19456r19457
553556
554557
555558
559#define ATTRSEL_REG 0
556560#define WIDTH40_REG 2
557561#define FONTSEL_REG 3
558562#define INTERLACE_REG 4
r19456r19457
708712      v_line = attr & 0x10;
709713      color = (attr & 0xe0) >> 5;
710714
715      if(state->m_video_ff[ATTRSEL_REG])
716         v_line = 0;
717
711718      for(yi=0;yi<lr;yi++)
712719      {
713720         for(xi=0;xi<8;xi++)
r19456r19457
10771084      }
10781085
10791086
1080      if(1)
1087      if(0)
10811088      {
10821089         static const char *const video_ff_regnames[] =
10831090         {
r19456r19457
10961103   }
10971104   else // odd
10981105   {
1099      printf("Write to undefined port [%02x] <- %02x\n",offset+0x68,data);
1106      //printf("Write to undefined port [%02x] <- %02x\n",offset+0x68,data);
11001107   }
11011108}
11021109
r19456r19457
11301137   {
11311138      if(offset < 0x08)
11321139         pit8253_w(machine().device("pit8253"), space, (offset & 6) >> 1, data);
1133      else
1134         printf("Write to undefined port [%02x] <- %02x\n",offset+0x70,data);
1140      //else
1141      //   printf("Write to undefined port [%02x] <- %02x\n",offset+0x70,data);
11351142   }
11361143}
11371144
r19456r19457
12891296         }
12901297      }
12911298
1292      printf("Write to undefined port [%02x] <- %02x\n",offset+0xa0,data);
1299      //printf("Write to undefined port [%02x] <- %02x\n",offset+0xa0,data);
12931300   }
12941301}
12951302
r19456r19457
19251932      m_access_ctrl = data;
19261933}
19271934
1935WRITE8_MEMBER( pc9801_state::pc9801rs_mouse_freq_w )
1936{
1937   /* TODO: bit 3 used */
1938   if(offset == 3)
1939   {
1940      m_mouse.freq_reg = data & 3;
1941      m_mouse.freq_index = 0;
1942   }
1943}
1944
19281945static ADDRESS_MAP_START( pc9801rs_map, AS_PROGRAM, 32, pc9801_state )
19291946   AM_RANGE(0x00000000, 0xffffffff) AM_READWRITE8(pc9801rs_memory_r,pc9801rs_memory_w,0xffffffff)
19301947ADDRESS_MAP_END
r19456r19457
19491966   AM_RANGE(0x0438, 0x043b) AM_READWRITE8(pc9801rs_access_ctrl_r,pc9801rs_access_ctrl_w,0xffffffff)
19501967   AM_RANGE(0x043c, 0x043f) AM_WRITE8(pc9801rs_bank_w,    0xffffffff) //ROM/RAM bank
19511968   AM_RANGE(0x7fd8, 0x7fdf) AM_READWRITE8(pc9801_mouse_r,     pc9801_mouse_w,     0xffffffff) // <undefined> / mouse ppi8255 ports
1969   AM_RANGE(0xbfd8, 0xbfdf) AM_WRITE8(pc9801rs_mouse_freq_w, 0xffffffff)
19521970ADDRESS_MAP_END
19531971
19541972READ8_MEMBER(pc9801_state::pc980ux_memory_r)
r19456r19457
27162734
27172735   PORT_START("MOUSE_B")
27182736   PORT_BIT(0x1f, IP_ACTIVE_HIGH, IPT_UNUSED )
2719   PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_BUTTON3) PORT_CODE(MOUSECODE_BUTTON3) PORT_NAME("Mouse Middle Button")
2737   /* TODO: Brandish 2 apparently needs both bits 7 & 5 to be active, to enter into a main menu sub-item. */
2738   PORT_BIT(0x20, IP_ACTIVE_LOW,  IPT_UNUSED )// PORT_CODE(MOUSECODE_BUTTON3) PORT_NAME("Mouse Middle Button")
27202739   PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_BUTTON2) PORT_CODE(MOUSECODE_BUTTON2) PORT_NAME("Mouse Right Button")
27212740   PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_CODE(MOUSECODE_BUTTON1) PORT_NAME("Mouse Left Button")
27222741
r19456r19457
33283347
33293348   m_nmi_ff = 0;
33303349   m_mouse.control = 0xff;
3350   m_mouse.freq_reg = 0;
3351   m_mouse.freq_index = 0;
33313352}
33323353
33333354MACHINE_RESET_MEMBER(pc9801_state,pc9801f)
r19456r19457
34383459{
34393460   if((m_mouse.control & 0x10) == 0)
34403461   {
3441      pic8259_ir5_w(machine().device("pic8259_slave"), 0);
3442      pic8259_ir5_w(machine().device("pic8259_slave"), 1);
3462      m_mouse.freq_index ++;
3463
3464//      printf("%02x\n",m_mouse.freq_index);
3465      if(m_mouse.freq_index > m_mouse.freq_reg)
3466      {
3467//         printf("irq %02x\n",m_mouse.freq_reg);
3468         m_mouse.freq_index = 0;
3469         pic8259_ir5_w(machine().device("pic8259_slave"), 0);
3470         pic8259_ir5_w(machine().device("pic8259_slave"), 1);
3471      }
34433472   }
34443473}
34453474

Previous 199869 Revisions Next


© 1997-2024 The MAME Team