Previous 15994 Revisions Next

r11147 Tuesday 12th April, 2011 at 11:48:03 UTC by Robbbert
[ARGO] Improved video, added makeshift cursor.
[src/mess/drivers]argo.c

src/mess/drivers/argo.c
r11146r11147
2626
2727   required_device<cpu_device> m_maincpu;
2828   DECLARE_WRITE8_MEMBER(argo_videoram_w);
29   DECLARE_WRITE8_MEMBER(argo_io_w);
2930   UINT8 *m_p_videoram;
3031   const UINT8 *m_p_chargen;
3132   UINT8 m_framecnt;
33   UINT8 m_cursor_pos[3];
34   UINT8 m_cur;
35   bool m_ram_ctrl;
3236   virtual void machine_reset();
3337   virtual void video_start();
3438   virtual bool screen_update(screen_device &screen, bitmap_t &bitmap, const rectangle &cliprect);
3539};
3640
41// write to videoram if following 'out b9,61' otherwise discard
3742WRITE8_MEMBER(argo_state::argo_videoram_w)
3843{
39   UINT8 *RAM = machine().region("videoram")->base();
40   RAM[offset] = data;
44   if (m_ram_ctrl)
45   {
46      UINT8 *RAM = machine().region("videoram")->base();
47      RAM[offset] = data;
48   }
4149}
4250
51WRITE8_MEMBER(argo_state::argo_io_w)
52{
53   UINT8 low_io = offset;
54
55   switch (low_io)
56   {
57   case 0xC0: // store cursor position if it followed 'out c4,80'
58      if (m_cur > 0) m_cursor_pos[m_cur]=data;
59      if (m_cur < 2) m_cur++;
60      break;
61   case 0xC4:
62      if (data == 0x80) m_cur=1; else m_cur=0;
63      break;
64   case 0xB9:
65      m_ram_ctrl = (data == 0x61);
66      break;
67   }
68}
69
70
71
4372static ADDRESS_MAP_START(argo_mem, AS_PROGRAM, 8, argo_state)
4473   ADDRESS_MAP_UNMAP_HIGH
4574   AM_RANGE(0x0000, 0x07ff) AM_RAMBANK("boot")
r11146r11147
6291   AM_RANGE(0x09A1, 0x09A1) AM_READ_PORT("X9")
6392   AM_RANGE(0x0AA1, 0x0AA1) AM_READ_PORT("XA")
6493   AM_RANGE(0x0BA1, 0x0BA1) AM_READ_PORT("XB")
94   AM_RANGE(0x0000, 0xFFFF) AM_WRITE(argo_io_w)
6595ADDRESS_MAP_END
6696
6797/* Input ports */
r11146r11147
108138{
109139   UINT8 y,ra,chr,gfx;
110140   UINT16 sy=0,ma=0,x;
111   UINT8 *vram = m_p_videoram;
141   UINT8 *p_vram = m_p_videoram;
112142
113143   m_framecnt++;
114144
r11146r11147
118148      {
119149         UINT16 *p = BITMAP_ADDR16(&bitmap, sy++, 0);
120150
121         for (x = ma; x < ma + 80; x++)
151         for (x = 1; x < 81; x++) // align x to the cursor position numbers
122152         {
123153            gfx = 0;
124154
125155            if (ra < 9)
126156            {
127               chr = vram[x];
157               chr = p_vram[x+ma-1];
128158
129159               /* Take care of flashing characters */
130               if ((chr & 0x80) && (m_framecnt & 0x08))
131                  chr = 0x20;
160               //if ((chr & 0x80) && (m_framecnt & 0x08))
161               //   chr = 0x20;
132162
133163               chr &= 0x7f;
134164
135165               gfx = m_p_chargen[(chr<<4) | ra ];
136166            }
167            else
168            // display cursor if at cursor position and flash on
169            if ((x==m_cursor_pos[1]) && (y==m_cursor_pos[2]) && (m_framecnt & 0x08))
170               gfx = 0xff;
137171
138172            /* Display a scanline of a character */
139173            *p++ = BIT(gfx, 7);
r11146r11147
152186      else
153187      {
154188         ma=0;
155         vram = machine().region("videoram")->base();
189         p_vram = machine().region("videoram")->base();
156190      }
157191   }
158192   return 0;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team