Dec 082017
 
C source code for pulldown windows.
File PULLDN_C.ZIP from The Programmer’s Corner in
Category C Source Code
C source code for pulldown windows.
File Name File Size Zip Size Zip Type
PULLDOWN.C 21085 6151 deflated
READ.ME 2328 1122 deflated

Download File PULLDN_C.ZIP Here

Contents of the READ.ME file



The enclosed source file is a slight modification of one I downloaded from
BYTE. It goes with the may 1987 article 'pulldown menus in C'. It was
originally written for lattice C, and I have changed it to work with
microsoft C. The only changes I needed to make were to change the lattice
peek and poke functions to the microsoft movedata function, and change the
interrupt function name. There is lots of good stuff in here if you want
to do video manipulation from C.

I have also modified this to work under aztec C. threee things; the peek
and poke functions take the address backwards in aztec, the interrupt function
name is different again, and aztec won't let you redefine the void keyword.
Why the original author saw fit to do so I don't know, but you have the choice
of just declaring all functions as ints, or going though and making sure all of
the voids are declared properly. (non-int functions must be declared inside
any routine that uses them).

Supposedly you can add your own stuff into this menu pretty easily. The places
where you see 'demo' are addresses of the demo function -- remember, a function
name without the () evaluates to the address of the function. So you put the
name of some routine you have in there instead, without the (). Note also that
he declares demo() and help() inside main, even though it is not required.
You have to do that in order to be able to use the name of the function as it's
address. So for example, to add the function foo(), you would add
int foo(); after where it reads int help();, and you would replace one of the
references to demo in the initialization of m_menu to foo, .




I also have a different version of many of the video routines for my own use.
I think set_color is easier to use if you change it to accept four arguments,
two for mono and two for color. then let the routine figure out which to use.
I also have all of the routines like fast_write, set_color, clear_wind, etc,
check to see if the monitor type has been determined (i init it to -1), and
if not, to call the init_monitor routine. This way you do not have to make
sure you call it in the main program, and can keep the globals tied up in
a sub-module.




Happy Hacking! Dave Michmerhuizen. Fremont Ca. 1987.




 December 8, 2017  Add comments

Leave a Reply