summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2014-01-31 22:18:50 +0100
committerUlrich Müller <ulm@gentoo.org>2014-01-31 22:18:50 +0100
commit0833e1c9e04904055d85be23dc8ffc3a64a20330 (patch)
tree08b973a2919d8a4cfc37839aa1cb1a6fd7c780d3 /app-emulation
parentInitial import, split off from app-editors/mg. (diff)
downloadulm-0833e1c9e04904055d85be23dc8ffc3a64a20330.tar.gz
ulm-0833e1c9e04904055d85be23dc8ffc3a64a20330.tar.bz2
ulm-0833e1c9e04904055d85be23dc8ffc3a64a20330.zip
Copied from Portage tree. Apply patch with some features for my own use.
Package-Manager: portage-2.2.8-r1
Diffstat (limited to 'app-emulation')
-rw-r--r--app-emulation/xtrs/ChangeLog10
-rw-r--r--app-emulation/xtrs/Manifest2
-rw-r--r--app-emulation/xtrs/files/xtrs-4.9d-ulm.patch41
-rw-r--r--app-emulation/xtrs/metadata.xml23
-rw-r--r--app-emulation/xtrs/xtrs-4.9d-r50.ebuild61
5 files changed, 137 insertions, 0 deletions
diff --git a/app-emulation/xtrs/ChangeLog b/app-emulation/xtrs/ChangeLog
new file mode 100644
index 0000000..2e2692a
--- /dev/null
+++ b/app-emulation/xtrs/ChangeLog
@@ -0,0 +1,10 @@
+# ChangeLog for app-emulation/xtrs
+# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+*xtrs-4.9d-r50 (31 Jan 2014)
+
+ 31 Jan 2014; Ulrich Müller <ulm@gentoo.org> +xtrs-4.9d-r50.ebuild,
+ +files/xtrs-4.9d-ulm.patch, +metadata.xml:
+ Copied from Portage tree. Apply patch with some features for my own use.
+
diff --git a/app-emulation/xtrs/Manifest b/app-emulation/xtrs/Manifest
new file mode 100644
index 0000000..1f4b58e
--- /dev/null
+++ b/app-emulation/xtrs/Manifest
@@ -0,0 +1,2 @@
+DIST ld4-631.zip 106955 SHA256 06a093c42bd5c10b431239d52c1beb1360cc41dd09fa3849ed19fbc0706f1f1d SHA512 8c6a24bc0af9326b5b935d7cdb1932b4cb714ab336167fed36f4f6d976cd80fe1d4d6a76e6374366fdc3fce623b2bdd6f9059a964bd6d29f59d6a052a1924c4a WHIRLPOOL 6ecdfc85c2415976f564579f7403bccf37865183e4a62372e9fdb9189ff1923ee56b3dcc779a8cad398c0465c8ebe1daaa1b22bf7213ae0ad81d1dbc4c83a782
+DIST xtrs-4.9d.tar.gz 455355 SHA256 d309b83cf6fee5acfc063401c4506974647154841f37aa18cf145811575234d4 SHA512 5d6a2e1d4c2f2df63eaec8d015ea9e485615d82b7923af5c03c394862a31b1e6be2329aca18c0fa0c7d6b984164bb9b4d18f94a3d8cd140a683c5197ddff2249 WHIRLPOOL 9776dce7365e61b95c8921f22bb752ad0c77af3467c991436b578c3e18e34a431a237526ee893612e954efc517890b28d7726f2f118ea9e64fdd37f90a969d8d
diff --git a/app-emulation/xtrs/files/xtrs-4.9d-ulm.patch b/app-emulation/xtrs/files/xtrs-4.9d-ulm.patch
new file mode 100644
index 0000000..aff5556
--- /dev/null
+++ b/app-emulation/xtrs/files/xtrs-4.9d-ulm.patch
@@ -0,0 +1,41 @@
+--- xtrs-4.9d-orig/trs_disk.c
++++ xtrs-4.9d/trs_disk.c
+@@ -2349,6 +2349,19 @@ trs_disk_command_write(unsigned char cmd
+ break;
+ }
+ id_index = search(state.sector, goal_side);
++
++ /* Model I cannot boot from a double density floppy and would
++ hang at this point. Switch to 1791 controller and retry. */
++ if (id_index == -1 && state.density == 0
++ && trs_model == 1 && REG_PC == 0x06c0) {
++ FDCState s = state;
++ state.density = 1;
++ state.controller = TRSDISK_P1791;
++ state.status = 0;
++ if ((id_index = search(state.sector, goal_side)) == -1)
++ state = s; /* Still unsuccessful: restore state. */
++ }
++
+ if (id_index == -1) {
+ state.status |= TRSDISK_BUSY;
+ trs_schedule_event(trs_disk_done, 0, 512);
+--- xtrs-4.9d-orig/trs_memory.c
++++ xtrs-4.9d/trs_memory.c
+@@ -216,6 +216,7 @@ int mem_read(int address)
+ if (address == TRSDISK_TRACK) return trs_disk_track_read();
+ if (address == TRSDISK_SECTOR) return trs_disk_sector_read();
+ if (address >= KEYBOARD_START) return trs_kb_mem_read(address);
++ if (address < 0x37e0) return memory[address];
+ return 0xff;
+
+ case 0x30: /* Model III */
+@@ -312,6 +313,8 @@ void mem_write(int address, int value)
+ trs_disk_sector_write(value);
+ } else if (TRSDISK_SELECT(address)) {
+ trs_disk_select_write(value);
++ } else if (address >= trs_rom_size && address < 0x37e0) {
++ memory[address] = value;
+ }
+ break;
+
diff --git a/app-emulation/xtrs/metadata.xml b/app-emulation/xtrs/metadata.xml
new file mode 100644
index 0000000..7f1c7c6
--- /dev/null
+++ b/app-emulation/xtrs/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>ulm@gentoo.org</email>
+</maintainer>
+<longdescription>
+ xtrs is a Radio Shack TRS-80 Model I/III/4/4P emulator for Unix and the
+ X Window System. It includes lower case, the real time clock, hi-res
+ graphics, serial port, parallel printer, mouse, cassette, sound and music
+ output, 5" and 8" floppy disk drives in single and double density, and
+ even hard disk drives. The emulated floppy and hard disk file formats
+ are compatible with the popular MSDOS-based emulators by Jeff Vavasour,
+ Matthew Reed, and David Keil, and (if you choose a capable enough file
+ format), all features of the original TRS-80 floppy disk controller are
+ emulated. Under Linux, physical floppy disk drives are also supported.
+ Physical cassettes can be read and written too. The user interface is a
+ bit spartan, but it gets the job done.
+</longdescription>
+<use>
+ <flag name='ldos'>Install disk images for Model 4P</flag>
+</use>
+</pkgmetadata>
diff --git a/app-emulation/xtrs/xtrs-4.9d-r50.ebuild b/app-emulation/xtrs/xtrs-4.9d-r50.ebuild
new file mode 100644
index 0000000..dd9459a
--- /dev/null
+++ b/app-emulation/xtrs/xtrs-4.9d-r50.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=5
+
+inherit eutils flag-o-matic toolchain-funcs readme.gentoo
+
+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
+ ldos? ( http://www.tim-mann.org/trs80/ld4-631.zip )"
+
+LICENSE="xtrs ldos? ( freedist )"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd"
+IUSE="ldos"
+
+DEPEND="sys-libs/ncurses
+ sys-libs/readline
+ >=x11-libs/libX11-1.0.0"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ sed -i -e 's/$(CC) -o/$(CC) $(LDFLAGS) -o/' Makefile || die
+ epatch "${FILESDIR}/${PN}-4.9c-ulm.patch"
+}
+
+src_compile() {
+ use ppc && append-flags -Dbig_endian
+ emake CC="$(tc-getCC)" DEBUG="${CFLAGS}" LDFLAGS="${LDFLAGS}"
+}
+
+src_install() {
+ dodir /usr/bin /usr/share/xtrs/disks /usr/share/man/man1
+ emake PREFIX="${D}"/usr install
+
+ insopts -m0444
+ insinto /usr/share/xtrs/disks
+ doins cpmutil.dsk utility.dsk
+
+ if use ldos; then
+ doins "${WORKDIR}"/ld4-631.dsk
+ dosym disks/ld4-631.dsk /usr/share/xtrs/disk4p-0
+ dosym disks/utility.dsk /usr/share/xtrs/disk4p-1
+ fi
+
+ dodoc ChangeLog README xtrsrom4p.README cpmutil.html dskspec.html
+
+ DOC_CONTENTS="For copyright reasons, xtrs does not include actual ROM
+ images. Because of this, unless you supply your own ROM, xtrs will
+ not function in any mode except 'Model 4p' mode (a minimal free ROM
+ is included for this), which can be run like this:
+ \n\nxtrs -model 4p -diskdir /usr/share/xtrs
+ \n\nIf you already own a copy of the ROM software (e.g., if you have
+ a TRS-80 with this ROM), then you can make yourself a copy of this
+ for use with xtrs, using utilities available on the web. To load
+ your own ROM, specify the '-romfile' option, or the 'Xtrs.romfile'
+ X resource. ROM files can be in Intel hex or binary format."
+ readme.gentoo_create_doc
+}