diff options
Diffstat (limited to 'src/devices/bus/isa/trident.cpp')
-rw-r--r-- | src/devices/bus/isa/trident.cpp | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/src/devices/bus/isa/trident.cpp b/src/devices/bus/isa/trident.cpp index b97f35abc78..5f97774ceba 100644 --- a/src/devices/bus/isa/trident.cpp +++ b/src/devices/bus/isa/trident.cpp @@ -20,41 +20,41 @@ const device_type TVGA9000_VGA = &device_creator<tvga9000_device>; #define LOG (1) #define LOG_ACCEL (1) -trident_vga_device::trident_vga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) +trident_vga_device::trident_vga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, uint32_t clock, const char *shortname, const char *source) : svga_device(mconfig, type, name, tag, owner, clock, shortname, source) { } -tgui9860_device::tgui9860_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tgui9860_device::tgui9860_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : trident_vga_device(mconfig, TRIDENT_VGA, "Trident TGUI9680", tag, owner, clock, "trident_vga", __FILE__) { m_version = 0xd3; // 0xd3 identifies at TGUI9660XGi (set to 0xe3 to identify at TGUI9440AGi) } -tvga9000_device::tvga9000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +tvga9000_device::tvga9000_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : trident_vga_device(mconfig, TVGA9000_VGA, "Trident TVGA9000", tag, owner, clock, "tvga9000_vga", __FILE__) { m_version = 0x43; } -UINT8 trident_vga_device::READPIXEL8(INT16 x, INT16 y) +uint8_t trident_vga_device::READPIXEL8(int16_t x, int16_t y) { return (vga.memory[((y & 0xfff)*offset() + (x & 0xfff)) % vga.svga_intf.vram_size]); } -UINT16 trident_vga_device::READPIXEL15(INT16 x, INT16 y) +uint16_t trident_vga_device::READPIXEL15(int16_t x, int16_t y) { return (vga.memory[((y & 0xfff)*offset() + (x & 0xfff)*2) % vga.svga_intf.vram_size] | (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*2)+1) % vga.svga_intf.vram_size] << 8)); } -UINT16 trident_vga_device::READPIXEL16(INT16 x, INT16 y) +uint16_t trident_vga_device::READPIXEL16(int16_t x, int16_t y) { return (vga.memory[((y & 0xfff)*offset() + (x & 0xfff)*2) % vga.svga_intf.vram_size] | (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*2)+1) % vga.svga_intf.vram_size] << 8)); } -UINT32 trident_vga_device::READPIXEL32(INT16 x, INT16 y) +uint32_t trident_vga_device::READPIXEL32(int16_t x, int16_t y) { return (vga.memory[((y & 0xfff)*offset() + (x & 0xfff)*4) % vga.svga_intf.vram_size] | (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*4)+1) % vga.svga_intf.vram_size] << 8) | @@ -62,7 +62,7 @@ UINT32 trident_vga_device::READPIXEL32(INT16 x, INT16 y) (vga.memory[((y & 0xfff)*offset() + ((x & 0xfff)*4)+3) % vga.svga_intf.vram_size] << 24)); } -void trident_vga_device::WRITEPIXEL8(INT16 x, INT16 y, UINT8 data) +void trident_vga_device::WRITEPIXEL8(int16_t x, int16_t y, uint8_t data) { if((x & 0xfff)<tri.accel_dest_x_clip && (y & 0xfff)<tri.accel_dest_y_clip) { @@ -71,7 +71,7 @@ void trident_vga_device::WRITEPIXEL8(INT16 x, INT16 y, UINT8 data) } } -void trident_vga_device::WRITEPIXEL15(INT16 x, INT16 y, UINT16 data) +void trident_vga_device::WRITEPIXEL15(int16_t x, int16_t y, uint16_t data) { if((x & 0xfff)<tri.accel_dest_x_clip && (y & 0xfff)<tri.accel_dest_y_clip) { @@ -81,7 +81,7 @@ void trident_vga_device::WRITEPIXEL15(INT16 x, INT16 y, UINT16 data) } } -void trident_vga_device::WRITEPIXEL16(INT16 x, INT16 y, UINT16 data) +void trident_vga_device::WRITEPIXEL16(int16_t x, int16_t y, uint16_t data) { if((x & 0xfff)<tri.accel_dest_x_clip && (y & 0xfff)<tri.accel_dest_y_clip) { @@ -91,7 +91,7 @@ void trident_vga_device::WRITEPIXEL16(INT16 x, INT16 y, UINT16 data) } } -void trident_vga_device::WRITEPIXEL32(INT16 x, INT16 y, UINT32 data) +void trident_vga_device::WRITEPIXEL32(int16_t x, int16_t y, uint32_t data) { if((x & 0xfff)<tri.accel_dest_x_clip && (y & 0xfff)<tri.accel_dest_y_clip) { @@ -103,7 +103,7 @@ void trident_vga_device::WRITEPIXEL32(INT16 x, INT16 y, UINT32 data) } } -UINT32 trident_vga_device::handle_rop(UINT32 src, UINT32 dst) +uint32_t trident_vga_device::handle_rop(uint32_t src, uint32_t dst) { switch(tri.accel_fmix) // TODO: better understand this register { @@ -127,7 +127,7 @@ UINT32 trident_vga_device::handle_rop(UINT32 src, UINT32 dst) return src; } -UINT32 trident_vga_device::READPIXEL(INT16 x,INT16 y) +uint32_t trident_vga_device::READPIXEL(int16_t x,int16_t y) { if(svga.rgb8_en) return READPIXEL8(x,y) & 0xff; @@ -140,7 +140,7 @@ UINT32 trident_vga_device::READPIXEL(INT16 x,INT16 y) return 0; // should never reach here } -void trident_vga_device::WRITEPIXEL(INT16 x,INT16 y, UINT32 data) +void trident_vga_device::WRITEPIXEL(int16_t x,int16_t y, uint32_t data) { if(svga.rgb8_en) WRITEPIXEL8(x,y,(((data >> 8) & 0xff) | (data & 0xff))); // XFree86 3.3 sets bits 0-7 to 0 when using mono patterns, does it OR each byte? @@ -207,9 +207,9 @@ void trident_vga_device::device_reset() tri.pixel_depth = 0x10; //disable 8bpp mode by default } -UINT32 trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { - UINT8 cur_mode; + uint8_t cur_mode; svga_device::screen_update(screen,bitmap,cliprect); cur_mode = pc_vga_choosevideomode(); @@ -217,15 +217,15 @@ UINT32 trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bi // draw hardware graphics cursor if(tri.cursor_ctrl & 0x80) // if cursor is enabled { - UINT32 src; - UINT32* dst; - UINT8 val; + uint32_t src; + uint32_t* dst; + uint8_t val; int x,y; - UINT16 cx = tri.cursor_x & 0x0fff; - UINT16 cy = tri.cursor_y & 0x0fff; - UINT32 bg_col; - UINT32 fg_col; - UINT8 cursor_size = (tri.cursor_ctrl & 0x01) ? 64 : 32; + uint16_t cx = tri.cursor_x & 0x0fff; + uint16_t cy = tri.cursor_y & 0x0fff; + uint32_t bg_col; + uint32_t fg_col; + uint8_t cursor_size = (tri.cursor_ctrl & 0x01) ? 64 : 32; if(cur_mode == SCREEN_OFF || cur_mode == TEXT_MODE || cur_mode == MONO_MODE || cur_mode == CGA_MODE || cur_mode == EGA_MODE) return 0; // cursor only works in VGA or SVGA modes @@ -245,15 +245,15 @@ UINT32 trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bi for(y=0;y<cursor_size;y++) { - UINT8 bitcount = 31; + uint8_t bitcount = 31; dst = &bitmap.pix32(cy + y, cx); for(x=0;x<cursor_size;x++) { - UINT32 bitb = (vga.memory[(src+3) % vga.svga_intf.vram_size] + uint32_t bitb = (vga.memory[(src+3) % vga.svga_intf.vram_size] | ((vga.memory[(src+2) % vga.svga_intf.vram_size]) << 8) | ((vga.memory[(src+1) % vga.svga_intf.vram_size]) << 16) | ((vga.memory[(src+0) % vga.svga_intf.vram_size]) << 24)); - UINT32 bita = (vga.memory[(src+7) % vga.svga_intf.vram_size] + uint32_t bita = (vga.memory[(src+7) % vga.svga_intf.vram_size] | ((vga.memory[(src+6) % vga.svga_intf.vram_size]) << 8) | ((vga.memory[(src+5) % vga.svga_intf.vram_size]) << 16) | ((vga.memory[(src+4) % vga.svga_intf.vram_size]) << 24)); @@ -307,9 +307,9 @@ UINT32 trident_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bi return 0; } -UINT16 trident_vga_device::offset() +uint16_t trident_vga_device::offset() { - UINT16 off = svga_device::offset(); + uint16_t off = svga_device::offset(); if (svga.rgb8_en || svga.rgb15_en || svga.rgb16_en || svga.rgb32_en) return vga.crtc.offset << 3; // don't know if this is right, but Eggs Playing Chicken switches off doubleword mode, but expects the same offset length @@ -324,7 +324,7 @@ int trident_vga_device::calculate_clock() // Bit 12: K // Later formula extends each variable by one extra bit (Providia 9685 and later) double freq; - UINT8 m,n,k; + uint8_t m,n,k; m = tri.vid_clock & 0x007f; n = (tri.vid_clock & 0x0f80) >> 7; @@ -401,9 +401,9 @@ void trident_vga_device::trident_define_video_mode() recompute_params_clock(divisor, xtal); } -UINT8 trident_vga_device::trident_seq_reg_read(UINT8 index) +uint8_t trident_vga_device::trident_seq_reg_read(uint8_t index) { - UINT8 res; + uint8_t res; res = 0xff; @@ -450,7 +450,7 @@ UINT8 trident_vga_device::trident_seq_reg_read(UINT8 index) return res; } -void trident_vga_device::trident_seq_reg_write(UINT8 index, UINT8 data) +void trident_vga_device::trident_seq_reg_write(uint8_t index, uint8_t data) { vga.sequencer.data[vga.sequencer.index] = data; if(index <= 0x04) @@ -509,9 +509,9 @@ void trident_vga_device::trident_seq_reg_write(UINT8 index, UINT8 data) if(LOG) logerror("Trident SR%02X: %s mode write %02x\n",index,tri.new_mode ? "new" : "old",data); } -UINT8 trident_vga_device::trident_crtc_reg_read(UINT8 index) +uint8_t trident_vga_device::trident_crtc_reg_read(uint8_t index) { - UINT8 res = 0; + uint8_t res = 0; if(index <= 0x18) res = crtc_reg_read(index); @@ -613,7 +613,7 @@ UINT8 trident_vga_device::trident_crtc_reg_read(UINT8 index) if(LOG) logerror("Trident CR%02X: read %02x\n",index,res); return res; } -void trident_vga_device::trident_crtc_reg_write(UINT8 index, UINT8 data) +void trident_vga_device::trident_crtc_reg_write(uint8_t index, uint8_t data) { if(index <= 0x18) { @@ -723,9 +723,9 @@ void trident_vga_device::trident_crtc_reg_write(UINT8 index, UINT8 data) if(LOG) logerror("Trident CR%02X: write %02x\n",index,data); } -UINT8 trident_vga_device::trident_gc_reg_read(UINT8 index) +uint8_t trident_vga_device::trident_gc_reg_read(uint8_t index) { - UINT8 res; + uint8_t res; if(index <= 0x0d) res = gc_reg_read(index); @@ -752,7 +752,7 @@ UINT8 trident_vga_device::trident_gc_reg_read(UINT8 index) return res; } -void trident_vga_device::trident_gc_reg_write(UINT8 index, UINT8 data) +void trident_vga_device::trident_gc_reg_write(uint8_t index, uint8_t data) { if(index <= 0x0d) gc_reg_write(index,data); @@ -786,7 +786,7 @@ void trident_vga_device::trident_gc_reg_write(UINT8 index, UINT8 data) READ8_MEMBER(trident_vga_device::port_03c0_r) { - UINT8 res; + uint8_t res; switch(offset) { @@ -857,7 +857,7 @@ WRITE8_MEMBER(trident_vga_device::port_03c0_w) READ8_MEMBER(trident_vga_device::port_03d0_r) { - UINT8 res = 0xff; + uint8_t res = 0xff; if (CRTC_PORT_ADDR == 0x3d0) { @@ -939,7 +939,7 @@ WRITE8_MEMBER(trident_vga_device::port_03d0_w) READ8_MEMBER(trident_vga_device::port_43c6_r) { - UINT8 res = 0xff; + uint8_t res = 0xff; switch(offset) { case 2: @@ -997,7 +997,7 @@ WRITE8_MEMBER(trident_vga_device::port_43c6_w) // Not much else is known. XFree86 uses register 4 for something related to DPMS READ8_MEMBER(trident_vga_device::port_83c6_r) { - UINT8 res = 0xff; + uint8_t res = 0xff; switch(offset) { case 2: @@ -1110,13 +1110,13 @@ WRITE8_MEMBER(trident_vga_device::mem_w) } // Old style MMIO (maps to 0xbff00) -void trident_vga_device::old_mmio_w(address_space& space, UINT32 offset, UINT8 data) +void trident_vga_device::old_mmio_w(address_space& space, uint32_t offset, uint8_t data) { if(offset >= 0x20) accel_w(space,offset-0x20,data); } -UINT8 trident_vga_device::old_mmio_r(address_space& space, UINT32 offset) +uint8_t trident_vga_device::old_mmio_r(address_space& space, uint32_t offset) { if(offset == 0x20) { @@ -1194,7 +1194,7 @@ Graphics Engine for 9440/9660/9680 READ8_MEMBER(trident_vga_device::accel_r) { - UINT8 res = 0xff; + uint8_t res = 0xff; if(offset >= 0x60) return tri.accel_pattern[(offset-0x60) % 0x80]; @@ -1561,13 +1561,13 @@ void trident_vga_device::accel_bitblt() void trident_vga_device::accel_line() { - UINT32 col = tri.accel_fgcolour; + uint32_t col = tri.accel_fgcolour; // TGUI_SRC_XY(dmin-dmaj,dmin); // TGUI_DEST_XY(x,y); // TGUI_DIM_XY(dmin+e,len); - INT16 dx = tri.accel_source_y - tri.accel_source_x; - INT16 dy = tri.accel_source_y; - INT16 err = tri.accel_dim_x + tri.accel_source_y; + int16_t dx = tri.accel_source_y - tri.accel_source_x; + int16_t dy = tri.accel_source_y; + int16_t err = tri.accel_dim_x + tri.accel_source_y; int sx = (tri.accel_drawflags & 0x0200) ? -1 : 1; int sy = (tri.accel_drawflags & 0x0100) ? -1 : 1; int x,y,z; @@ -1600,7 +1600,7 @@ void trident_vga_device::accel_line() } // feed data written to VRAM to an active BitBLT command -void trident_vga_device::accel_data_write(UINT32 data) +void trident_vga_device::accel_data_write(uint32_t data) { int xdir = 1,ydir = 1; |