From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: From: Robert Schwebel Date: Sun, 30 Oct 2011 23:00:42 +0100 Message-Id: <1320012059-24971-11-git-send-email-r.schwebel@pengutronix.de> In-Reply-To: <1320012059-24971-1-git-send-email-r.schwebel@pengutronix.de> References: <20111030220011.GK14918@pengutronix.de> <1320012059-24971-1-git-send-email-r.schwebel@pengutronix.de> Subject: [ptxdist] [PATCH 11/28] cbmbasic: clean up patches Reply-To: ptxdist@pengutronix.de List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: ptxdist-bounces@pengutronix.de Errors-To: ptxdist-bounces@pengutronix.de To: ptxdist@pengutronix.de Cc: Robert Schwebel Signed-off-by: Robert Schwebel --- ...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 +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 + +# --- +# 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 + #include + #include ++#include + + 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 - -Signed-off-by: Wolfram Sang - -# --- -# 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 - #include - #include -+#include - - 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 ptxdist@pengutronix.de