chip8

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.vgx.fr/chip8
Log | Files | Refs

commit 344d2cf20840fa152a7a0779d4f2a9375463dd35
parent 2283a39d095fbdfb3999ac5332d63163bcf26a03
Author: Léo Villeveygoux <l@vgx.fr>
Date:   Fri, 10 May 2019 19:18:13 +0200

Use original stack size (24 levels)

Diffstat:
Mchip8.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/chip8.c b/chip8.c @@ -7,6 +7,7 @@ #include "media.h" #define FREQ 840 +#define STACK_SIZE 24 unsigned char RAM[0x1000]; @@ -19,7 +20,7 @@ unsigned char ST; unsigned short PC=0x200; unsigned char SP; -unsigned short STACK[16]; +unsigned short STACK[STACK_SIZE]; unsigned short KEYBOARD; @@ -181,7 +182,7 @@ static void step(){ PC=I_ADDR(instr); return; case 2: /* call a subroutine */ - if(SP==16) + if(SP==STACK_SIZE) WARN("Stack overflow\n"); else STACK[SP++] = PC;