Timer interrupts
Moderator: Stef
Timer interrupts
Does the megadrive have any timer interrupts? or does it just have the blanking interrupts?
Either way, Would anyone here have any example of an interrupt function that may repeat at a set amount of time?
Either way, Would anyone here have any example of an interrupt function that may repeat at a set amount of time?
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: Timer interrupts
There is no timer interrupt, just VInt (and HInt). What we do usually is just counting a number of frame (using the vint) then when counter elapsed we process the event (then we reload the counter / timer for the next event).
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
Re: Timer interrupts
There ARE timers on the YM2612, but in their infinite wisdom, SEGA didn't connect the INT line from the 2612 to the Z80. People still use the 2612 timers in some cases, but it won't interrupt the Z80 or 68000, so you have to poll it periodically. Given most games don't need that kind of timing, nearly everyone just uses the vblank int to count frames, as Stef mentioned.
Re: Timer interrupts
Oh, thats BS. Timer interrupts are such a basic feature it should've been implemented.Chilly Willy wrote: ↑Tue Apr 02, 2019 5:19 pmThere ARE timers on the YM2612, but in their infinite wisdom, SEGA didn't connect the INT line from the 2612 to the Z80. People still use the 2612 timers in some cases, but it won't interrupt the Z80 or 68000, so you have to poll it periodically. Given most games don't need that kind of timing, nearly everyone just uses the vblank int to count frames, as Stef mentioned.
Well, there's no way around polling and software timers then, eh?
It just feels so wrong to poll for anything because i've been taught to avoid that.
Re: Timer interrupts
Since you update the game on a frame basis doesn't make sense to have more accurate timing than that.
The exceptions could be sound/music and sintetic tests.
The exceptions could be sound/music and sintetic tests.
HELP. Spanish TVs are brain washing people to be hostile to me.
Re: Timer interrupts
Possibly, if you are thinking on a game, the hidden discussion we are having here is how to structure the engine, in particular, how to make easy developing the IA.
A bit of addendum:
This cool way of managing concealed ideas remains me on how calm you have to be while endorsing diplomacy whit other people. Let me put two examples.
We were just asking representatives of well stablished religions about how the predictable imminent future will impact on them, and, after asking just that to an Indian, he told me:
“You idiot, westerns believe they are the center of the world!, the basis of our religion is precisely the existence of extraterrestrials!”
As said, on diplomacy you should always answer with a full smile and wait your turn. While the conversation was developing become very obvious that while he believed on the existence of other people he also trust they to be very far, like on other system or galaxy. That was my turn, I put him on perplexity when I told him they were right on his belly.
The second tale developed right when we were talking with southern Rarutziiby for second time, and I just learn they have streets on their cities. That didn’t make sense to me, because, why they need them? they just can “fly” on water, right? So I just ask them, and answer was:
“To carry things”, and undoubtedly thought: “how brilliant are those humans”
A year later we accomplish to visualize another one of their cities, enrolling their help, this time a norther one, and we were shock to observe a well known disposition, their city was built around two big streets perpendicular one to the other, while main/governmental buildings are situated on the junction. If this rings a bell, be warn, a lots of bells are coming.
A bit of addendum:
This cool way of managing concealed ideas remains me on how calm you have to be while endorsing diplomacy whit other people. Let me put two examples.
We were just asking representatives of well stablished religions about how the predictable imminent future will impact on them, and, after asking just that to an Indian, he told me:
“You idiot, westerns believe they are the center of the world!, the basis of our religion is precisely the existence of extraterrestrials!”
As said, on diplomacy you should always answer with a full smile and wait your turn. While the conversation was developing become very obvious that while he believed on the existence of other people he also trust they to be very far, like on other system or galaxy. That was my turn, I put him on perplexity when I told him they were right on his belly.
The second tale developed right when we were talking with southern Rarutziiby for second time, and I just learn they have streets on their cities. That didn’t make sense to me, because, why they need them? they just can “fly” on water, right? So I just ask them, and answer was:
“To carry things”, and undoubtedly thought: “how brilliant are those humans”
A year later we accomplish to visualize another one of their cities, enrolling their help, this time a norther one, and we were shock to observe a well known disposition, their city was built around two big streets perpendicular one to the other, while main/governmental buildings are situated on the junction. If this rings a bell, be warn, a lots of bells are coming.
HELP. Spanish TVs are brain washing people to be hostile to me.
Re: Timer interrupts
I didnt mean for my message to come across in any way that might offend people.
I was merely expressing my frustration with the hardware.
As much as i love the sega megadrive, timer interrupts could've greatly improved the amount of logic and code to achieve certain timed events for both low-level assembly and C.
Also, I've been strictly taught not to poll on any hardware and rely on interrupts instead. That's the only thing that makes sense for me and that i can wrap my head around.
So once again, I'm really sorry if my message came across as arrogant or asshole-ish.
After all, im having a hard enough time wrapping my head around C again after doing assembly for so long.
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: Timer interrupts
I was eventually thinking of adding "timer event" to SGDK but internally they would use the V-Int for that (and so could be inaccurate if some V-Int were missed or if they are disabled).
Re: Timer interrupts
Yeah, games treat vblank as their main timer. There's no point processing game logic more often than the hardware will ever draw on screen, so it's normally seen as good enough (and consider that early computers in several cases had it even worse than consoles of the time).
The YM2612 timer interrupts not being connected is bullshit, yeah, but if you ever use them, expect them to more likely see use in the context of audio (e.g. Echo uses timer A to handle PCM output and timer B as its "tempo" timer).
The YM2612 timer interrupts not being connected is bullshit, yeah, but if you ever use them, expect them to more likely see use in the context of audio (e.g. Echo uses timer A to handle PCM output and timer B as its "tempo" timer).
Sik is pronounced as "seek", not as "sick".
Re: Timer interrupts
You haven't offend anyone.
If you are developing a videogame I very much doubt REALLY need more timing hardware. You need better organization on a engine level to write easy IA routines. That's what my experience says.
Perhaps you are used to write programs for OS', then guess what, at a hardware level x86 has very few user friendly timers (like 1 or 2), the rest is accomplished by software.
HELP. Spanish TVs are brain washing people to be hostile to me.