diff --git a/src/decoder_8080.rs b/src/decoder_8080.rs index 79b2ddc..aa28d0d 100644 --- a/src/decoder_8080.rs +++ b/src/decoder_8080.rs @@ -163,7 +163,7 @@ impl Decoder8080 { // Load cycle information for c in 0..=255 { - if let Some(opcode) = &mut self.no_prefix[c as usize] { + if let Some(opcode) = &mut self.no_prefix[c] { opcode.cycles = NO_PREFIX_CYCLES[c]; opcode.cycles_conditional = opcode.cycles; } diff --git a/src/decoder_z80.rs b/src/decoder_z80.rs index 7f479ee..8821909 100644 --- a/src/decoder_z80.rs +++ b/src/decoder_z80.rs @@ -413,20 +413,20 @@ impl DecoderZ80 { // Load cycle information for c in 0..=255 { - if let Some(opcode) = &mut self.no_prefix[c as usize] { + if let Some(opcode) = &mut self.no_prefix[c] { opcode.cycles = NO_PREFIX_CYCLES[c]; opcode.cycles_conditional = opcode.cycles; } - if let Some(opcode) = &mut self.prefix_cb[c as usize] { + if let Some(opcode) = &mut self.prefix_cb[c] { opcode.cycles = PREFIX_CB_CYCLES[c]; opcode.cycles_conditional = opcode.cycles; } - if let Some(opcode) = &mut self.prefix_cb_indexed[c as usize] { + if let Some(opcode) = &mut self.prefix_cb_indexed[c] { // 23 cycles except for BIT that is 20 opcode.cycles = if (c & 0xc0) == 0x40 {20} else {23}; opcode.cycles_conditional = opcode.cycles; } - if let Some(opcode) = &mut self.prefix_ed[c as usize] { + if let Some(opcode) = &mut self.prefix_ed[c] { opcode.cycles = PREFIX_ED_CYCLES[c]; opcode.cycles_conditional = opcode.cycles; }