Skip to content

Commit

Permalink
Update dependencies and fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
kelpsyberry committed Apr 14, 2024
1 parent 9608f6f commit 5335936
Show file tree
Hide file tree
Showing 13 changed files with 162 additions and 151 deletions.
233 changes: 120 additions & 113 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ debugger-hooks = ["bft-r", "bft-w"]

[dependencies]
emu-utils = { git = "https://github.com/kelpsyberry/emu-utils" }
proc-bitfield = { git = "https://github.com/kelpsyberry/proc-bitfield", features = ["nightly"] }
proc-bitfield = { version = "0.4", features = ["nightly"] }
bitflags = "2.5"
cfg-if = "1.0"
slog = { version = "2.7", optional = true }
Expand Down
4 changes: 2 additions & 2 deletions core/src/cpu/arm9/dma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{
gpu::engine_3d::Engine3d,
utils::{schedule::RawTimestamp, Savestate},
};
use core::marker::ConstParamTy;
use core::{marker::ConstParamTy, mem::transmute};

#[repr(u8)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, ConstParamTy, Savestate)]
Expand Down Expand Up @@ -48,7 +48,7 @@ impl<E: Engine> Arm9<E> {
return;
}

channel.timing = unsafe { core::mem::transmute(value.timing_arm9()) };
channel.timing = unsafe { transmute::<u8, Timing>(value.timing_arm9()) };

