File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -345,7 +345,7 @@ impl Chip8Emulator {
345345 self . program_counter = addr;
346346 }
347347
348- fn ret ( & mut self ) {
348+ const fn ret ( & mut self ) {
349349 // 00EE - RET
350350 // Return from a subroutine.
351351 // The interpreter sets the program counter to the address at the top of the stack, then subtracts 1 from the stack pointer.
Original file line number Diff line number Diff line change @@ -72,9 +72,9 @@ impl App {
7272 while !self . exit {
7373 for _ in 0 ..10 {
7474 self . emulator . tick ( ) ;
75+ self . calculate_points ( ) ;
7576 }
7677 self . emulator . tick_timers ( ) ;
77- self . calculate_points ( ) ;
7878 self . handle_events ( ) ?;
7979 terminal. draw ( |frame| self . draw ( frame) ) ?;
8080 }
@@ -88,7 +88,7 @@ impl App {
8888 }
8989
9090 fn handle_events ( & mut self ) -> io:: Result < ( ) > {
91- if event:: poll ( Duration :: from_millis ( 10 ) ) ? {
91+ if event:: poll ( Duration :: from_millis ( 16 ) ) ? {
9292 match event:: read ( ) ? {
9393 Event :: Key ( key_event) => {
9494 let pressed = if key_event. kind == KeyEventKind :: Press {
You can’t perform that action at this time.
0 commit comments