Previous 199869 Revisions Next

r34836 Wednesday 4th February, 2015 at 17:20:43 UTC by MetalliC
(MESS) spectrum.c partial screen updates

note: for now hooked only at 128k screen page flip
[src/mess/drivers]pentagon.c spec128.c
[src/mess/video]spectrum.c

trunk/src/mess/drivers/pentagon.c
r243347r243348
120120   if (m_port_7ffd_data & 0x20)
121121      return;
122122
123   if ((m_port_7ffd_data ^ data) & 0x08)
124      spectrum_UpdateBorderBitmap();
125
123126   /* store new state */
124127   m_port_7ffd_data = data;
125128
trunk/src/mess/drivers/spec128.c
r243347r243348
172172   if (m_port_7ffd_data & 0x20)
173173         return;
174174
175   if ((m_port_7ffd_data ^ data) & 0x08)
176      spectrum_UpdateBorderBitmap();
177
175178   /* store new state */
176179   m_port_7ffd_data = data;
177180
trunk/src/mess/video/spectrum.c
r243347r243348
3939
4040   m_previous_border_x = 0; m_previous_border_y = 0;
4141   machine().first_screen()->register_screen_bitmap(m_border_bitmap);
42
43   m_screen_location = m_ram->pointer() + (5 << 14);
4244}
4345
4446
r243347r243348
5860   // rising edge
5961   if (state)
6062   {
63      spectrum_UpdateBorderBitmap();
64
6165      m_frame_number++;
6266
6367      if (m_frame_number >= m_frame_invert_count)
r243347r243348
6569         m_frame_number = 0;
6670         m_flash_invert = !m_flash_invert;
6771      }
68
69
70      spectrum_UpdateBorderBitmap();
7172   }
7273}
7374
r243347r243348
103104
104105UINT32 spectrum_state::screen_update_spectrum(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
105106{
107   if (m_border_bitmap.valid())
108      copyscrollbitmap(bitmap, m_border_bitmap, 0, 0, 0, 0, cliprect);
109
110#if 0
106111   // note, don't update borders in here, this can time travel w/regards to other timers and may end up giving you
107112   // screen positions earlier than the last write handler gave you
108113
r243347r243348
112117   unsigned char *attr, *scr;
113118   //  int full_refresh = 1;
114119
115   if (m_border_bitmap.valid())
116      copyscrollbitmap(bitmap, m_border_bitmap, 0, 0, 0, 0, cliprect);
117
118120   scr=m_screen_location;
119121
120122   for (y=0; y<192; y++)
r243347r243348
149151         attr++;
150152      }
151153   }
154#endif
152155
153156   return 0;
154157}
r243347r243348
191194
192195   if (m_border_bitmap.valid())
193196   {
194      int colour = m_port_fe_data & 0x07;
197      UINT16 border = m_port_fe_data & 0x07;
195198
196199      //printf("update border from %d,%d to %d,%d\n", m_previous_border_x, m_previous_border_y, x, y);
197200
198201      do
199202      {
200         UINT16* bm = &m_border_bitmap.pix16(m_previous_border_y);
201         bm[m_previous_border_x] = colour;
203         UINT16 scrx = m_previous_border_x - SPEC_LEFT_BORDER;
204         UINT16 scry = m_previous_border_y - SPEC_TOP_BORDER;
202205
206         if (scrx < SPEC_DISPLAY_XSIZE && scry < SPEC_DISPLAY_YSIZE)
207         {
208            // this can/must be optimised
209            if ((scrx & 7) == 0) {
210               UINT16 *bm = &m_border_bitmap.pix16(m_previous_border_y, m_previous_border_x);
211               UINT8 attr = *(m_screen_location + ((scry & 0xF8) << 2) + (scrx >> 3) + 0x1800);
212               UINT8 scr = *(m_screen_location + ((scry & 7) << 8) + ((scry & 0x38) << 2) + ((scry & 0xC0) << 5) + (scrx >> 3));
213               UINT16 ink = (attr & 0x07) + ((attr >> 3) & 0x08);
214               UINT16 pap = (attr >> 3) & 0x0f;
215
216               if (m_flash_invert && (attr & 0x80))
217                  scr = ~scr;
218
219               for (UINT8 b = 0x80; b != 0; b >>= 1)
220                  *bm++ = (scr & b) ? ink : pap;
221            }
222         } else
223            m_border_bitmap.pix16(m_previous_border_y, m_previous_border_x) = border;
224
203225         m_previous_border_x += 1;
204226
205227         if (m_previous_border_x >= width)


Previous 199869 Revisions Next


© 1997-2024 The MAME Team