|
|
| version 1.6, 2003/12/08 00:55:30 | version 1.9, 2011/01/15 18:04:42 |
|---|---|
| Line 6 | Line 6 |
| _NEVENT nevent; | _NEVENT nevent; |
| void nevent_init(void) { | void nevent_allreset(void) { |
| // すべてをリセット | // すべてをリセット |
| ZeroMemory(&nevent, sizeof(nevent)); | ZeroMemory(&nevent, sizeof(nevent)); |
| Line 138 void nevent_waitreset(UINT id) { | Line 138 void nevent_waitreset(UINT id) { |
| void nevent_set(UINT id, SINT32 eventclock, NEVENTCB proc, BOOL absolute) { | void nevent_set(UINT id, SINT32 eventclock, NEVENTCB proc, BOOL absolute) { |
| SINT32 clock; | SINT32 clk; |
| NEVENTITEM item; | NEVENTITEM item; |
| UINT eventid; | UINT eventid; |
| UINT i; | UINT i; |
| // TRACEOUT(("event %d - %xclocks", id, eventclock)); | // TRACEOUT(("event %d - %xclocks", id, eventclock)); |
| clock = CPU_BASECLOCK - CPU_REMCLOCK; | clk = CPU_BASECLOCK - CPU_REMCLOCK; |
| item = &nevent.item[id]; | item = &nevent.item[id]; |
| item->proc = proc; | item->proc = proc; |
| item->flag = 0; | item->flag = 0; |
| if (absolute) { | if (absolute) { |
| item->clock = eventclock + clock; | item->clock = eventclock + clk; |
| } | } |
| else { | else { |
| item->clock += eventclock; | item->clock += eventclock; |
| } | } |
| #if 0 | #if 0 |
| if (item->clock < clock) { | if (item->clock < clk) { |
| item->clock = clock; | item->clock = clk; |
| } | } |
| #endif | #endif |
| // イベントの削除 | // イベントの削除 |
| Line 179 void nevent_set(UINT id, SINT32 eventclo | Line 179 void nevent_set(UINT id, SINT32 eventclo |
| // もし最短イベントだったら... | // もし最短イベントだったら... |
| if (eventid == 0) { | if (eventid == 0) { |
| clock = CPU_BASECLOCK - item->clock; | clk = CPU_BASECLOCK - item->clock; |
| CPU_BASECLOCK -= clock; | CPU_BASECLOCK -= clk; |
| CPU_REMCLOCK -= clock; | CPU_REMCLOCK -= clk; |
| // TRACEOUT(("reset nextbase -%d (%d)", clock, CPU_REMCLOCK)); | // TRACEOUT(("reset nextbase -%d (%d)", clock, CPU_REMCLOCK)); |
| } | } |
| } | } |
| void nevent_setbyms(UINT id, SINT32 ms, NEVENTCB proc, BOOL absolute) { | void nevent_setbyms(UINT id, SINT32 ms, NEVENTCB proc, BOOL absolute) { |
| nevent_set(id, (pc.realclock / 1000) * ms, proc, absolute); | nevent_set(id, (pccore.realclock / 1000) * ms, proc, absolute); |
| } | } |
| BOOL nevent_iswork(UINT id) { | BOOL nevent_iswork(UINT id) { |