Previous 15994 Revisions Next

r10690 Sunday 6th March, 2011 at 14:20:10 UTC by Curt Coder
[ABC1600] Implemented MC6845 row/column addressing mode.
[src/emu/video]mc6845.c
[src/mess/includes]abc1600.h
[src/mess/video]abc1600.c

src/emu/video/mc6845.c
r10689r10690
837837         INT8 cursor_x = cursor_visible ? (mc6845->cursor_addr - mc6845->current_disp_addr) : -1;
838838
839839         /* call the external system to draw it */
840         mc6845->intf->update_row(device, bitmap, cliprect, mc6845->current_disp_addr, ra, y, mc6845->horiz_disp, cursor_x, param);
840         if (MODE_ROW_COLUMN_ADDRESSING(mc6845))
841         {
842            UINT8 cc = 0;
843            UINT8 cr = y / (mc6845->max_ras_addr + 1);
844            UINT16 ma = (cr << 8) | cc;
841845
846            mc6845->intf->update_row(device, bitmap, cliprect, ma, ra, y, mc6845->horiz_disp, cursor_x, param);
847         }
848         else
849         {
850            mc6845->intf->update_row(device, bitmap, cliprect, mc6845->current_disp_addr, ra, y, mc6845->horiz_disp, cursor_x, param);
851         }
852
842853         /* update MA if the last raster address */
843854         if (ra == mc6845->max_ras_addr)
844855            mc6845->current_disp_addr = (mc6845->current_disp_addr + mc6845->horiz_disp) & 0x3fff;
src/mess/video/abc1600.c
r10689r10690
22
33    TODO:
44
5   - mc6845 row/column addressing mode
65   - position image based on vsync/hsync
76   - FRAME POL
87   - landscape/portrait mode
r10689r10690
111110
112111      UINT8 gmdo = m_video_ram[addr];
113112      UINT8 gmdi = m_gmdi & 0xff;
114      UINT8 mask = m_wrm & 0xff;
113      UINT8 mask = 0xff;//m_wrm & 0xff;
115114
116115      m_video_ram[addr] = (gmdi & mask) | (gmdo & (mask ^ 0xff));
117116
r10689r10690
134133
135134      UINT8 gmdo = m_video_ram[addr];
136135      UINT8 gmdi = m_gmdi >> 8;
137      UINT8 mask = m_wrm >> 8;
136      UINT8 mask = 0xff;//m_wrm >> 8;
138137
139138      m_video_ram[addr] = (gmdi & mask) | (gmdo & (mask ^ 0xff));
140139
r10689r10690
258257         bit      description
259258
260259         0      MOVE CYK CLK
261         1      DISP CYK PRE FETCH / DISP CYC SEL
260         1      DISP CYC SEL / DISP CYK PRE FETCH (+1 PIXCLK)
262261         2      DATA CLK
263262         3      _DISP MEM WE
264263         4      _CAS HB
265         5      DTACK CLK
264         5      DTACK CLK / BLANK TEST (+2 PIXCLK)
266265         6      DISPREC CLK
267266         7      _RAS HB
268267
r10689r10690
282281         bit      description
283282
284283         0      MOVE CYK CLK
285         1      DISP CYK PRE FETCH / DISP CYC SEL
284         1      DISP CYC SEL / DISP CYK PRE FETCH (+1 PIXCLK)
286285         2      DATA CLK
287286         3      _DISP MEM WE
288287         4      _CAS HB
289         5      DTACK CLK
288         5      DTACK CLK / BLANK TEST (+2 PIXCLK)
290289         6      DISPREC CLK
291290         7      _RAS HB
292291
r10689r10690
391390
392391      CRTCA0      0
393392      CRTCA1      0
394      CRTCA2      MA1
395      CRTCA3      MA2
396      CRTCA4      MA3
397      CRTCA5      MA4
393      CRTCA2      CC1/MA1
394      CRTCA3      CC2/MA2
395      CRTCA4      CC3/MA3
396      CRTCA5      CC4/MA4
398397      CRTCA6      RA0
399398      CRTCA7      RA1
400399      CRTCA8      RA2
401400      CRTCA9      RA3
402      CRTCA10      MA8
403      CRTCA11      MA9
404      CRTCA12      MA10
405      CRTCA13      MA11
406      CRTCA14      MA12
407      CRTCA15      MA13
401      CRTCA10      CR0/MA8
402      CRTCA11      CR1/MA9
403      CRTCA12      CR2/MA10
404      CRTCA13      CR3/MA11
405      CRTCA14      CR4/MA12
406      CRTCA15      CR5/MA13
408407
409408   */
410409
411   UINT16 new_ma = ma + (column * 2);
410   UINT8 cc = (ma & 0xff) + column;
411   UINT8 cr = ma >> 8;
412412
413   return ((new_ma << 2) & 0xfc00) | (ra & 0x0f) << 6 | ((new_ma << 1) & 0x3c);
413   return (cr << 10) | ((ra & 0x0f) << 6) | ((cc << 1) & 0x3c);
414414}
415415
416416void abc1600_state::crtc_update_row(device_t *device, bitmap_t *bitmap, const rectangle *cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
417417{
418   for (int column = 0; column < x_count; column++)
418   int x = 0;
419
420   for (int column = 0; column < x_count; column += 2)
419421   {
420422      UINT16 dma = get_crtca(ma, ra, column);
421      UINT16 gmdo = (m_video_ram[dma] << 8) | m_video_ram[dma + 1];
422423
423      //logerror("Y %u col %u DMA %04x:%04x\n", y, column, dma, gmdo);
424
425      for (int bit = 0; bit < 16; bit++)
424      // data is read out of video RAM in nibble mode by strobing CAS 4 times
425      for (int cas = 0; cas < 4; cas++)
426426      {
427         int x = (column * 16) + bit;
428         int color = (BIT(gmdo, 15) ^ PIX_POL) & !BLANK;
427         UINT8 data = m_video_ram[dma + cas];
428         
429         for (int bit = 0; bit < 8; bit++)
430         {
431            int color = (BIT(data, 7) ^ PIX_POL) & !BLANK;
429432
430         *BITMAP_ADDR16(bitmap, y, x) = color;
433            *BITMAP_ADDR16(bitmap, y, x++) = color;
431434         
432         gmdo <<= 1;
435            data <<= 1;
436         }
433437      }
434438   }
435439}
r10689r10690
452456static const mc6845_interface crtc_intf =
453457{
454458   SCREEN_TAG,
455   8,
459   32,
456460   NULL,
457461   abc1600_update_row,
458462   NULL,
r10689r10690
472476{
473477   // allocate video RAM
474478   m_video_ram = auto_alloc_array(machine, UINT8, VIDEORAM_SIZE);
479   memset(m_video_ram, 0, VIDEORAM_SIZE);
475480
476481   // state saving
477482   save_pointer(NAME(m_video_ram), VIDEORAM_SIZE);
src/mess/includes/abc1600.h
r10689r10690
166166   int m_vs;               // vertical sync
167167   UINT16 m_gmdi;            // video RAM data latch
168168   UINT16 m_wrm;            // write mask latch
169   UINT8 m_ms[16];            //
170   UINT8 m_ds[16];            //
169   UINT8 m_ms[16];            // mover sequence control
170   UINT8 m_ds[16];            // display sequence control
171171   UINT8 m_flag;            // flags
172172   UINT16 m_sx;            // X size
173173   UINT16 m_sy;            // Y size

Previous 15994 Revisions Next


© 1998-2018 The MESS Team