let incr_shift = 1 + value.is_32_bit() as u8;
channel.src_addr_incr = match value.src_addr_control() {
Expand Down
6 changes: 4 additions & 2 deletions core/src/gpu/engine_3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1523,7 +1523,8 @@ impl Engine3d {
match command {
0x10 => {
// MTX_MODE
emu.gpu.engine_3d.mtx_mode = unsafe { transmute(first_param as u8 & 3) };
emu.gpu.engine_3d.mtx_mode =
unsafe { transmute::<u8, MatrixMode>(first_param as u8 & 3) };
}

0x11 => {
Expand Down Expand Up @@ -2003,7 +2004,8 @@ impl Engine3d {
0x40 => {
// BEGIN_VTXS
emu.gpu.engine_3d.cur_poly_attrs = emu.gpu.engine_3d.next_poly_attrs;
emu.gpu.engine_3d.cur_prim_type = unsafe { transmute(first_param as u8 & 3) };
emu.gpu.engine_3d.cur_prim_type =
unsafe { transmute::<u8, PrimitiveType>(first_param as u8 & 3) };
emu.gpu.engine_3d.cur_prim_vert_index = PrimVertIndex::new(0);
emu.gpu.engine_3d.cur_prim_max_verts = match emu.gpu.engine_3d.cur_prim_type {
PrimitiveType::Triangles | PrimitiveType::TriangleStrip => {
Expand Down
2 changes: 1 addition & 1 deletion frontend/desktop/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ bitflags = "2.5"
miniz_oxide = { version = "0.7", features = ["simd"] }
fatfs = { version = "0.3", optional = true }
tempfile = { version = "3.10", optional = true }
proc-bitfield = { git = "https://github.com/kelpsyberry/proc-bitfield", features = ["nightly"] }
proc-bitfield = { version = "0.4", features = ["nightly"] }

# Config
serde = { version = "1.0", features = ["derive"] }
Expand Down
8 changes: 5 additions & 3 deletions frontend/desktop/src/debug_views/cpu_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl<const ARM9: bool> InstanceableView for CpuMemory<ARM9> {
key: u32,
ui: &'ui imgui::Ui,
) -> imgui::Window<'ui, 'ui, impl AsRef<str> + 'static> {
let width = self.editor.window_width(ui);
let width = self.editor.window_auto_width(ui);
ui.window(format!("{} {key}", Self::MENU_NAME))
.size_constraints([width, 0.0], [width, f32::INFINITY])
}
Expand Down Expand Up @@ -139,7 +139,9 @@ impl<const ARM9: bool> FrameView for CpuMemory<ARM9> {
self.editor.handle_options_right_click(ui);
self.editor.draw_callbacks(
ui,
None,
imgui_memory_editor::DisplayMode::Child {
height: ui.content_region_avail()[1],
},
&mut (),
|_, addr| {
if self.mem_contents.visible_addrs.contains(&addr) {
Expand All @@ -161,7 +163,7 @@ impl<const ARM9: bool> FrameView for CpuMemory<ARM9> {
},
);

let mut visible_addrs = self.editor.visible_addrs(1);
let mut visible_addrs = self.editor.visible_addrs(1, ui);
visible_addrs.start &= !3;
visible_addrs.end = (visible_addrs.end + 3) & !3;
if visible_addrs != self.last_visible_addrs {
Expand Down
16 changes: 8 additions & 8 deletions frontend/desktop/src/debug_views/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ impl MessageView for Fs {
if contents.is_empty() {
*contents_ = Some(None);
} else {
self.editor.set_selected_addr(0);
self.editor.set_selected_addr(0, true);
self.editor
.set_addr_range((0_u64, contents.len() as u64 - 1).into());
*contents_ = Some(Some(contents));
Expand Down Expand Up @@ -551,13 +551,13 @@ impl MessageView for Fs {
match contents {
Some(Some(contents)) => {
let _font = ui.push_font(window.imgui.mono_font);
ui.child_window("file")
.size([
0.0,
ui.content_region_avail()[1] - style!(ui, cell_padding)[1],
])
.always_auto_resize(true)
.build(|| self.editor.draw_buffer_read_only(ui, None, contents));
self.editor.draw_buffer_read_only(
ui,
imgui_memory_editor::DisplayMode::Child {
height: ui.content_region_avail()[1] - style!(ui, cell_padding)[1],
},
contents,
);
}
Some(None) => ui.text("Empty file."),
None => ui.text("Loading..."),
Expand Down
2 changes: 1 addition & 1 deletion render/soft-2d/base/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ publish = false

[dependencies]
dust-core = { path = "../../../core" }
proc-bitfield = { git = "https://github.com/kelpsyberry/proc-bitfield", features = ["nightly"] }
proc-bitfield = { version = "0.4", features = ["nightly"] }
6 changes: 3 additions & 3 deletions render/soft-2d/base/src/render/bgs/avx2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,9 @@ pub unsafe fn render_scanline_bgs_and_objs<

static RGB5_TO_RGB6_DATA: [__m256i; 3] = unsafe {
[
transmute(u64x4::from_array([0x3E; 4])),
transmute(u64x4::from_array([0xF80; 4])),
transmute(u64x4::from_array([0x3_E000; 4])),
transmute::<u64x4, __m256i>(u64x4::from_array([0x3E; 4])),
transmute::<u64x4, __m256i>(u64x4::from_array([0xF80; 4])),
transmute::<u64x4, __m256i>(u64x4::from_array([0x3_E000; 4])),
]
};

Expand Down
28 changes: 14 additions & 14 deletions render/soft-2d/base/src/render/effects/avx2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ type BlendData = ([__m256i; 3], [__m256i; 3], [__m256i; 3]);
static BLEND_DATA: BlendData = unsafe {
(
[
transmute(u64x4::from_array([0x3F; 4])),
transmute(u64x4::from_array([0xFC0; 4])),
transmute(u64x4::from_array([0x3_F000; 4])),
transmute::<u64x4, __m256i>(u64x4::from_array([0x3F; 4])),
transmute::<u64x4, __m256i>(u64x4::from_array([0xFC0; 4])),
transmute::<u64x4, __m256i>(u64x4::from_array([0x3_F000; 4])),
],
[
transmute(u64x4::from_array([0x3F0; 4])),
transmute(u64x4::from_array([0xFC00; 4])),
transmute(u64x4::from_array([0x3F_0000; 4])),
transmute::<u64x4, __m256i>(u64x4::from_array([0x3F0; 4])),
transmute::<u64x4, __m256i>(u64x4::from_array([0xFC00; 4])),
transmute::<u64x4, __m256i>(u64x4::from_array([0x3F_0000; 4])),
],
[
transmute(u64x4::from_array([0x7E0; 4])),
transmute(u64x4::from_array([0x1_F800; 4])),
transmute(u64x4::from_array([0x7E_0000; 4])),
transmute::<u64x4, __m256i>(u64x4::from_array([0x7E0; 4])),
transmute::<u64x4, __m256i>(u64x4::from_array([0x1_F800; 4])),
transmute::<u64x4, __m256i>(u64x4::from_array([0x7E_0000; 4])),
],
)
};
Expand Down Expand Up @@ -211,12 +211,12 @@ pub unsafe fn apply_color_effects<B: Buffers, D: RenderingData, const EFFECT: u8
static RGB6_TO_RGBA8_DATA: ([__m256i; 3], __m256i, __m256i) = unsafe {
(
[
transmute(u32x8::from_array([0x3F; 8])),
transmute(u32x8::from_array([0x3F00; 8])),
transmute(u32x8::from_array([0x3F_0000; 8])),
transmute::<u32x8, __m256i>(u32x8::from_array([0x3F; 8])),
transmute::<u32x8, __m256i>(u32x8::from_array([0x3F00; 8])),
transmute::<u32x8, __m256i>(u32x8::from_array([0x3F_0000; 8])),
],
transmute(u32x8::from_array([0xFF00_0000; 8])),
transmute(u32x8::from_array([0x0003_0303; 8])),
transmute::<u32x8, __m256i>(u32x8::from_array([0xFF00_0000; 8])),
transmute::<u32x8, __m256i>(u32x8::from_array([0x0003_0303; 8])),
)
};

Expand Down
2 changes: 1 addition & 1 deletion render/soft-3d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ publish = false

[dependencies]
dust-core = { path = "../../core" }
proc-bitfield = { git = "https://github.com/kelpsyberry/proc-bitfield", features = ["nightly"] }
proc-bitfield = { version = "0.4", features = ["nightly"] }
2 changes: 1 addition & 1 deletion render/wgpu-2d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ publish = false
dust-core = { path = "../../core" }
emu-utils = { git = "https://github.com/kelpsyberry/emu-utils", features = ["triple-buffer"] }
dust-soft-2d-base = { path = "../soft-2d/base" }
proc-bitfield = { git = "https://github.com/kelpsyberry/proc-bitfield", features = ["nightly"] }
proc-bitfield = { version = "0.4", features = ["nightly"] }
wgpu = "0.19"
crossbeam-channel = "0.5"
parking_lot = "0.12"
2 changes: 1 addition & 1 deletion render/wgpu-3d/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ threaded = ["emu-utils", "crossbeam-channel", "parking_lot"]
dust-core = { path = "../../core", features = ["3d-hi-res-coords"] }
dust-soft-3d = { path = "../soft-3d" }
emu-utils = { git = "https://github.com/kelpsyberry/emu-utils", features = ["triple-buffer"], optional = true}
proc-bitfield = { git = "https://github.com/kelpsyberry/proc-bitfield", features = ["nightly"] }
proc-bitfield = { version = "0.4", features = ["nightly"] }
ahash = "0.8"
wgpu = "0.19"
crossbeam-channel = { version = "0.5", optional = true }
Expand Down

0 comments on commit 5335936

Please sign in to comment.