upd7220: tied pixel clock with the refresh rate, updated all drivers to use it [Angelo Salese]

This commit is contained in:
Angelo Salese 2012-12-12 20:16:58 +00:00
parent 84e53ca691
commit 1a35a58df0
10 changed files with 33 additions and 24 deletions

View File

@ -130,12 +130,18 @@ static UPD7220_DRAW_TEXT_LINE( hgdc_draw_text )
res_x = x * 8 + xi;
res_y = y * lr + yi;
if(!device->machine().primary_screen->visible_area().contains(res_x, res_y))
continue;
if(yi >= 8) { pen = 0; }
bitmap.pix32(res_y, res_x) = palette[pen];
/* TODO: pitch is currently 40, this should actually go in the upd7220 device */
if(!device->machine().primary_screen->visible_area().contains(res_x*2+0, res_y))
continue;
bitmap.pix32(res_y, res_x*2+0) = palette[pen];
if(!device->machine().primary_screen->visible_area().contains(res_x*2+1, res_y))
continue;
bitmap.pix32(res_y, res_x*2+1) = palette[pen];
}
}
}
@ -599,7 +605,7 @@ static MACHINE_CONFIG_START( a5105, a5105_state )
MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50)
/* Devices */
MCFG_UPD7220_ADD("upd7220", XTAL_15MHz, hgdc_intf, upd7220_map)
MCFG_UPD7220_ADD("upd7220", XTAL_15MHz / 16, hgdc_intf, upd7220_map) // unk clock
MCFG_Z80CTC_ADD( "z80ctc", XTAL_15MHz / 4, a5105_ctc_intf )
MCFG_Z80PIO_ADD( "z80pio", XTAL_15MHz / 4, a5105_pio_intf )

View File

@ -1042,8 +1042,8 @@ static MACHINE_CONFIG_START( apc, apc_state )
MCFG_GFXDECODE(apc)
MCFG_UPD7220_ADD("upd7220_chr", 5000000/2, hgdc_1_intf, upd7220_1_map)
MCFG_UPD7220_ADD("upd7220_btm", 5000000/2, hgdc_2_intf, upd7220_2_map)
MCFG_UPD7220_ADD("upd7220_chr", XTAL_3_579545MHz, hgdc_1_intf, upd7220_1_map) // unk clock
MCFG_UPD7220_ADD("upd7220_btm", XTAL_3_579545MHz, hgdc_2_intf, upd7220_2_map) // unk clock
MCFG_PALETTE_LENGTH(16)
MCFG_PALETTE_INIT_OVERRIDE(apc_state,apc)

View File

@ -376,7 +376,7 @@ static MACHINE_CONFIG_START( compis, compis_state )
MCFG_PIC8259_ADD( "pic8259_master", compis_pic8259_master_config )
MCFG_PIC8259_ADD( "pic8259_slave", compis_pic8259_slave_config )
MCFG_I8255_ADD( "ppi8255", compis_ppi_interface )
MCFG_UPD7220_ADD("upd7220", XTAL_4MHz, hgdc_intf, upd7220_map) //unknown clock
MCFG_UPD7220_ADD("upd7220", XTAL_4_433619MHz/2, hgdc_intf, upd7220_map) //unknown clock
MCFG_CENTRONICS_PRINTER_ADD("centronics", standard_centronics)
MCFG_I8251_ADD("uart", compis_usart_interface)
MCFG_MM58274C_ADD("mm58274c", compis_mm58274c_interface)
@ -416,7 +416,7 @@ static MACHINE_CONFIG_START( compis2, compis_state )
MCFG_PIC8259_ADD( "pic8259_master", compis_pic8259_master_config )
MCFG_PIC8259_ADD( "pic8259_slave", compis_pic8259_slave_config )
MCFG_I8255_ADD( "ppi8255", compis_ppi_interface )
MCFG_UPD7220_ADD("upd7220", XTAL_4MHz, hgdc_intf, upd7220_map) //unknown clock
MCFG_UPD7220_ADD("upd7220", XTAL_4_433619MHz/2, hgdc_intf, upd7220_map) //unknown clock
MCFG_CENTRONICS_PRINTER_ADD("centronics", standard_centronics)
MCFG_I8251_ADD("uart", compis_usart_interface)
MCFG_MM58274C_ADD("mm58274c", compis_mm58274c_interface)

