/[gxemul]/upstream/0.4.5.1/src/devices/dev_vga.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /upstream/0.4.5.1/src/devices/dev_vga.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 18 by dpavlin, Mon Oct 8 16:19:11 2007 UTC revision 24 by dpavlin, Mon Oct 8 16:19:56 2007 UTC
# Line 1  Line 1 
1  /*  /*
2   *  Copyright (C) 2004-2005  Anders Gavare.  All rights reserved.   *  Copyright (C) 2004-2006  Anders Gavare.  All rights reserved.
3   *   *
4   *  Redistribution and use in source and binary forms, with or without   *  Redistribution and use in source and binary forms, with or without
5   *  modification, are permitted provided that the following conditions are met:   *  modification, are permitted provided that the following conditions are met:
# Line 25  Line 25 
25   *  SUCH DAMAGE.   *  SUCH DAMAGE.
26   *     *  
27   *   *
28   *  $Id: dev_vga.c,v 1.86 2005/10/27 14:01:14 debug Exp $   *  $Id: dev_vga.c,v 1.99 2006/06/16 18:31:26 debug Exp $
29   *   *
30   *  VGA charcell and graphics device.   *  VGA charcell and graphics device.
31   *   *
# Line 53  Line 53 
53    
54    
55  /*  For videomem -> framebuffer updates:  */  /*  For videomem -> framebuffer updates:  */
56  #define VGA_TICK_SHIFT          19  #define VGA_TICK_SHIFT          18
57    
58  #define MAX_RETRACE_SCANLINES   420  #define MAX_RETRACE_SCANLINES   420
59  #define N_IS1_READ_THRESHOLD    50  #define N_IS1_READ_THRESHOLD    50
# Line 73  struct vga_data { Line 73  struct vga_data {
73          uint64_t        control_base;          uint64_t        control_base;
74    
75          struct vfb_data *fb;          struct vfb_data *fb;
76          size_t          fb_size;          uint32_t        fb_size;
77    
78          int             fb_max_x;               /*  pixels  */          int             fb_max_x;               /*  pixels  */
79          int             fb_max_y;               /*  pixels  */          int             fb_max_y;               /*  pixels  */
# Line 99  struct vga_data { Line 99  struct vga_data {
99          int             graphics_mode;          int             graphics_mode;
100          int             bits_per_pixel;          int             bits_per_pixel;
101          unsigned char   *gfx_mem;          unsigned char   *gfx_mem;
102          size_t          gfx_mem_size;          uint32_t        gfx_mem_size;
103    
104          /*  Registers:  */          /*  Registers:  */
105          int             attribute_state;        /*  0 or 1  */          int             attribute_state;        /*  0 or 1  */
# Line 137  struct vga_data { Line 137  struct vga_data {
137          int             cursor_y;          int             cursor_y;
138    
139          int             modified;          int             modified;
140            int             palette_modified;
141          int             update_x1;          int             update_x1;
142          int             update_y1;          int             update_y1;
143          int             update_x2;          int             update_x2;
# Line 207  static void reset_palette(struct vga_dat Line 208  static void reset_palette(struct vga_dat
208          for (i=16; i<256; i++)          for (i=16; i<256; i++)
209                  d->fb->rgb_palette[i*3 + 0] = d->fb->rgb_palette[i*3 + 1] =                  d->fb->rgb_palette[i*3 + 0] = d->fb->rgb_palette[i*3 + 1] =
210                      d->fb->rgb_palette[i*3 + 2] = (i & 15) * 4;                      d->fb->rgb_palette[i*3 + 2] = (i & 15) * 4;
211            d->palette_modified = 1;
212          i = 0;          i = 0;
213    
214          if (grayscale) {          if (grayscale) {
# Line 360  static void vga_update_graphics(struct m Line 361  static void vga_update_graphics(struct m
361                          }                          }
362                          for (iy=y*ry; iy<(y+1)*ry; iy++)                          for (iy=y*ry; iy<(y+1)*ry; iy++)
363                                  for (ix=x*rx; ix<(x+1)*rx; ix++) {                                  for (ix=x*rx; ix<(x+1)*rx; ix++) {
364                                          int addr2 = (d->fb_max_x * iy + ix) * 3;                                          uint32_t addr2 = (d->fb_max_x * iy
365                                                + ix) * 3;
366                                          if (addr2 < d->fb_size)                                          if (addr2 < d->fb_size)
367                                                  dev_fb_access(machine->cpus[0],                                                  dev_fb_access(machine->cpus[0],
368                                                      machine->memory, addr2,                                                      machine->memory, addr2,
# Line 381  static void vga_update_graphics(struct m Line 383  static void vga_update_graphics(struct m
383  static void vga_update_text(struct machine *machine, struct vga_data *d,  static void vga_update_text(struct machine *machine, struct vga_data *d,
384          int x1, int y1, int x2, int y2)          int x1, int y1, int x2, int y2)
385  {  {
386          int fg, bg, i, x,y, subx, line, start, end, base;          int fg, bg, x,y, subx, line;
387            size_t i, start, end, base;
388          int font_size = d->font_height;          int font_size = d->font_height;
389          int font_width = d->font_width;          int font_width = d->font_width;
390          unsigned char *pal = d->fb->rgb_palette;          unsigned char *pal = d->fb->rgb_palette;
391    
392            if (d->pixel_repx * font_width > 8*8) {
393                    fatal("[ too large font ]\n");
394                    return;
395            }
396    
397          /*  Hm... I'm still using the old start..end code:  */          /*  Hm... I'm still using the old start..end code:  */
398          start = (d->max_x * y1 + x1) * 2;          start = (d->max_x * y1 + x1) * 2;
399          end   = (d->max_x * y2 + x2) * 2;          end   = (d->max_x * y2 + x2) * 2;
# Line 405  static void vga_update_text(struct machi Line 413  static void vga_update_text(struct machi
413          for (i=start; i<=end; i+=2) {          for (i=start; i<=end; i+=2) {
414                  unsigned char ch = d->charcells[i + base];                  unsigned char ch = d->charcells[i + base];
415    
416                  if (d->charcells_drawn[i] == ch &&                  if (!d->palette_modified && d->charcells_drawn[i] == ch &&
417                      d->charcells_drawn[i+1] == d->charcells[i+base+1])                      d->charcells_drawn[i+1] == d->charcells[i+base+1])
418                          continue;                          continue;
419    
# Line 425  static void vga_update_text(struct machi Line 433  static void vga_update_text(struct machi
433    
434                  /*  Draw the character:  */                  /*  Draw the character:  */
435                  for (line = 0; line < font_size; line++) {                  for (line = 0; line < font_size; line++) {
436                            /*  hardcoded for max 8 scaleup... :-)  */
437                            unsigned char rgb_line[3 * 8 * 8];
438                            int iy;
439    
440                          for (subx = 0; subx < font_width; subx++) {                          for (subx = 0; subx < font_width; subx++) {
441                                  int ix, iy, color_index;                                  int ix, color_index;
442    
443                                  if (d->use_palette_per_line) {                                  if (d->use_palette_per_line) {
444                                          int sline = d->pixel_repy * (line+y);                                          int sline = d->pixel_repy * (line+y);
# Line 443  static void vga_update_text(struct machi Line 455  static void vga_update_text(struct machi
455                                  else                                  else
456                                          color_index = bg;                                          color_index = bg;
457    
458                                  for (iy=0; iy<d->pixel_repy; iy++)                                  for (ix=0; ix<d->pixel_repx; ix++)
459                                      for (ix=0; ix<d->pixel_repx; ix++) {                                          memcpy(rgb_line + (subx*d->pixel_repx +
460                                          int addr = (d->fb_max_x* (d->pixel_repy                                              ix) * 3, &pal[color_index * 3], 3);
461                                              * (line+y) + iy) + (x+subx) *                          }
                                             d->pixel_repx + ix) * 3;  
462    
463                                          if (addr >= d->fb_size)                          for (iy=0; iy<d->pixel_repy; iy++) {
464                                                  continue;                                  uint32_t addr = (d->fb_max_x * (d->pixel_repy *
465                                          dev_fb_access(machine->cpus[0],                                      (line+y) + iy) + x * d->pixel_repx) * 3;
466                                              machine->memory, addr,                                  if (addr >= d->fb_size)
467                                              &pal[color_index * 3], 3,                                          continue;
468                                              MEM_WRITE, d->fb);                                  dev_fb_access(machine->cpus[0],
469                                      }                                      machine->memory, addr, rgb_line,
470                                        3 * machine->x11_scaleup * font_width,
471                                        MEM_WRITE, d->fb);
472                          }                          }
473                  }                  }
474          }          }
# Line 508  void dev_vga_tick(struct cpu *cpu, void Line 521  void dev_vga_tick(struct cpu *cpu, void
521                  int base = ((d->crtc_reg[VGA_CRTC_START_ADDR_HIGH] << 8)                  int base = ((d->crtc_reg[VGA_CRTC_START_ADDR_HIGH] << 8)
522                      + d->crtc_reg[VGA_CRTC_START_ADDR_LOW]) * 2;                      + d->crtc_reg[VGA_CRTC_START_ADDR_LOW]) * 2;
523                  int new_u_y1, new_u_y2;                  int new_u_y1, new_u_y2;
524                  debug("[ dev_vga_tick: dyntrans access, %llx .. %llx ]\n",                  debug("[ dev_vga_tick: dyntrans access, %"PRIx64" .. %"
525                      (long long)low, (long long)high);                      PRIx64" ]\n", (uint64_t) low, (uint64_t) high);
526                  low -= base;                  low -= base;
527                  high -= base;                  high -= base;
528                  d->update_x1 = 0;                  d->update_x1 = 0;
# Line 560  void dev_vga_tick(struct cpu *cpu, void Line 573  void dev_vga_tick(struct cpu *cpu, void
573                          vga_update_graphics(cpu->machine, d, d->update_x1,                          vga_update_graphics(cpu->machine, d, d->update_x1,
574                              d->update_y1, d->update_x2, d->update_y2);                              d->update_y1, d->update_x2, d->update_y2);
575    
576                    d->palette_modified = 0;
577                  d->modified = 0;                  d->modified = 0;
578                  d->update_x1 = 999999;                  d->update_x1 = 999999;
579                  d->update_x2 = -1;                  d->update_x2 = -1;
# Line 577  void dev_vga_tick(struct cpu *cpu, void Line 591  void dev_vga_tick(struct cpu *cpu, void
591   *   *
592   *  Reads and writes to the VGA video memory (pixels).   *  Reads and writes to the VGA video memory (pixels).
593   */   */
594  int dev_vga_graphics_access(struct cpu *cpu, struct memory *mem,  DEVICE_ACCESS(vga_graphics)
         uint64_t relative_addr, unsigned char *data, size_t len,  
         int writeflag, void *extra)  
595  {  {
596          struct vga_data *d = extra;          struct vga_data *d = extra;
597          int i,j, x=0, y=0, x2=0, y2=0, modified = 0;          int j, x=0, y=0, x2=0, y2=0, modified = 0;
598            size_t i;
599    
600          if (relative_addr + len >= GFX_ADDR_WINDOW)          if (relative_addr + len >= GFX_ADDR_WINDOW)
601                  return 0;                  return 0;
# Line 619  int dev_vga_graphics_access(struct cpu * Line 632  int dev_vga_graphics_access(struct cpu *
632                                          int b = data[i] & pixelmask;                                          int b = data[i] & pixelmask;
633                                          int m = d->sequencer_reg[                                          int m = d->sequencer_reg[
634                                              VGA_SEQ_MAP_MASK] & 0x0f;                                              VGA_SEQ_MAP_MASK] & 0x0f;
635                                          int addr = (y * d->max_x + x + i*8 + j)                                          uint32_t addr = (y * d->max_x + x +
636                                              * d->bits_per_pixel / 8;                                              i*8 + j) * d->bits_per_pixel / 8;
637                                          unsigned char byte;                                          unsigned char byte;
638                                          if (!(d->graphcontr_reg[                                          if (!(d->graphcontr_reg[
639                                              VGA_GRAPHCONTR_MASK] & pixelmask))                                              VGA_GRAPHCONTR_MASK] & pixelmask))
# Line 675  int dev_vga_graphics_access(struct cpu * Line 688  int dev_vga_graphics_access(struct cpu *
688   *   *
689   *  Reads and writes to the VGA video memory (charcells).   *  Reads and writes to the VGA video memory (charcells).
690   */   */
691  int dev_vga_access(struct cpu *cpu, struct memory *mem, uint64_t relative_addr,  DEVICE_ACCESS(vga)
         unsigned char *data, size_t len, int writeflag, void *extra)  
692  {  {
693          struct vga_data *d = extra;          struct vga_data *d = extra;
694          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
695          int i, x, y, x2, y2, r, base;          int x, y, x2, y2, r, base;
696            size_t i;
697    
698          if (writeflag == MEM_WRITE)          if (writeflag == MEM_WRITE)
699                  idata = memory_readmax64(cpu, data, len);                  idata = memory_readmax64(cpu, data, len);
# Line 777  static void vga_crtc_reg_write(struct ma Line 790  static void vga_crtc_reg_write(struct ma
790                  case 0x01:                  case 0x01:
791                          d->cur_mode = MODE_CHARCELL;                          d->cur_mode = MODE_CHARCELL;
792                          d->max_x = 40; d->max_y = 25;                          d->max_x = 40; d->max_y = 25;
793                          d->pixel_repx = 2; d->pixel_repy = 1;                          d->pixel_repx = machine->x11_scaleup * 2;
794                            d->pixel_repy = machine->x11_scaleup;
795                          d->font_width = 8;                          d->font_width = 8;
796                          d->font_height = 16;                          d->font_height = 16;
797                          d->font = font8x16;                          d->font = font8x16;
# Line 787  static void vga_crtc_reg_write(struct ma Line 801  static void vga_crtc_reg_write(struct ma
801                  case 0x03:                  case 0x03:
802                          d->cur_mode = MODE_CHARCELL;                          d->cur_mode = MODE_CHARCELL;
803                          d->max_x = 80; d->max_y = 25;                          d->max_x = 80; d->max_y = 25;
804                          d->pixel_repx = d->pixel_repy = 1;                          d->pixel_repx = d->pixel_repy = machine->x11_scaleup;
805                          d->font_width = 8;                          d->font_width = 8;
806                          d->font_height = 16;                          d->font_height = 16;
807                          d->font = font8x16;                          d->font = font8x16;
# Line 797  static void vga_crtc_reg_write(struct ma Line 811  static void vga_crtc_reg_write(struct ma
811                          d->max_x = 160; d->max_y = 200;                          d->max_x = 160; d->max_y = 200;
812                          d->graphics_mode = GRAPHICS_MODE_4BIT;                          d->graphics_mode = GRAPHICS_MODE_4BIT;
813                          d->bits_per_pixel = 4;                          d->bits_per_pixel = 4;
814                          d->pixel_repx = 4;                          d->pixel_repx = 4 * machine->x11_scaleup;
815                          d->pixel_repy = 2;                          d->pixel_repy = 2 * machine->x11_scaleup;
816                          break;                          break;
817                  case 0x09:                  case 0x09:
818                  case 0x0d:                  case 0x0d:
# Line 806  static void vga_crtc_reg_write(struct ma Line 820  static void vga_crtc_reg_write(struct ma
820                          d->max_x = 320; d->max_y = 200;                          d->max_x = 320; d->max_y = 200;
821                          d->graphics_mode = GRAPHICS_MODE_4BIT;                          d->graphics_mode = GRAPHICS_MODE_4BIT;
822                          d->bits_per_pixel = 4;                          d->bits_per_pixel = 4;
823                          d->pixel_repx = d->pixel_repy = 2;                          d->pixel_repx = d->pixel_repy =
824                                2 * machine->x11_scaleup;
825                          break;                          break;
826                  case 0x0e:                  case 0x0e:
827                          d->cur_mode = MODE_GRAPHICS;                          d->cur_mode = MODE_GRAPHICS;
828                          d->max_x = 640; d->max_y = 200;                          d->max_x = 640; d->max_y = 200;
829                          d->graphics_mode = GRAPHICS_MODE_4BIT;                          d->graphics_mode = GRAPHICS_MODE_4BIT;
830                          d->bits_per_pixel = 4;                          d->bits_per_pixel = 4;
831                          d->pixel_repx = 1;                          d->pixel_repx = machine->x11_scaleup;
832                          d->pixel_repy = 2;                          d->pixel_repy = machine->x11_scaleup * 2;
833                          break;                          break;
834                  case 0x10:                  case 0x10:
835                          d->cur_mode = MODE_GRAPHICS;                          d->cur_mode = MODE_GRAPHICS;
836                          d->max_x = 640; d->max_y = 350;                          d->max_x = 640; d->max_y = 350;
837                          d->graphics_mode = GRAPHICS_MODE_4BIT;                          d->graphics_mode = GRAPHICS_MODE_4BIT;
838                          d->bits_per_pixel = 4;                          d->bits_per_pixel = 4;
839                          d->pixel_repx = d->pixel_repy = 1;                          d->pixel_repx = d->pixel_repy = machine->x11_scaleup;
840                          break;                          break;
841                  case 0x12:                  case 0x12:
842                          d->cur_mode = MODE_GRAPHICS;                          d->cur_mode = MODE_GRAPHICS;
843                          d->max_x = 640; d->max_y = 480;                          d->max_x = 640; d->max_y = 480;
844                          d->graphics_mode = GRAPHICS_MODE_4BIT;                          d->graphics_mode = GRAPHICS_MODE_4BIT;
845                          d->bits_per_pixel = 4;                          d->bits_per_pixel = 4;
846                          d->pixel_repx = d->pixel_repy = 1;                          d->pixel_repx = d->pixel_repy = machine->x11_scaleup;
847                          break;                          break;
848                  case 0x13:                  case 0x13:
849                          d->cur_mode = MODE_GRAPHICS;                          d->cur_mode = MODE_GRAPHICS;
850                          d->max_x = 320; d->max_y = 200;                          d->max_x = 320; d->max_y = 200;
851                          d->graphics_mode = GRAPHICS_MODE_8BIT;                          d->graphics_mode = GRAPHICS_MODE_8BIT;
852                          d->bits_per_pixel = 8;                          d->bits_per_pixel = 8;
853                          d->pixel_repx = d->pixel_repy = 2;                          d->pixel_repx = d->pixel_repy =
854                                2 * machine->x11_scaleup;
855                          break;                          break;
856                  default:                  default:
857                          fatal("TODO! video mode change hack (mode 0x%02x)\n",                          fatal("TODO! video mode change hack (mode 0x%02x)\n",
# Line 891  static void vga_sequencer_reg_write(stru Line 907  static void vga_sequencer_reg_write(stru
907          int regnr, int idata)          int regnr, int idata)
908  {  {
909          switch (regnr) {          switch (regnr) {
910          case VGA_SEQ_MAP_MASK:          /*  0x02  */          case VGA_SEQ_RESET:
911            case VGA_SEQ_MAP_MASK:
912            case VGA_SEQ_SEQUENCER_MEMORY_MODE:
913                    debug("[ vga_sequencer_reg_write: select %i: TODO ]\n", regnr);
914                  break;                  break;
915          default:fatal("[ vga_sequencer_reg_write: select %i ]\n", regnr);          default:fatal("[ vga_sequencer_reg_write: select %i ]\n", regnr);
916                  /*  cpu->running = 0;  */                  /*  cpu->running = 0;  */
# Line 908  static void vga_graphcontr_reg_write(str Line 927  static void vga_graphcontr_reg_write(str
927          struct vga_data *d, int regnr, int idata)          struct vga_data *d, int regnr, int idata)
928  {  {
929          switch (regnr) {          switch (regnr) {
930          case VGA_GRAPHCONTR_MASK:               /*  0x08  */          case VGA_GRAPHCONTR_READMAPSELECT:
931            case VGA_GRAPHCONTR_GRAPHICSMODE:
932            case VGA_GRAPHCONTR_MISC:
933            case VGA_GRAPHCONTR_MASK:
934                    debug("[ vga_graphcontr_reg_write: select %i: TODO ]\n", regnr);
935                  break;                  break;
936          default:fatal("[ vga_graphcontr_reg_write: select %i ]\n", regnr);          default:fatal("[ vga_graphcontr_reg_write: select %i ]\n", regnr);
937                  /*  cpu->running = 0;  */                  /*  cpu->running = 0;  */
# Line 940  static void vga_attribute_reg_write(stru Line 963  static void vga_attribute_reg_write(stru
963   *   *
964   *  Reads and writes of the VGA control registers.   *  Reads and writes of the VGA control registers.
965   */   */
966  int dev_vga_ctrl_access(struct cpu *cpu, struct memory *mem,  DEVICE_ACCESS(vga_ctrl)
         uint64_t relative_addr, unsigned char *data, size_t len,  
         int writeflag, void *extra)  
967  {  {
968          struct vga_data *d = extra;          struct vga_data *d = extra;
969          int i;          size_t i;
970          uint64_t idata = 0, odata = 0;          uint64_t idata = 0, odata = 0;
971    
972          for (i=0; i<len; i++) {          for (i=0; i<len; i++) {
# Line 1050  int dev_vga_ctrl_access(struct cpu *cpu, Line 1071  int dev_vga_ctrl_access(struct cpu *cpu,
1071                                      palette changed:  */                                      palette changed:  */
1072                                  if (new != old) {                                  if (new != old) {
1073                                          d->modified = 1;                                          d->modified = 1;
1074                                            d->palette_modified = 1;
1075                                          d->update_x1 = d->update_y1 = 0;                                          d->update_x1 = d->update_y1 = 0;
1076                                          d->update_x2 = d->max_x - 1;                                          d->update_x2 = d->max_x - 1;
1077                                          d->update_y2 = d->max_y - 1;                                          d->update_y2 = d->max_y - 1;
# Line 1173  void dev_vga_init(struct machine *machin Line 1195  void dev_vga_init(struct machine *machin
1195          uint64_t videomem_base, uint64_t control_base, char *name)          uint64_t videomem_base, uint64_t control_base, char *name)
1196  {  {
1197          struct vga_data *d;          struct vga_data *d;
1198          int i;          size_t i;
1199          size_t allocsize;          size_t allocsize;
1200    
1201          d = malloc(sizeof(struct vga_data));          d = malloc(sizeof(struct vga_data));
# Line 1183  void dev_vga_init(struct machine *machin Line 1205  void dev_vga_init(struct machine *machin
1205          }          }
1206          memset(d, 0, sizeof(struct vga_data));          memset(d, 0, sizeof(struct vga_data));
1207    
1208          d->console_handle = console_start_slave(machine, name);          d->console_handle = console_start_slave(machine, "vga",
1209                CONSOLE_OUTPUT_ONLY);
1210    
1211          d->videomem_base  = videomem_base;          d->videomem_base  = videomem_base;
1212          d->control_base   = control_base;          d->control_base   = control_base;
1213          d->max_x          = 80;          d->max_x          = 80;
1214          d->max_y          = 25;          d->max_y          = 25;
         d->pixel_repx     = 1;  
         d->pixel_repy     = 1;  
1215          d->cur_mode       = MODE_CHARCELL;          d->cur_mode       = MODE_CHARCELL;
1216          d->crtc_reg[0xff] = 0x03;          d->crtc_reg[0xff] = 0x03;
1217          d->charcells_size = 0x8000;          d->charcells_size = 0x8000;
1218          d->gfx_mem_size   = 1;  /*  Nothing, as we start in text mode  */          d->gfx_mem_size   = 1;  /*  Nothing, as we start in text mode  */
1219            d->pixel_repx = d->pixel_repy = machine->x11_scaleup;
1220    
1221          /*  Allocate in full pages, to make it possible to use bintrans:  */          /*  Allocate in full pages, to make it possible to use dyntrans:  */
1222          allocsize = ((d->charcells_size-1) | (machine->arch_pagesize-1)) + 1;          allocsize = ((d->charcells_size-1) | (machine->arch_pagesize-1)) + 1;
1223          d->charcells = malloc(d->charcells_size);          d->charcells = malloc(d->charcells_size);
1224          d->charcells_outputed = malloc(d->charcells_size);          d->charcells_outputed = malloc(d->charcells_size);
# Line 1232  void dev_vga_init(struct machine *machin Line 1254  void dev_vga_init(struct machine *machin
1254          }          }
1255    
1256          memory_device_register(mem, "vga_charcells", videomem_base + 0x18000,          memory_device_register(mem, "vga_charcells", videomem_base + 0x18000,
1257              allocsize, dev_vga_access, d, MEM_DYNTRANS_OK |              allocsize, dev_vga_access, d, DM_DYNTRANS_OK |
1258              MEM_DYNTRANS_WRITE_OK | MEM_READING_HAS_NO_SIDE_EFFECTS,              DM_DYNTRANS_WRITE_OK | DM_READS_HAVE_NO_SIDE_EFFECTS,
1259              d->charcells);              d->charcells);
1260          memory_device_register(mem, "vga_gfx", videomem_base, GFX_ADDR_WINDOW,          memory_device_register(mem, "vga_gfx", videomem_base, GFX_ADDR_WINDOW,
1261              dev_vga_graphics_access, d, MEM_DEFAULT |              dev_vga_graphics_access, d, DM_DEFAULT |
1262              MEM_READING_HAS_NO_SIDE_EFFECTS, d->gfx_mem);              DM_READS_HAVE_NO_SIDE_EFFECTS, d->gfx_mem);
1263          memory_device_register(mem, "vga_ctrl", control_base,          memory_device_register(mem, "vga_ctrl", control_base,
1264              32, dev_vga_ctrl_access, d, MEM_DEFAULT, NULL);              32, dev_vga_ctrl_access, d, DM_DEFAULT, NULL);
1265    
1266          d->fb = dev_fb_init(machine, mem, VGA_FB_ADDR, VFB_GENERIC,          d->fb = dev_fb_init(machine, mem, VGA_FB_ADDR, VFB_GENERIC,
1267              d->fb_max_x, d->fb_max_y, d->fb_max_x, d->fb_max_y, 24, "VGA");              d->fb_max_x, d->fb_max_y, d->fb_max_x, d->fb_max_y, 24, "VGA");
# Line 1254  void dev_vga_init(struct machine *machin Line 1276  void dev_vga_init(struct machine *machin
1276          d->update_y2 = d->max_y - 1;          d->update_y2 = d->max_y - 1;
1277          d->modified = 1;          d->modified = 1;
1278    
1279          machine_add_tickfunction(machine, dev_vga_tick, d, VGA_TICK_SHIFT);          machine_add_tickfunction(machine, dev_vga_tick, d,
1280                VGA_TICK_SHIFT, 0.0);
1281    
1282          register_reset(d);          register_reset(d);
1283    

Legend:
Removed from v.18  
changed lines
  Added in v.24

  ViewVC Help
Powered by ViewVC 1.1.26