commit 1330705f656258baa1b66d240e18e73f0a38165d from: Witcher01 date: Sun Aug 1 17:04:21 2021 UTC instantiate stack with 0 length but 16 capacity, removing stack pointer commit - ebf97be247eb7e27b2df1adf663ae48c9accd391 commit + 1330705f656258baa1b66d240e18e73f0a38165d blob - a354d0166c46432769fc74e545d7a6bde293d80b blob + fbf9504c5f31fd5faa20fdb5b342632d1ba86825 --- src/chip8.rs +++ src/chip8.rs @@ -19,8 +19,6 @@ pub struct Chip8 { pc: u16, /// Call stack with a maximum size of 16. stack: Vec, - /// Stack pointer, pointing to the topmost level of the stack. - stack_pointer: u8, /// Delay timer /// The value of timer is being decremented at a rate of 60Hz. delay_timer: u8, @@ -38,8 +36,7 @@ impl Chip8 { regs: vec![0; 16], i_reg: 0, pc: PROGRAM_START, - stack: vec![0; 16], - stack_pointer: 0, + stack: Vec::with_capacity(16), delay_timer: 0, sound_timer: 0, video_driver: VideoDriver::new(),