Previous 199869 Revisions Next

r19501 Wednesday 12th December, 2012 at 20:16:58 UTC by Angelo Salese
upd7220: tied pixel clock with the refresh rate, updated all drivers to use it [Angelo Salese]
[src/mess/drivers]a5105.c apc.c compis.c dmv.c mz6500.c pc9801.c qx10.c vt240.c
[src/mess/machine]wangpc_tig.c
[src/mess/video]upd7220.c

trunk/src/mess/machine/wangpc_tig.c
r19500r19501
140140
141141   MCFG_PALETTE_LENGTH(3)
142142
143   MCFG_UPD7220_ADD(UPD7720_0_TAG, XTAL_52_832MHz/10, hgdc0_intf, upd7220_0_map)
144   MCFG_UPD7220_ADD(UPD7720_1_TAG, XTAL_52_832MHz/16, hgdc1_intf, upd7220_1_map)
143   MCFG_UPD7220_ADD(UPD7720_0_TAG, XTAL_52_832MHz/28, hgdc0_intf, upd7220_0_map) // was /10?
144   MCFG_UPD7220_ADD(UPD7720_1_TAG, XTAL_52_832MHz/28, hgdc1_intf, upd7220_1_map) // was /16?
145145MACHINE_CONFIG_END
146146
147147
trunk/src/mess/video/upd7220.c
r19500r19501
2727    - QX-10 diagnostic test has positioning bugs with the bitmap display test;
2828    - QX-10 diagnostic test misses the zooming factor (external pin);
2929    - compis2 SAD address for bitmap is 0x20000 for whatever reason (presumably missing banking);
30    - A5105 has a FIFO bug with the RDAT, should be a lot larger when it scrolls up;
30    - A5105 has a FIFO bug with the RDAT, should be a lot larger when it scrolls up.
31      The problem is that DMA-ing with RDAT/WDAT shouldn't be instant;
3132
3233    - honor visible area
3334    - wide mode (32-bit access)
r19500r19501
391392
392393inline void upd7220_device::recompute_parameters()
393394{
394   int horiz_pix_total = (m_hs + m_hbp + m_aw + m_hfp) * 8;
395   /* TODO: assume that the pitch also controls number of horizontal pixels in a single cell */
396   int horiz_mult = ((m_pitch == 40) ? 16 : 8);
397   int horiz_pix_total = (m_hs + m_hbp + m_aw + m_hfp) * horiz_mult;
395398   int vert_pix_total = m_vs + m_vbp + m_al + m_vfp;
396399
397400   //printf("%d %d %d %d\n",m_hs,m_hbp,m_aw,m_hfp);
r19500r19501
400403   if (horiz_pix_total == 0 || vert_pix_total == 0) //bail out if screen params aren't valid
401404      return;
402405
403   attoseconds_t refresh = HZ_TO_ATTOSECONDS(60); //HZ_TO_ATTOSECONDS(clock() * 8) * horiz_pix_total * vert_pix_total;
406   attoseconds_t refresh = HZ_TO_ATTOSECONDS(clock() * horiz_mult) * horiz_pix_total * vert_pix_total;
404407
405408   rectangle visarea;
406409
407410   visarea.min_x = 0; //(m_hs + m_hbp) * 8;
408411   visarea.min_y = 0; //m_vs + m_vbp;
409   visarea.max_x = m_aw * 8 - 1;//horiz_pix_total - (m_hfp * 8) - 1;
412   visarea.max_x = m_aw * horiz_mult - 1;//horiz_pix_total - (m_hfp * 8) - 1;
410413   visarea.max_y = m_al - 1;//vert_pix_total - m_vfp - 1;
411414
412415
413   if (LOG)
416   if (0)
414417   {
415418      printf("uPD7220 '%s' Screen: %u x %u @ %f Hz\n", tag(), horiz_pix_total, vert_pix_total, 1 / ATTOSECONDS_TO_DOUBLE(refresh));
416419      printf("Visible Area: (%u, %u) - (%u, %u)\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y);
420      printf("%d %d %d %d %d\n",m_hs,m_hbp,m_aw,m_hfp,m_pitch);
417421      printf("%d %d %d %d\n",m_vs,m_vbp,m_al,m_vfp);
418422   }
419423
trunk/src/mess/drivers/dmv.c
r19500r19501
325325   MCFG_DEFAULT_LAYOUT(layout_dmv)
326326
327327   // devices
328   MCFG_UPD7220_ADD( "upd7220", XTAL_4MHz, hgdc_intf, upd7220_map )
328   MCFG_UPD7220_ADD( "upd7220", XTAL_5MHz/2, hgdc_intf, upd7220_map ) // unk clock
329329   MCFG_I8237_ADD( "dma8237", XTAL_4MHz, dmv_dma8237_config )
330330   MCFG_UPD765A_ADD( "upd765", true, true )
331331   MCFG_FLOPPY_DRIVE_ADD("upd765:0", dmv_floppies, "525dd", 0, floppy_image_device::default_floppy_formats)
trunk/src/mess/drivers/pc9801.c
r19500r19501
5454      "can't use (this) on a vanilla PC-9801, a PC-9801E nor a PC-9801U. Please turn off the computer and turn it on again."
5555   - Alice no Yakata: wants a "DSW 1-8" on.
5656   - Animahjong V3: accesses port 0x88;
57   - Anniversary - Memories of Summer: thinks that a button is pressed, has window masking bugs during intro;
57   - Anniversary - Memories of Summer: thinks that a button is pressed;
5858   - Another Genesis: fails loading;
5959   - Apple Club 1: how to pass an hand?
6060   (Applesauce Pirates)
6161
62   - Brandish 2: Intro needs some window masking effects (or not?);
6362   - Dragon Buster: slight issue with window masking;
6463   - Far Side Moon: doesn't detect sound board (tied to 0x00ec ports)
6564   - Jan Borg Suzume: gets stuck at a pic8259 read;
r19500r19501
721720      knj_tile = state->m_video_ram_1[(tile_addr*2+1) & 0x1fff] & 0xff;
722721      if(knj_tile)
723722      {
724         /* Note: lr doesn't really count, if a kanji is enabled then the successive tile is always the second part of it.
723         /* Note: bit 7 doesn't really count, if a kanji is enabled then the successive tile is always the second part of it.
725724            Trusted with Alice no Yakata, Animahjong V3, Aki no Tsukasa no Fushigi no Kabe, Apros ...
726725         */
727726         //kanji_lr = (knj_tile & 0x80) >> 7;
trunk/src/mess/drivers/qx10.c
r19500r19501
10401040   MCFG_I8255_ADD("i8255", qx10_i8255_interface)
10411041   MCFG_I8237_ADD("8237dma_1", MAIN_CLK/4, qx10_dma8237_1_interface)
10421042   MCFG_I8237_ADD("8237dma_2", MAIN_CLK/4, qx10_dma8237_2_interface)
1043   MCFG_UPD7220_ADD("upd7220", MAIN_CLK/4, hgdc_intf, upd7220_map)
1043   MCFG_UPD7220_ADD("upd7220", MAIN_CLK/6, hgdc_intf, upd7220_map) // unk clock
10441044   MCFG_MC146818_ADD( "rtc", MC146818_STANDARD )
10451045   MCFG_UPD765A_ADD("upd765", true, true)
10461046   MCFG_FLOPPY_DRIVE_ADD("upd765:0", qx10_floppies, "525dd", 0, floppy_image_device::default_floppy_formats)
trunk/src/mess/drivers/apc.c
r19500r19501
10421042
10431043   MCFG_GFXDECODE(apc)
10441044
1045   MCFG_UPD7220_ADD("upd7220_chr", 5000000/2, hgdc_1_intf, upd7220_1_map)
1046   MCFG_UPD7220_ADD("upd7220_btm", 5000000/2, hgdc_2_intf, upd7220_2_map)
1045   MCFG_UPD7220_ADD("upd7220_chr", XTAL_3_579545MHz, hgdc_1_intf, upd7220_1_map) // unk clock
1046   MCFG_UPD7220_ADD("upd7220_btm", XTAL_3_579545MHz, hgdc_2_intf, upd7220_2_map) // unk clock
10471047
10481048   MCFG_PALETTE_LENGTH(16)
10491049   MCFG_PALETTE_INIT_OVERRIDE(apc_state,apc)
trunk/src/mess/drivers/compis.c
r19500r19501
376376   MCFG_PIC8259_ADD( "pic8259_master", compis_pic8259_master_config )
377377   MCFG_PIC8259_ADD( "pic8259_slave", compis_pic8259_slave_config )
378378   MCFG_I8255_ADD( "ppi8255", compis_ppi_interface )
379   MCFG_UPD7220_ADD("upd7220", XTAL_4MHz, hgdc_intf, upd7220_map) //unknown clock
379   MCFG_UPD7220_ADD("upd7220", XTAL_4_433619MHz/2, hgdc_intf, upd7220_map) //unknown clock
380380   MCFG_CENTRONICS_PRINTER_ADD("centronics", standard_centronics)
381381   MCFG_I8251_ADD("uart", compis_usart_interface)
382382   MCFG_MM58274C_ADD("mm58274c", compis_mm58274c_interface)
r19500r19501
416416   MCFG_PIC8259_ADD( "pic8259_master", compis_pic8259_master_config )
417417   MCFG_PIC8259_ADD( "pic8259_slave", compis_pic8259_slave_config )
418418   MCFG_I8255_ADD( "ppi8255", compis_ppi_interface )
419   MCFG_UPD7220_ADD("upd7220", XTAL_4MHz, hgdc_intf, upd7220_map) //unknown clock
419   MCFG_UPD7220_ADD("upd7220", XTAL_4_433619MHz/2, hgdc_intf, upd7220_map) //unknown clock
420420   MCFG_CENTRONICS_PRINTER_ADD("centronics", standard_centronics)
421421   MCFG_I8251_ADD("uart", compis_usart_interface)
422422   MCFG_MM58274C_ADD("mm58274c", compis_mm58274c_interface)
trunk/src/mess/drivers/a5105.c
r19500r19501
130130            res_x = x * 8 + xi;
131131            res_y = y * lr + yi;
132132
133            if(!device->machine().primary_screen->visible_area().contains(res_x, res_y))
133            if(yi >= 8) { pen = 0; }
134
135            /* TODO: pitch is currently 40, this should actually go in the upd7220 device */
136            if(!device->machine().primary_screen->visible_area().contains(res_x*2+0, res_y))
134137               continue;
135138
136            if(yi >= 8) { pen = 0; }
139            bitmap.pix32(res_y, res_x*2+0) = palette[pen];
137140
138            bitmap.pix32(res_y, res_x) = palette[pen];
141            if(!device->machine().primary_screen->visible_area().contains(res_x*2+1, res_y))
142               continue;
143
144            bitmap.pix32(res_y, res_x*2+1) = palette[pen];
139145         }
140146      }
141147   }
r19500r19501
599605   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
600606
601607   /* Devices */
602   MCFG_UPD7220_ADD("upd7220", XTAL_15MHz, hgdc_intf, upd7220_map)
608   MCFG_UPD7220_ADD("upd7220", XTAL_15MHz / 16, hgdc_intf, upd7220_map) // unk clock
603609   MCFG_Z80CTC_ADD( "z80ctc", XTAL_15MHz / 4, a5105_ctc_intf )
604610   MCFG_Z80PIO_ADD( "z80pio", XTAL_15MHz / 4, a5105_pio_intf )
605611
trunk/src/mess/drivers/mz6500.c
r19500r19501
140140
141141static MACHINE_CONFIG_START( mz6500, mz6500_state )
142142   /* basic machine hardware */
143   MCFG_CPU_ADD("maincpu", I8086, 4000000) //unk clock
143   MCFG_CPU_ADD("maincpu", I8086, 8000000) //unk clock
144144   MCFG_CPU_PROGRAM_MAP(mz6500_map)
145145   MCFG_CPU_IO_MAP(mz6500_io)
146146
r19500r19501
155155   MCFG_PALETTE_LENGTH(8)
156156
157157   /* Devices */
158   MCFG_UPD7220_ADD("upd7220", 4000000, hgdc_intf, upd7220_map)
158   MCFG_UPD7220_ADD("upd7220", 8000000/6, hgdc_intf, upd7220_map) // unk clock
159159   MCFG_UPD765A_ADD("upd765", true, true)
160160   MCFG_FLOPPY_DRIVE_ADD("upd765:0", mz6500_floppies, "525hd", 0, floppy_image_device::default_floppy_formats)
161161   MCFG_FLOPPY_DRIVE_ADD("upd765:1", mz6500_floppies, "525hd", 0, floppy_image_device::default_floppy_formats)
trunk/src/mess/drivers/vt240.c
r19500r19501
181181   MCFG_PALETTE_INIT(black_and_white)
182182   MCFG_GFXDECODE(vt240)
183183
184   MCFG_UPD7220_ADD("upd7220", XTAL_4MHz, hgdc_intf, upd7220_map) //unknown clock
184   MCFG_UPD7220_ADD("upd7220", XTAL_4MHz / 4, hgdc_intf, upd7220_map) //unknown clock
185185MACHINE_CONFIG_END
186186
187187/* ROM definition */

Previous 199869 Revisions Next


© 1997-2024 The MAME Team