6139befc20f07c62bf8d1022f5fa24e5031d4da0
3 * Copyright (C) 1998-2003 Brian Palmer <brianp@sginet.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
28 #if 0 /* This stuff isn't used and as far as I'm concerned it can go - GvG */
29 U32 CurrentMemoryBank
= 0;
31 VOID
VideoSetMemoryBank(U16 BankNumber
)
33 if (CurrentMemoryBank
!= BankNumber
)
35 BiosVesaSetBank(BankNumber
);
36 CurrentMemoryBank
= BankNumber
;
40 U32
VideoGetMemoryBankForPixel(U32 X
, U32 Y
)
47 //BytesPerPixel = ROUND_UP(VesaVideoModeInformation.BitsPerPixel, 8) / 8;
48 BytesPerPixel
= (VesaVideoModeInformation
.BitsPerPixel
+ 7) >> 3;
49 MemoryPos
= (Y
* VideoGetBytesPerScanLine()) + (X
* BytesPerPixel
);
50 //BankSize = VesaVideoModeInformation.WindowGranularity * 1024;
51 BankSize
= VesaVideoModeInformation
.WindowGranularity
<< 10;
52 Bank
= MemoryPos
/ BankSize
;
57 U32
VideoGetMemoryBankForPixel16(U32 X
, U32 Y
)
63 MemoryPos
= (Y
* VideoGetBytesPerScanLine()) + (X
/ 2);
64 //BankSize = VesaVideoModeInformation.WindowGranularity * 1024;
65 BankSize
= VesaVideoModeInformation
.WindowGranularity
<< 10;
66 Bank
= MemoryPos
/ BankSize
;
71 U32
VideoGetBankOffsetForPixel(U32 X
, U32 Y
)
78 //BytesPerPixel = ROUND_UP(VesaVideoModeInformation.BitsPerPixel, 8) / 8;
79 BytesPerPixel
= (VesaVideoModeInformation
.BitsPerPixel
+ 7) >> 3;
80 MemoryPos
= (Y
* VideoGetBytesPerScanLine()) + (X
* BytesPerPixel
);
81 //BankSize = VesaVideoModeInformation.WindowGranularity * 1024;
82 BankSize
= VesaVideoModeInformation
.WindowGranularity
<< 10;
83 BankOffset
= MemoryPos
% BankSize
;
88 U32
VideoGetBankOffsetForPixel16(U32 X
, U32 Y
)
94 MemoryPos
= (Y
* VideoGetBytesPerScanLine()) + (X
/ 2);
95 //BankSize = VesaVideoModeInformation.WindowGranularity * 1024;
96 BankSize
= VesaVideoModeInformation
.WindowGranularity
<< 10;
97 BankOffset
= MemoryPos
% BankSize
;
102 U32
VideoGetOffScreenMemoryOffsetForPixel(U32 X
, U32 Y
)
107 //BytesPerPixel = ROUND_UP(VesaVideoModeInformation.BitsPerPixel, 8) / 8;
108 BytesPerPixel
= (VesaVideoModeInformation
.BitsPerPixel
+ 7) >> 3;
109 MemoryPos
= (Y
* VesaVideoModeInformation
.BytesPerScanLine
) + (X
* BytesPerPixel
);
115 VOID
VideoCopyOffScreenBufferToVRAM(VOID
)
117 MachVideoCopyOffScreenBufferToVRAM(VideoOffScreenBuffer
);