Signed-off-by: Robert Schwebel <[email protected]>
---
 ...and-pseudo-timer-will-give-RND-functional.patch |   56 ++++++++++++++++++++
 patches/cbmbasic/add_iobase.diff                   |   48 -----------------
 patches/cbmbasic/series                            |    1 -
 3 files changed, 56 insertions(+), 49 deletions(-)
 create mode 100644 
patches/cbmbasic/0001-Add-IOBASE-and-pseudo-timer-will-give-RND-functional.patch
 delete mode 100644 patches/cbmbasic/add_iobase.diff
 delete mode 100644 patches/cbmbasic/series

diff --git 
a/patches/cbmbasic/0001-Add-IOBASE-and-pseudo-timer-will-give-RND-functional.patch
 
b/patches/cbmbasic/0001-Add-IOBASE-and-pseudo-timer-will-give-RND-functional.patch
new file mode 100644
index 0000000..21ebb33
--- /dev/null
+++ 
b/patches/cbmbasic/0001-Add-IOBASE-and-pseudo-timer-will-give-RND-functional.patch
@@ -0,0 +1,56 @@
+From f7cf261c349c0f511392ec061011ce0a84fbec0b Mon Sep 17 00:00:00 2001
+From: Wolfram Sang <[email protected]>
+Date: Sat, 29 Oct 2011 19:01:11 +0200
+Subject: [PATCH] Add IOBASE and pseudo-timer (will give RND-functionality)
+
+Signed-off-by: Wolfram Sang <[email protected]>
+
+# ---
+# 20091210 rsc: check if there is another upstream version
+# 20081127 wsa: already sent mainline and accepted.
+---
+ runtime.c |   14 ++++++++++++--
+ 1 files changed, 12 insertions(+), 2 deletions(-)
+
+diff --git a/runtime.c b/runtime.c
+index 454000e..2c3c54b 100644
+--- a/runtime.c
++++ b/runtime.c
+@@ -29,6 +29,7 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
++#include <time.h>
+ 
+ unsigned char RAM[65536];
+ 
+@@ -155,6 +156,7 @@ init_os(int argc, char **argv) {
+               interactive = 1;
+               f = NULL;
+       }
++      srand(time(NULL));
+ }
+ 
+ static void
+@@ -565,8 +567,16 @@ PLOT() {
+ /* IOBASE */
+ static void
+ IOBASE() {
+-              printf("UNIMPL: IOBASE\n");
+-              exit(1);
++              /*
++               * IOBASE is just used inside RND to get a timer value.
++               * So, let's fake this here, too.
++               */
++              int pseudo_timer = rand();
++              RAM[0xDC04] = pseudo_timer&0xff;
++              RAM[0xDC05] = pseudo_timer>>8;
++
++              X = 0x00;
++              Y = 0xDC;
+ }
+ 
+ int
+-- 
+1.7.7
+
diff --git a/patches/cbmbasic/add_iobase.diff b/patches/cbmbasic/add_iobase.diff
deleted file mode 100644
index 55628b6..0000000
--- a/patches/cbmbasic/add_iobase.diff
+++ /dev/null
@@ -1,48 +0,0 @@
-Subject: Add IOBASE and pseudo-timer (will give RND-functionality)
-From: Wolfram Sang <[email protected]>
-
-Signed-off-by: Wolfram Sang <[email protected]>
-
-# ---
-# 20091210 rsc: check if there is another upstream version
-# 20081127 wsa: already sent mainline and accepted.
-
-Index: basic/runtime.c
-===================================================================
---- basic.orig/runtime.c       2008-11-17 05:16:31.000000000 +0100
-+++ basic/runtime.c    2008-11-17 05:43:31.000000000 +0100
-@@ -29,6 +29,7 @@
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
-+#include <time.h>
- 
- unsigned char RAM[65536];
- 
-@@ -155,6 +156,7 @@
-               interactive = 1;
-               f = NULL;
-       }
-+      srand(time(NULL));
- }
- 
- static void
-@@ -565,8 +567,16 @@
- /* IOBASE */
- static void
- IOBASE() {
--              printf("UNIMPL: IOBASE\n");
--              exit(1);
-+              /*
-+               * IOBASE is just used inside RND to get a timer value.
-+               * So, let's fake this here, too.
-+               */
-+              int pseudo_timer = rand();
-+              RAM[0xDC04] = pseudo_timer&0xff;
-+              RAM[0xDC05] = pseudo_timer>>8;
-+
-+              X = 0x00;
-+              Y = 0xDC;
- }
- 
- int
diff --git a/patches/cbmbasic/series b/patches/cbmbasic/series
deleted file mode 100644
index a474bc9..0000000
--- a/patches/cbmbasic/series
+++ /dev/null
@@ -1 +0,0 @@
-add_iobase.diff
-- 
1.7.7


-- 
ptxdist mailing list
[email protected]

Reply via email to