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
Jorgeche
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. π
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[INTCLR] = VIP_REGS[INTPND];
VIP_REGS[INTENB] = 0x0000;
timer_freq(TIMER_100US);
timer_set(TIME_MS(1000));
timer_clearstat();
But it runs to fast…
Jorgeche
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() { asm(" 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 */ "); return; } // 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 return; }
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.
Jorgeche