pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/emulators/gxemul Fix dropped characters on landisk (sh...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/fb5224e6d75b
branches:  trunk
changeset: 365422:fb5224e6d75b
user:      christos <christos%pkgsrc.org@localhost>
date:      Sun Jul 16 14:10:58 2017 +0000

description:
Fix dropped characters on landisk (sh4). Now the arrow keys work in the
installer.

diffstat:

 emulators/gxemul/Makefile                              |   4 +-
 emulators/gxemul/distinfo                              |   4 +-
 emulators/gxemul/patches/patch-src_console_console.cc  |  52 ++++++++++++++++++
 emulators/gxemul/patches/patch-src_devices_dev__sh4.cc |  17 +++++
 4 files changed, 74 insertions(+), 3 deletions(-)

diffs (111 lines):

diff -r e1fd93968ba5 -r fb5224e6d75b emulators/gxemul/Makefile
--- a/emulators/gxemul/Makefile Sun Jul 16 12:06:46 2017 +0000
+++ b/emulators/gxemul/Makefile Sun Jul 16 14:10:58 2017 +0000
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.57 2017/06/29 17:51:46 christos Exp $
+# $NetBSD: Makefile,v 1.58 2017/07/16 14:10:58 christos Exp $
 
 DISTNAME=      gxemul-0.6.0.1
-PKGREVISION=   4
+PKGREVISION=   5
 CATEGORIES=    emulators
 MASTER_SITES=  http://gxemul.sourceforge.net/src/
 
diff -r e1fd93968ba5 -r fb5224e6d75b emulators/gxemul/distinfo
--- a/emulators/gxemul/distinfo Sun Jul 16 12:06:46 2017 +0000
+++ b/emulators/gxemul/distinfo Sun Jul 16 14:10:58 2017 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.47 2017/06/29 17:51:46 christos Exp $
+$NetBSD: distinfo,v 1.48 2017/07/16 14:10:58 christos Exp $
 
 SHA1 (gxemul-0.6.0.1.tar.gz) = 8a9b7a6c08628c2a59a6e7e9c7c449c3826b4744
 RMD160 (gxemul-0.6.0.1.tar.gz) = 6943173d4149bfe40218715b8ed2c82b5b361e50
@@ -11,9 +11,11 @@
 SHA1 (patch-src_components_cpu_CPUDyntransComponent.cc) = 1a70375b3ed409ef43122ce7e6935c07b4ed386d
 SHA1 (patch-src_components_cpu_M88K__CPUComponent.cc) = 931cdc9a806e9ff48dccb2a63873c52491336b30
 SHA1 (patch-src_components_cpu_MIPS__CPUComponent.cc) = 75d8276092fcdc9f548f874e5807ae8e6a2b9eae
+SHA1 (patch-src_console_console.cc) = e0deed737004ab1d64997c778227c0aa9e62fac0
 SHA1 (patch-src_cpus_cpu_mips.cc) = d239116e4ce5e040a1bdf39b803ca9a05500be53
 SHA1 (patch-src_cpus_cpu_mips_instr.cc) = be40f86a103d2366d13a884d957848d4f680dc61
 SHA1 (patch-src_devices_dev__footbridge.cc) = 2dc76e65fff7e6c846d9d06b74bed76075b0c79a
+SHA1 (patch-src_devices_dev__sh4.cc) = b3bf483fe803d19cb18db7fdf6f0abd64afc6048
 SHA1 (patch-src_include_components_CPUDyntransComponent.h) = 4fa3c327c4ce5ee9e39e7bc49ce6029b2a7da100
 SHA1 (patch-src_include_components_M88K__CPUComponent.h) = afd07ae4df33d0c0a9d3d8c15dca4ef9ee7dd916
 SHA1 (patch-src_include_components_MIPS__CPUComponent.h) = 4e49da9af0d220a1ea7c4520d8e7e53d8d84c155
diff -r e1fd93968ba5 -r fb5224e6d75b emulators/gxemul/patches/patch-src_console_console.cc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/gxemul/patches/patch-src_console_console.cc     Sun Jul 16 14:10:58 2017 +0000
@@ -0,0 +1,52 @@
+$NetBSD: patch-src_console_console.cc,v 1.1 2017/07/16 14:10:58 christos Exp $
+
+Change console_charavail() to return the number of characters available
+in the FIFO instead of 0/1.
+
+--- /usr/src/gxemul/gxemul-0.6.0.1/src/console/console.cc      2014-08-17 04:45:15.000000000 -0400
++++ ./console.cc       2017-07-16 10:04:04.603287788 -0400
+@@ -328,10 +328,19 @@
+ }
+ 
+ 
++static int console_room_left_in_fifo(int handle)
++{
++      int roomLeftInFIFO = console_handles[handle].fifo_tail
++          - console_handles[handle].fifo_head;
++      if (roomLeftInFIFO <= 0)
++              roomLeftInFIFO += CONSOLE_FIFO_LEN;
++      return roomLeftInFIFO;
++}
++
+ /*
+  *  console_charavail():
+  *
+- *  Returns 1 if a char is available in the fifo, 0 otherwise.
++ *  Returns the number of chararacters available in the fifo.
+  */
+ int console_charavail(int handle)
+ {
+@@ -342,9 +351,7 @@
+ 
+               // If adding more would lead to a full FIFO, then let's
+               // wait.
+-              int roomLeftInFIFO = console_handles[handle].fifo_tail - console_handles[handle].fifo_head;
+-              if (roomLeftInFIFO <= 0)
+-                      roomLeftInFIFO += CONSOLE_FIFO_LEN;
++              int roomLeftInFIFO = console_room_left_in_fifo(handle);
+               if (roomLeftInFIFO < (int)sizeof(ch) + 1)
+                       break;
+ 
+@@ -369,11 +376,7 @@
+               }
+       }
+ 
+-      if (console_handles[handle].fifo_head ==
+-          console_handles[handle].fifo_tail)
+-              return 0;
+-
+-      return 1;
++      return CONSOLE_FIFO_LEN - console_room_left_in_fifo(handle);
+ }
+ 
+ 
diff -r e1fd93968ba5 -r fb5224e6d75b emulators/gxemul/patches/patch-src_devices_dev__sh4.cc
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/gxemul/patches/patch-src_devices_dev__sh4.cc    Sun Jul 16 14:10:58 2017 +0000
@@ -0,0 +1,17 @@
+$NetBSD: patch-src_devices_dev__sh4.cc,v 1.1 2017/07/16 14:10:58 christos Exp $
+
+Put the actual number of characters waiting in the FIFO instead of 1 or 0
+
+--- /usr/src/gxemul/gxemul-0.6.0.1/src/devices/dev_sh4.cc      2014-08-17 04:45:12.000000000 -0400
++++ ./dev_sh4.cc       2017-07-16 09:58:19.288954403 -0400
+@@ -1703,8 +1703,8 @@
+ 
+       case SH4_SCIF_BASE + SCIF_FDR:
+               /*  Nr of bytes in the TX and RX fifos, respectively:  */
+-              odata = (console_charavail(d->scif_console_handle)? 1 : 0)
+-                  + (d->scif_tx_fifo_cursize << 8);
++              odata = console_charavail(d->scif_console_handle) |
++                  (d->scif_tx_fifo_cursize << 8);
+               break;
+ 
+       case SH4_SCIF_BASE + SCIF_SPTR:



Home | Main Index | Thread Index | Old Index