View File

@ -325,7 +325,7 @@ static MACHINE_CONFIG_START( dmv, dmv_state )
MCFG_DEFAULT_LAYOUT(layout_dmv)
// devices
MCFG_UPD7220_ADD( "upd7220", XTAL_4MHz, hgdc_intf, upd7220_map )
MCFG_UPD7220_ADD( "upd7220", XTAL_5MHz/2, hgdc_intf, upd7220_map ) // unk clock
MCFG_I8237_ADD( "dma8237", XTAL_4MHz, dmv_dma8237_config )
MCFG_UPD765A_ADD( "upd765", true, true )
MCFG_FLOPPY_DRIVE_ADD("upd765:0", dmv_floppies, "525dd", 0, floppy_image_device::default_floppy_formats)

View File

@ -140,7 +140,7 @@ ADDRESS_MAP_END
static MACHINE_CONFIG_START( mz6500, mz6500_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", I8086, 4000000) //unk clock
MCFG_CPU_ADD("maincpu", I8086, 8000000) //unk clock
MCFG_CPU_PROGRAM_MAP(mz6500_map)
MCFG_CPU_IO_MAP(mz6500_io)
@ -155,7 +155,7 @@ static MACHINE_CONFIG_START( mz6500, mz6500_state )
MCFG_PALETTE_LENGTH(8)
/* Devices */
MCFG_UPD7220_ADD("upd7220", 4000000, hgdc_intf, upd7220_map)
MCFG_UPD7220_ADD("upd7220", 8000000/6, hgdc_intf, upd7220_map) // unk clock
MCFG_UPD765A_ADD("upd765", true, true)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", mz6500_floppies, "525hd", 0, floppy_image_device::default_floppy_formats)
MCFG_FLOPPY_DRIVE_ADD("upd765:1", mz6500_floppies, "525hd", 0, floppy_image_device::default_floppy_formats)

View File

@ -54,12 +54,11 @@
"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."
- Alice no Yakata: wants a "DSW 1-8" on.
- Animahjong V3: accesses port 0x88;
- Anniversary - Memories of Summer: thinks that a button is pressed, has window masking bugs during intro;
- Anniversary - Memories of Summer: thinks that a button is pressed;
- Another Genesis: fails loading;
- Apple Club 1: how to pass an hand?
(Applesauce Pirates)
- Brandish 2: Intro needs some window masking effects (or not?);
- Dragon Buster: slight issue with window masking;
- Far Side Moon: doesn't detect sound board (tied to 0x00ec ports)
- Jan Borg Suzume: gets stuck at a pic8259 read;
@ -721,7 +720,7 @@ static UPD7220_DRAW_TEXT_LINE( hgdc_draw_text )
knj_tile = state->m_video_ram_1[(tile_addr*2+1) & 0x1fff] & 0xff;
if(knj_tile)
{
/* Note: lr doesn't really count, if a kanji is enabled then the successive tile is always the second part of it.
/* Note: bit 7 doesn't really count, if a kanji is enabled then the successive tile is always the second part of it.
Trusted with Alice no Yakata, Animahjong V3, Aki no Tsukasa no Fushigi no Kabe, Apros ...
*/
//kanji_lr = (knj_tile & 0x80) >> 7;

View File

@ -1040,7 +1040,7 @@ static MACHINE_CONFIG_START( qx10, qx10_state )
MCFG_I8255_ADD("i8255", qx10_i8255_interface)
MCFG_I8237_ADD("8237dma_1", MAIN_CLK/4, qx10_dma8237_1_interface)
MCFG_I8237_ADD("8237dma_2", MAIN_CLK/4, qx10_dma8237_2_interface)
MCFG_UPD7220_ADD("upd7220", MAIN_CLK/4, hgdc_intf, upd7220_map)
MCFG_UPD7220_ADD("upd7220", MAIN_CLK/6, hgdc_intf, upd7220_map) // unk clock
MCFG_MC146818_ADD( "rtc", MC146818_STANDARD )
MCFG_UPD765A_ADD("upd765", true, true)
MCFG_FLOPPY_DRIVE_ADD("upd765:0", qx10_floppies, "525dd", 0, floppy_image_device::default_floppy_formats)

View File

@ -181,7 +181,7 @@ static MACHINE_CONFIG_START( vt240, vt240_state )
MCFG_PALETTE_INIT(black_and_white)
MCFG_GFXDECODE(vt240)
MCFG_UPD7220_ADD("upd7220", XTAL_4MHz, hgdc_intf, upd7220_map) //unknown clock
MCFG_UPD7220_ADD("upd7220", XTAL_4MHz / 4, hgdc_intf, upd7220_map) //unknown clock
MACHINE_CONFIG_END
/* ROM definition */

View File

@ -140,8 +140,8 @@ static MACHINE_CONFIG_FRAGMENT( wangpc_tig )
MCFG_PALETTE_LENGTH(3)
MCFG_UPD7220_ADD(UPD7720_0_TAG, XTAL_52_832MHz/10, hgdc0_intf, upd7220_0_map)
MCFG_UPD7220_ADD(UPD7720_1_TAG, XTAL_52_832MHz/16, hgdc1_intf, upd7220_1_map)
MCFG_UPD7220_ADD(UPD7720_0_TAG, XTAL_52_832MHz/28, hgdc0_intf, upd7220_0_map) // was /10?
MCFG_UPD7220_ADD(UPD7720_1_TAG, XTAL_52_832MHz/28, hgdc1_intf, upd7220_1_map) // was /16?
MACHINE_CONFIG_END

View File

@ -27,7 +27,8 @@
- QX-10 diagnostic test has positioning bugs with the bitmap display test;
- QX-10 diagnostic test misses the zooming factor (external pin);
- compis2 SAD address for bitmap is 0x20000 for whatever reason (presumably missing banking);
- A5105 has a FIFO bug with the RDAT, should be a lot larger when it scrolls up;
- A5105 has a FIFO bug with the RDAT, should be a lot larger when it scrolls up.
The problem is that DMA-ing with RDAT/WDAT shouldn't be instant;
- honor visible area
- wide mode (32-bit access)
@ -391,7 +392,9 @@ inline void upd7220_device::update_blank_timer(int state)
inline void upd7220_device::recompute_parameters()
{
int horiz_pix_total = (m_hs + m_hbp + m_aw + m_hfp) * 8;
/* TODO: assume that the pitch also controls number of horizontal pixels in a single cell */
int horiz_mult = ((m_pitch == 40) ? 16 : 8);
int horiz_pix_total = (m_hs + m_hbp + m_aw + m_hfp) * horiz_mult;
int vert_pix_total = m_vs + m_vbp + m_al + m_vfp;
//printf("%d %d %d %d\n",m_hs,m_hbp,m_aw,m_hfp);
@ -400,20 +403,21 @@ inline void upd7220_device::recompute_parameters()
if (horiz_pix_total == 0 || vert_pix_total == 0) //bail out if screen params aren't valid
return;
attoseconds_t refresh = HZ_TO_ATTOSECONDS(60); //HZ_TO_ATTOSECONDS(clock() * 8) * horiz_pix_total * vert_pix_total;
attoseconds_t refresh = HZ_TO_ATTOSECONDS(clock() * horiz_mult) * horiz_pix_total * vert_pix_total;
rectangle visarea;
visarea.min_x = 0; //(m_hs + m_hbp) * 8;
visarea.min_y = 0; //m_vs + m_vbp;
visarea.max_x = m_aw * 8 - 1;//horiz_pix_total - (m_hfp * 8) - 1;
visarea.max_x = m_aw * horiz_mult - 1;//horiz_pix_total - (m_hfp * 8) - 1;
visarea.max_y = m_al - 1;//vert_pix_total - m_vfp - 1;
if (LOG)
if (0)
{
printf("uPD7220 '%s' Screen: %u x %u @ %f Hz\n", tag(), horiz_pix_total, vert_pix_total, 1 / ATTOSECONDS_TO_DOUBLE(refresh));
printf("Visible Area: (%u, %u) - (%u, %u)\n", visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y);
printf("%d %d %d %d %d\n",m_hs,m_hbp,m_aw,m_hfp,m_pitch);
printf("%d %d %d %d\n",m_vs,m_vbp,m_al,m_vfp);
}