74 |
|
// Function pointers of imported functions |
75 |
|
typedef int16 (*iocic_ptr)(void *, int16); |
76 |
|
static uint32 iocic_tvect = 0; |
77 |
< |
static inline int16 IOCommandIsComplete(void *arg1, int16 arg2) |
77 |
> |
static inline int16 IOCommandIsComplete(uintptr arg1, int16 arg2) |
78 |
|
{ |
79 |
< |
return (int16)CallMacOS2(iocic_ptr, iocic_tvect, arg1, arg2); |
79 |
> |
return (int16)CallMacOS2(iocic_ptr, iocic_tvect, (void *)arg1, arg2); |
80 |
|
} |
81 |
|
typedef int16 (*vslnewis_ptr)(void *, uint32, uint32 *); |
82 |
|
static uint32 vslnewis_tvect = 0; |
83 |
< |
static inline int16 VSLNewInterruptService(void *arg1, uint32 arg2, uint32 *arg3) |
83 |
> |
static inline int16 VSLNewInterruptService(uintptr arg1, uint32 arg2, uintptr arg3) |
84 |
|
{ |
85 |
< |
return (int16)CallMacOS3(vslnewis_ptr, vslnewis_tvect, arg1, arg2, arg3); |
85 |
> |
return (int16)CallMacOS3(vslnewis_ptr, vslnewis_tvect, (void *)arg1, arg2, (uint32 *)arg3); |
86 |
|
} |
87 |
|
typedef int16 (*vsldisposeis_ptr)(uint32); |
88 |
|
static uint32 vsldisposeis_tvect = 0; |
98 |
|
} |
99 |
|
typedef void (*nqdmisc_ptr)(uint32, void *); |
100 |
|
static uint32 nqdmisc_tvect = 0; |
101 |
< |
void NQDMisc(uint32 arg1, void *arg2) |
101 |
> |
void NQDMisc(uint32 arg1, uintptr arg2) |
102 |
|
{ |
103 |
< |
CallMacOS2(nqdmisc_ptr, nqdmisc_tvect, arg1, arg2); |
103 |
> |
CallMacOS2(nqdmisc_ptr, nqdmisc_tvect, arg1, (void *)arg2); |
104 |
|
} |
105 |
|
|
106 |
|
|
169 |
|
|
170 |
|
// Install and activate interrupt service |
171 |
|
SheepVar32 theServiceID = 0; |
172 |
< |
VSLNewInterruptService(csSave->regEntryID, FOURCC('v','b','l',' '), (uint32 *)theServiceID.addr()); |
172 |
> |
VSLNewInterruptService(Host2MacAddr((uint8 *)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; |
184 |
|
|
185 |
|
static int16 set_gamma(VidLocals *csSave, uint32 gamma) |
186 |
|
{ |
187 |
+ |
#warning "FIXME: this code is not little endian aware" |
188 |
|
GammaTbl *clientGamma = (GammaTbl *)gamma; |
189 |
|
GammaTbl *gammaTable = csSave->gammaTable; |
190 |
|
|
449 |
|
MacCursor[3] = ReadMacInt8(0x887); |
450 |
|
|
451 |
|
// Set new cursor image |
452 |
< |
if (display_type == DIS_SCREEN) |
452 |
> |
if (!video_can_change_cursor()) |
453 |
|
return controlErr; |
454 |
|
if (changed) |
455 |
|
video_set_cursor(); |
691 |
|
WriteMacInt32(param + csVerticalLines, 768); |
692 |
|
WriteMacInt32(param + csRefreshRate, 75<<16); |
693 |
|
break; |
694 |
+ |
case APPLE_1152x768: |
695 |
+ |
WriteMacInt32(param + csHorizontalPixels, 1152); |
696 |
+ |
WriteMacInt32(param + csVerticalLines, 768); |
697 |
+ |
WriteMacInt32(param + csRefreshRate, 75<<16); |
698 |
+ |
break; |
699 |
|
case APPLE_1152x900: |
700 |
|
WriteMacInt32(param + csHorizontalPixels, 1152); |
701 |
|
WriteMacInt32(param + csVerticalLines, 900); |
814 |
|
case APPLE_1024x768: |
815 |
|
timing = timingVESA_1024x768_75hz; |
816 |
|
break; |
817 |
+ |
case APPLE_1152x768: |
818 |
+ |
timing = timingApple_1152x870_75hz; // FIXME |
819 |
+ |
break; |
820 |
|
case APPLE_1152x900: |
821 |
|
timing = timingApple_1152x870_75hz; |
822 |
|
break; |
877 |
|
* Native (PCI) driver entry |
878 |
|
*/ |
879 |
|
|
880 |
< |
int16 VideoDoDriverIO(void *spaceID, void *commandID, void *commandContents, uint32 commandCode, uint32 commandKind) |
880 |
> |
int16 VideoDoDriverIO(uint32 spaceID, uint32 commandID, uint32 commandContents, uint32 commandCode, uint32 commandKind) |
881 |
|
{ |
882 |
< |
// D(bug("VideoDoDriverIO space %p, command %p, contents %p, code %d, kind %d\n", spaceID, commandID, commandContents, commandCode, commandKind)); |
882 |
> |
// D(bug("VideoDoDriverIO space %08x, command %08x, contents %08x, code %d, kind %d\n", spaceID, commandID, commandContents, commandCode, commandKind)); |
883 |
|
int16 err = noErr; |
884 |
|
|
885 |
|
switch (commandCode) { |
889 |
|
delete private_data->gammaTable; |
890 |
|
delete private_data; |
891 |
|
|
892 |
< |
iocic_tvect = (uint32)FindLibSymbol("\021DriverServicesLib", "\023IOCommandIsComplete"); |
892 |
> |
iocic_tvect = FindLibSymbol("\021DriverServicesLib", "\023IOCommandIsComplete"); |
893 |
|
D(bug("IOCommandIsComplete TVECT at %08lx\n", iocic_tvect)); |
894 |
|
if (iocic_tvect == 0) { |
895 |
|
printf("FATAL: VideoDoDriverIO(): Can't find IOCommandIsComplete()\n"); |
896 |
|
err = -1; |
897 |
|
break; |
898 |
|
} |
899 |
< |
vslnewis_tvect = (uint32)FindLibSymbol("\020VideoServicesLib", "\026VSLNewInterruptService"); |
899 |
> |
vslnewis_tvect = FindLibSymbol("\020VideoServicesLib", "\026VSLNewInterruptService"); |
900 |
|
D(bug("VSLNewInterruptService TVECT at %08lx\n", vslnewis_tvect)); |
901 |
|
if (vslnewis_tvect == 0) { |
902 |
|
printf("FATAL: VideoDoDriverIO(): Can't find VSLNewInterruptService()\n"); |
903 |
|
err = -1; |
904 |
|
break; |
905 |
|
} |
906 |
< |
vsldisposeis_tvect = (uint32)FindLibSymbol("\020VideoServicesLib", "\032VSLDisposeInterruptService"); |
906 |
> |
vsldisposeis_tvect = FindLibSymbol("\020VideoServicesLib", "\032VSLDisposeInterruptService"); |
907 |
|
D(bug("VSLDisposeInterruptService TVECT at %08lx\n", vsldisposeis_tvect)); |
908 |
|
if (vsldisposeis_tvect == 0) { |
909 |
|
printf("FATAL: VideoDoDriverIO(): Can't find VSLDisposeInterruptService()\n"); |
910 |
|
err = -1; |
911 |
|
break; |
912 |
|
} |
913 |
< |
vsldois_tvect = (uint32)FindLibSymbol("\020VideoServicesLib", "\025VSLDoInterruptService"); |
913 |
> |
vsldois_tvect = FindLibSymbol("\020VideoServicesLib", "\025VSLDoInterruptService"); |
914 |
|
D(bug("VSLDoInterruptService TVECT at %08lx\n", vsldois_tvect)); |
915 |
|
if (vsldois_tvect == 0) { |
916 |
|
printf("FATAL: VideoDoDriverIO(): Can't find VSLDoInterruptService()\n"); |
917 |
|
err = -1; |
918 |
|
break; |
919 |
|
} |
920 |
< |
nqdmisc_tvect = (uint32)FindLibSymbol("\014InterfaceLib", "\007NQDMisc"); |
920 |
> |
nqdmisc_tvect = FindLibSymbol("\014InterfaceLib", "\007NQDMisc"); |
921 |
|
D(bug("NQDMisc TVECT at %08lx\n", nqdmisc_tvect)); |
922 |
|
if (nqdmisc_tvect == 0) { |
923 |
|
printf("FATAL: VideoDoDriverIO(): Can't find NQDMisc()\n"); |
927 |
|
|
928 |
|
private_data = new VidLocals; |
929 |
|
private_data->gammaTable = NULL; |
930 |
< |
memcpy(private_data->regEntryID, (uint8 *)commandContents + 2, 16); // DriverInitInfo.deviceEntry |
930 |
> |
Mac2Host_memcpy(&private_data->regEntryID, commandContents + 2, 16); // DriverInitInfo.deviceEntry |
931 |
|
private_data->interruptsEnabled = false; // Disable interrupts |
932 |
|
break; |
933 |
|
|
940 |
|
break; |
941 |
|
|
942 |
|
case kOpenCommand: |
943 |
< |
err = VideoOpen((uint32)commandContents, private_data); |
943 |
> |
err = VideoOpen(commandContents, private_data); |
944 |
|
break; |
945 |
|
|
946 |
|
case kCloseCommand: |
947 |
< |
err = VideoClose((uint32)commandContents, private_data); |
947 |
> |
err = VideoClose(commandContents, private_data); |
948 |
|
break; |
949 |
|
|
950 |
|
case kControlCommand: |
951 |
< |
err = VideoControl((uint32)commandContents, private_data); |
951 |
> |
err = VideoControl(commandContents, private_data); |
952 |
|
break; |
953 |
|
|
954 |
|
case kStatusCommand: |
955 |
< |
err = VideoStatus((uint32)commandContents, private_data); |
955 |
> |
err = VideoStatus(commandContents, private_data); |
956 |
|
break; |
957 |
|
|
958 |
|
case kReadCommand: |