diff options
Diffstat (limited to 'apps/codecs/libgme/hes_emu.c')
-rw-r--r-- | apps/codecs/libgme/hes_emu.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/apps/codecs/libgme/hes_emu.c b/apps/codecs/libgme/hes_emu.c index a44eded8d7..324027888d 100644 --- a/apps/codecs/libgme/hes_emu.c +++ b/apps/codecs/libgme/hes_emu.c | |||
@@ -37,8 +37,8 @@ void clear_track_vars( struct Hes_Emu* this ) | |||
37 | this->out_time = 0; | 37 | this->out_time = 0; |
38 | this->emu_time = 0; | 38 | this->emu_time = 0; |
39 | this->emu_track_ended_ = true; | 39 | this->emu_track_ended_ = true; |
40 | this->track_ended = true; | 40 | this->track_ended = true; |
41 | this->fade_start = LONG_MAX / 2 + 1; | 41 | this->fade_start = (blargg_long)(LONG_MAX / 2 + 1); |
42 | this->fade_step = 1; | 42 | this->fade_step = 1; |
43 | this->silence_time = 0; | 43 | this->silence_time = 0; |
44 | this->silence_count = 0; | 44 | this->silence_count = 0; |
@@ -202,7 +202,7 @@ int Cpu_done( struct Hes_Emu* this ) | |||
202 | if ( this->irq.timer <= present && !(this->irq.disables & timer_mask) ) | 202 | if ( this->irq.timer <= present && !(this->irq.disables & timer_mask) ) |
203 | { | 203 | { |
204 | this->timer.fired = true; | 204 | this->timer.fired = true; |
205 | this->irq.timer = future_hes_time; | 205 | this->irq.timer = (hes_time_t)future_hes_time; |
206 | irq_changed( this ); // overkill, but not worth writing custom code | 206 | irq_changed( this ); // overkill, but not worth writing custom code |
207 | #if defined (GME_FRAME_HOOK_DEFINED) | 207 | #if defined (GME_FRAME_HOOK_DEFINED) |
208 | { | 208 | { |
@@ -322,7 +322,7 @@ int Emu_cpu_read( struct Hes_Emu* this, hes_addr_t addr ) | |||
322 | case 0x0000: | 322 | case 0x0000: |
323 | if ( this->irq.vdp > time ) | 323 | if ( this->irq.vdp > time ) |
324 | return 0; | 324 | return 0; |
325 | this->irq.vdp = future_hes_time; | 325 | this->irq.vdp = (hes_time_t)future_hes_time; |
326 | run_until( this, time ); | 326 | run_until( this, time ); |
327 | irq_changed( this ); | 327 | irq_changed( this ); |
328 | return 0x20; | 328 | return 0x20; |
@@ -398,19 +398,19 @@ void irq_changed( struct Hes_Emu* this ) | |||
398 | 398 | ||
399 | if ( this->irq.timer > present ) | 399 | if ( this->irq.timer > present ) |
400 | { | 400 | { |
401 | this->irq.timer = future_hes_time; | 401 | this->irq.timer = (hes_time_t)future_hes_time; |
402 | if ( this->timer.enabled && !this->timer.fired ) | 402 | if ( this->timer.enabled && !this->timer.fired ) |
403 | this->irq.timer = present + this->timer.count; | 403 | this->irq.timer = present + this->timer.count; |
404 | } | 404 | } |
405 | 405 | ||
406 | if ( this->irq.vdp > present ) | 406 | if ( this->irq.vdp > present ) |
407 | { | 407 | { |
408 | this->irq.vdp = future_hes_time; | 408 | this->irq.vdp = (hes_time_t)future_hes_time; |
409 | if ( this->vdp.control & 0x08 ) | 409 | if ( this->vdp.control & 0x08 ) |
410 | this->irq.vdp = this->vdp.next_vbl; | 410 | this->irq.vdp = this->vdp.next_vbl; |
411 | } | 411 | } |
412 | 412 | ||
413 | hes_time_t time = future_hes_time; | 413 | hes_time_t time = (hes_time_t)future_hes_time; |
414 | if ( !(this->irq.disables & timer_mask) ) time = this->irq.timer; | 414 | if ( !(this->irq.disables & timer_mask) ) time = this->irq.timer; |
415 | if ( !(this->irq.disables & vdp_mask) ) time = min( time, this->irq.vdp ); | 415 | if ( !(this->irq.disables & vdp_mask) ) time = min( time, this->irq.vdp ); |
416 | 416 | ||
@@ -422,7 +422,7 @@ void irq_changed( struct Hes_Emu* this ) | |||
422 | static void adjust_time( blargg_long* time, hes_time_t delta ) ICODE_ATTR; | 422 | static void adjust_time( blargg_long* time, hes_time_t delta ) ICODE_ATTR; |
423 | static void adjust_time( blargg_long* time, hes_time_t delta ) | 423 | static void adjust_time( blargg_long* time, hes_time_t delta ) |
424 | { | 424 | { |
425 | if ( *time < future_hes_time ) | 425 | if ( *time < (blargg_long)future_hes_time ) |
426 | { | 426 | { |
427 | *time -= delta; | 427 | *time -= delta; |
428 | if ( *time < 0 ) | 428 | if ( *time < 0 ) |
@@ -452,8 +452,8 @@ blargg_err_t run_clocks( struct Hes_Emu* this, blip_time_t* duration_ ) | |||
452 | 452 | ||
453 | // End cpu frame | 453 | // End cpu frame |
454 | this->cpu.state_.base -= duration; | 454 | this->cpu.state_.base -= duration; |
455 | if ( this->cpu.irq_time < future_hes_time ) this->cpu.irq_time -= duration; | 455 | if ( this->cpu.irq_time < (hes_time_t)future_hes_time ) this->cpu.irq_time -= duration; |
456 | if ( this->cpu.end_time < future_hes_time ) this->cpu.end_time -= duration; | 456 | if ( this->cpu.end_time < (hes_time_t)future_hes_time ) this->cpu.end_time -= duration; |
457 | 457 | ||
458 | adjust_time( &this->irq.timer, duration ); | 458 | adjust_time( &this->irq.timer, duration ); |
459 | adjust_time( &this->irq.vdp, duration ); | 459 | adjust_time( &this->irq.vdp, duration ); |
@@ -585,8 +585,8 @@ blargg_err_t Hes_start_track( struct Hes_Emu* this, int track ) | |||
585 | Cpu_set_mmr( this, page_count, 0xFF ); // unmapped beyond end of address space | 585 | Cpu_set_mmr( this, page_count, 0xFF ); // unmapped beyond end of address space |
586 | 586 | ||
587 | this->irq.disables = timer_mask | vdp_mask; | 587 | this->irq.disables = timer_mask | vdp_mask; |
588 | this->irq.timer = future_hes_time; | 588 | this->irq.timer = (hes_time_t)future_hes_time; |
589 | this->irq.vdp = future_hes_time; | 589 | this->irq.vdp = (hes_time_t)future_hes_time; |
590 | 590 | ||
591 | this->timer.enabled = false; | 591 | this->timer.enabled = false; |
592 | this->timer.raw_load= 0x80; | 592 | this->timer.raw_load= 0x80; |