Previous 15994 Revisions Next

r2067 Saturday 22nd March, 2008 at 18:16:00 UTC by Nathan Woods
Updated MC6845 code from MAMEDEV
[src/emu/video]mc6845.c mc6845.h

src/emu/video/mc6845.c
r2066r2067
3232/* device types */
3333enum
3434{
35   TYPE_MC6845,
35   TYPE_MC6845 = 0,
3636   TYPE_MC6845_1,
3737   TYPE_C6545_1,
3838   TYPE_R6545_1,
r2066r2067
7979   UINT16   light_pen_addr;      /* 0x10/0x11 */
8080
8181   /* other internal state */
82   UINT64   clock;
8283   UINT8   register_address_latch;
8384   UINT8   cursor_state;   /* 0 = off, 1 = on */
8485   UINT8   cursor_blink_count;
r2066r2067
119120   assert(device != NULL);
120121   assert(device->token != NULL);
121122   assert((device->type == DEVICE_GET_INFO_NAME(mc6845)) ||
123         (device->type == DEVICE_GET_INFO_NAME(mc6845_1)) ||
122124         (device->type == DEVICE_GET_INFO_NAME(c6545_1)) ||
123         (device->type == DEVICE_GET_INFO_NAME(r6545_1)));
125         (device->type == DEVICE_GET_INFO_NAME(r6545_1)) ||
126         (device->type == DEVICE_GET_INFO_NAME(h46505)) ||
127         (device->type == DEVICE_GET_INFO_NAME(hd6845)) ||
128         (device->type == DEVICE_GET_INFO_NAME(sy6545_1)));
124129
125130   return (mc6845_t *)device->token;
126131}
r2066r2067
268273         {
269274            rectangle visarea;
270275
271            attoseconds_t refresh = HZ_TO_ATTOSECONDS(mc6845->intf->clock) * (mc6845->horiz_char_total + 1) * vert_pix_total;
276            attoseconds_t refresh = HZ_TO_ATTOSECONDS(mc6845->clock) * (mc6845->horiz_char_total + 1) * vert_pix_total;
272277
273278            visarea.min_x = 0;
274279            visarea.min_y = 0;
r2066r2067
544549}
545550
546551
552void mc6845_set_clock(const device_config *device, int clock)
553{
554   mc6845_t *mc6845 = get_safe_token(device);
555
556   /* validate arguments */
557   assert(clock > 0);
558
559   if (clock != mc6845->clock)
560   {
561      mc6845->clock = clock;
562      recompute_parameters(mc6845, FALSE);
563   }
564}
565
566
547567static void update_cursor_state(mc6845_t *mc6845)
548568{
549569   /* save and increment cursor counter */
r2066r2067
657677      assert(mc6845->intf->clock > 0);
658678      assert(mc6845->intf->hpixels_per_column > 0);
659679
680      /* copy the initial clock */
681      mc6845->clock = mc6845->intf->clock;
682
660683      /* get the screen device */
661684      mc6845->screen = device_list_find_by_tag(device->machine->config->devicelist, VIDEO_SCREEN, mc6845->intf->screen_tag);
662685      assert(mc6845->screen != NULL);
r2066r2067
685708
686709   state_save_register_func_postload_ptr(mc6845_state_save_postload, mc6845);
687710
711   state_save_register_item(unique_tag, 0, mc6845->clock);
688712   state_save_register_item(unique_tag, 0, mc6845->register_address_latch);
689713   state_save_register_item(unique_tag, 0, mc6845->horiz_char_total);
690714   state_save_register_item(unique_tag, 0, mc6845->horiz_disp);
src/emu/video/mc6845.h
r2066r2067
107107/* simulates the LO->HI clocking of the light pen pin (pin 3) */
108108void mc6845_assert_light_pen_input(const device_config *device);
109109
110/* set the clock (pin 21) of the chip */
111void mc6845_set_clock(const device_config *device, int clock);
112
110113/* updates the screen -- this will call begin_update(),
111114   followed by update_row() reapeatedly and after all row
112115   updating is complete, end_update() */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team