Original Post

There is a homebrewn demo that uses vbTextOut function to print the currect time elapsed since the load of it… but I can’t remember where I download it from anymore… I need it to do some test in my game engine, if anyone knows where can I get it please let me know. Thanks


9 Replies

hey jorgeche! the demo you are looking for can be found in the gccvb package in the examples directory.
hope the game engine is progressing nicely, the demo of it looks great! πŸ™‚

Thank for the info… I think the game and the engine will be released by march 2007…

i’m glad that i could help. looking foward to your game! please keep us informed. πŸ™‚

…Game engine?

Did I miss something?…

Sure.. I’m half way with the sprite engine…. then I’d like to make a basic 3d engine (wriframe only I suppose)… there is a demo in the game section.

By the way, any idea how to set properly the timer so it doesn’t run too fast or too slow? here is my code:

VIP_REGS[INTENB] = 0x0000;


But it runs to fast…


For everybody who hasn’t seen it yet: click here.

jorgeche: I haven’t touched gccVB in ages, and since then its gone an overhaul, so the following may not work right.
This is the timing code from my Zelda demo. I just tested the ROM in the latest (at least I think it is) copy of Reality Boy, and it seems to be running at the correct speed.
I actually used the ROM timer interrupt to increment a counter that I could then use to calculate the time. I’m not sure of the duration of the timer, but I think I have it set to 10x100uS (1mS).

// Timer Interrupt Handler
// Create a timed delay
void INTTIM()
    di                   /* Disable interrupts             */
	add -4, r3           /* Increment sp by register size  */
	st.w r2, 0 [r3]      /* Store the contents of r2 in sp */
	movhi 0x0500, r0, r1 /* Put address of timer val in r1 */
	movea 0x0008, r1, r1 /*                                */
	ld.w 0 [r1], r2      /* Load timer value into r2       */
    add 1, r2            /* Increment timer value by 1     */
    st.w r2, 0 [r1]      /* Store timer value back in ram  */
    ld.w 0 [r3], r2      /* Retrieve previous r2 from sp   */
    add 4, r3            /* Set sp back to previous value  */
    ld.w 0 [r3], r1      /* Retrieve previous r1 from sp   */
    add 4, r3            /* Set sp back to previous value  */
    ei                   /* Re-enable interrrupts          */
    reti                 /* Return from interrupt          */

// Timer Initialisation
// Create a timed delay
void InitTimer()
    HW_REGS[THR] = 0x00; // THR, timer duration value high byte
    HW_REGS[TLR] = 0x09; // TLR, timer duration value low byte
    HW_REGS[TCR] = HW_REGS[TCR] & ~TIMER_20US; // T-Clk-Sel = 0, 100uS delay
    HW_REGS[TCR] = HW_REGS[TCR] | TIMER_INT;   // Tim-Z-Int = 1, enable interrupt
    HW_REGS[TCR] = HW_REGS[TCR] | TIMER_ENB;   // T-Enb = 1, turn on timer

Hope this is some help. I haven’t touched this since the early days (it was made just after the timer was figured out IIRC), so it probably doesn’t work anymore.

Thanks. I hope I’ll be able soon to realease another demo running over a more “dynamic” engine.


cool! that time i won’t forget to mention it on the front page. πŸ˜‰


Write a reply

You must be logged in to reply to this topic.