Qbasicnews.com
February 22, 2020, 08:26:24 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: 1 [2]
  Print  
Author Topic: Clock & Timer Program Question  (Read 6598 times)
Moneo
Na_th_an
*****
Posts: 1971


« Reply #15 on: September 16, 2004, 11:11:15 PM »

John Monti,
You said the magic word: GAME.
I pass on games.
*****
Logged
John Monti/
Member
*
Posts: 83



« Reply #16 on: September 20, 2004, 09:49:12 AM »

:Huh: I don't get it.

So how do I go about using the 70h ?
Logged

I'm your Huckleberry; that's just my game."

Doc Holiday, TOMBSTONE
relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #17 on: September 22, 2004, 02:37:15 AM »

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.
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
Plasma
Na_th_an
*****
Posts: 1770


WWW
« Reply #18 on: September 22, 2004, 01:27:12 PM »

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...
Logged
Antoni Gual
Na_th_an
*****
Posts: 1434



WWW
« Reply #19 on: September 22, 2004, 01:59:32 PM »

This could be a nice new function for RelLib...
Just an ISR increasing by 1 a LONG every 1/1000th of second  Cheesy
Logged

Antoni
Jofers
Been there, done that
*****
Posts: 1040



WWW
« Reply #20 on: September 22, 2004, 03:02:42 PM »

It'd probably be nicer as a standalone qlb.  Then rel could package it, like FFix.  I mean, what if you're using UGL?

I might be able to try this tonight.  I ironically have another DSP lab due, the assignment after the one I was bitching about in a previous post here, but I should have the rest of the day off.
Logged
relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #21 on: September 23, 2004, 04:16:28 AM »

Quote from: "Antoni Gual"
This could be a nice new function for RelLib...
Just an ISR increasing by 1 a LONG every 1/1000th of second  Cheesy


Can't code. Busy at night with the "vigil". The only thing I can do is read.

Just finished reading:

Congo by Michael Crichton
and Chilhood's End by Arthur C. Clarke.

All books by Crichton  are must reads.  The Sphere is prolly the best of them.  Better than J park and Lost world.
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #22 on: September 23, 2004, 08:47:35 AM »

Sorry, but I hate Crichton. His books are not good. Best-sellers, just that. But that's just my taste.
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Jofers
Been there, done that
*****
Posts: 1040



WWW
« Reply #23 on: September 23, 2004, 01:04:34 PM »

I saw the movie "Sphere".  It was the most boring god-awful piece of crap ever produced by Hollywood.  Though "Timeline", another Crichton movie, is definately battling for the spot.  "The 13th Warrior" is resting at a comfortable third Smiley

The thing is, though, is that as books all three were pretty good (Although 13th Warrior is the only one I've read... the rest came from character witnesses).  Hollywood just loves to crapify books (anybody up for some "Battlefield Earth"?)

EDIT:  Okay, I've hooked up an interrupt handler that basically resets the refresh rate 1024s^-1 every time 70h is called, and add 1 to a double word defined in DATA, which I think is what I need to do.  However, I'm not sure how to get that tick count back to QB, as I never really got that far in ASM programming.  I get all sorts of "operand type" errors if I send it back.  How do you return something bigger than a register to qb?
Logged
John Monti/
Member
*
Posts: 83



« Reply #24 on: September 23, 2004, 01:41:30 PM »

Quote
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...

  Sad Gee, and I thought I was finally going to get somewhere with this.  Oh well, I guess I'll skip this project I was working on and move on to something else.  At least I'll learn something more in the process.  Just too bad I can't find the kind of timing routine I was looking for.

That's all I really needed too but perhaps I'll find something else in return.  No point in giving it all up.  I'm moving onto side-scrolling platform games next.  Probably will start learning and understanding the concepts used behind the Commander Keen games.  Preferably the later installments such as, "Goodbye Galaxy".  At least I can work on the basics of this for now but there is no way in the world that I could program the whole game in QBasic on my own.  Heck, I wouldn't even try to. :normal:
Logged

I'm your Huckleberry; that's just my game."

Doc Holiday, TOMBSTONE
relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #25 on: September 24, 2004, 02:59:31 AM »

Quote from: "na_th_an"
Sorry, but I hate Crichton. His books are not good. Best-sellers, just that. But that's just my taste.


I dunno about that but his books are very good.  Never liked the movie "The sphere" but read the book and tell me if his books still sucks.

One way to kill a good book is to watch its movie.  

Joe, what value woud you like to return?

byte =al
integer = ax
long =dx:ax
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
Jofers
Been there, done that
*****
Posts: 1040



WWW
« Reply #26 on: September 24, 2004, 11:08:51 AM »

Yeah, but lets say I have a double word in assembly:

.DATA
        ticks          DD  0  

How do I increment this and break it down into ax and dx so it can be returned to qb?  I can't seem to make it play nice with my registers.  And to be honest, I'm not even sure if add ticks, 1 is allowed.
Logged
relsoft
*/-\*
*****
Posts: 3927



WWW
« Reply #27 on: September 25, 2004, 03:26:45 AM »

inc tics
But add ticks, 1 should work.



To put it into DX:AX


mov eax, tics
mov edx, eax
shr edx, 16
Logged

y smiley is 24 bit.


Genso's Junkyard:
http://rel.betterwebber.com/
Pages: 1 [2]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!