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 |
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; |
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 |
|
|
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; |