1 |
commit: 0833e1c9e04904055d85be23dc8ffc3a64a20330 |
2 |
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jan 31 21:18:50 2014 +0000 |
4 |
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jan 31 21:18:50 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/ulm.git;a=commit;h=0833e1c9 |
7 |
|
8 |
Copied from Portage tree. Apply patch with some features for my own use. |
9 |
|
10 |
Package-Manager: portage-2.2.8-r1 |
11 |
|
12 |
--- |
13 |
app-emulation/xtrs/ChangeLog | 10 +++++ |
14 |
app-emulation/xtrs/Manifest | 2 + |
15 |
app-emulation/xtrs/files/xtrs-4.9d-ulm.patch | 41 +++++++++++++++++++ |
16 |
app-emulation/xtrs/metadata.xml | 23 +++++++++++ |
17 |
app-emulation/xtrs/xtrs-4.9d-r50.ebuild | 61 ++++++++++++++++++++++++++++ |
18 |
5 files changed, 137 insertions(+) |
19 |
|
20 |
diff --git a/app-emulation/xtrs/ChangeLog b/app-emulation/xtrs/ChangeLog |
21 |
new file mode 100644 |
22 |
index 0000000..2e2692a |
23 |
--- /dev/null |
24 |
+++ b/app-emulation/xtrs/ChangeLog |
25 |
@@ -0,0 +1,10 @@ |
26 |
+# ChangeLog for app-emulation/xtrs |
27 |
+# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 |
28 |
+# $Header: $ |
29 |
+ |
30 |
+*xtrs-4.9d-r50 (31 Jan 2014) |
31 |
+ |
32 |
+ 31 Jan 2014; Ulrich Müller <ulm@g.o> +xtrs-4.9d-r50.ebuild, |
33 |
+ +files/xtrs-4.9d-ulm.patch, +metadata.xml: |
34 |
+ Copied from Portage tree. Apply patch with some features for my own use. |
35 |
+ |
36 |
|
37 |
diff --git a/app-emulation/xtrs/Manifest b/app-emulation/xtrs/Manifest |
38 |
new file mode 100644 |
39 |
index 0000000..1f4b58e |
40 |
--- /dev/null |
41 |
+++ b/app-emulation/xtrs/Manifest |
42 |
@@ -0,0 +1,2 @@ |
43 |
+DIST ld4-631.zip 106955 SHA256 06a093c42bd5c10b431239d52c1beb1360cc41dd09fa3849ed19fbc0706f1f1d SHA512 8c6a24bc0af9326b5b935d7cdb1932b4cb714ab336167fed36f4f6d976cd80fe1d4d6a76e6374366fdc3fce623b2bdd6f9059a964bd6d29f59d6a052a1924c4a WHIRLPOOL 6ecdfc85c2415976f564579f7403bccf37865183e4a62372e9fdb9189ff1923ee56b3dcc779a8cad398c0465c8ebe1daaa1b22bf7213ae0ad81d1dbc4c83a782 |
44 |
+DIST xtrs-4.9d.tar.gz 455355 SHA256 d309b83cf6fee5acfc063401c4506974647154841f37aa18cf145811575234d4 SHA512 5d6a2e1d4c2f2df63eaec8d015ea9e485615d82b7923af5c03c394862a31b1e6be2329aca18c0fa0c7d6b984164bb9b4d18f94a3d8cd140a683c5197ddff2249 WHIRLPOOL 9776dce7365e61b95c8921f22bb752ad0c77af3467c991436b578c3e18e34a431a237526ee893612e954efc517890b28d7726f2f118ea9e64fdd37f90a969d8d |
45 |
|
46 |
diff --git a/app-emulation/xtrs/files/xtrs-4.9d-ulm.patch b/app-emulation/xtrs/files/xtrs-4.9d-ulm.patch |
47 |
new file mode 100644 |
48 |
index 0000000..aff5556 |
49 |
--- /dev/null |
50 |
+++ b/app-emulation/xtrs/files/xtrs-4.9d-ulm.patch |
51 |
@@ -0,0 +1,41 @@ |
52 |
+--- xtrs-4.9d-orig/trs_disk.c |
53 |
++++ xtrs-4.9d/trs_disk.c |
54 |
+@@ -2349,6 +2349,19 @@ trs_disk_command_write(unsigned char cmd |
55 |
+ break; |
56 |
+ } |
57 |
+ id_index = search(state.sector, goal_side); |
58 |
++ |
59 |
++ /* Model I cannot boot from a double density floppy and would |
60 |
++ hang at this point. Switch to 1791 controller and retry. */ |
61 |
++ if (id_index == -1 && state.density == 0 |
62 |
++ && trs_model == 1 && REG_PC == 0x06c0) { |
63 |
++ FDCState s = state; |
64 |
++ state.density = 1; |
65 |
++ state.controller = TRSDISK_P1791; |
66 |
++ state.status = 0; |
67 |
++ if ((id_index = search(state.sector, goal_side)) == -1) |
68 |
++ state = s; /* Still unsuccessful: restore state. */ |
69 |
++ } |
70 |
++ |
71 |
+ if (id_index == -1) { |
72 |
+ state.status |= TRSDISK_BUSY; |
73 |
+ trs_schedule_event(trs_disk_done, 0, 512); |
74 |
+--- xtrs-4.9d-orig/trs_memory.c |
75 |
++++ xtrs-4.9d/trs_memory.c |
76 |
+@@ -216,6 +216,7 @@ int mem_read(int address) |
77 |
+ if (address == TRSDISK_TRACK) return trs_disk_track_read(); |
78 |
+ if (address == TRSDISK_SECTOR) return trs_disk_sector_read(); |
79 |
+ if (address >= KEYBOARD_START) return trs_kb_mem_read(address); |
80 |
++ if (address < 0x37e0) return memory[address]; |
81 |
+ return 0xff; |
82 |
+ |
83 |
+ case 0x30: /* Model III */ |
84 |
+@@ -312,6 +313,8 @@ void mem_write(int address, int value) |
85 |
+ trs_disk_sector_write(value); |
86 |
+ } else if (TRSDISK_SELECT(address)) { |
87 |
+ trs_disk_select_write(value); |
88 |
++ } else if (address >= trs_rom_size && address < 0x37e0) { |
89 |
++ memory[address] = value; |
90 |
+ } |
91 |
+ break; |
92 |
+ |
93 |
|
94 |
diff --git a/app-emulation/xtrs/metadata.xml b/app-emulation/xtrs/metadata.xml |
95 |
new file mode 100644 |
96 |
index 0000000..7f1c7c6 |
97 |
--- /dev/null |
98 |
+++ b/app-emulation/xtrs/metadata.xml |
99 |
@@ -0,0 +1,23 @@ |
100 |
+<?xml version="1.0" encoding="UTF-8"?> |
101 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
102 |
+<pkgmetadata> |
103 |
+<maintainer> |
104 |
+ <email>ulm@g.o</email> |
105 |
+</maintainer> |
106 |
+<longdescription> |
107 |
+ xtrs is a Radio Shack TRS-80 Model I/III/4/4P emulator for Unix and the |
108 |
+ X Window System. It includes lower case, the real time clock, hi-res |
109 |
+ graphics, serial port, parallel printer, mouse, cassette, sound and music |
110 |
+ output, 5" and 8" floppy disk drives in single and double density, and |
111 |
+ even hard disk drives. The emulated floppy and hard disk file formats |
112 |
+ are compatible with the popular MSDOS-based emulators by Jeff Vavasour, |
113 |
+ Matthew Reed, and David Keil, and (if you choose a capable enough file |
114 |
+ format), all features of the original TRS-80 floppy disk controller are |
115 |
+ emulated. Under Linux, physical floppy disk drives are also supported. |
116 |
+ Physical cassettes can be read and written too. The user interface is a |
117 |
+ bit spartan, but it gets the job done. |
118 |
+</longdescription> |
119 |
+<use> |
120 |
+ <flag name='ldos'>Install disk images for Model 4P</flag> |
121 |
+</use> |
122 |
+</pkgmetadata> |
123 |
|
124 |
diff --git a/app-emulation/xtrs/xtrs-4.9d-r50.ebuild b/app-emulation/xtrs/xtrs-4.9d-r50.ebuild |
125 |
new file mode 100644 |
126 |
index 0000000..dd9459a |
127 |
--- /dev/null |
128 |
+++ b/app-emulation/xtrs/xtrs-4.9d-r50.ebuild |
129 |
@@ -0,0 +1,61 @@ |
130 |
+# Copyright 1999-2014 Gentoo Foundation |
131 |
+# Distributed under the terms of the GNU General Public License v2 |
132 |
+# $Header: $ |
133 |
+ |
134 |
+EAPI=5 |
135 |
+ |
136 |
+inherit eutils flag-o-matic toolchain-funcs readme.gentoo |
137 |
+ |
138 |
+DESCRIPTION="Radio Shack TRS-80 emulator" |
139 |
+HOMEPAGE="http://www.tim-mann.org/xtrs.html" |
140 |
+SRC_URI="http://www.tim-mann.org/trs80/${P}.tar.gz |
141 |
+ ldos? ( http://www.tim-mann.org/trs80/ld4-631.zip )" |
142 |
+ |
143 |
+LICENSE="xtrs ldos? ( freedist )" |
144 |
+SLOT="0" |
145 |
+KEYWORDS="~amd64 ~ppc ~x86 ~x86-fbsd" |
146 |
+IUSE="ldos" |
147 |
+ |
148 |
+DEPEND="sys-libs/ncurses |
149 |
+ sys-libs/readline |
150 |
+ >=x11-libs/libX11-1.0.0" |
151 |
+RDEPEND="${DEPEND}" |
152 |
+ |
153 |
+src_prepare() { |
154 |
+ sed -i -e 's/$(CC) -o/$(CC) $(LDFLAGS) -o/' Makefile || die |
155 |
+ epatch "${FILESDIR}/${PN}-4.9c-ulm.patch" |
156 |
+} |
157 |
+ |
158 |
+src_compile() { |
159 |
+ use ppc && append-flags -Dbig_endian |
160 |
+ emake CC="$(tc-getCC)" DEBUG="${CFLAGS}" LDFLAGS="${LDFLAGS}" |
161 |
+} |
162 |
+ |
163 |
+src_install() { |
164 |
+ dodir /usr/bin /usr/share/xtrs/disks /usr/share/man/man1 |
165 |
+ emake PREFIX="${D}"/usr install |
166 |
+ |
167 |
+ insopts -m0444 |
168 |
+ insinto /usr/share/xtrs/disks |
169 |
+ doins cpmutil.dsk utility.dsk |
170 |
+ |
171 |
+ if use ldos; then |
172 |
+ doins "${WORKDIR}"/ld4-631.dsk |
173 |
+ dosym disks/ld4-631.dsk /usr/share/xtrs/disk4p-0 |
174 |
+ dosym disks/utility.dsk /usr/share/xtrs/disk4p-1 |
175 |
+ fi |
176 |
+ |
177 |
+ dodoc ChangeLog README xtrsrom4p.README cpmutil.html dskspec.html |
178 |
+ |
179 |
+ DOC_CONTENTS="For copyright reasons, xtrs does not include actual ROM |
180 |
+ images. Because of this, unless you supply your own ROM, xtrs will |
181 |
+ not function in any mode except 'Model 4p' mode (a minimal free ROM |
182 |
+ is included for this), which can be run like this: |
183 |
+ \n\nxtrs -model 4p -diskdir /usr/share/xtrs |
184 |
+ \n\nIf you already own a copy of the ROM software (e.g., if you have |
185 |
+ a TRS-80 with this ROM), then you can make yourself a copy of this |
186 |
+ for use with xtrs, using utilities available on the web. To load |
187 |
+ your own ROM, specify the '-romfile' option, or the 'Xtrs.romfile' |
188 |
+ X resource. ROM files can be in Intel hex or binary format." |
189 |
+ readme.gentoo_create_doc |
190 |
+} |