Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Clock & Timer Program Question
#11
That code refreshes the timer more quickly. And lots of programs do, the TIMER only allows about 18 frames a second.

Does ANYONE have that library that used a Windows virtual device to time in milliseconds? I forget who released it, but his first name was Robert (and there were a few people by that name).
Reply
#12
Never heard of that one...

If you want a fast and accurate timer without reprogramming the PIT, you can hook int 70h (BIOS RTC). By default it gets triggered 1024 times/sec, and is compatible with XP. (If you need even more precise timing, you can reprogram the RTC to trigger the interrupt at up to 8192 times/sec. That's 122 microseconds.)

Of course it requires a little assembly, but all the "good stuff" does. Wink
Reply
#13
Sounds like something I can use but I'll need some help implementing it into my program after I have it. Where can I get it anyways? or should I say; How do I emplement it?

Obviously I mangaged to get myself thinking I needed a faster Frame Rate but what I really needed was a better timer since that is what I want to program. That is... a Time based game and having things happen at certain times. I seem to have worked out animations without a real Frame Per Second Program. It's more of a hashed, mix-mashed version of something strange that works for me right now.

The frame per second thing really doesn't concern me all that much because I've somehow done something else that seems to work but it probabaly required more code; oh well.
I'm your Huckleberry; that's just my game."

Doc Holiday, TOMBSTONE
Reply
#14
Here is the program that I need to get timed just the way "I Think" should be the proper speed for it to run.

In other words, I might need some help in understanding how to run whatever you are going to give me for a better timer.

Code:
' Initializing Box Array
z = 0
FOR y = 0 TO 176 STEP 16
FOR x = 3 TO 18
z = z + 1
Box(x, y / 16) = z
NEXT x
NEXT y

z = 0


' Now randomly place on screen until it is covered
' But not too fast and not too slow
' This doesn't do that yet
DO

j = INT(RND * 19)
k = INT(RND * 12)

SELECT CASE j
CASE 1
j = j + 2
CASE 2
j = j + 1
END SELECT

IF Box(j, k) <> 0 THEN
z = z + 1
Box(j, k) = 0
PUT (j * 16, k * 16), Blue.Tag, PSET
END IF
i$ = INKEY$
LOOP UNTIL z = 192
I'm your Huckleberry; that's just my game."

Doc Holiday, TOMBSTONE
Reply
#15
Well hot damn, Plasmer... I had no idea about that interrupt...

Maybe it's time to dust off the ol' ASM gloves. But more likely it's time to do the several Signal Processing labs I have due.
Reply
#16
John Monti,
You said the magic word: GAME.
I pass on games.
*****
Reply
#17
:???: I don't get it.

So how do I go about using the 70h ?
I'm your Huckleberry; that's just my game."

Doc Holiday, TOMBSTONE
Reply
#18
Help PC


Haven't used it but you could prolly do it in QB using Call Interrupt by passing the subfunction in Reg.AX and return is prolly in one of the Regs also.
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#19
Unfortunately, since you actually have to hook int 70h, you'll have to use assembly or C. You can't just call the interrupt from QB. So this is probably not a good solution for you unless you have experience with that sort of thing...
Reply
#20
This could be a nice new function for RelLib...
Just an ISR increasing by 1 a LONG every 1/1000th of second Big Grin
Antoni
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)