backc is not a word

This commit is contained in:
Gwilym Kuiper 2022-11-17 21:00:51 +00:00
parent 679a2ec997
commit 55c7541386

View file

@ -32,10 +32,10 @@ fn main(mut gba: agb::Gba) -> ! {
let back = Mutex::new(RefCell::new(BackCosines { cosines, row: 0 }));
let _a = agb::interrupt::add_interrupt_handler(Interrupt::HBlank, |key: CriticalSection| {
let mut backc = back.borrow(key).borrow_mut();
let deflection = backc.cosines[backc.row % 32];
let mut back = back.borrow(key).borrow_mut();
let deflection = back.cosines[back.row % 32];
unsafe { ((0x0400_0010) as *mut u16).write_volatile(deflection) }
backc.row += 1;
back.row += 1;
});
let vblank = agb::interrupt::VBlank::get();
@ -43,10 +43,10 @@ fn main(mut gba: agb::Gba) -> ! {
loop {
vblank.wait_for_vblank();
free(|key| {
let mut backc = back.borrow(key).borrow_mut();
backc.row = 0;
let mut back = back.borrow(key).borrow_mut();
back.row = 0;
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)
.cos()
* (256 * 4 - 1)