Previous 15994 Revisions Next

r14222 Friday 27th January, 2012 at 03:33:20 UTC by Angelo Salese
Add files
[src/mess/video]isa_svga_s3.c* isa_svga_s3.h*

src/mess/video/isa_svga_s3.c
r0r14222
1/***************************************************************************
2
3  ISA SVGA S3 wrapper
4
5***************************************************************************/
6
7#include "emu.h"
8#include "isa_svga_s3.h"
9#include "video/pc_vga.h"
10
11ROM_START( s3_764 )
12   ROM_REGION(0x8000,"s3_764", 0)
13   ROM_LOAD("s3_764.bin", 0x00000, 0x8000, CRC(4f10aac7) SHA1(c77b3f11cc15679121314823588887dd547cd715) )
14   ROM_IGNORE( 0x8000 )
15ROM_END
16
17//**************************************************************************
18//  GLOBAL VARIABLES
19//**************************************************************************
20
21const device_type ISA8_SVGA_S3 = &device_creator<isa8_svga_s3_device>;
22
23
24//-------------------------------------------------
25//  machine_config_additions - device-specific
26//  machine configurations
27//-------------------------------------------------
28
29machine_config_constructor isa8_svga_s3_device::device_mconfig_additions() const
30{
31   return MACHINE_CONFIG_NAME( pcvideo_vga_isa );
32}
33
34//-------------------------------------------------
35//  rom_region - device-specific ROM region
36//-------------------------------------------------
37
38const rom_entry *isa8_svga_s3_device::device_rom_region() const
39{
40   return ROM_NAME( s3_764 );
41}
42
43//**************************************************************************
44//  LIVE DEVICE
45//**************************************************************************
46
47//-------------------------------------------------
48//  isa8_vga_device - constructor
49//-------------------------------------------------
50
51isa8_svga_s3_device::isa8_svga_s3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
52        device_t(mconfig, ISA8_SVGA_S3, "ISA8_SVGA_S3", tag, owner, clock),
53      device_isa8_card_interface(mconfig, *this)
54{
55   m_shortname = "s3_864";
56}
57
58//-------------------------------------------------
59//  device_start - device-specific startup
60//-------------------------------------------------
61static READ8_HANDLER( input_port_0_r ) { return 0xff; } //return input_port_read(space->machine(), "IN0"); }
62
63void isa8_svga_s3_device::device_start()
64{
65   set_isa_device();
66
67   video_start_vga( machine() );
68
69   pc_vga_init(machine(), input_port_0_r, NULL);
70
71   int i;
72   for (i = 0; i < 0x100; i++)
73      palette_set_color_rgb(machine(), i, 0, 0, 0);
74   pc_video_start(machine());
75
76   m_isa->install_rom(this, 0xc0000, 0xc7fff, 0, 0, "svga", "s3_764");
77
78   m_isa->install_device(0x3b0, 0x3bf, 0, 0, FUNC(vga_port_03b0_r), FUNC(vga_port_03b0_w));
79   m_isa->install_device(0x3c0, 0x3cf, 0, 0, FUNC(vga_port_03c0_r), FUNC(vga_port_03c0_w));
80   m_isa->install_device(0x3d0, 0x3df, 0, 0, FUNC(vga_port_03d0_r), FUNC(vga_port_03d0_w));
81
82   m_isa->install_memory(0xa0000, 0xbffff, 0, 0, FUNC(vga_mem_r), FUNC(vga_mem_w));
83}
84
85//-------------------------------------------------
86//  device_reset - device-specific reset
87//-------------------------------------------------
88
89void isa8_svga_s3_device::device_reset()
90{
91   pc_vga_reset(machine());
92}
src/mess/video/isa_svga_s3.h
r0r14222
1#pragma once
2
3#ifndef __ISA_SVGA_S3_H__
4#define __ISA_SVGA_S3_H__
5
6#include "emu.h"
7#include "machine/isa.h"
8
9//**************************************************************************
10//  TYPE DEFINITIONS
11//**************************************************************************
12
13// ======================> isa8_vga_device
14
15class isa8_svga_s3_device :
16      public device_t,
17      public device_isa8_card_interface
18{
19public:
20        // construction/destruction
21        isa8_svga_s3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
22
23      // optional information overrides
24      virtual machine_config_constructor device_mconfig_additions() const;
25      virtual const rom_entry *device_rom_region() const;
26protected:
27        // device-level overrides
28        virtual void device_start();
29        virtual void device_reset();
30};
31
32
33// device type definition
34extern const device_type ISA8_SVGA_S3;
35
36#endif  /* __ISA_VGA_H__ */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team