Skip to main content
gamedev.net
🔒 Locked

svga memory allocation?

Started by patrick_chm 2 replies 350+ views
Original Post
patrick_chm
patrick_chm
Dear All, I am using Rhide, Djgpp. Computer P3, VBE 3.0. OS:WinMe. I got some SIGSEV error:General protection fault: listing of selectors and limits, while running a 800x600 16-bit color. Suspect that this is the problem. typedef unsigned short word; word *vscreen; vscreen=(word *)malloc(2*800*601); sometimes while running, program stopped with callback frame pointing to: vscreen[2*(800*y+x)]= color;//color is word type. Other part is copy vscreen to video ram thru bank switching function? I was thinking of doing some animation so having a virtual screen will help in the erasure of previous image. I suspect the memory allocation is within the conventional memory that may cause its crash. How to allocate memory beyond the 1MB boundary and copy it to video ram? Thank you. Patrick [edited by - patrick_chm on August 4, 2002 11:51:45 AM]
Yann L
Yann L
vscreen is a word type pointer. You''re generating a GPF, because you are trying to write beyond the limits of your malloc''ed memory region. Try that instead: vscreen[800*y+x]= color;

/ Yann
trzy
trzy
Also, it''s worth noting that there is no concept of conventional memory under 1MB in DJGPP.

DJGPP makes use of 32-bit protected mode which gives you a linear 32-bit address space.

---
Bart
----Bart
GuessWho
GuessWho
use bank-switching instead :lol:

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.