Skip to content

Commit 802a461

Browse files
committed
Use deterministic size for linked tracks
1 parent cd19932 commit 802a461

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/core/hle/sound_nitro.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ struct Channel {
128128
loop_pos: u16,
129129
length: u32,
130130
data_addr_duty_cycle: u32,
131-
linked_track: Option<usize>, // size 8, callback and data
131+
linked_track: Option<u32>, // size 8, callback and data
132132
next: Option<u16>, // size 4, ptr
133133
}
134134

@@ -1524,7 +1524,7 @@ impl Emu {
15241524
ret_chan.status_flags.set_active(false);
15251525

15261526
ret_chan.next = None;
1527-
ret_chan.linked_track = Some(track_id as usize);
1527+
ret_chan.linked_track = Some(track_id as u32);
15281528
ret_chan.note_length = 0;
15291529
ret_chan.priority = prio;
15301530
ret_chan.volume = 127;
@@ -2128,7 +2128,7 @@ impl Emu {
21282128

21292129
fn sound_nitro_unlink_channel(&mut self, chan_id: u8, unlink: bool) {
21302130
let sound_nitro = &mut self.hle.sound.nitro;
2131-
let track_id = sound_nitro.channels[chan_id as usize].linked_track.unwrap();
2131+
let track_id = sound_nitro.channels[chan_id as usize].linked_track.unwrap() as usize;
21322132

21332133
if unlink {
21342134
let chan = &mut sound_nitro.channels[chan_id as usize];

0 commit comments

Comments
 (0)