From 8ac41b05194b15c7c239b54d919a83c069160ed3 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Tue, 27 Jun 2023 06:45:03 +1000 Subject: [PATCH] Tidy up some stuff, combine sunelectronics/markham.cpp source files. --- src/devices/bus/isa/svga_s3.h | 4 +- src/devices/bus/isa/svga_trident.h | 4 +- src/devices/bus/isa/svga_tseng.h | 3 + src/devices/bus/isa/vga_ati.h | 10 +- src/devices/video/ati_mach32.h | 3 +- src/devices/video/ati_mach8.h | 3 +- src/devices/video/ibm8514a.cpp | 98 ++++----- src/devices/video/pc_vga.h | 4 +- src/devices/video/pc_vga_ati.h | 8 +- src/devices/video/pc_vga_nvidia.h | 4 +- src/devices/video/pc_vga_s3.h | 4 +- src/devices/video/pc_vga_tseng.h | 4 +- src/devices/video/pc_xga.h | 4 +- src/mame/mame.lst | 6 +- src/mame/pc/pcat_dyn.cpp | 15 +- src/mame/pc/pcipc.cpp | 18 +- src/mame/sunelectronics/markham.cpp | 273 +++++++++++++++++++++++++- src/mame/sunelectronics/markham.h | 126 ------------ src/mame/sunelectronics/markham_v.cpp | 159 --------------- 19 files changed, 379 insertions(+), 371 deletions(-) delete mode 100644 src/mame/sunelectronics/markham.h delete mode 100644 src/mame/sunelectronics/markham_v.cpp diff --git a/src/devices/bus/isa/svga_s3.h b/src/devices/bus/isa/svga_s3.h index fa93264efb3..7009ce28167 100644 --- a/src/devices/bus/isa/svga_s3.h +++ b/src/devices/bus/isa/svga_s3.h @@ -6,9 +6,11 @@ #pragma once #include "isa.h" -#include "video/pc_vga_s3.h" #include "s3virge.h" +#include "video/pc_vga_s3.h" + + //************************************************************************** // TYPE DEFINITIONS //************************************************************************** diff --git a/src/devices/bus/isa/svga_trident.h b/src/devices/bus/isa/svga_trident.h index 350d598f213..39afd40be96 100644 --- a/src/devices/bus/isa/svga_trident.h +++ b/src/devices/bus/isa/svga_trident.h @@ -2,16 +2,16 @@ // copyright-holders:Barry Rodewald /* * svga_trident.h - * - * Created on: 6/09/2014 */ #ifndef MAME_BUS_ISA_SVGA_TRIDENT_H #define MAME_BUS_ISA_SVGA_TRIDENT_H #include "isa.h" + #include "video/pc_vga_trident.h" + //************************************************************************** // TYPE DEFINITIONS //************************************************************************** diff --git a/src/devices/bus/isa/svga_tseng.h b/src/devices/bus/isa/svga_tseng.h index 6603b3b9d71..f1b56423ef0 100644 --- a/src/devices/bus/isa/svga_tseng.h +++ b/src/devices/bus/isa/svga_tseng.h @@ -6,9 +6,12 @@ #pragma once #include "isa.h" + #include "video/pc_vga_tseng.h" + #include "screen.h" + //************************************************************************** // TYPE DEFINITIONS //************************************************************************** diff --git a/src/devices/bus/isa/vga_ati.h b/src/devices/bus/isa/vga_ati.h index 98d0df0f7fe..5ca355f590c 100644 --- a/src/devices/bus/isa/vga_ati.h +++ b/src/devices/bus/isa/vga_ati.h @@ -1,11 +1,9 @@ // license:BSD-3-Clause // copyright-holders:Barry Rodewald /* - * isa_vga_ati.h + * isa/vga_ati.h * * Header for ATi Graphics Ultra/Graphics Ultra Pro ISA video cards - * - * Created on: 9/09/2012 */ #ifndef MAME_BUS_ISA_VGA_ATI_H #define MAME_BUS_ISA_VGA_ATI_H @@ -13,9 +11,11 @@ #pragma once #include "isa.h" -#include "video/pc_vga_ati.h" -#include "video/ati_mach8.h" + #include "video/ati_mach32.h" +#include "video/ati_mach8.h" +#include "video/pc_vga_ati.h" + //************************************************************************** // TYPE DEFINITIONS diff --git a/src/devices/video/ati_mach32.h b/src/devices/video/ati_mach32.h index edecf45303a..fe80d92b9b5 100644 --- a/src/devices/video/ati_mach32.h +++ b/src/devices/video/ati_mach32.h @@ -11,9 +11,10 @@ #pragma once +#include "machine/eepromser.h" #include "video/ati_mach8.h" #include "video/pc_vga_ati.h" -#include "machine/eepromser.h" + // 8514/A module of the Mach32 class mach32_8514a_device : public mach8_device diff --git a/src/devices/video/ati_mach8.h b/src/devices/video/ati_mach8.h index 8b190c9b2d7..cd21764cc36 100644 --- a/src/devices/video/ati_mach8.h +++ b/src/devices/video/ati_mach8.h @@ -6,8 +6,9 @@ #pragma once -#include "video/pc_vga.h" #include "video/ibm8514a.h" +#include "video/pc_vga.h" + class mach8_device : public ibm8514a_device { diff --git a/src/devices/video/ibm8514a.cpp b/src/devices/video/ibm8514a.cpp index 96fecf04409..969d93d908c 100644 --- a/src/devices/video/ibm8514a.cpp +++ b/src/devices/video/ibm8514a.cpp @@ -55,8 +55,10 @@ void ibm8514a_device::ibm8514_write_fg(uint32_t offset) return; // do nothing } else + { if(ibm8514.curr_x < ibm8514.scissors_left || ibm8514.curr_x > ibm8514.scissors_right || ibm8514.curr_y < ibm8514.scissors_top || ibm8514.curr_y > ibm8514.scissors_bottom) return; // do nothing + } // determine source switch(ibm8514.fgmix & 0x0060) @@ -291,7 +293,7 @@ uint16_t ibm8514a_device::ibm8514_line_error_r() void ibm8514a_device::ibm8514_line_error_w(uint16_t data) { ibm8514.line_errorterm = data; - LOG( "8514/A: Line Parameter/Error Term write %04x\n",data); + LOG("8514/A: Line Parameter/Error Term write %04x\n", data); } /* @@ -319,7 +321,7 @@ uint16_t ibm8514a_device::ibm8514_gpstatus_r() { uint16_t ret = 0x0000; - //LOG( "S3: 9AE8 read\n"); + //LOG("S3: 9AE8 read\n"); if(ibm8514.gpbusy == true) ret |= 0x0200; if(ibm8514.data_avail == true) @@ -471,7 +473,7 @@ void ibm8514a_device::ibm8514_cmd_w(uint16_t data) case 0x0000: // NOP (for "Short Stroke Vectors") ibm8514.state = IBM8514_IDLE; ibm8514.gpbusy = false; - LOG( "8514/A: Command (%04x) - NOP (Short Stroke Vector)\n",ibm8514.current_cmd); + LOG("8514/A: Command (%04x) - NOP (Short Stroke Vector)\n", ibm8514.current_cmd); break; case 0x2000: // Line ibm8514.state = IBM8514_IDLE; @@ -482,12 +484,12 @@ void ibm8514a_device::ibm8514_cmd_w(uint16_t data) { ibm8514.state = IBM8514_DRAWING_LINE; ibm8514.data_avail = true; - LOG( "8514/A: Command (%04x) - Vector Line (WAIT) %i,%i \n",ibm8514.current_cmd,ibm8514.curr_x,ibm8514.curr_y); + LOG("8514/A: Command (%04x) - Vector Line (WAIT) %i,%i \n", ibm8514.current_cmd, ibm8514.curr_x, ibm8514.curr_y); } else { ibm8514_draw_vector(ibm8514.rect_width,(data & 0x00e0) >> 5,(data & 0010) ? true : false); - LOG( "8514/A: Command (%04x) - Vector Line - %i,%i \n",ibm8514.current_cmd,ibm8514.curr_x,ibm8514.curr_y); + LOG("8514/A: Command (%04x) - Vector Line - %i,%i \n", ibm8514.current_cmd, ibm8514.curr_x, ibm8514.curr_y); } } else @@ -501,8 +503,8 @@ void ibm8514a_device::ibm8514_cmd_w(uint16_t data) int count = 0; int16_t temp; - LOG( "8514/A: Command (%04x) - Line (Bresenham) - %i,%i Axial %i, Diagonal %i, Error %i, Major Axis %i, Minor Axis %i\n",ibm8514.current_cmd, - ibm8514.curr_x,ibm8514.curr_y,ibm8514.line_axial_step,ibm8514.line_diagonal_step,ibm8514.line_errorterm,ibm8514.rect_width,ibm8514.rect_height); + LOG("8514/A: Command (%04x) - Line (Bresenham) - %i,%i Axial %i, Diagonal %i, Error %i, Major Axis %i, Minor Axis %i\n", + ibm8514.current_cmd, ibm8514.curr_x, ibm8514.curr_y, ibm8514.line_axial_step, ibm8514.line_diagonal_step, ibm8514.line_errorterm, ibm8514.rect_width, ibm8514.rect_height); if((data & 0x0040)) { @@ -533,12 +535,12 @@ void ibm8514a_device::ibm8514_cmd_w(uint16_t data) //ibm8514.gpbusy = true; // DirectX 5 keeps waiting for the busy bit to be clear... ibm8514.bus_size = (data & 0x0600) >> 9; ibm8514.data_avail = true; - LOG( "8514/A: Command (%04x) - Rectangle Fill (WAIT) %i,%i Width: %i Height: %i Colour: %08x\n",ibm8514.current_cmd,ibm8514.curr_x, - ibm8514.curr_y,ibm8514.rect_width,ibm8514.rect_height,ibm8514.fgcolour); + LOG("8514/A: Command (%04x) - Rectangle Fill (WAIT) %i,%i Width: %i Height: %i Colour: %08x\n", + ibm8514.current_cmd, ibm8514.curr_x, ibm8514.curr_y, ibm8514.rect_width, ibm8514.rect_height, ibm8514.fgcolour); break; } - LOG( "8514/A: Command (%04x) - Rectangle Fill %i,%i Width: %i Height: %i Colour: %08x\n",ibm8514.current_cmd,ibm8514.curr_x, - ibm8514.curr_y,ibm8514.rect_width,ibm8514.rect_height,ibm8514.fgcolour); + LOG("8514/A: Command (%04x) - Rectangle Fill %i,%i Width: %i Height: %i Colour: %08x\n", + ibm8514.current_cmd, ibm8514.curr_x, ibm8514.curr_y, ibm8514.rect_width, ibm8514.rect_height, ibm8514.fgcolour); off = 0; off += (IBM8514_LINE_LENGTH * ibm8514.curr_y); off += ibm8514.curr_x; @@ -587,8 +589,8 @@ void ibm8514a_device::ibm8514_cmd_w(uint16_t data) break; case 0xc000: // BitBLT // TODO: a10cuba sets up blantantly invalid parameters here, CPU core bug maybe? - LOG( "8514/A: Command (%04x) - BitBLT from %i,%i to %i,%i Width: %i Height: %i\n",ibm8514.current_cmd, - ibm8514.curr_x,ibm8514.curr_y,ibm8514.dest_x,ibm8514.dest_y,ibm8514.rect_width,ibm8514.rect_height); + LOG("8514/A: Command (%04x) - BitBLT from %i,%i to %i,%i Width: %i Height: %i\n", + ibm8514.current_cmd, ibm8514.curr_x, ibm8514.curr_y, ibm8514.dest_x, ibm8514.dest_y, ibm8514.rect_width, ibm8514.rect_height); off = 0; off += (IBM8514_LINE_LENGTH * ibm8514.dest_y); off += ibm8514.dest_x; @@ -664,8 +666,8 @@ void ibm8514a_device::ibm8514_cmd_w(uint16_t data) ibm8514.curr_y = ibm8514.prev_y; break; case 0xe000: // Pattern Fill - LOG( "8514/A: Command (%04x) - Pattern Fill - source %i,%i dest %i,%i Width: %i Height: %i\n",ibm8514.current_cmd, - ibm8514.curr_x,ibm8514.curr_y,ibm8514.dest_x,ibm8514.dest_y,ibm8514.rect_width,ibm8514.rect_height); + LOG("8514/A: Command (%04x) - Pattern Fill - source %i,%i dest %i,%i Width: %i Height: %i\n", + ibm8514.current_cmd, ibm8514.curr_x, ibm8514.curr_y, ibm8514.dest_x, ibm8514.dest_y, ibm8514.rect_width, ibm8514.rect_height); off = 0; off += (IBM8514_LINE_LENGTH * ibm8514.dest_y); off += ibm8514.dest_x; @@ -735,7 +737,7 @@ void ibm8514a_device::ibm8514_cmd_w(uint16_t data) default: ibm8514.state = IBM8514_IDLE; ibm8514.gpbusy = false; - LOG( "8514/A: Unknown command: %04x\n",data); + LOG("8514/A: Unknown command: %04x\n", data); break; } } @@ -761,7 +763,7 @@ void ibm8514a_device::ibm8514_desty_w(uint16_t data) { ibm8514.line_axial_step = data; ibm8514.dest_y = data; - LOG( "8514/A: Line Axial Step / Destination Y write %04x\n",data); + LOG("8514/A: Line Axial Step / Destination Y write %04x\n", data); } /* @@ -786,7 +788,7 @@ void ibm8514a_device::ibm8514_destx_w(uint16_t data) { ibm8514.line_diagonal_step = data; ibm8514.dest_x = data; - LOG( "8514/A: Line Diagonal Step / Destination X write %04x\n",data); + LOG("8514/A: Line Diagonal Step / Destination X write %04x\n", data); } /* @@ -938,7 +940,7 @@ void ibm8514a_device::ibm8514_ssv_w(uint16_t data) ibm8514_draw_ssv(data >> 8); ibm8514_draw_ssv(data & 0xff); } - LOG( "8514/A: Short Stroke Vector write %04x\n",data); + LOG("8514/A: Short Stroke Vector write %04x\n", data); } void ibm8514a_device::ibm8514_wait_draw_vector() @@ -1028,7 +1030,7 @@ uint16_t ibm8514a_device::ibm8514_width_r() void ibm8514a_device::ibm8514_width_w(uint16_t data) { ibm8514.rect_width = data & 0x1fff; - LOG( "8514/A: Major Axis Pixel Count / Rectangle Width write %04x\n",data); + LOG("8514/A: Major Axis Pixel Count / Rectangle Width write %04x\n", data); } uint16_t ibm8514a_device::ibm8514_currentx_r() @@ -1040,7 +1042,7 @@ void ibm8514a_device::ibm8514_currentx_w(uint16_t data) { ibm8514.curr_x = data; ibm8514.prev_x = data; - LOG( "8514/A: Current X set to %04x (%i)\n",data,ibm8514.curr_x); + LOG("8514/A: Current X set to %04x (%i)\n", data, ibm8514.curr_x); } uint16_t ibm8514a_device::ibm8514_currenty_r() @@ -1052,7 +1054,7 @@ void ibm8514a_device::ibm8514_currenty_w(uint16_t data) { ibm8514.curr_y = data; ibm8514.prev_y = data; - LOG( "8514/A: Current Y set to %04x (%i)\n",data,ibm8514.curr_y); + LOG("8514/A: Current Y set to %04x (%i)\n", data, ibm8514.curr_y); } uint16_t ibm8514a_device::ibm8514_fgcolour_r() @@ -1063,7 +1065,7 @@ uint16_t ibm8514a_device::ibm8514_fgcolour_r() void ibm8514a_device::ibm8514_fgcolour_w(uint16_t data) { ibm8514.fgcolour = data; - LOG( "8514/A: Foreground Colour write %04x\n",data); + LOG("8514/A: Foreground Colour write %04x\n", data); } uint16_t ibm8514a_device::ibm8514_bgcolour_r() @@ -1074,7 +1076,7 @@ uint16_t ibm8514a_device::ibm8514_bgcolour_r() void ibm8514a_device::ibm8514_bgcolour_w(uint16_t data) { ibm8514.bgcolour = data; - LOG( "8514/A: Background Colour write %04x\n",data); + LOG("8514/A: Background Colour write %04x\n", data); } /* @@ -1096,7 +1098,7 @@ uint16_t ibm8514a_device::ibm8514_read_mask_r() void ibm8514a_device::ibm8514_read_mask_w(uint16_t data) { ibm8514.read_mask = (ibm8514.read_mask & 0xffff0000) | data; - LOG( "8514/A: Read Mask (Low) write = %08x\n",ibm8514.read_mask); + LOG("8514/A: Read Mask (Low) write = %08x\n", ibm8514.read_mask); } /* @@ -1117,7 +1119,7 @@ uint16_t ibm8514a_device::ibm8514_write_mask_r() void ibm8514a_device::ibm8514_write_mask_w(uint16_t data) { ibm8514.write_mask = (ibm8514.write_mask & 0xffff0000) | data; - LOG( "8514/A: Write Mask (Low) write = %08x\n",ibm8514.write_mask); + LOG("8514/A: Write Mask (Low) write = %08x\n", ibm8514.write_mask); } uint16_t ibm8514a_device::ibm8514_multifunc_r() @@ -1136,7 +1138,7 @@ uint16_t ibm8514a_device::ibm8514_multifunc_r() return ibm8514.scissors_right; // TODO: remaining functions default: - LOG( "8514/A: Unimplemented multifunction register %i selected\n",ibm8514.multifunc_sel); + LOG("8514/A: Unimplemented multifunction register %i selected\n", ibm8514.multifunc_sel); return 0xff; } } @@ -1153,7 +1155,7 @@ bit 0-10 (911/924) Rectangle Height. Height of BITBLT or rectangle command. */ case 0x0000: ibm8514.rect_height = data & 0x0fff; - LOG( "8514/A: Minor Axis Pixel Count / Rectangle Height write %04x\n",data); + LOG("8514/A: Minor Axis Pixel Count / Rectangle Height write %04x\n", data); break; /* BEE8h index 01h W(R/W): Top Scissors Register (SCISSORS_T). @@ -1178,19 +1180,19 @@ bit 0-10 (911,924) Clipping Right Limit. Defines the right bound of the */ case 0x1000: ibm8514.scissors_top = data & 0x0fff; - LOG( "S3: Scissors Top write %04x\n",data); + LOG("S3: Scissors Top write %04x\n", data); break; case 0x2000: ibm8514.scissors_left = data & 0x0fff; - LOG( "S3: Scissors Left write %04x\n",data); + LOG("S3: Scissors Left write %04x\n", data); break; case 0x3000: ibm8514.scissors_bottom = data & 0x0fff; - LOG( "S3: Scissors Bottom write %04x\n",data); + LOG("S3: Scissors Bottom write %04x\n", data); break; case 0x4000: ibm8514.scissors_right = data & 0x0fff; - LOG( "S3: Scissors Right write %04x\n",data); + LOG("S3: Scissors Right write %04x\n", data); break; /* BEE8h index 0Ah W(R/W): Pixel Control Register (PIX_CNTL). @@ -1204,11 +1206,11 @@ BIT 2 (911-928) Pack Data. If set image read data is a monochrome bitmap, */ case 0xa000: ibm8514.pixel_control = data; - LOG( "S3: Pixel control write %04x\n",data); + LOG("S3: Pixel control write %04x\n", data); break; case 0xe000: ibm8514.multifunc_misc = data; - LOG( "S3: Multifunction Miscellaneous write %04x\n",data); + LOG("S3: Multifunction Miscellaneous write %04x\n", data); break; /* BEE8h index 0Fh W(W): Read Register Select Register (READ_SEL) (801/5,928) @@ -1230,10 +1232,10 @@ bit 0-2 (911-928) READ-REG-SEL. Read Register Select. Selects the register */ case 0xf000: ibm8514.multifunc_sel = data & 0x000f; - LOG( "S3: Multifunction select write %04x\n",data); + LOG("S3: Multifunction select write %04x\n", data); break; default: - LOG( "S3: Unimplemented multifunction register %i write %03x\n",data >> 12,data & 0x0fff); + LOG("S3: Unimplemented multifunction register %i write %03x\n", data >> 12, data & 0x0fff); break; } } @@ -1430,7 +1432,7 @@ uint16_t ibm8514a_device::ibm8514_backmix_r() void ibm8514a_device::ibm8514_backmix_w(uint16_t data) { ibm8514.bgmix = data; - LOG( "8514/A: BG Mix write %04x\n",data); + LOG("8514/A: BG Mix write %04x\n", data); } uint16_t ibm8514a_device::ibm8514_foremix_r() @@ -1441,7 +1443,7 @@ uint16_t ibm8514a_device::ibm8514_foremix_r() void ibm8514a_device::ibm8514_foremix_w(uint16_t data) { ibm8514.fgmix = data; - LOG( "8514/A: FG Mix write %04x\n",data); + LOG("8514/A: FG Mix write %04x\n", data); } uint16_t ibm8514a_device::ibm8514_pixel_xfer_r(offs_t offset) @@ -1468,7 +1470,7 @@ void ibm8514a_device::ibm8514_pixel_xfer_w(offs_t offset, uint16_t data) if(ibm8514.state == IBM8514_DRAWING_LINE) ibm8514_wait_draw_vector(); - LOG( "8514/A: Pixel Transfer = %08x\n",ibm8514.pixel_xfer); + LOG("8514/A: Pixel Transfer = %08x\n", ibm8514.pixel_xfer); } /* @@ -1510,20 +1512,20 @@ void ibm8514a_device::ibm8514_htotal_w(offs_t offset, uint8_t data) ibm8514.htotal = data & 0xff; break; case 2: - m_vga->port_03c0_w(6,data); + m_vga->port_03c0_w(6, data); break; case 3: - m_vga->port_03c0_w(7,data); + m_vga->port_03c0_w(7, data); break; case 4: - m_vga->port_03c0_w(8,data); + m_vga->port_03c0_w(8, data); break; case 5: - m_vga->port_03c0_w(9,data); + m_vga->port_03c0_w(9, data); break; } //vga.crtc.horz_total = data & 0x01ff; - LOG( "8514/A: Horizontal total write %04x\n",data); + LOG("8514/A: Horizontal total write %04x\n", data); } /* @@ -1575,7 +1577,7 @@ void ibm8514a_device::ibm8514_subcontrol_w(uint16_t data) { ibm8514.subctrl = data; ibm8514.substatus &= ~(data & 0x0f); // reset interrupts -// LOG( "8514/A: Subsystem control write %04x\n",data); +// LOG("8514/A: Subsystem control write %04x\n", data); } uint16_t ibm8514a_device::ibm8514_subcontrol_r() @@ -1627,7 +1629,7 @@ void ibm8514a_device::ibm8514_vtotal_w(uint16_t data) { ibm8514.vtotal = data; // vga.crtc.vert_total = data; - LOG( "8514/A: Vertical total write %04x\n",data); + LOG("8514/A: Vertical total write %04x\n", data); } uint16_t ibm8514a_device::ibm8514_vdisp_r() @@ -1639,7 +1641,7 @@ void ibm8514a_device::ibm8514_vdisp_w(uint16_t data) { ibm8514.vdisp = data; // vga.crtc.vert_disp_end = data >> 3; - LOG( "8514/A: Vertical Displayed write %04x\n",data); + LOG("8514/A: Vertical Displayed write %04x\n", data); } uint16_t ibm8514a_device::ibm8514_vsync_r() @@ -1650,7 +1652,7 @@ uint16_t ibm8514a_device::ibm8514_vsync_r() void ibm8514a_device::ibm8514_vsync_w(uint16_t data) { ibm8514.vsync = data; - LOG( "8514/A: Vertical Sync write %04x\n",data); + LOG("8514/A: Vertical Sync write %04x\n", data); } void ibm8514a_device::enabled() diff --git a/src/devices/video/pc_vga.h b/src/devices/video/pc_vga.h index bf0a9252c3b..54f2ef168ae 100644 --- a/src/devices/video/pc_vga.h +++ b/src/devices/video/pc_vga.h @@ -13,10 +13,10 @@ #pragma once -#include "screen.h" #include "ibm8514a.h" -class ibm8514a_device; +#include "screen.h" + // ======================> vga_device diff --git a/src/devices/video/pc_vga_ati.h b/src/devices/video/pc_vga_ati.h index d8c8b31d47b..70c83f50e11 100644 --- a/src/devices/video/pc_vga_ati.h +++ b/src/devices/video/pc_vga_ati.h @@ -6,10 +6,12 @@ #pragma once -#include "screen.h" -#include "video/pc_vga.h" -#include "video/ati_mach8.h" #include "machine/eepromser.h" +#include "video/ati_mach8.h" +#include "video/pc_vga.h" + +#include "screen.h" + class ati_vga_device : public svga_device { diff --git a/src/devices/video/pc_vga_nvidia.h b/src/devices/video/pc_vga_nvidia.h index 3ce6191c943..14213e64af2 100644 --- a/src/devices/video/pc_vga_nvidia.h +++ b/src/devices/video/pc_vga_nvidia.h @@ -6,9 +6,11 @@ #pragma once -#include "screen.h" #include "video/pc_vga.h" +#include "screen.h" + + class nvidia_nv3_vga_device : public svga_device { public: diff --git a/src/devices/video/pc_vga_s3.h b/src/devices/video/pc_vga_s3.h index 1811e5bb703..a7de03db80c 100644 --- a/src/devices/video/pc_vga_s3.h +++ b/src/devices/video/pc_vga_s3.h @@ -6,9 +6,11 @@ #pragma once -#include "screen.h" #include "video/pc_vga.h" +#include "screen.h" + + class s3_vga_device : public svga_device { public: diff --git a/src/devices/video/pc_vga_tseng.h b/src/devices/video/pc_vga_tseng.h index 5354bfb82e2..85279de7580 100644 --- a/src/devices/video/pc_vga_tseng.h +++ b/src/devices/video/pc_vga_tseng.h @@ -6,9 +6,11 @@ #pragma once -#include "screen.h" #include "video/pc_vga.h" +#include "screen.h" + + class tseng_vga_device : public svga_device { public: diff --git a/src/devices/video/pc_xga.h b/src/devices/video/pc_xga.h index 370963bee26..b3973608187 100644 --- a/src/devices/video/pc_xga.h +++ b/src/devices/video/pc_xga.h @@ -4,9 +4,11 @@ #ifndef MAME_VIDEO_PC_XGA_H #define MAME_VIDEO_PC_XGA_H -#include "screen.h" #include "pc_vga.h" +#include "screen.h" + + class xga_copro_device : public device_t { public: diff --git a/src/mame/mame.lst b/src/mame/mame.lst index 3d93592d629..193915a60e6 100755 --- a/src/mame/mame.lst +++ b/src/mame/mame.lst @@ -35410,10 +35410,10 @@ streetg2r5 // (c) 1993 streetgr3 // (c) 1993 @source:pc/pcipc.cpp -pcipc // -pcinv3 // -pcipctx // pciagp // +pcinv3 // +pcipc // +pcipctx // @source:pc/pcipc_sis.cpp sis85c496 // 486 motherboards using the SiS 85C496/85C497 chipset diff --git a/src/mame/pc/pcat_dyn.cpp b/src/mame/pc/pcat_dyn.cpp index dc9817e699f..906ed02fd68 100644 --- a/src/mame/pc/pcat_dyn.cpp +++ b/src/mame/pc/pcat_dyn.cpp @@ -24,20 +24,22 @@ If the output isn't satisfactory, it prints "I/O BOARD FAILURE". #include "pcshare.h" +#include "bus/isa/isa.h" +#include "bus/isa/sblaster.h" +#include "bus/rs232/hlemouse.h" +#include "bus/rs232/rs232.h" + #include "cpu/i386/i386.h" + #include "machine/ds128x.h" #include "machine/ins8250.h" #include "machine/nvram.h" #include "sound/ad1848.h" - -#include "bus/isa/isa.h" -#include "bus/isa/sblaster.h" #include "video/pc_vga_trident.h" -#include "bus/rs232/hlemouse.h" -#include "bus/rs232/rs232.h" #include "screen.h" + namespace { class pcat_dyn_state : public pcat_base_state @@ -48,7 +50,8 @@ public: , m_isabus(*this, "isa") , m_prgbank(*this, "prgbank") , m_nvram_bank(*this, "nvram_bank") - , m_nvram_mem(0x2000){ } + , m_nvram_mem(0x2000) + { } void pcat_dyn(machine_config &config); diff --git a/src/mame/pc/pcipc.cpp b/src/mame/pc/pcipc.cpp index 800c9078a07..f72b2b8a77d 100644 --- a/src/mame/pc/pcipc.cpp +++ b/src/mame/pc/pcipc.cpp @@ -27,21 +27,21 @@ #include "bus/rs232/terminal.h" #include "cpu/i386/i386.h" #include "machine/fdc37c93x.h" -#include "machine/w83977tf.h" +#include "machine/i82371eb_acpi.h" +#include "machine/i82371eb_ide.h" +#include "machine/i82371eb_isa.h" +#include "machine/i82371eb_usb.h" #include "machine/i82371sb.h" #include "machine/i82439hx.h" #include "machine/i82439tx.h" #include "machine/i82443bx_host.h" -#include "machine/i82371eb_isa.h" -#include "machine/i82371eb_ide.h" -#include "machine/i82371eb_acpi.h" -#include "machine/i82371eb_usb.h" -#include "machine/pci-ide.h" #include "machine/pci.h" -#include "video/mga2064w.h" -#include "video/virge_pci.h" -#include "video/riva128.h" +#include "machine/pci-ide.h" +#include "machine/w83977tf.h" #include "video/clgd546x_laguna.h" +#include "video/mga2064w.h" +#include "video/riva128.h" +#include "video/virge_pci.h" namespace { diff --git a/src/mame/sunelectronics/markham.cpp b/src/mame/sunelectronics/markham.cpp index 30cbe755357..5ed38ea9185 100644 --- a/src/mame/sunelectronics/markham.cpp +++ b/src/mame/sunelectronics/markham.cpp @@ -24,7 +24,19 @@ *****************************************************************************/ #include "emu.h" -#include "markham.h" + +#include "cpu/mb88xx/mb88xx.h" +#include "cpu/z80/z80.h" +#include "machine/timer.h" +#include "sound/sn76496.h" + +#include "emupal.h" +#include "screen.h" +#include "speaker.h" +#include "tilemap.h" + + +namespace { #define MASTER_CLOCK (20_MHz_XTAL) #define PIXEL_CLOCK (MASTER_CLOCK/4) // guess @@ -38,6 +50,262 @@ #define VBEND (16) #define VBSTART (240) + +class markham_state : public driver_device +{ +public: + // construction/destruction + markham_state(const machine_config &mconfig, device_type type, const char *tag) + : driver_device(mconfig, type, tag) + , m_maincpu(*this, "maincpu") + , m_subcpu(*this, "subcpu") + , m_mcu(*this, "mcu") + , m_sn(*this, "sn%u", 1U) + , m_screen(*this, "screen") + , m_gfxdecode(*this, "gfxdecode") + , m_palette(*this, "palette") + , m_spriteram(*this, "spriteram") + , m_videoram(*this, "videoram") + , m_xscroll(*this, "xscroll") + , m_scroll_ctrl(0) + , m_irq_source(0) + , m_irq_scanline_start(0) + , m_irq_scanline_end(0) + , m_coin2_lock_cnt(3) + , m_packet_buffer{} + , m_packet_write_pos(0) + , m_packet_reset(true) + { + } + + void markham(machine_config &config) ATTR_COLD; + void strnskil(machine_config &config) ATTR_COLD; + void banbam(machine_config &config) ATTR_COLD; + +protected: + virtual void machine_start() override ATTR_COLD; + virtual void machine_reset() override ATTR_COLD; + virtual void video_start() override ATTR_COLD; + +private: + void base_master_map(address_map &map) ATTR_COLD; + void markham_master_map(address_map &map) ATTR_COLD; + void strnskil_master_map(address_map &map) ATTR_COLD; + void banbam_master_map(address_map &map) ATTR_COLD; + void markham_slave_map(address_map &map) ATTR_COLD; + void strnskil_slave_map(address_map &map) ATTR_COLD; + + void coin_output_w(uint8_t data); + void flipscreen_w(uint8_t data); + void videoram_w(offs_t offset, uint8_t data); + + // markham specific + uint8_t markham_e004_r(); + + // strnskil specific + uint8_t strnskil_d800_r(); + void strnskil_master_output_w(uint8_t data); + + // protection comms for banbam/pettanp + uint8_t banbam_protection_r(); + void banbam_protection_w(uint8_t data); + void mcu_reset_w(uint8_t data); + + uint32_t screen_update_markham(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + uint32_t screen_update_strnskil(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); + + TILE_GET_INFO_MEMBER(get_bg_tile_info); + + void markham_palette(palette_device &palette) const; + DECLARE_VIDEO_START(strnskil); + + void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); + + TIMER_DEVICE_CALLBACK_MEMBER(strnskil_scanline); + + required_device m_maincpu; + required_device m_subcpu; + optional_device m_mcu; + required_device_array m_sn; + required_device m_screen; + required_device m_gfxdecode; + required_device m_palette; + + /* memory pointers */ + required_shared_ptr m_spriteram; + required_shared_ptr m_videoram; + required_shared_ptr m_xscroll; + + /* video-related */ + tilemap_t *m_bg_tilemap = nullptr; + + uint8_t m_scroll_ctrl; + uint8_t m_irq_source; + uint8_t m_irq_scanline_start; + uint8_t m_irq_scanline_end; + + /* misc */ + uint8_t m_coin2_lock_cnt; + + /* banbam protection simulation */ + uint8_t m_packet_buffer[2]; + uint8_t m_packet_write_pos; + bool m_packet_reset; + + u8 m_strnskil_slave_irq = 0; +}; + + +void markham_state::markham_palette(palette_device &palette) const +{ + const uint8_t *color_prom = memregion("proms")->base(); + + // create a lookup table for the palette + for (int i = 0; i < 0x100; i++) + { + int const r = pal4bit(color_prom[i | 0x000]); + int const g = pal4bit(color_prom[i | 0x100]); + int const b = pal4bit(color_prom[i | 0x200]); + + palette.set_indirect_color(i, rgb_t(r, g, b)); + } + + // color_prom now points to the beginning of the lookup table + color_prom += 0x300; + + // sprites lookup table + for (int i = 0; i < 0x400; i++) + { + uint8_t const ctabentry = color_prom[i]; + palette.set_pen_indirect(i, ctabentry); + } +} + +void markham_state::videoram_w(offs_t offset, uint8_t data) +{ + m_videoram[offset] = data; + m_bg_tilemap->mark_tile_dirty(offset / 2); +} + +TILE_GET_INFO_MEMBER(markham_state::get_bg_tile_info) +{ + int attr = m_videoram[tile_index * 2]; + int code = m_videoram[(tile_index * 2) + 1] + ((attr & 0x60) << 3); + int color = (attr & 0x1f) | ((attr & 0x80) >> 2); + + tileinfo.set(0, code, color, 0); +} + +void markham_state::video_start() +{ + m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(markham_state::get_bg_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 32, 32); + + m_bg_tilemap->set_scroll_rows(32); +} + +VIDEO_START_MEMBER(markham_state, strnskil) +{ + video_start(); + + m_bg_tilemap->set_scroll_rows(32); + m_irq_scanline_start = 109; + m_irq_scanline_end = 240; + + save_item(NAME(m_irq_source)); + save_item(NAME(m_irq_scanline_start)); + save_item(NAME(m_irq_scanline_end)); + save_item(NAME(m_scroll_ctrl)); +} + +void markham_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) +{ + uint8_t *spriteram = m_spriteram; + int offs; + + for (offs = 0x60; offs < 0x100; offs += 4) + { + int chr = spriteram[offs + 1]; + int col = spriteram[offs + 2]; + + int fx = flip_screen(); + int fy = flip_screen(); + + int x = spriteram[offs + 3]; + int y = spriteram[offs + 0]; + int px, py; + col &= 0x3f; + + if (flip_screen() == 0) + { + px = x - 2; + py = 240 - y; + } + else + { + px = 240 - x; + py = y; + } + + px = px & 0xff; + + if (px > 248) + px = px - 256; + + m_gfxdecode->gfx(1)->transmask(bitmap,cliprect, + chr, + col, + fx,fy, + px,py, + m_palette->transpen_mask(*m_gfxdecode->gfx(1), col, 0)); + } +} + +uint32_t markham_state::screen_update_markham(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + int row; + + for (row = 0; row < 32; row++) + { + if ((row > 3) && (row < 16)) + m_bg_tilemap->set_scrollx(row, m_xscroll[0]); + if (row >= 16) + m_bg_tilemap->set_scrollx(row, m_xscroll[1]); + } + + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + draw_sprites(bitmap, cliprect); + return 0; +} + +uint32_t markham_state::screen_update_strnskil(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) +{ + const uint8_t *scroll_data = (const uint8_t *)memregion("scroll_prom")->base(); + + int row; + + for (row = 0; row < 32; row++) + { + switch (scroll_data[m_scroll_ctrl * 32 + row]) + { + case 2: + m_bg_tilemap->set_scrollx(row, -~m_xscroll[1]); + break; + case 4: + m_bg_tilemap->set_scrollx(row, -~m_xscroll[0]); + break; + default: + // case 6 and 0 + m_bg_tilemap->set_scrollx(row, 0); + break; + } + } + + m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); + draw_sprites(bitmap, cliprect); + return 0; +} + + uint8_t markham_state::markham_e004_r() { return 0; @@ -812,6 +1080,9 @@ ROM_START( pettanp ) ROM_LOAD( "sun-8212.ic3", 0x000, 0x800, NO_DUMP ) // very much likely to be same as banbam and arabian ROM_END +} // anonymous namespace + + /* Markham hardware */ GAME( 1983, markham, 0, markham, markham, markham_state, empty_init, ROT0, "Sun Electronics", "Markham", MACHINE_SUPPORTS_SAVE ) diff --git a/src/mame/sunelectronics/markham.h b/src/mame/sunelectronics/markham.h deleted file mode 100644 index 23040c05b2e..00000000000 --- a/src/mame/sunelectronics/markham.h +++ /dev/null @@ -1,126 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Uki - -#ifndef MAME_SUNELECTRONICS_MARKHAM_H -#define MAME_SUNELECTRONICS_MARKHAM_H - -#pragma once - -#include "machine/timer.h" - -#include "cpu/z80/z80.h" -#include "cpu/mb88xx/mb88xx.h" -#include "sound/sn76496.h" -#include "emupal.h" -#include "screen.h" -#include "speaker.h" -#include "tilemap.h" - -class markham_state : public driver_device -{ -public: - // construction/destruction - markham_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag) - , m_maincpu(*this, "maincpu") - , m_subcpu(*this, "subcpu") - , m_mcu(*this, "mcu") - , m_sn(*this, "sn%u", 1U) - , m_screen(*this, "screen") - , m_gfxdecode(*this, "gfxdecode") - , m_palette(*this, "palette") - , m_spriteram(*this, "spriteram") - , m_videoram(*this, "videoram") - , m_xscroll(*this, "xscroll") - , m_scroll_ctrl(0) - , m_irq_source(0) - , m_irq_scanline_start(0) - , m_irq_scanline_end(0) - , m_coin2_lock_cnt(3) - , m_packet_buffer{} - , m_packet_write_pos(0) - , m_packet_reset(true) - { - } - - void markham(machine_config &config); - void strnskil(machine_config &config); - void banbam(machine_config &config); - - void init_common(); - void init_banbam(); - void init_pettanp(); - -private: - void base_master_map(address_map &map); - void markham_master_map(address_map &map); - void strnskil_master_map(address_map &map); - void banbam_master_map(address_map &map); - void markham_slave_map(address_map &map); - void strnskil_slave_map(address_map &map); - - void coin_output_w(uint8_t data); - void flipscreen_w(uint8_t data); - void videoram_w(offs_t offset, uint8_t data); - - // markham specific - uint8_t markham_e004_r(); - - // strnskil specific - uint8_t strnskil_d800_r(); - void strnskil_master_output_w(uint8_t data); - - // protection comms for banbam/pettanp - uint8_t banbam_protection_r(); - void banbam_protection_w(uint8_t data); - void mcu_reset_w(uint8_t data); - - virtual void machine_start() override; - virtual void machine_reset() override; - virtual void video_start() override; - - uint32_t screen_update_markham(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - uint32_t screen_update_strnskil(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - - TILE_GET_INFO_MEMBER(get_bg_tile_info); - - void markham_palette(palette_device &palette) const; - DECLARE_VIDEO_START(strnskil); - - void draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect); - - TIMER_DEVICE_CALLBACK_MEMBER(strnskil_scanline); - - required_device m_maincpu; - required_device m_subcpu; - optional_device m_mcu; - required_device_array m_sn; - required_device m_screen; - required_device m_gfxdecode; - required_device m_palette; - - /* memory pointers */ - required_shared_ptr m_spriteram; - required_shared_ptr m_videoram; - required_shared_ptr m_xscroll; - - /* video-related */ - tilemap_t *m_bg_tilemap = nullptr; - - uint8_t m_scroll_ctrl; - uint8_t m_irq_source; - uint8_t m_irq_scanline_start; - uint8_t m_irq_scanline_end; - - /* misc */ - uint8_t m_coin2_lock_cnt; - - /* banbam protection simulation */ - uint8_t m_packet_buffer[2]; - uint8_t m_packet_write_pos; - bool m_packet_reset; - - u8 m_strnskil_slave_irq = 0; -}; - -#endif // MAME_SUNELECTRONICS_MARKHAM_H diff --git a/src/mame/sunelectronics/markham_v.cpp b/src/mame/sunelectronics/markham_v.cpp deleted file mode 100644 index 32870c0cda7..00000000000 --- a/src/mame/sunelectronics/markham_v.cpp +++ /dev/null @@ -1,159 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Uki -/****************************************************************************** - - Video hardware driver by Uki - -******************************************************************************/ - -#include "emu.h" -#include "markham.h" - -void markham_state::markham_palette(palette_device &palette) const -{ - const uint8_t *color_prom = memregion("proms")->base(); - - // create a lookup table for the palette - for (int i = 0; i < 0x100; i++) - { - int const r = pal4bit(color_prom[i | 0x000]); - int const g = pal4bit(color_prom[i | 0x100]); - int const b = pal4bit(color_prom[i | 0x200]); - - palette.set_indirect_color(i, rgb_t(r, g, b)); - } - - // color_prom now points to the beginning of the lookup table - color_prom += 0x300; - - // sprites lookup table - for (int i = 0; i < 0x400; i++) - { - uint8_t const ctabentry = color_prom[i]; - palette.set_pen_indirect(i, ctabentry); - } -} - -void markham_state::videoram_w(offs_t offset, uint8_t data) -{ - m_videoram[offset] = data; - m_bg_tilemap->mark_tile_dirty(offset / 2); -} - -TILE_GET_INFO_MEMBER(markham_state::get_bg_tile_info) -{ - int attr = m_videoram[tile_index * 2]; - int code = m_videoram[(tile_index * 2) + 1] + ((attr & 0x60) << 3); - int color = (attr & 0x1f) | ((attr & 0x80) >> 2); - - tileinfo.set(0, code, color, 0); -} - -void markham_state::video_start() -{ - m_bg_tilemap = &machine().tilemap().create(*m_gfxdecode, tilemap_get_info_delegate(*this, FUNC(markham_state::get_bg_tile_info)), TILEMAP_SCAN_COLS, 8, 8, 32, 32); - - m_bg_tilemap->set_scroll_rows(32); -} - -VIDEO_START_MEMBER(markham_state, strnskil) -{ - video_start(); - - m_bg_tilemap->set_scroll_rows(32); - m_irq_scanline_start = 109; - m_irq_scanline_end = 240; - - save_item(NAME(m_irq_source)); - save_item(NAME(m_irq_scanline_start)); - save_item(NAME(m_irq_scanline_end)); - save_item(NAME(m_scroll_ctrl)); -} - -void markham_state::draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect ) -{ - uint8_t *spriteram = m_spriteram; - int offs; - - for (offs = 0x60; offs < 0x100; offs += 4) - { - int chr = spriteram[offs + 1]; - int col = spriteram[offs + 2]; - - int fx = flip_screen(); - int fy = flip_screen(); - - int x = spriteram[offs + 3]; - int y = spriteram[offs + 0]; - int px, py; - col &= 0x3f; - - if (flip_screen() == 0) - { - px = x - 2; - py = 240 - y; - } - else - { - px = 240 - x; - py = y; - } - - px = px & 0xff; - - if (px > 248) - px = px - 256; - - m_gfxdecode->gfx(1)->transmask(bitmap,cliprect, - chr, - col, - fx,fy, - px,py, - m_palette->transpen_mask(*m_gfxdecode->gfx(1), col, 0)); - } -} - -uint32_t markham_state::screen_update_markham(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - int row; - - for (row = 0; row < 32; row++) - { - if ((row > 3) && (row < 16)) - m_bg_tilemap->set_scrollx(row, m_xscroll[0]); - if (row >= 16) - m_bg_tilemap->set_scrollx(row, m_xscroll[1]); - } - - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - draw_sprites(bitmap, cliprect); - return 0; -} - -uint32_t markham_state::screen_update_strnskil(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) -{ - const uint8_t *scroll_data = (const uint8_t *)memregion("scroll_prom")->base(); - - int row; - - for (row = 0; row < 32; row++) - { - switch (scroll_data[m_scroll_ctrl * 32 + row]) - { - case 2: - m_bg_tilemap->set_scrollx(row, -~m_xscroll[1]); - break; - case 4: - m_bg_tilemap->set_scrollx(row, -~m_xscroll[0]); - break; - default: - // case 6 and 0 - m_bg_tilemap->set_scrollx(row, 0); - break; - } - } - - m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); - draw_sprites(bitmap, cliprect); - return 0; -}