Skip to content

Commit ed71a4d

Browse files
author
Matt Liegey
committed
Commenting out some broken code and throwing unimplemented instead.
1 parent 2e25153 commit ed71a4d

File tree

2 files changed

+50
-45
lines changed

2 files changed

+50
-45
lines changed

src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#![no_std]
2-
#![feature(asm, global_asm, isa_attribute)]
2+
#![feature(isa_attribute)]
33

44
//! This crate helps you write GBA ROMs.
55
//!
@@ -31,11 +31,11 @@ pub mod prelude {
3131
#[cfg(target_arch = "arm")]
3232
pub use crate::mmio_addresses::*;
3333
#[cfg(target_arch = "arm")]
34+
pub use crate::random::*;
35+
#[cfg(target_arch = "arm")]
3436
pub use crate::save::*;
3537
#[cfg(target_arch = "arm")]
3638
pub use crate::sync::*;
37-
#[cfg(target_arch = "arm")]
38-
pub use crate::random::*;
3939
}
4040

4141
pub mod mmio_types;

src/sync/statics.rs

Lines changed: 47 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -85,59 +85,64 @@ unsafe fn transfer_align4_thumb<T: Copy>(mut dst: *mut T, mut src: *const T) {
8585

8686
#[cfg(target_arch = "arm")]
8787
#[instruction_set(arm::a32)]
88-
#[allow(unused_assignments)]
88+
#[allow(unused_assignments, unused_variables, unused_mut)] // TODO(rust-console/gba#158)
8989
unsafe fn transfer_align4_arm<T: Copy>(mut dst: *mut T, mut src: *const T) {
9090
let size = size_of::<T>();
9191
if size <= 16 {
9292
unimplemented!("This should be done via transfer_thumb.");
9393
} else if size <= 20 {
9494
// Starting at size == 20, we have to switch to ARM due to lack of
9595
// accessible registers in THUMB mode.
96-
asm!(
97-
"ldmia {0}!, {{r2-r5,r8}}",
98-
"stmia {1}!, {{r2-r5,r8}}",
99-
inout(reg) src, inout(reg) dst,
100-
out("r2") _, out("r3") _, out("r4") _, out("r5") _, out("r8") _,
101-
)
96+
// asm!(
97+
// "ldmia {0}!, {{r2-r5,r8}}",
98+
// "stmia {1}!, {{r2-r5,r8}}",
99+
// inout(reg) src, inout(reg) dst,
100+
// out("r2") _, out("r3") _, out("r4") _, out("r5") _, out("r8") _,
101+
// )
102+
unimplemented!("Currently higher registers are unavailable. See rust-console/gba#158");
102103
} else if size <= 24 {
103-
asm!(
104-
"push {{r9}}",
105-
"ldmia {0}!, {{r2-r5,r8-r9}}",
106-
"stmia {1}!, {{r2-r5,r8-r9}}",
107-
"pop {{r9}}",
108-
inout(reg) src, inout(reg) dst,
109-
out("r2") _, out("r3") _, out("r4") _, out("r5") _, out("r8") _,
110-
)
104+
// asm!(
105+
// "push {{r9}}",
106+
// "ldmia {0}!, {{r2-r5,r8-r9}}",
107+
// "stmia {1}!, {{r2-r5,r8-r9}}",
108+
// "pop {{r9}}",
109+
// inout(reg) src, inout(reg) dst,
110+
// out("r2") _, out("r3") _, out("r4") _, out("r5") _, out("r8") _,
111+
// )
112+
unimplemented!("Currently higher registers are unavailable. See rust-console/gba#158");
111113
} else if size <= 28 {
112-
asm!(
113-
"push {{r9}}",
114-
"ldmia {0}!, {{r2-r5,r8-r10}}",
115-
"stmia {1}!, {{r2-r5,r8-r10}}",
116-
"pop {{r9}}",
117-
inout(reg) src, inout(reg) dst,
118-
out("r2") _, out("r3") _, out("r4") _, out("r5") _, out("r8") _,
119-
out("r10") _,
120-
)
114+
// asm!(
115+
// "push {{r9}}",
116+
// "ldmia {0}!, {{r2-r5,r8-r10}}",
117+
// "stmia {1}!, {{r2-r5,r8-r10}}",
118+
// "pop {{r9}}",
119+
// inout(reg) src, inout(reg) dst,
120+
// out("r2") _, out("r3") _, out("r4") _, out("r5") _, out("r8") _,
121+
// out("r10") _,
122+
// )
123+
unimplemented!("Currently higher registers are unavailable. See rust-console/gba#158");
121124
} else if size <= 32 {
122-
asm!(
123-
"push {{r9}}",
124-
"ldmia {0}!, {{r2-r5,r8-r10,r12}}",
125-
"stmia {1}!, {{r2-r5,r8-r10,r12}}",
126-
"pop {{r9}}",
127-
inout(reg) src, inout(reg) dst,
128-
out("r2") _, out("r3") _, out("r4") _, out("r5") _, out("r8") _,
129-
out("r10") _, out("r12") _,
130-
)
125+
// asm!(
126+
// "push {{r9}}",
127+
// "ldmia {0}!, {{r2-r5,r8-r10,r12}}",
128+
// "stmia {1}!, {{r2-r5,r8-r10,r12}}",
129+
// "pop {{r9}}",
130+
// inout(reg) src, inout(reg) dst,
131+
// out("r2") _, out("r3") _, out("r4") _, out("r5") _, out("r8") _,
132+
// out("r10") _, out("r12") _,
133+
// )
134+
unimplemented!("Currently higher registers are unavailable. See rust-console/gba#158");
131135
} else if size <= 36 {
132-
asm!(
133-
"push {{r9}}",
134-
"ldmia {0}!, {{r2-r5,r8-r10,r12,r14}}",
135-
"stmia {1}!, {{r2-r5,r8-r10,r12,r14}}",
136-
"pop {{r9}}",
137-
inout(reg) src, inout(reg) dst,
138-
out("r2") _, out("r3") _, out("r4") _, out("r5") _, out("r8") _,
139-
out("r10") _, out("r12") _, out("r14") _,
140-
)
136+
// asm!(
137+
// "push {{r9}}",
138+
// "ldmia {0}!, {{r2-r5,r8-r10,r12,r14}}",
139+
// "stmia {1}!, {{r2-r5,r8-r10,r12,r14}}",
140+
// "pop {{r9}}",
141+
// inout(reg) src, inout(reg) dst,
142+
// out("r2") _, out("r3") _, out("r4") _, out("r5") _, out("r8") _,
143+
// out("r10") _, out("r12") _, out("r14") _,
144+
// )
145+
unimplemented!("Currently higher registers are unavailable. See rust-console/gba#158");
141146
} else {
142147
unimplemented!("Copy too large for use of ldmia/stmia.");
143148
}

0 commit comments

Comments
 (0)