And what you get when you trying to send your virtual screen to video memory?
FlyFire/CodeX
http://codexorg.webjump.com
FlyFire/CodeX
http://codexorg.webjump.com
#include unsigned char *vid_mem = (unsigned char *)0xA0000; void main() { unsigned char *back_buffer = (unsigned char *)malloc(width * height * bitdepth); set_video(whatever); set_video(back to whatever); void Update_vidmem_from_back_buffer(char *buffer) { setpage(0); I would never work with vid_mem directly cause there is a chance that something could screw up.. as for your memset stuff, that would most likely be used to set a backgroud color.. and you buffer[65537] is that an array? i am a bit confused on what you were trying to do... E-mail me if ya want specific stuff, and i can help ya out more...
pixel_stuff_to_back_buffer(back_buffer);
Update_vidmem_from_back_buffer(back_buffer);
free(back_buffer);
}
memcpy(vid_mem,(unsigned char *)buffer,65536);
setpage(1)
memcpy(vid_mem,(unsigned char *)buffer+65536,65536);
...
...
...
}
dieraxx@stega.smoky.org
Since real dos depends a lot on 64Kb stuff you can't access buffer[65537]
(why can you allocate buffers >64Kb when it is almost impossible to access?!).
But on to the subject if you use
memcpy(screen,buffer+65536,65536)
it's just the same as:
memcpy(screen,buffer,65536)
Since the reason I wanted to learn C++ is because you can allocate blocks >64Kb I'm now going to learn DJGPP (it is just C++ with DPMI).
Anyone knows how to use asm in that compiler?
asm { code }; doesn't work (parse error)
you said
"memcpy(screen,buffer+65536,65536)
it's just the same as:
memcpy(screen,buffer,65536)"
I dont understand how they are the same..
because you are setting pages in video_memory you obviously have to copy it in segments, maybe i am thinking it all wrong and missing what you are trying to say, please explain though..Talk to ya later
Other way, as Syntax says, is to use
memcpy(vid_mem,buffer+65536,65536);
it's really not the same as
memcpy(vid_mem,buffer,65536)
because in first way you copy memory beginning from 65536 offset of your buffer, and in second, from beginning.
Also, if you will go into DJGPP (i recommend Watcom, really), you can use large arrays without restrictions, because you will run in 32bit flat model. But inline asm there is really beast, but powerful thing. You gotta read about it in online help.
Syntax: if you are using a great thing like Watcom C++, why you still using banks, when you can use LFB addressing? And i don't agree with your words that working directly with video mem is dangerous. I always do so.
Also, if you interested, i'm currently developing a lot of stuff for Watcom C++, which you can find on my homepage. There is also my new VFlat library, which will allow you to use LFB addressing wihtout VESA 2.0 standart.
That's it. If you have any more questions, ask me. Just i worked for all this stuff for a long time and know a lot.
FlyFire/CodeX
http://codexorg.webjump.com
I'm really interested in that LFB addressing you talked about. Maybe you can send me an URL or something like that with more info.
FlyFire/CodeX
http://codexorg.webjump.com