summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Peterson <lavajoe@gentoo.org>2008-03-06 22:35:54 +0000
committerJoe Peterson <lavajoe@gentoo.org>2008-03-06 22:35:54 +0000
commit463b3810b5d995b6233701af59a58e290f7856b1 (patch)
tree92868b61d35344ba3c3861b92afa3e0ef7e2d454 /app-emulation/xtrs
parentQA cleanup: Fix quoting. (diff)
downloadgentoo-2-463b3810b5d995b6233701af59a58e290f7856b1.tar.gz
gentoo-2-463b3810b5d995b6233701af59a58e290f7856b1.tar.bz2
gentoo-2-463b3810b5d995b6233701af59a58e290f7856b1.zip
Auto-initialize system date/time in NEWDOS/80
(Portage version: 2.1.4.4)
Diffstat (limited to 'app-emulation/xtrs')
-rw-r--r--app-emulation/xtrs/ChangeLog10
-rw-r--r--app-emulation/xtrs/files/xtrs-4.9c-newdos-datetime.patch66
-rw-r--r--app-emulation/xtrs/xtrs-4.9c-r1.ebuild63
3 files changed, 137 insertions, 2 deletions
diff --git a/app-emulation/xtrs/ChangeLog b/app-emulation/xtrs/ChangeLog
index cd3665f18cde..8bceb643f537 100644
--- a/app-emulation/xtrs/ChangeLog
+++ b/app-emulation/xtrs/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for app-emulation/xtrs
-# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/xtrs/ChangeLog,v 1.21 2007/06/15 01:21:26 lavajoe Exp $
+# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/xtrs/ChangeLog,v 1.22 2008/03/06 22:35:53 lavajoe Exp $
+
+*xtrs-4.9c-r1 (06 Mar 2008)
+
+ 06 Mar 2008; Joe Peterson <lavajoe@gentoo.org>
+ +files/xtrs-4.9c-newdos-datetime.patch, +xtrs-4.9c-r1.ebuild:
+ Auto-initialize system date/time in NEWDOS/80
15 Jun 2007; Joe Peterson <lavajoe@gentoo.org>
-files/xtrs-4.9-gentoo.diff, -xtrs-4.9-r1.ebuild:
diff --git a/app-emulation/xtrs/files/xtrs-4.9c-newdos-datetime.patch b/app-emulation/xtrs/files/xtrs-4.9c-newdos-datetime.patch
new file mode 100644
index 000000000000..1e58f8125dbc
--- /dev/null
+++ b/app-emulation/xtrs/files/xtrs-4.9c-newdos-datetime.patch
@@ -0,0 +1,66 @@
+diff -Nur xtrs-4.9c~newdos-datetime/trs_interrupt.c xtrs-4.9c/trs_interrupt.c
+--- xtrs-4.9c~newdos-datetime/trs_interrupt.c 2008-03-06 14:49:43.000000000 -0700
++++ xtrs-4.9c/trs_interrupt.c 2008-03-06 14:50:00.000000000 -0700
+@@ -62,6 +62,34 @@
+ #define LDOS4_DAY 0x0034
+ #define LDOS4_YEAR 0x0033
+
++/* Kludge, continued: On NEWDOS/80, both date and time are stored in memory
++ across reboots, but a test is done on boot to decide whether to use the
++ stored values. Here's how it works: NEWDOS/80 writes a special byte value
++ to the memory address right before the stored date and time. On reboot,
++ this address is checked, and if it contains that special byte, the stored
++ date and time are considered valid and are therefore used.
++
++ By putting this info in memory on powerup, NEWDOS/80 gets initialized
++ with the system date and time.
++ */
++#define NEWDOS_DATETIME_VALID_BYTE 0xa5
++// Model 1
++#define NEWDOS_DATETIME_VALID_ADDR 0x43ab
++#define NEWDOS_MONTH 0x43b1
++#define NEWDOS_DAY 0x43b0
++#define NEWDOS_YEAR 0x43af
++#define NEWDOS_HOUR 0x43ae
++#define NEWDOS_MIN 0x43ad
++#define NEWDOS_SEC 0x43ac
++// Model 3
++#define NEWDOS3_DATETIME_VALID_ADDR 0x42cb
++#define NEWDOS3_MONTH 0x42d1
++#define NEWDOS3_DAY 0x42d0
++#define NEWDOS3_YEAR 0x42cf
++#define NEWDOS3_HOUR 0x42ce
++#define NEWDOS3_MIN 0x42cd
++#define NEWDOS3_SEC 0x42cc
++
+ static int timer_on = 1;
+ #ifdef IDEBUG
+ long lost_timer_interrupts = 0;
+@@ -398,10 +426,27 @@
+ mem_write(LDOS_MONTH, (lt->tm_mon + 1) ^ 0x50);
+ mem_write(LDOS_DAY, lt->tm_mday);
+ mem_write(LDOS_YEAR, lt->tm_year - 80);
++
++ mem_write(NEWDOS_DATETIME_VALID_ADDR, NEWDOS_DATETIME_VALID_BYTE);
++ mem_write(NEWDOS_MONTH, lt->tm_mon + 1);
++ mem_write(NEWDOS_DAY, lt->tm_mday);
++ mem_write(NEWDOS_YEAR, lt->tm_year % 100);
++ mem_write(NEWDOS_HOUR, lt->tm_hour);
++ mem_write(NEWDOS_MIN, lt->tm_min);
++ mem_write(NEWDOS_SEC, lt->tm_sec);
+ } else {
+ mem_write(LDOS3_MONTH, (lt->tm_mon + 1) ^ 0x50);
+ mem_write(LDOS3_DAY, lt->tm_mday);
+ mem_write(LDOS3_YEAR, lt->tm_year - 80);
++
++ mem_write(NEWDOS3_DATETIME_VALID_ADDR, NEWDOS_DATETIME_VALID_BYTE);
++ mem_write(NEWDOS3_MONTH, lt->tm_mon + 1);
++ mem_write(NEWDOS3_DAY, lt->tm_mday);
++ mem_write(NEWDOS3_YEAR, lt->tm_year % 100);
++ mem_write(NEWDOS3_HOUR, lt->tm_hour);
++ mem_write(NEWDOS3_MIN, lt->tm_min);
++ mem_write(NEWDOS3_SEC, lt->tm_sec);
++
+ if (trs_model >= 4) {
+ extern Uchar memory[];
+ memory[LDOS4_MONTH] = lt->tm_mon + 1;
diff --git a/app-emulation/xtrs/xtrs-4.9c-r1.ebuild b/app-emulation/xtrs/xtrs-4.9c-r1.ebuild
new file mode 100644
index 000000000000..e8d63a2273a8
--- /dev/null
+++ b/app-emulation/xtrs/xtrs-4.9c-r1.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/xtrs/xtrs-4.9c-r1.ebuild,v 1.1 2008/03/06 22:35:53 lavajoe Exp $
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Radio Shack TRS-80 emulator"
+HOMEPAGE="http://www.tim-mann.org/xtrs.html"
+SRC_URI="http://www.tim-mann.org/trs80/${P}.tar.gz
+ http://home.gwi.net/~plemon/support/disks/xtrs/ld4-631.tar.gz"
+
+LICENSE="as-is"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd"
+IUSE=""
+
+DEPEND="sys-libs/ncurses
+ sys-libs/readline
+ >=x11-libs/libX11-1.0.0"
+
+src_unpack() {
+ unpack ${P}.tar.gz
+ tar xzf "${DISTDIR}/ld4-631.tar.gz" disks || die "tar failed"
+
+ cd "${S}"
+ epatch "${FILESDIR}/${P}-gentoo.patch"
+ epatch "${FILESDIR}/${P}-newdos-datetime.patch"
+}
+
+src_compile() {
+ use ppc && append-flags -Dbig_endian
+ emake CC="$(tc-getCC)" DEBUG="${CFLAGS}" \
+ DISKDIR="-DDISKDIR='\"/usr/share/xtrs\"'" \
+ DEFAULT_ROM="-DDEFAULT_ROM='\"/usr/share/xtrs/romimage\"' \
+ -DDEFAULT_ROM3='\"/usr/share/xtrs/romimage.m3\"' \
+ -DDEFAULT_ROM4P='\"/usr/share/xtrs/romimage.m4p\"'" \
+ || die "emake failed"
+}
+
+src_install() {
+ dodir /usr/bin /usr/share/xtrs/disks /usr/share/man/man1
+ emake PREFIX="${D}"/usr install || die "emake install failed"
+
+ insopts -m0444
+ insinto /usr/share/xtrs/disks
+ doins cpmutil.dsk utility.dsk "${WORKDIR}"/disks/ld4-631.dsk
+ dosym disks/ld4-631.dsk /usr/share/xtrs/disk4p-0
+ dosym disks/utility.dsk /usr/share/xtrs/disk4p-1
+
+ dodoc ChangeLog README xtrsrom4p.README cpmutil.html dskspec.html \
+ || die "dodoc failed"
+}
+
+pkg_postinst() {
+ elog "For copyright reasons, xtrs does not include ROM images."
+ elog "If you already own a copy of the ROM software (e.g., if you have"
+ elog "a TRS-80 with this ROM), then you can make yourself a copy of this"
+ elog "for use with xtrs. You can get such a copy also from elsewhere on"
+ elog "the web. You may install the ROM images in directory /usr/share/xtrs"
+ elog "as files \"romimage\", \"romimage.m3\", or \"romimage.m4p\", for"
+ elog "Model I, III, or 4P, respectively. (Model 4 uses the same ROM image"
+ elog "as Model III.) The files may be in Intel hex or binary format."
+}