Switch to tidied up sim68xx repo (hopefully this will be accepted upstream too)
authorNick Downing <nick@ndcode.org>
Mon, 25 Jul 2022 17:05:02 +0000 (03:05 +1000)
committerNick Downing <nick@ndcode.org>
Sat, 30 Jul 2022 01:22:08 +0000 (11:22 +1000)
basic_test.txt
cpu_6800.h
sim68xx

index 6a007bd..792fc49 100644 (file)
@@ -15,7 +15,7 @@ Y
 120 REM A9=ATN(X9) === GOSUB 60310
 130 X9=.8:GOSUB 60310:PRINT ATN(.8),A9
 140 END
-60000 REM EXPONENTIATI0N: P9=X9^Y9
+60000 REM EXPONENTIATION: P9=X9^Y9
 60010 REM NEED: EXP, LOG
 60020 REM VARIABLES USED: A9,B9,C9,E9,L9,P9,X9,Y9
 60030 P9=1 : E9=0 : IF Y9=0 THEN RETURN
@@ -24,17 +24,17 @@ Y
 60060 P9=P9*E9 : RETURN
 60070 REM NATURAL LOGARITHM: L9=LOG(X9)
 60080 REM VARIABLES USED: A9,B9,C9,E9,L9,X9
-60090 E9=0 : IF X9<=0 THEN PRINT "LOG FC ERROR"; : ST0P
+60090 E9=0 : IF X9<=0 THEN PRINT "LOG FC ERROR"; : STOP
 60095 A9=1 : B9=2 : C9=.5 : REM THIS WILL SPEED UP THE FOLLOWING
 60100 IF X9>=A9 THEN X9=C9*X9 : E9=E9+A9 : GOTO 60100
 60110 IF X9<C9 THEN X9=B9*X9 : E9=E9-A9 : GOTO 60110
 60120 X9=(X9-.707107)/(X9+.707107) : L9=X9*X9
 60130 L9=(((.598979*L9+.961471)*L9+2.88539)*X9+E9-.5)*.693147
 60135 RETURN
-60190 REM EXPONENTIAL: E9=EXP(X9)
+60140 REM EXPONENTIAL: E9=EXP(X9)
 60150 REM VARIABLES USED: A9,E9,L9,X9
 60160 L9=INT(1.4427*X9)+1 : IF L9<1E7 THEN 60180
-60170 IF X9>0 THEN PRINT "EXP OV ERR0R"; : STOP
+60170 IF X9>0 THEN PRINT "EXP OV ERROR"; : STOP
 60175 E9=0 : RETURN
 60180 E9=.693147*L9-X9 : A9=1.32988E-3-1.41316E-4*E9
 60190 A9=((A9*E9-8.30136E-3)*E9+4.16574E-2)*E9
index b15bd1f..cc68fdb 100644 (file)
@@ -302,6 +302,7 @@ static ALWAYS_INLINE void cpu_6800_cl(struct cpu_6800 *self, int n) {
 }
 
 static ALWAYS_INLINE void cpu_6800_clr(struct cpu_6800 *self, int lvalue) {
+  cpu_6800_read_byte(self, lvalue); // clr is implemented as RMW like inc/dec
   cpu_6800_write_byte(self, lvalue, 0);
 
   self->regs.bit.nf = false;
diff --git a/sim68xx b/sim68xx
index 8b65ae6..c93ed6d 160000 (submodule)
--- a/sim68xx
+++ b/sim68xx
@@ -1 +1 @@
-Subproject commit 8b65ae6a4c8169cc40844026d472d97bdcde3e2f
+Subproject commit c93ed6d6ddea2af58fd9ffb09081162b02378eb5