Previous 199869 Revisions Next

r33110 Saturday 1st November, 2014 at 12:41:13 UTC by Jürgen Buchmüller
Add zero() to (s)vga_device: zeroes all private variables but vtbls.
The vga.memory is resized to 0.
[src/emu/bus/isa]s3virge.c trident.c
[src/emu/video]pc_vga.c pc_vga.h

trunk/src/emu/bus/isa/s3virge.c
r241621r241622
4545
4646void s3virge_vga_device::device_start()
4747{
48   // FIXME: this kills the vptr of vga.memory
49   memset(&vga, 0, sizeof(vga));
50   memset(&svga, 0, sizeof(svga));
48   zero();
5149
5250   int x;
5351   int i;
trunk/src/emu/bus/isa/trident.c
r241621r241622
155155
156156void trident_vga_device::device_start()
157157{
158   // FIXME: this kill the vga.memory vptr
159   memset(&vga, 0, sizeof(vga));
160   memset(&svga, 0, sizeof(svga));
158   zero();
161159
162160   int i;
163161   for (i = 0; i < 0x100; i++)
trunk/src/emu/video/pc_vga.c
r241621r241622
198198{
199199}
200200
201// zero everything, keep vtbls
202void vga_device::zero()
203{
204   memset(&vga.svga_intf, 0, sizeof(vga.svga_intf));
205   vga.memory.resize(0);
206   memset(vga.pens, 0, sizeof(vga.pens));
207   vga.miscellaneous_output = 0;
208   vga.feature_control = 0;
209   memset(&vga.sequencer, 0, sizeof(vga.sequencer));
210   memset(&vga.crtc, 0, sizeof(vga.crtc));
211   memset(&vga.gc, 0, sizeof(vga.gc));
212   memset(&vga.attribute, 0, sizeof(vga.attribute));
213   memset(&vga.dac, 0, sizeof(vga.dac));
214   memset(&vga.oak, 0, sizeof(vga.oak));
215}
201216
217void svga_device::zero()
218{
219   vga_device::zero();
220   memset(&svga, 0, sizeof(svga));
221}
222
202223/* VBLANK callback, start address definitely updates AT vblank, not before. */
203224TIMER_CALLBACK_MEMBER(vga_device::vblank_timer_cb)
204225{
r241621r241622
208229
209230void vga_device::device_start()
210231{
211   // FIXME: this kills the vga.memory vptr
212   memset(&vga, 0, sizeof(vga));
232   zero();
213233
214234   int i;
215235   for (i = 0; i < 0x100; i++)
trunk/src/emu/video/pc_vga.h
r241621r241622
2626   vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
2727   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);
2828
29
29   virtual void zero();
3030   virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
3131
3232   virtual READ8_MEMBER(port_03b0_r);
r241621r241622
205205   // construction/destruction
206206   svga_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);
207207
208   virtual void zero();
208209   virtual UINT32 screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
209210protected:
210211   void svga_vh_rgb8(bitmap_rgb32 &bitmap, const rectangle &cliprect);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team