Mail Archives: djgpp/1997/09/25/00:30:43
abderahim DOT boukhairi AT hol DOT fr wrote:
>
> I'm using since one month the compiler v2 . In the old version i got
> v1.1 it was easy to swap from 320x200 to 640x200 or to higher
> resolution .the location into memory was always the same 0xD000000.
> //version 1 of compiler
> /*memmove((char*)0xD0000000,back.virt,DEFX*DEFY);*/
> Writing to this location was always good and not depending of the
> resolution.
> Since new version of the compiler i use
> //version 2 of compiler
> movedata(_my_ds(), back.virt ,_dos_ds, 0xA0000,DEFX*DEFY)
>
> This is acting well when DEFX*DEFY = 320*200;
> but i always obtain segmentation violation when DEFX*DEFY = 640*480 or
> higher.
> it's perhaps that i have to write directly to graphic cards memory
> bank !
> Please tell me how to do that
> (my graphic card got 1 Mbyte of memory)
> thanks!
> email-me the answer to
>
> abderahim DOT boukhairi AT hol DOT fr
Hi!
Do you use bankswitches?
I have never been using the D00000... adress I use the 'window' of 64kb
at A0000 with bank set to 0 to access the first 64kb of the screen
setting bank to 1 to write to the 64kb+1-128kb memoryspace on
screen(always writeing on A0000) and on.
the function to change banks:
int set_bank(int bank)
{
__dpmi_regs reg;
if(bank!=active_bank)
{
reg.h.ah=0x4f;
reg.h.al=0x05;
reg.h.bh=0x00;
reg.h.dl=bank;
reg.h.dh=0;
__dpmi_int(0x10,®);
active_bank=bank;
}
return(0);
}
BTW active_bank is a global variable(set to -1 in my init_graphics()
function) so that you don't need to waste time changing to the same bank
thats active and I think bank==0 when you switch on the graphic mode.
Hope it was this you needed.
Ludvig
- Raw text -