mirror of
https://github.com/bobbimanners/EightBall.git
synced 2024-05-29 03:41:32 +00:00
v0.52. Fix memory corruption bug.
This fixes a memory corruption bug that occurred when compiling code with subroutines. The symbol table was corrupting the source code. This was showing up on 6502 systems only (seemed okay on Linux).
This commit is contained in:
parent
9550257613
commit
cdbfeafda9
BIN
8ball20.prg
BIN
8ball20.prg
Binary file not shown.
BIN
8ball64.prg
BIN
8ball64.prg
Binary file not shown.
4
Makefile
4
Makefile
|
@ -84,9 +84,11 @@ test.d64: 8ball20.prg 8ballvm20.prg 8ball64.prg 8ballvm64.prg
|
|||
c1541 -attach test.d64 -write 8ball64.prg
|
||||
c1541 -attach test.d64 -write 8ballvm64.prg
|
||||
|
||||
test.dsk: eightball.system ebvm.system
|
||||
test.dsk: eightball.system ebvm.system sieve4.8b
|
||||
java -jar ~/Desktop/Apple2/AppleCommander-1.3.5.jar -d test.dsk e8ball.system
|
||||
java -jar ~/Desktop/Apple2/AppleCommander-1.3.5.jar -d test.dsk ebvm.system
|
||||
java -jar ~/Desktop/Apple2/AppleCommander-1.3.5.jar -d test.dsk sieve4.8b
|
||||
java -jar ~/Desktop/Apple2/AppleCommander-1.3.5.jar -p test.dsk e8ball.system sys <eightball.system
|
||||
java -jar ~/Desktop/Apple2/AppleCommander-1.3.5.jar -p test.dsk ebvm.system sys <ebvm.system
|
||||
java -jar ~/Desktop/Apple2/AppleCommander-1.3.5.jar -p test.dsk sieve4.8b txt <sieve4.8b
|
||||
|
||||
|
|
12
eightball.c
12
eightball.c
|
@ -3017,7 +3017,7 @@ unsigned char dosubr()
|
|||
* of the location of the variables in the compiled code.
|
||||
* TODO: There is no way to free this without deleting all of heap2 (source code)
|
||||
*/
|
||||
s = alloc2(sizeof(var_t) + sizeof(int));
|
||||
s = alloc2(sizeof(sub_t));
|
||||
strncpy(s->name, readbuf, 8);
|
||||
s->addr = rtPC;
|
||||
s->next = NULL;
|
||||
|
@ -3177,7 +3177,7 @@ unsigned char docall()
|
|||
* Do this before evaluating arguments, which overwrites readbuf
|
||||
*/
|
||||
if (compile) {
|
||||
s = alloc2(sizeof(var_t) + sizeof(int));
|
||||
s = alloc2(sizeof(sub_t));
|
||||
strncpy(s->name, readbuf, 8);
|
||||
}
|
||||
|
||||
|
@ -4730,17 +4730,17 @@ main()
|
|||
#ifdef A2E
|
||||
videomode(VIDEOMODE_80COL);
|
||||
revers(1);
|
||||
print(" *** EIGHTBALL V0.51 *** \n");
|
||||
print(" *** EIGHTBALL V0.52 *** \n");
|
||||
print(" *** (C)BOBBI, 2018 *** \n\n");
|
||||
revers(0);
|
||||
#elif defined(C64)
|
||||
print(" *** EightBall v0.51 *** ");
|
||||
print(" *** EightBall v0.52 *** ");
|
||||
print(" *** (c)Bobbi, 2018 *** \n\n");
|
||||
#elif defined(VIC20)
|
||||
/* Looks great in 22 cols! */
|
||||
print("*** EightBall v0.51 ***** (c)Bobbi, 2017 ***\n\n");
|
||||
print("*** EightBall v0.52****** (c)Bobbi, 2017 ***\n\n");
|
||||
#else
|
||||
print(" *** EightBall v0.51 *** \n");
|
||||
print(" *** EightBall v0.52 *** \n");
|
||||
print(" *** (c)Bobbi, 2018 *** \n\n");
|
||||
#endif
|
||||
|
||||
|
|
BIN
eightball.system
BIN
eightball.system
Binary file not shown.
|
@ -1,7 +1,7 @@
|
|||
' Sieve of Eratosthenes
|
||||
|
||||
byte A[10000] = 1
|
||||
call doall(100)
|
||||
byte A[400] = 1
|
||||
call doall(20)
|
||||
end
|
||||
|
||||
sub doall(word nr)
|
||||
|
|
Loading…
Reference in New Issue
Block a user