Previous 15994 Revisions Next

r15726 Friday 3rd August, 2012 at 14:54:06 UTC by Curt Coder
[ABC800C] Added high resolution graphics. [Curt Coder]
[src/mess/video]abc800.c abc806.c

src/mess/video/abc800.c
r15725r15726
44 *
55 ****************************************************************************/
66
7/*
8   
9   TODO:
10
11   - color cursor
12   - color HR graphics
13
14*/
15
167#include "includes/abc80x.h"
178
189
r15725r15726
6556   if (col >= 80) row += 16;
6657   else if (col >= 40) row += 8;
6758
68   col %= 40;
69
70   return (row * 40) + col;
59   return (row * 40) + (col % 40);
7160}
7261
7362
r15725r15726
9988{
10089   UINT16 addr = 0;
10190
102   for (int y = m_hrs; y < MIN(cliprect.max_y + 1, m_hrs + 240); y++)
91   for (int y = m_hrs; y < MIN(cliprect.max_y + 1, m_hrs + 480); y += 2)
10392   {
10493      int x = 0;
10594
r15725r15726
11099         for (int dot = 0; dot < 4; dot++)
111100         {
112101            UINT16 fgctl_addr = ((m_fgctl & 0x7f) << 2) | ((data >> 6) & 0x03);
113            int color = m_fgctl_prom[fgctl_addr] & 0x07;
102            UINT8 fgctl = m_fgctl_prom[fgctl_addr];
103            int color = fgctl & 0x07;
114104
115            bitmap.pix16(y, x++) = color;
105            if (color)
106            {
107               rgb_t rgb = palette_entry_get_color(machine().palette, bitmap.pix16(y, x));
108               bool black = !RGB_RED(rgb) && !RGB_GREEN(rgb) && !RGB_BLUE(rgb);
109               bool opaque = !BIT(fgctl, 3);
116110
111               if (black || opaque)
112               {
113                  color += 128;
114   
115                  bitmap.pix16(y, x) = color;
116                  bitmap.pix16(y, x + 1) = color;
117
118                  bitmap.pix16(y + 1, x) = color;
119                  bitmap.pix16(y + 1, x + 1) = color;
120               }
121            }
122
117123            data <<= 2;
124            x += 2;
118125         }
119126      }
120127   }
r15725r15726
138145
139146
140147//-------------------------------------------------
148//  VIDEO_START( abc800c )
149//-------------------------------------------------
150
151void abc800c_state::video_start()
152{
153   abc800_state::video_start();
154
155   // initialize palette
156   palette_set_color_rgb(machine(), 128+0, 0x00, 0x00, 0x00); // black
157   palette_set_color_rgb(machine(), 128+1, 0xff, 0x00, 0x00); // red
158   palette_set_color_rgb(machine(), 128+2, 0x00, 0xff, 0x00); // green
159   palette_set_color_rgb(machine(), 128+3, 0xff, 0xff, 0x00); // yellow
160   palette_set_color_rgb(machine(), 128+4, 0x00, 0x00, 0xff); // blue
161   palette_set_color_rgb(machine(), 128+5, 0xff, 0x00, 0xff); // magenta
162   palette_set_color_rgb(machine(), 128+6, 0x00, 0xff, 0xff); // cyan
163   palette_set_color_rgb(machine(), 128+7, 0xff, 0xff, 0xff); // white
164}
165
166
167//-------------------------------------------------
141168//  SCREEN_UPDATE( abc800c )
142169//-------------------------------------------------
143170
r15725r15726
146173   // clear screen
147174   bitmap.fill(get_black_pen(machine()), cliprect);
148175
149   // draw HR graphics
150   hr_update(bitmap, cliprect);
151
176   // draw text
152177   if (!BIT(m_fgctl, 7))
153178   {
154      // draw text
155179      saa5050_update(m_trom, bitmap, cliprect);
156180   }
157181
182   saa5050_frame_advance(m_trom);
183
184   // draw HR graphics
185   hr_update(bitmap, cliprect);
186
158187   return 0;
159188}
160189
r15725r15726
180209   MCFG_SCREEN_ADD(SCREEN_TAG, RASTER)
181210   MCFG_SCREEN_UPDATE_DRIVER(abc800c_state, screen_update)
182211
183   MCFG_SCREEN_REFRESH_RATE(60)
212   MCFG_SCREEN_REFRESH_RATE(50)
184213   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
185   MCFG_SCREEN_SIZE(640, 480)
186   MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1)
214   MCFG_SCREEN_SIZE(480, 480)
215   MCFG_SCREEN_VISIBLE_AREA(0, 480-1, 0, 480-1)
187216
188   MCFG_PALETTE_LENGTH(128)
217   MCFG_PALETTE_LENGTH(128+8)
189218   MCFG_PALETTE_INIT(saa5050)
190219
191220   MCFG_GFXDECODE(saa5050)
r15725r15726
321350   // draw HR graphics
322351   hr_update(bitmap, cliprect);
323352
353   // draw text
324354   if (!BIT(m_fgctl, 7))
325355   {
326      // draw text
327356      m_crtc->screen_update(screen, bitmap, cliprect);
328357   }
329358
src/mess/video/abc806.c
r15725r15726
66
77/*
88
9    TODO:
9   TODO:
1010
11    - HRU II PROM reading
11   - HRU II PROM test
12   - flashing
13   - double height
14   - underline
1215
1316*/
1417
r15725r15726
4144
4245
4346//-------------------------------------------------
44//  abc806_hrs_w - high resolution memory banking
47//  hrs_w - high resolution memory banking
4548//-------------------------------------------------
4649
4750WRITE8_MEMBER( abc806_state::hrs_w )
r15725r15726
6669
6770
6871//-------------------------------------------------
69//  abc806_hrc_w - high resolution color write
72//  hrc_w - high resolution color write
7073//-------------------------------------------------
7174
7275WRITE8_MEMBER( abc806_state::hrc_w )
r15725r15726
7881
7982
8083//-------------------------------------------------
81//  abc806_charram_r - character RAM read
84//  charram_r - character RAM read
8285//-------------------------------------------------
8386
8487READ8_MEMBER( abc806_state::charram_r )
r15725r15726
9093
9194
9295//-------------------------------------------------
93//  abc806_charram_w - character RAM write
96//  charram_w - character RAM write
9497//-------------------------------------------------
9598
9699WRITE8_MEMBER( abc806_state::charram_w )
97100{
98101   m_color_ram[offset] = m_attr_data;
102   
99103   m_char_ram[offset] = data;
100104}
101105
102106
103107//-------------------------------------------------
104//  abc806_ami_r - attribute memory read
108//  ami_r - attribute memory read
105109//-------------------------------------------------
106110
107111READ8_MEMBER( abc806_state::ami_r )
r15725r15726
111115
112116
113117//-------------------------------------------------
114//  abc806_amo_w - attribute memory write
118//  amo_w - attribute memory write
115119//-------------------------------------------------
116120
117121WRITE8_MEMBER( abc806_state::amo_w )
r15725r15726
121125
122126
123127//-------------------------------------------------
124//  abc806_cli_r - palette PROM read
128//  cli_r - palette PROM read
125129//-------------------------------------------------
126130
127131READ8_MEMBER( abc806_state::cli_r )
r15725r15726
144148   UINT16 hru2_addr = (m_hru2_a8 << 8) | (offset >> 8);
145149   UINT8 data = m_hru2_prom[hru2_addr] & 0x0f;
146150
151   logerror("HRU II %03x : %01x\n", hru2_addr, data);
152
147153   data |= m_rtc->dio_r() << 7;
148154
149155   return data;
r15725r15726
151157
152158
153159//-------------------------------------------------
154//  abc806_sti_r - protection device read
160//  sti_r - protection device read
155161//-------------------------------------------------
156162
157163READ8_MEMBER( abc806_state::sti_r )
r15725r15726
176182
177183
178184//-------------------------------------------------
179//  abc806_sto_w -
185//  sto_w -
180186//-------------------------------------------------
181187
182188WRITE8_MEMBER( abc806_state::sto_w )
r15725r15726
221227
222228
223229//-------------------------------------------------
224//  abc806_sso_w - sync offset write
230//  sso_w - sync offset write
225231//-------------------------------------------------
226232
227233WRITE8_MEMBER( abc806_state::sso_w )
r15725r15726
513519   screen.set_visible_area(0, 767, 0, 311);
514520
515521   // clear screen
516   bitmap.fill(0, cliprect);
522   bitmap.fill(get_black_pen(machine()), cliprect);
517523
518524   if (!m_txoff)
519525   {
r15725r15726
541547   MCFG_SCREEN_REFRESH_RATE(60)
542548   MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500))
543549   MCFG_SCREEN_SIZE(768, 312)
544   MCFG_SCREEN_VISIBLE_AREA(0,768-1, 0, 312-1)
550   MCFG_SCREEN_VISIBLE_AREA(0, 768-1, 0, 312-1)
545551
546552   MCFG_PALETTE_LENGTH(8)
547553

Previous 15994 Revisions Next


© 1998-2018 The MESS Team