mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
backc is not a word
This commit is contained in:
parent
679a2ec997
commit
55c7541386
|
@ -32,10 +32,10 @@ fn main(mut gba: agb::Gba) -> ! {
|
||||||
let back = Mutex::new(RefCell::new(BackCosines { cosines, row: 0 }));
|
let back = Mutex::new(RefCell::new(BackCosines { cosines, row: 0 }));
|
||||||
|
|
||||||
let _a = agb::interrupt::add_interrupt_handler(Interrupt::HBlank, |key: CriticalSection| {
|
let _a = agb::interrupt::add_interrupt_handler(Interrupt::HBlank, |key: CriticalSection| {
|
||||||
let mut backc = back.borrow(key).borrow_mut();
|
let mut back = back.borrow(key).borrow_mut();
|
||||||
let deflection = backc.cosines[backc.row % 32];
|
let deflection = back.cosines[back.row % 32];
|
||||||
unsafe { ((0x0400_0010) as *mut u16).write_volatile(deflection) }
|
unsafe { ((0x0400_0010) as *mut u16).write_volatile(deflection) }
|
||||||
backc.row += 1;
|
back.row += 1;
|
||||||
});
|
});
|
||||||
|
|
||||||
let vblank = agb::interrupt::VBlank::get();
|
let vblank = agb::interrupt::VBlank::get();
|
||||||
|
@ -43,10 +43,10 @@ fn main(mut gba: agb::Gba) -> ! {
|
||||||
loop {
|
loop {
|
||||||
vblank.wait_for_vblank();
|
vblank.wait_for_vblank();
|
||||||
free(|key| {
|
free(|key| {
|
||||||
let mut backc = back.borrow(key).borrow_mut();
|
let mut back = back.borrow(key).borrow_mut();
|
||||||
backc.row = 0;
|
back.row = 0;
|
||||||
time += 1;
|
time += 1;
|
||||||
for (r, a) in backc.cosines.iter_mut().enumerate() {
|
for (r, a) in back.cosines.iter_mut().enumerate() {
|
||||||
let n: FixedNum<8> = (FixedNum::new(r as i32) / 32 + FixedNum::new(time) / 128)
|
let n: FixedNum<8> = (FixedNum::new(r as i32) / 32 + FixedNum::new(time) / 128)
|
||||||
.cos()
|
.cos()
|
||||||
* (256 * 4 - 1)
|
* (256 * 4 - 1)
|
||||||
|
|
Loading…
Reference in a new issue