TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: MATT RAYKOWSKI
from: WILLIAM MCBRINE
date: 1998-02-10 01:03:00
subject: 32bit integers to 16bit integers

-=> Matt Raykowski wrote to Bob Stout <=-
 MR> Yeah, I'm moving from TC to djgpp.  The thing is that everything's
 MR> dumped via structure to the file and I was hoping there was an easy 
 MR> way. I'd assume that this means I'll have to read the structures in
 MR> one field at a time (and it's a HUGE structure), correct? 
No -- or, not necessarily. Just provide a new definition of the structure,
with fields which were previously defined as "int" labelled "short"
instead.
You might encounter padding problems, but you could probably get around
that by compiling with the "-fpack-struct" option. (That's a gcc-ism...
I'm *assuming* it's available in DJGPP.)
 MR> As long as I'm at it, are there any good books, FAQs, or anything on
 MR> programming in djgpp or pmode?  I've done all my programming (primarily
 MR> graphics) in rmode, and have been urged, especially by my artists to
 MR> go to 640x480, and I can't see how I could do this without moving to
 MR> pmode.  Any suggestions, for someone totally ignorant to pmode?
The nice thing about *32-bit* protected mode (which, AFAIK, is the only
mode available via DJGPP) is that there's nothing special to know. :-)
It's miles easier than old-style DOS programming, because you no longer
have to wrestle with segment registers and segment limits all the time.
But to get access to fixed addresses, such as those used by the video
frame buffer, does require extra steps in protected mode.
In *16-bit* protected mode, you get more total memory, but still have to
deal with 64k segments. :-P
If you're working in raw DOS, you may also be able to set up a special
32-bit real mode, which gives you most of the advantages without the
disadvantages.
I'm simplifying a bit. :-)
... This message released to public domain.  Use at your own risk.
---
1:109/570)
---------------
* Origin: * My Place BBS * Bowie, Md USA * V.34 * (301)805-1602 *

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.