ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/video.cpp
(Generate patch)

Comparing SheepShaver/src/video.cpp (file contents):
Revision 1.11 by gbeauche, 2004-12-19T15:14:22Z vs.
Revision 1.13 by gbeauche, 2005-01-30T21:48:19Z

# Line 1 | Line 1
1   /*
2   *  video.cpp - Video/graphics emulation
3   *
4 < *  SheepShaver (C) 1997-2004 Marc Hellwig and Christian Bauer
4 > *  SheepShaver (C) 1997-2005 Marc Hellwig and Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 169 | Line 169 | static int16 VideoOpen(uint32 pb, VidLoc
169  
170          // Install and activate interrupt service
171          SheepVar32 theServiceID = 0;
172 <        VSLNewInterruptService(Host2MacAddr((uint8 *)csSave->regEntryID), FOURCC('v','b','l',' '), theServiceID.addr());
172 >        VSLNewInterruptService(csSave->regEntryID, FOURCC('v','b','l',' '), theServiceID.addr());
173          csSave->vslServiceID = theServiceID.value();
174          D(bug(" Interrupt ServiceID %08lx\n", csSave->vslServiceID));
175          csSave->interruptsEnabled = true;
# Line 885 | Line 885 | int16 VideoDoDriverIO(uint32 spaceID, ui
885                          if (private_data != NULL) {     // Might be left over from a reboot
886                                  if (private_data->gammaTable)
887                                          Mac_sysfree(private_data->gammaTable);
888 +                                if (private_data->regEntryID)
889 +                                        Mac_sysfree(private_data->regEntryID);
890                          }
891                          delete private_data;
892  
# Line 926 | Line 928 | int16 VideoDoDriverIO(uint32 spaceID, ui
928  
929                          private_data = new VidLocals;
930                          private_data->gammaTable = 0;
931 <                        Mac2Host_memcpy(&private_data->regEntryID, commandContents + 2, 16);    // DriverInitInfo.deviceEntry
931 >                        private_data->regEntryID = Mac_sysalloc(sizeof(RegEntryID));
932 >                        if (private_data->regEntryID == 0) {
933 >                                printf("FATAL: VideoDoDriverIO(): Can't allocate service owner\n");
934 >                                err = -1;
935 >                                break;
936 >                        }
937 >                        Mac2Mac_memcpy(private_data->regEntryID, commandContents + 2, 16);      // DriverInitInfo.deviceEntry
938                          private_data->interruptsEnabled = false;        // Disable interrupts
939                          break;
940  
941                  case kFinalizeCommand:
942                  case kSupersededCommand:
943 <                        if (private_data != NULL && private_data->gammaTable)
944 <                                Mac_sysfree(private_data->gammaTable);
943 >                        if (private_data != NULL) {
944 >                                if (private_data->gammaTable)
945 >                                        Mac_sysfree(private_data->gammaTable);
946 >                                if (private_data->regEntryID)
947 >                                        Mac_sysfree(private_data->regEntryID);
948 >                        }
949                          delete private_data;
950                          private_data = NULL;
951                          break;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines