Previous 15994 Revisions Next

r5741 Wednesday 16th September, 2009 at 12:02:06 UTC by Dirk Best
[SAMCOUPE] Improved Mode 1 graphics.
[docs]messnew.txt
[src/mess/drivers]samcoupe.c
[src/mess/includes]samcoupe.h
[src/mess/video]samcoupe.c

src/mess/video/samcoupe.c
r5740r5741
129129static void draw_mode1_line(const device_config *screen, bitmap_t *bitmap, int y)
130130{
131131   coupe_asic *asic = screen->machine->driver_data;
132   int x, b;
133   UINT16 ink = 127, pap = 0;
134   UINT8 *attr = videoram + 32*192 + (y/8)*32;
132   int block, x = 0;
135133
136   int scrx = 0;
137   int scry = ((y & 7) * 8) + ((y & 0x38) >> 3) + (y & 0xc0);
134   /* get base address of attribute and data values */
135   UINT8 *attr = videoram + 32*192 + ((y & 0xf8) << 2);
136   UINT8 *data = videoram + (((y & 0xc0) << 5) | ((y & 0x07) << 8) | ((y & 0x38) << 2));
138137
139   for (x = 0; x < 256/8; x++)
138   /* loop over all 32 blocks */
139   for (block = 0; block < 32; block++)
140140   {
141      UINT8 tmp = *(videoram + x + (y*32));
141 int bit;
142142
143#ifndef MONO
144      ink = asic->clut[(*attr) & 0x07];
145      pap = asic->clut[((*attr)>>3) & 0x07];
146#endif
143        /* get current colors from attribute byte */
144        UINT8 ink = asic->clut[(*attr & 0x07) + ((*attr >> 3) & 0x08)];
145        UINT8 paper = asic->clut[(*attr >> 3) & 0x0f];
147146
148      attr++;
149
150      for (b = 0x80; b != 0; b>>= 1)
147        /* draw a block (8 pixels, doubled) */
148      for (bit = 0x80; bit != 0; bit >>= 1)
151149      {
152         *BITMAP_ADDR16(bitmap, scry, scrx++) = (tmp & b) ? ink : pap;
153         *BITMAP_ADDR16(bitmap, scry, scrx++) = (tmp & b) ? ink : pap;
150         *BITMAP_ADDR16(bitmap, y, x++) = (*data & bit) ? ink : paper;
151         *BITMAP_ADDR16(bitmap, y, x++) = (*data & bit) ? ink : paper;
154152      }
153
154      /* save current attribute */
155      asic->attribute = *attr;
156
157      /* move to the next block of values */
158      attr++;
159      data++;
155160   }
156161}
157162
r5740r5741
181186      case 3:   draw_mode4_line(screen, bitmap, scanline); break;
182187      }
183188   }
184
189//printf("videomode: %u\n", (asic->vmpr & 0x60) >> 5);
185190   return 0;
186191}
src/mess/includes/samcoupe.h
r5740r5741
3030   UINT8 line_int;         /* line interrupt */
3131   UINT8 status;           /* status register */
3232
33   /* attribute */
34   UINT8 attribute;
35
3336   /* mouse */
3437   int mouse_index;
3538   emu_timer *mouse_reset;
src/mess/drivers/samcoupe.c
r5740r5741
261261
262262static READ8_HANDLER( samcoupe_attributes_r )
263263{
264   coupe_asic *asic = space->machine->driver_data;
265
264266   if (video_screen_get_vblank(space->machine->primary_screen))
265   {
266      /* Border areas return 0xff */
267      return 0xff;
268   }
267      return 0xff; /* border areas return 0xff */
269268   else
270   {
271      /* TODO: This actually needs to return various attributes
272         * of the currently displayed screen data */
273      return 0x00;
274   }
269      return asic->attribute;
275270}
276271
277272static READ8_DEVICE_HANDLER( samcoupe_lpt1_busy_r )
docs/messnew.txt
r5740r5741
1010----------------------
1111- [SAMCOUPE] Added mouse support.  [Dirk Best]
1212
13- [SAMCOUPE] Improved Mode 1 graphics.  [Dirk Best]
1314
1415
16
1517User Interface Changes:
1618-----------------------
1719(none)

Previous 15994 Revisions Next


© 1998-2018 The MESS Team