VOGONS

Common searches


Search results

Display options

Re: turboC programming question

in Milliways
I got it working with kbhit, but still limited to the character repeat rate - the ship just crawls across the screen while the stars are flying by If a flag is set when the key is pressed that will turn on ship movement, there is no way to turn it off. I store old keypress and compare to mew one, …

Re: turboC programming question

in Milliways
I think I might have an idea. Store the old keypress, set the variable from getch equal to zero, and re-call getch. If key is still being held down, the value will equal the stored value. If not, the key has been let up and the flag can be reset Kind of a kludge but that might work

Re: turboC programming question

in Milliways
HELP So now I am stuck....on keyboard input If you use something like getch - then you are stuck with the keyboard character rate - so if you increment a variable that controls a ship, it moves across the screen at a snail's pace So I get the idea - when a key is pressed, just set a flag that turns …

Re: turboC programming question

in Milliways
actually - the code is not that bad - maybe 300 lines or so of course, it is nowhere NEAR complete - still barebones but still, not bad for a few days - and has forced me to learn several aspects of C I never used Outdated but maybe a useful exercise

Re: turboC programming question

in Milliways
Well if anyone is interested.....I have it working pretty well! Four step process: 1..Array is cleared 2. Stars are scrolled into array 3. Anything else (ships) are added so they seem to be on top of the stars 4. Array is copied into video ram There is no actual clearing of the video screen - the …

Re: turboC programming question

in Milliways
Well - the malloc was useful I created a frame buffer, set up the starfield, and then copied it over Three functions - one to clear the ram, one to set it up, and one to copy over MUCH cleaner than the way I was doing What I would LIKE to do is have three buffers - one for the stars, one for ships, …

Re: turboC programming question

in Milliways
Well I did away with reading video memory - and now it is flying across the screen! More like what I expected. But now, I seem to have a new problem. TurboC will not let me make a 320x200 array - so there goes making a screen buffer Does anyone know if there is way to get around this?

Re: turboC programming question

in Milliways
For each "star" I have a row number and then the column numbers. and a function that calculates exact pixel....hmm...I could increase the row numbers and hen recycle back to zero wen they hit 200

Re: turboC programming question

in Milliways
yeah I got to thinking about that this morning it might be the easier way to do it but there is no need to read and rewrite every pixel on the screen instead erase the old ones and redraw the new ones

Re: turboC programming question

in Milliways
If anyone is interested.... I got the screen scroll going - nothing fancy, just scrolling the screen But is is SLOW - was expecting it to be faster I SUSPECT - I could speed it up my creating a buffer in RAM and copying it once rather than reading writing video RAM I'm going to have do do that …

Re: turboC programming question

in Milliways
Well - I wanted to create an initial star-field But it had to look somewhat random - ruling out a simple loop Finally did it with an array of locations Next step is to get a simple scroll routine going I have a feeling I am not going to get away without having some kind of off-screen buffer

Re: When PC became soulless for you?

in Milliways
When the policies got too heavy-handed - software activation, subscription based software, etc When it got to where you could no longer just buy something on a disk and install it without being connected to the internet

Re: turboC programming question

in Milliways
If anyone is interested in where I am going with this - I set it for the 320x200 256-color mode First goal is to set a scrolling starfield But first to set a random pattern Then I realized this isn't a text screen - 320 x 200 is a lot at the individual pixel level So I wrote a function that take a …

turboC programming question

in Milliways
Was just fooling around with TurboC What I WANT to do is be able to access the video memory directly I had to refresh my knowledge of pointers I TRIED something like ptr *vram = 0xb8000 BUT I get an error message saying non-portable pointer assignemnt Is there a way around this?

Re: What game are you playing now?

in Milliways
Unreal 2! Brough back some memories. The first computer I tried to run that on was a 1 GHz pentium 3 - woefully underpowered. Currently running on Athlon XP 2400 (and honestly even that seems slow)

Page 2 of 46