mirror of
https://github.com/wwarthen/RomWBW.git
synced 2026-02-07 15:03:13 -06:00
Compare commits
925 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb0dde5ef8 | ||
|
|
0451620de9 | ||
|
|
ef7bdc4b29 | ||
|
|
f0ac9973d0 | ||
|
|
34fc468265 | ||
|
|
0046ba9a2c | ||
|
|
c37a97308e | ||
|
|
81390b846c | ||
|
|
c24dbb2b98 | ||
|
|
6726f1be88 | ||
|
|
be5a148d88 | ||
|
|
e15546e051 | ||
|
|
47774eacab | ||
|
|
6092737c9c | ||
|
|
f2fb76341e | ||
|
|
cb37a34c8b | ||
|
|
60c3ff8a41 | ||
|
|
0f37e64f35 | ||
|
|
5244ea9e79 | ||
|
|
f11962ef8e | ||
|
|
4862827058 | ||
|
|
2150b04349 | ||
|
|
001bbaaeec | ||
|
|
04d5fcd9a4 | ||
|
|
cc8d62969f | ||
|
|
ee4855cd14 | ||
|
|
ea600edcd2 | ||
|
|
1a60676f44 | ||
|
|
5943b0c5e5 | ||
|
|
77caac761f | ||
|
|
df29795904 | ||
|
|
5264f2f4d2 | ||
|
|
cae65413ee | ||
|
|
9a19ae21aa | ||
|
|
a86411682b | ||
|
|
77fd7f0e5d | ||
|
|
ac12f7fe1a | ||
|
|
508e766ea5 | ||
|
|
3a10e437c8 | ||
|
|
a8d2f3bd39 | ||
|
|
d1abba5378 | ||
|
|
242a1ce108 | ||
|
|
09c673fbd0 | ||
|
|
bbd1ce6168 | ||
|
|
1bdf833e2c | ||
|
|
daf0430c6f | ||
|
|
06b685df21 | ||
|
|
dfd70b8d63 | ||
|
|
b379b94f97 | ||
|
|
00d204be75 | ||
|
|
3526355842 | ||
|
|
76510fee5c | ||
|
|
7daf65c01c | ||
|
|
f036deef33 | ||
|
|
6f0940e4b5 | ||
|
|
97c533c7c5 | ||
|
|
fdad9afc05 | ||
|
|
db81d1a28b | ||
|
|
eb250cc178 | ||
|
|
d98ce895f8 | ||
|
|
b91871114a | ||
|
|
aeb4bc6245 | ||
|
|
6b47216266 | ||
|
|
c7dbee6375 | ||
|
|
de6069b7d0 | ||
|
|
f9727ec384 | ||
|
|
b939f9d4a3 | ||
|
|
b59dc1cc14 | ||
|
|
3fee1c5d20 | ||
|
|
606fac6fa5 | ||
|
|
8058a3c3e0 | ||
|
|
b3731be4b1 | ||
|
|
52af91e066 | ||
|
|
280511b990 | ||
|
|
83db582b92 | ||
|
|
490c865ea1 | ||
|
|
9fe5004756 | ||
|
|
86765620d7 | ||
|
|
02c051f47c | ||
|
|
2c2df76f15 | ||
|
|
1f6ef60599 | ||
|
|
85bc2c8792 | ||
|
|
1131480f44 | ||
|
|
b92352c480 | ||
|
|
1831141abd | ||
|
|
332831a8cc | ||
|
|
0fc1ec5c93 | ||
|
|
7c2fcf6e2a | ||
|
|
8e99303e2f | ||
|
|
a8357047b2 | ||
|
|
995bb335b8 | ||
|
|
f8d0fda179 | ||
|
|
b801d793e6 | ||
|
|
b45e531127 | ||
|
|
7cef05148f | ||
|
|
a207ede5be | ||
|
|
a40e7961a1 | ||
|
|
8b7c9e10c3 | ||
|
|
d1b96c340f | ||
|
|
cf4baa1270 | ||
|
|
4eeba4e48b | ||
|
|
f5c32423bc | ||
|
|
e7f9116c30 | ||
|
|
7c60884847 | ||
|
|
d4f9ffbc6b | ||
|
|
fbcaeeb6a2 | ||
|
|
41ecdeccd0 | ||
|
|
fb136ba200 | ||
|
|
81756bfb05 | ||
|
|
31372884ea | ||
|
|
b574faed39 | ||
|
|
fdbb6752f9 | ||
|
|
462fe228aa | ||
|
|
462ceffeb7 | ||
|
|
2bce5224f6 | ||
|
|
f888cc94ba | ||
|
|
51a1c6eb5b | ||
|
|
a85f962a47 | ||
|
|
052475d492 | ||
|
|
d211f0977d | ||
|
|
81c4913c72 | ||
|
|
462f786c18 | ||
|
|
82a6e66269 | ||
|
|
136a8365b1 | ||
|
|
edca77176f | ||
|
|
aba91a61a0 | ||
|
|
3ac12fba98 | ||
|
|
4790b02168 | ||
|
|
efde97c169 | ||
|
|
8485115118 | ||
|
|
2f21caca71 | ||
|
|
29457ea214 | ||
|
|
fd5a035453 | ||
|
|
d3d7225a79 | ||
|
|
d427fee7ee | ||
|
|
eebed062ad | ||
|
|
1b5420c33b | ||
|
|
158658c3fc | ||
|
|
def32eda19 | ||
|
|
41989e1151 | ||
|
|
39a6474820 | ||
|
|
ef1c610c58 | ||
|
|
07dd8eba32 | ||
|
|
b60a3f95b8 | ||
|
|
4cc218a450 | ||
|
|
8f9e7f3990 | ||
|
|
5f07834b47 | ||
|
|
0fb8a2d2ff | ||
|
|
59d6099865 | ||
|
|
8ba8a3b43a | ||
|
|
e0522bce3f | ||
|
|
f8c4ee1183 | ||
|
|
fcc736bd45 | ||
|
|
56e75fc46e | ||
|
|
b951a844ca | ||
|
|
e6e0bb5287 | ||
|
|
4add4bc237 | ||
|
|
dc49632ddc | ||
|
|
62fd42edc6 | ||
|
|
621083947c | ||
|
|
9bc1af2f0f | ||
|
|
e73e0ba5f1 | ||
|
|
c9571fb3ed | ||
|
|
1db0b09378 | ||
|
|
4f824a04a8 | ||
|
|
6ec8ca174f | ||
|
|
1d5c5b39a5 | ||
|
|
f6954a33a6 | ||
|
|
263de80c6c | ||
|
|
93bfdbc45d | ||
|
|
27d8fb3ac1 | ||
|
|
32e34cb656 | ||
|
|
9799120899 | ||
|
|
6a1781b9ed | ||
|
|
68a9dea630 | ||
|
|
1bc9a0bcc3 | ||
|
|
915cc50228 | ||
|
|
5fe4a5db4c | ||
|
|
dad5a2e004 | ||
|
|
c28e80e836 | ||
|
|
39822a9864 | ||
|
|
3eebb5438b | ||
|
|
7707ea860d | ||
|
|
52a692030e | ||
|
|
b662ee1aa2 | ||
|
|
39f7403b78 | ||
|
|
56f4b14ef6 | ||
|
|
363c844eec | ||
|
|
f6d979a084 | ||
|
|
1d52dd7433 | ||
|
|
349b3eb108 | ||
|
|
26a24be24e | ||
|
|
94d5c0f5ba | ||
|
|
d139b592ed | ||
|
|
088862634d | ||
|
|
c41d73b850 | ||
|
|
8cab372267 | ||
|
|
bc9d44b476 | ||
|
|
25ce672106 | ||
|
|
1d149c3f75 | ||
|
|
a7bc7bb16f | ||
|
|
5e1022bb86 | ||
|
|
ec899e6920 | ||
|
|
ab100bf3bc | ||
|
|
bac0c76a6d | ||
|
|
174722f387 | ||
|
|
3d916a90d4 | ||
|
|
8fc0274044 | ||
|
|
a03d15fd2f | ||
|
|
2cc61c3804 | ||
|
|
c585594197 | ||
|
|
1c227f7270 | ||
|
|
1099b358a0 | ||
|
|
0264711f9f | ||
|
|
8fb73c95f4 | ||
|
|
9d37b4a59b | ||
|
|
ba29011021 | ||
|
|
6ea1a8f840 | ||
|
|
331cbce5c9 | ||
|
|
a44572f9bf | ||
|
|
41ed037935 | ||
|
|
ad03d3e4ba | ||
|
|
c414664200 | ||
|
|
cdaf04eaed | ||
|
|
155959b430 | ||
|
|
ae9ec4c1d8 | ||
|
|
d7232abb60 | ||
|
|
2604212a97 | ||
|
|
59ffef2bf2 | ||
|
|
3065c077be | ||
|
|
22d4825e2c | ||
|
|
da9520466d | ||
|
|
7a4b88e7b5 | ||
|
|
320c905578 | ||
|
|
050aa3096b | ||
|
|
c205e1b314 | ||
|
|
d31c146a7b | ||
|
|
b765749c3d | ||
|
|
5ada00af9f | ||
|
|
88d7c37424 | ||
|
|
2bfe845f6d | ||
|
|
08b4d10367 | ||
|
|
3e9bbbffe3 | ||
|
|
bab0628f0a | ||
|
|
d0ee590a1c | ||
|
|
6d5a900c3e | ||
|
|
0510a02447 | ||
|
|
f4609159fc | ||
|
|
85967e46f3 | ||
|
|
ac18ab9c19 | ||
|
|
0a52d6922e | ||
|
|
ed2f6097ef | ||
|
|
f44288082c | ||
|
|
964cc4b91a | ||
|
|
81fe427352 | ||
|
|
e02bc96ce2 | ||
|
|
437a0d39b7 | ||
|
|
f6f995d407 | ||
|
|
9452540c75 | ||
|
|
f039b3b77e | ||
|
|
f30c0aa619 | ||
|
|
628bd4f4b2 | ||
|
|
3da911edf4 | ||
|
|
7304c0c0d0 | ||
|
|
84ce67a816 | ||
|
|
e8e57e5e94 | ||
|
|
3f9b41e891 | ||
|
|
f91dfd7b69 | ||
|
|
5d35a80cf7 | ||
|
|
a9b400f076 | ||
|
|
382b5594f0 | ||
|
|
0445b3547c | ||
|
|
608356cc9b | ||
|
|
2198918231 | ||
|
|
09b967e82b | ||
|
|
e81962f774 | ||
|
|
f552c83f23 | ||
|
|
907b5d578e | ||
|
|
461aaedd56 | ||
|
|
8fd1fefdf9 | ||
|
|
89b2489727 | ||
|
|
d8bbb1e8ca | ||
|
|
941f958742 | ||
|
|
ae287ca56d | ||
|
|
57983b0a4f | ||
|
|
f65e17f3ac | ||
|
|
15d607d686 | ||
|
|
bd21224a9d | ||
|
|
b89e457414 | ||
|
|
7fb1a8851e | ||
|
|
45fc44e59f | ||
|
|
4ac878029d | ||
|
|
2dc8e6bd12 | ||
|
|
2c3ebee6ca | ||
|
|
336393aad6 | ||
|
|
5df54bc6fd | ||
|
|
c3ef70efc0 | ||
|
|
684a209c84 | ||
|
|
8a1ddec0f0 | ||
|
|
a96e8e9ef0 | ||
|
|
71b7e9c8f5 | ||
|
|
6828269137 | ||
|
|
3eedd25b48 | ||
|
|
c83cd1cb2d | ||
|
|
227481f0b8 | ||
|
|
48968766a0 | ||
|
|
e7794723bf | ||
|
|
47bb48c8b4 | ||
|
|
7a4d42ba93 | ||
|
|
32bdd461f6 | ||
|
|
c3f1123187 | ||
|
|
3a2ef5efdd | ||
|
|
389cd70e7e | ||
|
|
7b6faa3280 | ||
|
|
0a6c226a5b | ||
|
|
c4c6b8a051 | ||
|
|
0e9894012b | ||
|
|
0ef6074a6b | ||
|
|
9eab1f5e5b | ||
|
|
639a9c7459 | ||
|
|
c30c5a6437 | ||
|
|
917f21e468 | ||
|
|
40663d7f3d | ||
|
|
adabd69598 | ||
|
|
f9126620c8 | ||
|
|
b4c1ca7fcb | ||
|
|
ad35748d5c | ||
|
|
fac1974589 | ||
|
|
14e48f24b5 | ||
|
|
6dcfb7b058 | ||
|
|
c6f7d4d38a | ||
|
|
b75153d263 | ||
|
|
fdb5f82815 | ||
|
|
6950195741 | ||
|
|
d2ca0c35f1 | ||
|
|
a6f6a9734a | ||
|
|
207b3cebc5 | ||
|
|
ae62931fbb | ||
|
|
afd5c22264 | ||
|
|
825002c181 | ||
|
|
60df79fa4d | ||
|
|
424676c469 | ||
|
|
11376d6d3d | ||
|
|
32210b399c | ||
|
|
5b78631fdc | ||
|
|
285ad8f54c | ||
|
|
c73e87c8c7 | ||
|
|
99b5e4eec9 | ||
|
|
31c917192d | ||
|
|
6a4723f2f5 | ||
|
|
350b99778b | ||
|
|
b2b07a9d6e | ||
|
|
58f924cff4 | ||
|
|
815c6c14a0 | ||
|
|
c77b9130f3 | ||
|
|
082a2b7e99 | ||
|
|
e58ff3fbd8 | ||
|
|
04f0b785b5 | ||
|
|
3f01182f92 | ||
|
|
42efbcd553 | ||
|
|
2c3e9ec365 | ||
|
|
83877497cc | ||
|
|
0c70aadd46 | ||
|
|
03bf58f64c | ||
|
|
d94d1f16dd | ||
|
|
ad816cde01 | ||
|
|
23d0061fb1 | ||
|
|
3c0ad4816b | ||
|
|
3c01f5b037 | ||
|
|
60f96f3244 | ||
|
|
5bf4dbc30f | ||
|
|
4f798e2454 | ||
|
|
e6183cddec | ||
|
|
5cda17b800 | ||
|
|
be45e63e90 | ||
|
|
da26366c0b | ||
|
|
677bbe18b2 | ||
|
|
3280a71bbb | ||
|
|
30cc54b9c3 | ||
|
|
4b7f570947 | ||
|
|
276de14ff6 | ||
|
|
43ac88c90b | ||
|
|
8e86a65875 | ||
|
|
27ea5e63c3 | ||
|
|
aa37affe34 | ||
|
|
3d7e3cae6f | ||
|
|
f3d059d4d7 | ||
|
|
34540fff54 | ||
|
|
57f54b325c | ||
|
|
67e4c81676 | ||
|
|
3a4f272a01 | ||
|
|
485045408c | ||
|
|
e9709fcde6 | ||
|
|
d8fa619c2e | ||
|
|
3c8cd5219e | ||
|
|
745798def7 | ||
|
|
8bc4a40662 | ||
|
|
8124595a38 | ||
|
|
5e4e098f64 | ||
|
|
625661714f | ||
|
|
b10286422c | ||
|
|
a3f093e254 | ||
|
|
64ab933492 | ||
|
|
5e8c2dfdc7 | ||
|
|
928c9fe3f5 | ||
|
|
8799352a31 | ||
|
|
a2d06b849b | ||
|
|
b635a601be | ||
|
|
54ad5df47f | ||
|
|
2610fd5be7 | ||
|
|
5940292bb6 | ||
|
|
4beb1ba437 | ||
|
|
6647cd6a05 | ||
|
|
ab3882b489 | ||
|
|
c60c8394b3 | ||
|
|
922adde120 | ||
|
|
2e39da65f4 | ||
|
|
808b1b19a5 | ||
|
|
913ca308d2 | ||
|
|
2ebd800482 | ||
|
|
ae05aa499e | ||
|
|
6d22708b66 | ||
|
|
e2f066492f | ||
|
|
7917a0143a | ||
|
|
c6e6ed89dc | ||
|
|
1ff1a70bfb | ||
|
|
81722bfa4d | ||
|
|
1d542d88bc | ||
|
|
da1761b7c1 | ||
|
|
bd8d059f32 | ||
|
|
dc6ecfd9e3 | ||
|
|
7436c165a5 | ||
|
|
c47611525f | ||
|
|
659f60c23b | ||
|
|
b87f7b6e89 | ||
|
|
871520cef7 | ||
|
|
084df830ef | ||
|
|
326ee0ae67 | ||
|
|
fc760e90e0 | ||
|
|
c0ca96cb96 | ||
|
|
1fac76f80c | ||
|
|
18f78cfd3e | ||
|
|
ba24d578f6 | ||
|
|
294b42f5a4 | ||
|
|
fa7eb7f916 | ||
|
|
446d969779 | ||
|
|
b7ad90c245 | ||
|
|
9e815edc29 | ||
|
|
5d03973e80 | ||
|
|
1d2f74b5b0 | ||
|
|
6c3f632990 | ||
|
|
9ad14e2392 | ||
|
|
8f2754b0f7 | ||
|
|
04f374a4da | ||
|
|
9895c4d47d | ||
|
|
976ef858d0 | ||
|
|
6cb051ec52 | ||
|
|
d78229a875 | ||
|
|
8fb0d9019b | ||
|
|
6ab3ecd0cc | ||
|
|
a22ac6beab | ||
|
|
dc9dd8e8ca | ||
|
|
9d25a7663d | ||
|
|
019ae62c2a | ||
|
|
b0226fe1e8 | ||
|
|
96fd7b1808 | ||
|
|
7290a52cf7 | ||
|
|
0e9edd0874 | ||
|
|
11857925d2 | ||
|
|
36e2a0b6ec | ||
|
|
bcb16757bb | ||
|
|
5db3d11b9a | ||
|
|
b7d928d043 | ||
|
|
0b84b88f57 | ||
|
|
ab305429fb | ||
|
|
391997ee09 | ||
|
|
1ee2167c2a | ||
|
|
8c8c09097d | ||
|
|
45b27c34ed | ||
|
|
cc1a39ebd7 | ||
|
|
2d2cb3d8ea | ||
|
|
2430231dc1 | ||
|
|
2ec195b9e8 | ||
|
|
5617d6b27e | ||
|
|
c15ae9670a | ||
|
|
f98b97e20a | ||
|
|
1e47726176 | ||
|
|
3bdcf371d1 | ||
|
|
a4f2cd8c11 | ||
|
|
b0995506ef | ||
|
|
57c87db9a1 | ||
|
|
d56c9baccf | ||
|
|
147fadefd9 | ||
|
|
b9a21ae296 | ||
|
|
768a459565 | ||
|
|
bfbf6e7dcf | ||
|
|
8f4a3112d1 | ||
|
|
d12ed64fd6 | ||
|
|
18bc22fd3e | ||
|
|
56d0c81af8 | ||
|
|
1628c51bd6 | ||
|
|
e92da9b2db | ||
|
|
dc0411746e | ||
|
|
27fd30ef5f | ||
|
|
26a4abd3f5 | ||
|
|
1d5cd55452 | ||
|
|
bd2fc6dbfe | ||
|
|
b4e5839681 | ||
|
|
af2a9a7110 | ||
|
|
4485e0e932 | ||
|
|
1c57cae1ed | ||
|
|
b498f5a744 | ||
|
|
782bcba9f7 | ||
|
|
98bec91318 | ||
|
|
57dabc1ab5 | ||
|
|
99311e4820 | ||
|
|
dcfdc4fc36 | ||
|
|
bf7470d712 | ||
|
|
3865aaad83 | ||
|
|
8d96efb6f5 | ||
|
|
88940645c0 | ||
|
|
341c55945c | ||
|
|
866449c8ee | ||
|
|
ff851d36d6 | ||
|
|
183ddeac5f | ||
|
|
cc38eef867 | ||
|
|
a6f95d70d5 | ||
|
|
b819360605 | ||
|
|
ee04d84abd | ||
|
|
f77072fbd2 | ||
|
|
fa34bcbea3 | ||
|
|
21b231bced | ||
|
|
0fb98bc071 | ||
|
|
ea8dad4220 | ||
|
|
8b1f7dcba0 | ||
|
|
587a618400 | ||
|
|
c57c3527d2 | ||
|
|
6c48811167 | ||
|
|
642953eaf1 | ||
|
|
7033755762 | ||
|
|
fdb4304f70 | ||
|
|
0bdecc9a4a | ||
|
|
988bf98d4a | ||
|
|
8c0c75253e | ||
|
|
d55bd64d6b | ||
|
|
21568a4b8d | ||
|
|
f8b50f66ec | ||
|
|
b856a1a529 | ||
|
|
5eee238729 | ||
|
|
474626b779 | ||
|
|
52c7b7f25c | ||
|
|
4d51086cd1 | ||
|
|
a473c5c221 | ||
|
|
381d62a733 | ||
|
|
d5206276a8 | ||
|
|
0307fe1aa9 | ||
|
|
4cc4fc0ffe | ||
|
|
a3a4e84965 | ||
|
|
d478b3382e | ||
|
|
b8930bd10a | ||
|
|
d700a1bd1a | ||
|
|
72fe10c00a | ||
|
|
b3568c0142 | ||
|
|
a7bd07b3ce | ||
|
|
8a5ff459a7 | ||
|
|
bff6e20946 | ||
|
|
f323246d4f | ||
|
|
c969e46519 | ||
|
|
1c42ea0a7c | ||
|
|
49b2255020 | ||
|
|
03c6cf9d51 | ||
|
|
a9780aa8be | ||
|
|
9ec3d258bd | ||
|
|
29d3476d68 | ||
|
|
e4eee85274 | ||
|
|
5f7a396ced | ||
|
|
aeccf550e3 | ||
|
|
c8c1dd9c10 | ||
|
|
2398b48e29 | ||
|
|
88f45a4166 | ||
|
|
522b72d9df | ||
|
|
51cb56b064 | ||
|
|
09044d1959 | ||
|
|
38820a4f89 | ||
|
|
b96c87baf9 | ||
|
|
d426e16216 | ||
|
|
f613520ee9 | ||
|
|
56c5710b3f | ||
|
|
0b661442c5 | ||
|
|
d589a215ad | ||
|
|
a8b0e9848b | ||
|
|
0031151008 | ||
|
|
8a560bfbbb | ||
|
|
5417ae2155 | ||
|
|
65bce62b26 | ||
|
|
d22d83f2c8 | ||
|
|
12c99e9144 | ||
|
|
a3844a0149 | ||
|
|
cf9d077057 | ||
|
|
7c622942e7 | ||
|
|
d89d68e816 | ||
|
|
8c49962102 | ||
|
|
ea4aea46d4 | ||
|
|
19033c018d | ||
|
|
32bdecb828 | ||
|
|
086957fd3f | ||
|
|
7eeea3684b | ||
|
|
6f16fdc9d5 | ||
|
|
dcc1bd8cb7 | ||
|
|
b85eda9649 | ||
|
|
c210b5941e | ||
|
|
de72e05a45 | ||
|
|
31b2192f22 | ||
|
|
2480976308 | ||
|
|
5958f7760e | ||
|
|
9a3e3e443c | ||
|
|
056f8eab5f | ||
|
|
784fd1f433 | ||
|
|
293ca770de | ||
|
|
64203d4796 | ||
|
|
1ca508dc2e | ||
|
|
260d7c0054 | ||
|
|
b0aab772ef | ||
|
|
b560f1d3a9 | ||
|
|
ca3ba80fd8 | ||
|
|
3a1e9f3b72 | ||
|
|
8197caa4ef | ||
|
|
c39c27009b | ||
|
|
9a15a1796d | ||
|
|
4a2dfd7f4a | ||
|
|
fa7ae387bf | ||
|
|
bfc0fa8345 | ||
|
|
f9c82467cb | ||
|
|
03fc29d297 | ||
|
|
ccf8d06c8f | ||
|
|
f624082a62 | ||
|
|
cffd109179 | ||
|
|
346b190f97 | ||
|
|
aaaac827d1 | ||
|
|
4860cd945f | ||
|
|
6106e1600f | ||
|
|
2d8cd1538f | ||
|
|
824580de66 | ||
|
|
9cde0994fc | ||
|
|
9e5f7331b1 | ||
|
|
5551fb9df1 | ||
|
|
af892d719c | ||
|
|
7121a62b36 | ||
|
|
68d02e5572 | ||
|
|
040337eaf4 | ||
|
|
5196a56267 | ||
|
|
e3805d4138 | ||
|
|
b334a4224d | ||
|
|
dcbda8806e | ||
|
|
8fa9ef8d06 | ||
|
|
97dbc7847b | ||
|
|
f0c62ceef1 | ||
|
|
efad064619 | ||
|
|
1f3d2a7611 | ||
|
|
57ac1ca1fb | ||
|
|
21acf463ba | ||
|
|
8d3c7a1859 | ||
|
|
328453309a | ||
|
|
6606baebe9 | ||
|
|
4594e990a6 | ||
|
|
1e7e28a065 | ||
|
|
56150ef85f | ||
|
|
de208491dc | ||
|
|
b9b1fecbfa | ||
|
|
580d4ddf25 | ||
|
|
35d3408ab6 | ||
|
|
dcd4a5a8f1 | ||
|
|
dd4c51db97 | ||
|
|
a6cc5c0986 | ||
|
|
c79d497063 | ||
|
|
8d30252044 | ||
|
|
20c291dea2 | ||
|
|
b79c1e7a2f | ||
|
|
825c2d340b | ||
|
|
810beae712 | ||
|
|
7ba9bd6e67 | ||
|
|
9c43e63d1b | ||
|
|
0fe4c5e6f8 | ||
|
|
931d33eb11 | ||
|
|
6f712f4f01 | ||
|
|
8d0e25c8a6 | ||
|
|
5c4bf2ad89 | ||
|
|
92bdce5eb1 | ||
|
|
d7f68775ce | ||
|
|
877d868745 | ||
|
|
82e7b3d813 | ||
|
|
c6a3750ea5 | ||
|
|
fd5636229d | ||
|
|
a69a1cc930 | ||
|
|
fd41ef179e | ||
|
|
2a4455aa9c | ||
|
|
7ed82106a3 | ||
|
|
982744b6c9 | ||
|
|
cccf49d8bd | ||
|
|
082c101845 | ||
|
|
c8ba301d45 | ||
|
|
2701c43161 | ||
|
|
dd73ec092b | ||
|
|
03fd4f030b | ||
|
|
2c8399dfcf | ||
|
|
229f040d43 | ||
|
|
b2788ca1ee | ||
|
|
2dbc4f9a9d | ||
|
|
2fac781a0a | ||
|
|
07ebb83cac | ||
|
|
52aff2a304 | ||
|
|
53286700f7 | ||
|
|
c3a9624040 | ||
|
|
1dbc6ea740 | ||
|
|
26dea9aa33 | ||
|
|
d686f982cc | ||
|
|
7cdad0b4ed | ||
|
|
04084b31aa | ||
|
|
48fa2a027d | ||
|
|
8586202ae2 | ||
|
|
445943d253 | ||
|
|
1682a41e40 | ||
|
|
7c302ba456 | ||
|
|
ab32774e68 | ||
|
|
2633a7711d | ||
|
|
e2400a535c | ||
|
|
42cf223f4e | ||
|
|
5f1c2a3e8c | ||
|
|
0838624a79 | ||
|
|
9fad7db460 | ||
|
|
5f7f902ba1 | ||
|
|
9bc2cb5328 | ||
|
|
e95eb28fe6 | ||
|
|
518478c793 | ||
|
|
f77eedf4b4 | ||
|
|
b5703e8177 | ||
|
|
a97284c18d | ||
|
|
6703f3b74c | ||
|
|
22f30c06f7 | ||
|
|
60cfebfcfa | ||
|
|
f2892e5927 | ||
|
|
4cc4d83ef9 | ||
|
|
f45e316a8c | ||
|
|
2c5f0ee332 | ||
|
|
164627f794 | ||
|
|
39b7b08932 | ||
|
|
127d5bc676 | ||
|
|
5b1348d123 | ||
|
|
2f9cd64489 | ||
|
|
81eacdda24 | ||
|
|
c33adf6cf7 | ||
|
|
d29ce909a0 | ||
|
|
aaf957af4e | ||
|
|
eb107c9b54 | ||
|
|
40b40b7fa5 | ||
|
|
a28bfc157b | ||
|
|
9d372a54cc | ||
|
|
b5b29fcb32 | ||
|
|
f7fc9dc564 | ||
|
|
e15c2201ee | ||
|
|
a69218877c | ||
|
|
f4953e6394 | ||
|
|
b6ca264e88 | ||
|
|
3279f78ced | ||
|
|
00935edaa1 | ||
|
|
97e9339bc9 | ||
|
|
6fb53c08d5 | ||
|
|
f7cf537454 | ||
|
|
83bc6af3a6 | ||
|
|
f5294a19d7 | ||
|
|
5b08693ba2 | ||
|
|
b084b075e6 | ||
|
|
78267d5111 | ||
|
|
f982a5e67b | ||
|
|
b4a7805033 | ||
|
|
6bec8936a9 | ||
|
|
67deaf3949 | ||
|
|
0f6f1077c5 | ||
|
|
1d59af182e | ||
|
|
060418d5d9 | ||
|
|
64901dcbbb | ||
|
|
2e8d44d005 | ||
|
|
c99293d94e | ||
|
|
64f2e37ffb | ||
|
|
716ee19f6c | ||
|
|
1fc2017db5 | ||
|
|
e7cc7906c5 | ||
|
|
41c5eba034 | ||
|
|
f66b6f155e | ||
|
|
add0f3df07 | ||
|
|
34f55f6024 | ||
|
|
331760cd5c | ||
|
|
42ad81285f | ||
|
|
14f73f3dd2 | ||
|
|
e768dc2d5f | ||
|
|
d0ee99fff2 | ||
|
|
1b565de9ce | ||
|
|
0a324564d5 | ||
|
|
206b3ffcd2 | ||
|
|
398dec28e9 | ||
|
|
0e8b6aecb7 | ||
|
|
5d0906aef6 | ||
|
|
f1448fde6e | ||
|
|
6d7ac7a06c | ||
|
|
0010dc8c81 | ||
|
|
d93a85c1d4 | ||
|
|
490e3e49f8 | ||
|
|
0a2654a761 | ||
|
|
ae2c3b113c | ||
|
|
d43ef1728c | ||
|
|
cb9ead08c7 | ||
|
|
e0509aafe1 | ||
|
|
99b8409738 | ||
|
|
05641bdec0 | ||
|
|
b09f30ed41 | ||
|
|
e1d2eb1ecd | ||
|
|
2872381c7d | ||
|
|
1f594e1004 | ||
|
|
0834762f6e | ||
|
|
091d171f02 | ||
|
|
86b11cca5f | ||
|
|
2232c87fdb | ||
|
|
82619da3fd | ||
|
|
aef2561f2a | ||
|
|
dc26d38a36 | ||
|
|
55d7b5e80e | ||
|
|
231239f43f | ||
|
|
5fc01b4100 | ||
|
|
768e41c933 | ||
|
|
cedb584722 | ||
|
|
234bb0bbe5 | ||
|
|
fb63612ebf | ||
|
|
c9869344e2 | ||
|
|
409c306474 | ||
|
|
05376b6173 | ||
|
|
09d0e3754f | ||
|
|
feee56990a | ||
|
|
b02d9bf1fa | ||
|
|
984a4c6ff3 | ||
|
|
99ec7049f7 | ||
|
|
4a9d3c654f | ||
|
|
c171dd329d | ||
|
|
584c3b0aa3 | ||
|
|
a2cfb95574 | ||
|
|
46b74f8e94 | ||
|
|
d27fa8a587 | ||
|
|
4579b1fd9c | ||
|
|
8e7f41cd08 | ||
|
|
4c91264062 | ||
|
|
366bb7301f | ||
|
|
9635d5933e | ||
|
|
ad55977d4a | ||
|
|
8863b071da | ||
|
|
a60eb57a47 | ||
|
|
51a33aaf0b | ||
|
|
a5bb6a2b7e | ||
|
|
7014a33285 | ||
|
|
e8d9671753 | ||
|
|
8deca61094 | ||
|
|
d5936b7fb5 | ||
|
|
4fdb89d651 | ||
|
|
c4e9a47048 | ||
|
|
2fd22922d5 | ||
|
|
1060cfd441 | ||
|
|
7db00165dd | ||
|
|
9d9018b455 | ||
|
|
eb460e885a | ||
|
|
8ca34eb81f | ||
|
|
f509b0fa01 | ||
|
|
75282a33c9 | ||
|
|
db89164e1e | ||
|
|
fb6b1fd54a | ||
|
|
939a822f65 | ||
|
|
4ab1cadfad | ||
|
|
97c36c0efc | ||
|
|
8d02b02ab4 | ||
|
|
f1ada661c1 | ||
|
|
90d7b9673c | ||
|
|
5e6196d541 | ||
|
|
e350aa0672 | ||
|
|
c478a04b48 | ||
|
|
928a64147c | ||
|
|
a57736ef2b | ||
|
|
62641ba4a6 | ||
|
|
5f205dd90b | ||
|
|
5115684dc2 | ||
|
|
a2566d4de5 | ||
|
|
68c9813390 | ||
|
|
0653a42984 | ||
|
|
a7d4459a01 | ||
|
|
7da6c582a0 | ||
|
|
684f59a73c | ||
|
|
97a09a6e33 | ||
|
|
9e5a1ea41b | ||
|
|
07d833473c | ||
|
|
31f5388f9e | ||
|
|
521af19e50 | ||
|
|
9605d80b99 | ||
|
|
67ede23694 | ||
|
|
5154713644 | ||
|
|
5bb7bd6c44 | ||
|
|
8fe3526ecd | ||
|
|
f9c7f30d2d | ||
|
|
8aedfbb7f3 | ||
|
|
b4fc05acfb | ||
|
|
5adbef5f68 | ||
|
|
b63dfdf587 | ||
|
|
6354bd300d | ||
|
|
53a74f78d7 | ||
|
|
b67106889e | ||
|
|
25974843e3 | ||
|
|
6d8c2283b9 | ||
|
|
df74f73d5b | ||
|
|
099172e44e | ||
|
|
4626695b52 | ||
|
|
8fbeb6eecc | ||
|
|
d90c4dfed2 | ||
|
|
803bb6a87d | ||
|
|
31d58909ce | ||
|
|
522b061fe6 | ||
|
|
63c0289e28 | ||
|
|
a0cc974323 | ||
|
|
20f874d146 | ||
|
|
de52c4f560 | ||
|
|
c754fcdb99 |
2
.gitattributes
vendored
Normal file
2
.gitattributes
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
# Leave all line endings alone!
|
||||
* -text
|
||||
31
.github/workflows/commit.yml
vendored
Normal file
31
.github/workflows/commit.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: Commit Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
tags-ignore:
|
||||
- v*
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: rlespinasse/github-slug-action@1.1.0
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
sudo apt-get install libncurses-dev
|
||||
make
|
||||
make clean
|
||||
rm -rf .git*
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: RomWBW-${{env.GITHUB_REF_SLUG}}-${{env.GITHUB_SHA_SHORT}}
|
||||
path: .
|
||||
51
.github/workflows/release.yml
vendored
Normal file
51
.github/workflows/release.yml
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
name: Release Build
|
||||
|
||||
on:
|
||||
release:
|
||||
types: published
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Create Package Label
|
||||
run: |
|
||||
LABEL=`echo "$GITHUB_REF" | sed "s|^refs/tags/||"`
|
||||
echo "::set-env name=PKGLBL::$LABEL"
|
||||
|
||||
- name: Display Diagnostics
|
||||
run: |
|
||||
echo PKGLBL: "$PKGLBL"
|
||||
echo Upload URL: "${{github.event.release.upload_url}}"
|
||||
echo GITHUB_TOKEN: "${{secrets.GITHUB_TOKEN}}"
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
sudo apt-get install libncurses-dev
|
||||
make
|
||||
make clean
|
||||
rm -rf .git*
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v1
|
||||
with:
|
||||
name: RomWBW-${{env.PKGLBL}}-Package
|
||||
path: .
|
||||
|
||||
- name: Create Package Archive
|
||||
run: |
|
||||
zip -r Package.zip .
|
||||
|
||||
- name: Upload Release Asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
|
||||
with:
|
||||
upload_url: ${{github.event.release.upload_url}}
|
||||
asset_path: Package.zip
|
||||
asset_name: RomWBW-${{env.PKGLBL}}-Package.zip
|
||||
asset_content_type: application/zip
|
||||
96
.gitignore
vendored
Normal file
96
.gitignore
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
# Not sure what patterns to apply
|
||||
# So ignoring all generated files explicitly
|
||||
|
||||
**/*.[Bb][Ii][Nn]
|
||||
**/*.[Cc][Oo][Mm]
|
||||
**/*.[Rr][Oo][Mm]
|
||||
**/*.com
|
||||
**/*.eeprom
|
||||
**/*.hex
|
||||
**/*.img
|
||||
**/*.lib
|
||||
**/*.lst
|
||||
**/*.o
|
||||
**/*.prn
|
||||
**/*.rel
|
||||
**/*.sym
|
||||
**/*.sys
|
||||
**/*.tmp
|
||||
**/*/font*.asm
|
||||
|
||||
Binary/**/*.mym
|
||||
Binary/**/*.pt3
|
||||
|
||||
Source/**/eeprom
|
||||
Source/Apps/Assign.com
|
||||
Source/Apps/FDU/FDU.COM
|
||||
Source/Apps/Format.com
|
||||
Source/Apps/IntTest.com
|
||||
Source/Apps/Mode.com
|
||||
Source/Apps/OSLdr.com
|
||||
Source/Apps/RTC.com
|
||||
Source/Apps/SysCopy.com
|
||||
Source/Apps/SysGen.com
|
||||
Source/Apps/Talk.com
|
||||
Source/Apps/Timer.com
|
||||
Source/Apps/Tune/Tune.com
|
||||
Source/BPBIOS/bpsys.bak
|
||||
Source/BPBIOS/bpsys.dat
|
||||
Source/BPBIOS/def-ww.lib
|
||||
Source/CPM3/bios3.spr
|
||||
Source/CPM3/bnkbios3.spr
|
||||
Source/CPM3/gencpm.dat
|
||||
Source/CPM3/options.lib
|
||||
Source/CPM3/zpmbios3.spr
|
||||
Source/HBIOS/Blank512KB.dat
|
||||
Source/HBIOS/build.inc
|
||||
Source/Images/blank144
|
||||
Source/Images/blankhd
|
||||
Source/Prop/Spin/ParPortProp.list
|
||||
Source/Prop/Spin/PropIO.list
|
||||
Source/Prop/Spin/PropIO2.list
|
||||
Source/ZPM3/bnkbios3.spr
|
||||
Source/ZPM3/gencpm.com
|
||||
Source/ZPM3/gencpm.com
|
||||
Source/ZPM3/gencpm.dat
|
||||
|
||||
Tools/Linux
|
||||
Tools/Darwin
|
||||
|
||||
Tools/unix/bin2asm/bin2asm
|
||||
Tools/unix/cpmtools/cpmchattr
|
||||
Tools/unix/cpmtools/cpmchmod
|
||||
Tools/unix/cpmtools/cpmcp
|
||||
Tools/unix/cpmtools/cpmls
|
||||
Tools/unix/cpmtools/cpmrm
|
||||
Tools/unix/cpmtools/fsck.cpm
|
||||
Tools/unix/cpmtools/fsed.cpm
|
||||
Tools/unix/cpmtools/mkfs.cpm
|
||||
Tools/unix/lzsa/lzsa
|
||||
Tools/unix/uz80as/uz80as
|
||||
Tools/unix/zx/config.h
|
||||
Tools/unix/zx/zx
|
||||
|
||||
!Source/ver.lib
|
||||
!Source/Apps/FAT/FAT.COM
|
||||
!Source/BPBIOS/bpbuild.com
|
||||
!Source/BPBIOS/movp112.com
|
||||
!Source/BPBIOS/Z34RCP11/cledinst.com
|
||||
!Source/BPBIOS/Z34RCP11/cledsave.com
|
||||
!Source/Fonts
|
||||
!Source/Images/**/*.[Cc][Oo][Mm]
|
||||
!Source/RomDsk/**/*.[Cc][Oo][Mm]
|
||||
!Source/UBIOS/FSFAT.BIN
|
||||
!Source/UBIOS/UNA-BIOS.BIN
|
||||
!Source/ZCCP/*.[Cc][Oo][Mm]
|
||||
!Source/ZCPR-DJ/*.[Cc][Oo][Mm]
|
||||
!Source/ZPM3/*.[Cc][Oo][Mm]
|
||||
!Source/ZSDOS/*.[Cc][Oo][Mm]
|
||||
!Tools/cpm/bin
|
||||
!Tools/unix/zx
|
||||
!Tools/zx
|
||||
|
||||
Source/ZPM3/gencpm.com
|
||||
Source/ZPM3/startzpm.com
|
||||
Source/ZPM3/zccp.com
|
||||
Source/ZPM3/zpmldr.com
|
||||
6
Binary/Apps/Clean.cmd
Normal file
6
Binary/Apps/Clean.cmd
Normal file
@@ -0,0 +1,6 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
if exist *.com del *.com
|
||||
if exist Tunes\*.pt? del Tunes\*.pt?
|
||||
if exist Tunes\*.mym del Tunes\*.mym
|
||||
10
Binary/Apps/Makefile
Normal file
10
Binary/Apps/Makefile
Normal file
@@ -0,0 +1,10 @@
|
||||
TOOLS = ../../Tools
|
||||
MOREDIFF := $(shell $(TOOLS)/unix/casefn.sh *.com Tunes/*)
|
||||
|
||||
include $(TOOLS)/Makefile.inc
|
||||
|
||||
all::
|
||||
mkdir -p Tunes
|
||||
|
||||
clobber::
|
||||
rm -f *.bin *.com *.img *.rom *.pdf *.log *.eeprom *.COM *.BIN Tunes/*.mym Tunes/*.pt?
|
||||
14
Binary/Apps/ReadMe.txt
Normal file
14
Binary/Apps/ReadMe.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
***********************************************************************
|
||||
*** ***
|
||||
*** R o m W B W ***
|
||||
*** ***
|
||||
*** Z80/Z180 System Software ***
|
||||
*** ***
|
||||
***********************************************************************
|
||||
|
||||
This directory contains the executable application files that
|
||||
are specific to RomWBW. The source for these applications is found
|
||||
in the Source\Apps directory of the distribution.
|
||||
|
||||
The Tunes subdirectory contains some sample ProTracker and MYM sound
|
||||
files that can be played by the TUNE application.
|
||||
10
Binary/Apps/Tunes/ReadMe.txt
Normal file
10
Binary/Apps/Tunes/ReadMe.txt
Normal file
@@ -0,0 +1,10 @@
|
||||
***********************************************************************
|
||||
*** ***
|
||||
*** R o m W B W ***
|
||||
*** ***
|
||||
*** Z80/Z180 System Software ***
|
||||
*** ***
|
||||
***********************************************************************
|
||||
|
||||
This directory contains some sample ProTracker and MYM sound
|
||||
files that can be played by the TUNE application.
|
||||
12
Binary/Clean.cmd
Normal file
12
Binary/Clean.cmd
Normal file
@@ -0,0 +1,12 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
if exist *.bin del *.bin
|
||||
if exist *.com del *.com
|
||||
if exist *.img del *.img
|
||||
if exist *.rom del *.rom
|
||||
if exist *.pdf del *.pdf
|
||||
if exist *.log del *.log
|
||||
if exist *.eeprom del *.eeprom
|
||||
|
||||
setlocal & cd Apps && call Clean || exit /b 1 & endlocal
|
||||
167
Binary/DiskList.txt
Normal file
167
Binary/DiskList.txt
Normal file
@@ -0,0 +1,167 @@
|
||||
***********************************************************************
|
||||
*** ***
|
||||
*** R o m W B W ***
|
||||
*** ***
|
||||
*** Z80/Z180 System Software ***
|
||||
*** ***
|
||||
***********************************************************************
|
||||
|
||||
This directory ("Binary") is part of the RomWBW System Software
|
||||
distribution archive. Refer to the ReadMe.txt file in this
|
||||
directory for more information on the overall contents of the
|
||||
directory.
|
||||
|
||||
RomWBW includes a set of disk images that are ready to copy onto
|
||||
a floppy or hard/CF/SD disk. You can use your modern computer
|
||||
(Windows/Linux/Mac) to copy the disk image file onto your disk
|
||||
media. The disk media will then be ready to use in your RomWBW
|
||||
System.
|
||||
|
||||
A description of the disk images is provided later in this file.
|
||||
For more information on the creatioin of these images including
|
||||
instructions for customizing them or creating your own, refer to
|
||||
the ReadMe.txt file in the Source\Images directory.
|
||||
|
||||
Installing Images
|
||||
-----------------
|
||||
|
||||
The following instructions apply to Windows computers. Alternatively,
|
||||
you can use the "dd" command on Linux or Mac.
|
||||
|
||||
First of all, a MAJOR WARNING!!!! The tools described below are
|
||||
quite capable of obliterating your running Windows system drive. Use
|
||||
with extreme caution and make sure you have backups.
|
||||
|
||||
To install a floppy image on floppy media, you can use the tool
|
||||
called RaWriteWin. This tool is included in the Tools directory of
|
||||
the distribution. This tool will write your floppy image (fd_xxx.img)
|
||||
to a floppy disk using a raw block transfer. The tool is GUI based
|
||||
and it's operation is self explanatory.
|
||||
|
||||
To install a hard disk image on a CF card or SD card, you must have
|
||||
the appropriate media card slot on your computer. If you do, you can
|
||||
use the tool called Win32DiskImager. This tool is also included in
|
||||
the Tools directory of the distribution. It will write your
|
||||
hard disk image (hd_xxx.img) to the designated media card. This tool
|
||||
is also GUI based and self explanatory.
|
||||
|
||||
The use of the SIMH emulator is outside of the scope of this document.
|
||||
However, if you use SIMH, you will find that you can attach the hard
|
||||
disk images to the emulator with lines such as the following in your
|
||||
SIMH configuration file:
|
||||
|
||||
| attach hdsk0 hd_cpm22.img
|
||||
| set hdsk0 format=HDSK
|
||||
| set hdsk0 geom=T:2048/N:256/S:512
|
||||
| set hdsk0 wrtenb
|
||||
|
||||
Making Disk Images Bootable
|
||||
---------------------------
|
||||
|
||||
The Operating System disk images below are ready to boot by the
|
||||
RomWBW Boot Loader. However, if you update your RomWBW ROM, then
|
||||
you should also update the system tracks of your bootable disk
|
||||
images. You would use SYSCOPY to do this. SYSCOPY can also be
|
||||
used to make a disk bootable if it is not already bootable.
|
||||
|
||||
You would use a command like the following to make drive C bootable:
|
||||
|
||||
| B>SYSCOPY C:=CPM.SYS
|
||||
|
||||
The system file to use depends on the operating system you are trying
|
||||
to boot from the slice you are initializing with SYSCOPY:
|
||||
|
||||
CP/M 2.2 - cpm.sys
|
||||
ZSDOS 1.1 - zsys.sys
|
||||
CP/M 3 - cpmldr.sys
|
||||
ZPM3 - cpmldr.sys
|
||||
|
||||
Slices
|
||||
------
|
||||
|
||||
A RomWBW CP/M filesystem is fixed at 8MB. This is because it is the
|
||||
largest size filesystem supported by all common CP/M variants. Since
|
||||
all modern hard disks (including SD Cards and CF Cards) are much
|
||||
larger than 8MB, RomWBW supports the concept of "slices". This
|
||||
simply means that you can concatenate multiple CP/M filesystems (up
|
||||
to 256 of them) on a single physical hard disk and RomWBW will allow
|
||||
you to assign drive letters to them and treat them as multiple
|
||||
independent CP/M drives.
|
||||
|
||||
With the exception of the hd_combo image, each of the disk images
|
||||
includes a single CP/M file system (i.e., a single slice). However,
|
||||
you can easily create a multi-slice disk image by merely concatenating
|
||||
multiple images together. For example, if you wanted to create a 2
|
||||
slice disk image that has ZSDOS in the first slice and Wordstar in
|
||||
the second slice, you could use the following command from a Windows
|
||||
command prompt:
|
||||
|
||||
| C:\RomWBW\Binary>copy /b hd_zsdos.img + hd_ws.img hd_multi.img
|
||||
|
||||
You can now write hd_multi.img onto your SD or CF Card and you will
|
||||
have ZSDOS in the first slice and Wordstar in the second slice.
|
||||
|
||||
The hd_combo disk image is an example of this. It contains several
|
||||
slices in one image file. The contents of this special disk image
|
||||
are described below.
|
||||
|
||||
The concept of slices applies ONLY to hard disks. Floppy disks are
|
||||
not large enough to support multiple slices.
|
||||
|
||||
Disk Image Contents
|
||||
-------------------
|
||||
|
||||
What follows is a brief description of the contents of the
|
||||
disk images automatically provided in the RomWBW distribution.
|
||||
Note that all of the OS images include the RomWBW custom
|
||||
support apps.
|
||||
|
||||
cpm22 - DRI CP/M 2.2 (Bootable Floppy and Hard Disk)
|
||||
|
||||
Standard DRI CP/M 2.2 distribution files along with a few commonly
|
||||
used utilities.
|
||||
|
||||
zsdos - ZCPR1 + ZSDOS 1.1 (Bootable Floppy and Hard Disk)
|
||||
|
||||
Contains ZCPR1 and ZSDOS 1.1. This is roughly equivalent to the
|
||||
ROM boot contents, but provides a full set of the applications
|
||||
and related files that would not all fit on the ROM drive.
|
||||
|
||||
nzcom - NZCOM (Bootable Floppy and Hard Disk)
|
||||
|
||||
Standard NZCOM distribution. Note that you will need to run the
|
||||
NZCOM setup before this will run properly. You will need
|
||||
to refer to the NZCOM documentation.
|
||||
|
||||
cpm3 - DRI CP/M3 (Bootable Floppy and Hard Disk)
|
||||
|
||||
Standard DRI CP/M 3 adaptation for RomWBW that is ready to run.
|
||||
It can be started by running CPMLDR.
|
||||
|
||||
zpm3 - ZPM3 (Bootable Floppy and Hard Disk)
|
||||
|
||||
Simeon Cran's ZCPR 3 compatible OS for CP/M 3 adapted for RomWBW and
|
||||
ready to run. It can be started by running CPMLDR (which seems
|
||||
wrong, but ZPMLDR is somewhat broken).
|
||||
|
||||
ws4 - WordStar 4 (Floppy and Hard Disk)
|
||||
|
||||
Micropro Wordstar 4 full distribution. This image is not bootable
|
||||
and is intended to be added as an additional slice to an OS image.
|
||||
|
||||
bp - BPBIOS (Hard Disk only)
|
||||
|
||||
Adaptation of BPBIOS for RomWBW. This is NOT complete and NOT
|
||||
useable in it's current state.
|
||||
|
||||
combo - Multi-Boot Combination (Bootable Hard Disk)
|
||||
|
||||
A pre-created combo image that contains the following slices. The
|
||||
slices are identical to the individual images listed above.
|
||||
|
||||
Slice 0: cpm22 (bootable)
|
||||
Slice 1: zsdos (bootable)
|
||||
Slice 2: nzcom (bootable)
|
||||
Slice 3: cpm3 (bootable)
|
||||
Slice 4: zpm3 (bootable)
|
||||
Slice 5: ws4 (not bootable)
|
||||
674
Binary/GPL-3.0.txt
Normal file
674
Binary/GPL-3.0.txt
Normal file
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
8
Binary/Makefile
Normal file
8
Binary/Makefile
Normal file
@@ -0,0 +1,8 @@
|
||||
TOOLS = ../Tools
|
||||
MOREDIFF := $(shell $(TOOLS)/unix/casefn.sh *.img *.rom *.com *.eeprom)
|
||||
SUBDIRS = Apps
|
||||
|
||||
include $(TOOLS)/Makefile.inc
|
||||
|
||||
clobber::
|
||||
rm -f *.bin *.com *.img *.rom *.pdf *.log *.eeprom
|
||||
122
Binary/ReadMe.txt
Normal file
122
Binary/ReadMe.txt
Normal file
@@ -0,0 +1,122 @@
|
||||
***********************************************************************
|
||||
*** ***
|
||||
*** R o m W B W ***
|
||||
*** ***
|
||||
*** Z80/Z180 System Software ***
|
||||
*** ***
|
||||
***********************************************************************
|
||||
|
||||
This directory ("Binary") is part of the RomWBW System Software
|
||||
distribution archive. It contains the completed binary outputs of
|
||||
the build process. As described below, these files are used to
|
||||
assemble a working RetroBrew Computers system.
|
||||
|
||||
The files in this directory are created by the build process that is
|
||||
documented in the ReadMe.txt file in the Source directory. When
|
||||
released the directory is populated with the default output files.
|
||||
However, the output of custom builds will be placed in this directory
|
||||
as well.
|
||||
|
||||
If you only see a few files in this directory, then you downloaded
|
||||
just the source from GitHub. To retrieve the full release download
|
||||
package, go to https://github.com/wwarthen/RomWBW. On this page,
|
||||
look for the text "XX releases" where XX is a number. Click on this
|
||||
text to go to the releases page. On this page, you will see the
|
||||
latest releases listed. For each release, you will see a package
|
||||
file called something like "RomWBW-2.9.0-Package.zip". Click on the
|
||||
package file for the release you want to download.
|
||||
|
||||
ROM Firmware Images (<plt>_<cfg>.rom)
|
||||
-------------------------------------
|
||||
|
||||
The files with a ".rom" extension are binary images ready to program
|
||||
into an appropriate PROM. These files are named with the format
|
||||
<plt>_<cfg>.rom. <plt> refers to the primary platform such as Zeta,
|
||||
N8, Mark IV, etc. <cfg> refers to the specific configuration. In
|
||||
general, there will be a standard configuration ("std") for each
|
||||
platform. So, for example, the file called MK4_std.rom is a ROM
|
||||
image for the Mark IV with the standard configuration. If a custom
|
||||
configuration called "custom" is created and built, a new file called
|
||||
MK4_custom.rom will be added to this directory.
|
||||
|
||||
Documentation of the pre-built ROM Images is contained in the
|
||||
RomList.txt file in this directory.
|
||||
|
||||
ROM Executable Images (<plt>_<cfg>.com)
|
||||
---------------------------------------
|
||||
|
||||
When a ROM image (".rom") is created, an executable version of the
|
||||
ROM is also created. These files have the same naming convention as
|
||||
the ROM Image files, but have the extension ".com". These files can
|
||||
be copied to a working system and run like a normal CP/M application.
|
||||
|
||||
When run on the target system, they install in RAM just like they had
|
||||
been loaded from ROM. This allows a new ROM build to be tested
|
||||
without reprogramming the actual ROM.
|
||||
|
||||
WARNING: In a few cases the .com file is too big to load. If you get
|
||||
a message like "Full" or "BAD LOAD" when trying to load one of the
|
||||
.com files, it is too big. In these cases, you will not be able to
|
||||
test the ROM prior to programming it.
|
||||
|
||||
VDU ROM Image (vdu.rom)
|
||||
-----------------------
|
||||
|
||||
The VDU video board requires a dedicated onboard ROM containing the
|
||||
font data. The "vdu.rom" file contains the binary data to program
|
||||
onto that chip.
|
||||
|
||||
Disk Images (fd_*.img, hd_*.img)
|
||||
------------------------------
|
||||
|
||||
RomWBW includes a mechanism for generating floppy disk and hard disk
|
||||
binary images that are ready to copy directly to a floppy, hard disk,
|
||||
CF Card, or SD Card which will then be ready for use in any
|
||||
RomWBW-based system.
|
||||
|
||||
Essentially, these files contain prepared floppy and hard disk images
|
||||
with a large set of programs and related files. By copying the
|
||||
contents of these files to appropriate media as described below, you
|
||||
can quickly create ready-to-use media. Win32DiskImager or
|
||||
RawWriteWin can be used to copy images directly to media. These
|
||||
programs are included in the RomWBW Tools directory.
|
||||
|
||||
The fd_*.img files are floppy disk images. They are sized for 1.44MB
|
||||
floppy media and can be copied to actual floppy disks using
|
||||
RawWriteWin (as long as you have access to a floppy drive on your
|
||||
Windows computer). The resulting floppy disks will be usable on any
|
||||
RomWBW-based system with floppy drive(s).
|
||||
|
||||
Likewise, the hd_*.img files are hard disk images. Each file is
|
||||
intended to be copied to the start of any type of hard disk media
|
||||
(typically a CF Card or SD Card). The resulting media will be usable
|
||||
on any RomWBW-based system that accepts the corresponding media type.
|
||||
|
||||
Documentation of the pre-built disk images is contained in the
|
||||
DiskList.txt file in this directory.
|
||||
|
||||
The contents of the floppy/hard disk images are created by
|
||||
the BuildImages.cmd script in the Source directory. Additional
|
||||
information on how to generate custom disk images is found in the
|
||||
Source\Images ReadMe.txt file.
|
||||
|
||||
Propeller ROM Images (*.eeprom)
|
||||
-------------------------------
|
||||
|
||||
The files with and extension of ".eeprom" contain the binary images
|
||||
to be programmed into the Propeller-based boards. The list below
|
||||
indicates which file targets each of the Propeller board variants:
|
||||
|
||||
ParPortProp ParPortProp.eeprom
|
||||
PropIO V1 PropIO.eeprom
|
||||
PropIO V2 PropIO2.eeprom
|
||||
|
||||
Refer to the board documentation of the boards for more information
|
||||
on how to program the EEPROMs on these boards.
|
||||
|
||||
Apps Directory
|
||||
--------------
|
||||
|
||||
The Apps subdirectory contains the executable application files that
|
||||
are specific to RomWBW. The source for these applications is found
|
||||
in the Source\Apps directory of the distribution.
|
||||
218
Binary/RomList.txt
Normal file
218
Binary/RomList.txt
Normal file
@@ -0,0 +1,218 @@
|
||||
***********************************************************************
|
||||
*** ***
|
||||
*** R o m W B W ***
|
||||
*** ***
|
||||
*** Z80/Z180 System Software ***
|
||||
*** ***
|
||||
***********************************************************************
|
||||
|
||||
This directory ("Binary") is part of the RomWBW System Software
|
||||
distribution archive. Refer to the ReadMe.txt file in this
|
||||
directory for more information on the overall contents of the
|
||||
directory.
|
||||
|
||||
When distributed, RomWBW contains a set of pre-built ROM images that
|
||||
are ready to program onto the EEPROM of any of the Z80/Z180 based
|
||||
RetroBrew Computers CPU boards. Additionally, any custom built ROM
|
||||
images will be placed in this directory.
|
||||
|
||||
All of the pre-built ROM images are 512KB. This size is compatible
|
||||
with all of the Z80/Z180 systems. Some systems can accept different
|
||||
size ROM images. Creating alternative sizes requires a custom ROM
|
||||
build (see ReadMe.txt in the Source directory).
|
||||
|
||||
It is critical that the right ROM Imgae be selected for the target
|
||||
platform being used. The table below indicates the correct ROM
|
||||
image to use for each platform:
|
||||
|
||||
SBC V1/V2 SBC_std.rom
|
||||
SBC SimH SBC_simh.rom
|
||||
Zeta V1 ZETA_std.rom
|
||||
Zeta V2 ZETA2_std.rom
|
||||
N8 N8_std.rom
|
||||
Mark IV MK4_std.rom
|
||||
RC2014 w/ Z80 RCZ80_std.rom
|
||||
RC2014 w/ Z180 RCZ180_nat.rom (native Z180 memory addressing)
|
||||
RC2014 w/ Z180 RCZ180_ext.rom (external 512K RAM/ROM module)
|
||||
SC-series SC126, SC130
|
||||
Easy Z80 EZZ180_std.rom
|
||||
Dyno DYNO_std.rom
|
||||
|
||||
You will find there is one additional ROM image called
|
||||
"UNA_std.rom". This ROM image is an UNA-based RomWBW ROM image. As
|
||||
such, this ROM image can be used on any Z80/Z180 platform supported
|
||||
by John Coffman's UNA BIOS. Refer to RetroBrew Computers Wiki for
|
||||
more information on UNA hardware support.
|
||||
|
||||
For each of the ROM Images (".rom"), there are corresponding files
|
||||
with the extensions of ".com" and ".img". The .com variant can be
|
||||
copied to a functional RomWBW-based system and executed like a
|
||||
normal application under CP/M or Z-System. This will load the new
|
||||
ROM on-the-fly. It is an excellent way to test a ROM Image before
|
||||
actually burning it. Similarly, the .img files can be loaded using
|
||||
the UNA FAT loader for testing.
|
||||
|
||||
WARNING: In a few cases the .com file is too big to load. If you get
|
||||
a message like "Full" or "BAD LOAD" when trying to load one of the
|
||||
.com files, it is too big. In these cases, you will not be able to
|
||||
test the ROM prior to programming it.
|
||||
|
||||
All of the standard ROM Images are configured for:
|
||||
- 512KB ROM Disk
|
||||
- 512KB RAM Disk
|
||||
- 38.4Kbps baud serial console (*)
|
||||
- Auto-discovery of all serial ports
|
||||
|
||||
* RC2014 and Stephen Cousins' kits run at 115,200Kbps baud
|
||||
|
||||
All hard disk type devices (IDE, PPIDE, CF Card, SD Card) will be
|
||||
automatically assigned two drive letters per device. The drive
|
||||
letters will refer to the first 2 slices of the device. The ASSIGN
|
||||
command can be used to display and reassign drives to disk devices
|
||||
and slices as desired.
|
||||
|
||||
Standard ROM Image Notes
|
||||
------------------------
|
||||
|
||||
The standard ROM images will detect and install support for certain
|
||||
devices and peripherals that are on-board or frequently used with
|
||||
each platform as documented below. If the device or peripheral is
|
||||
not detected at boot, the ROM will simply bypass support
|
||||
appropriately.
|
||||
|
||||
SBC (SBC_std.rom):
|
||||
- CPU speed is detected at startup
|
||||
- Console on onboard UART serial port at 38400 baud
|
||||
- Includes support for PPIDE/CF Card(s) connected to on-board
|
||||
parallel port.
|
||||
- Includes support for CVDU and VGA3 boards. If detected at
|
||||
startup, support for video and keyboard is installed
|
||||
including VT-100/ANSI terminal emulation.
|
||||
- Auto-detects PropIO or PropIO V2 and installs associated
|
||||
video, keyboard and SD Card support if present.
|
||||
- If PropIO, PropIO V2, CVDU, or VGA hardware is detected,
|
||||
initial console output is determined by JP2. If JP2 is
|
||||
shorted, console will go to on-board serial port, if JP2
|
||||
is open, console will go to the detected video and keyboard
|
||||
ports.
|
||||
- SBC V1 has a known race condition in the bank switching
|
||||
circuit which is likely to cause system instability. SBC
|
||||
V2 does not have this issue.
|
||||
|
||||
SBC (SBC_simh.rom):
|
||||
- SBC variant customized to run under SimH
|
||||
- Implments two emulated SimH hard disk images
|
||||
- Uses SimH RTC
|
||||
|
||||
ZETA (ZETA_std.rom):
|
||||
- CPU speed is detected at startup
|
||||
- Console on onboard UART serial port at 38400 baud
|
||||
- Includes support for on-board floppy disk controller and
|
||||
two attached floppy disks.
|
||||
- Auto-detects ParPortProp and includes support for it if it
|
||||
is attached.
|
||||
- If ParPortProp is installed, initial console output is
|
||||
determined by JP1. If JP1 is shorted, console will go to
|
||||
on-board serial port, if JP1 is open, console will go to
|
||||
ParPortProp video and keyboard ports.
|
||||
|
||||
ZETA2 (ZETA2_std.rom):
|
||||
- CPU speed is detected at startup
|
||||
- Console on onboard UART serial port at 38400 baud
|
||||
- Includes support for on-board floppy disk controller and
|
||||
two attached floppy disks.
|
||||
- Auto-detects ParPortProp and includes support for it if it
|
||||
is attached.
|
||||
- Uses CTC to generate periodic timer interrupts.
|
||||
- If ParPortProp is installed, initial console output is
|
||||
determined by JP1. If JP1 is shorted, console will go to
|
||||
on-board serial port, if JP1 is open, console will go to
|
||||
ParPortProp video and keyboard ports.
|
||||
|
||||
N8 (N8_std.rom):
|
||||
- CPU speed is detected at startup
|
||||
- Console on Z180 onboard primary ASCI serial port at 38400 baud
|
||||
- Includes support for on-board floppy disk controller and
|
||||
two attached floppy disks.
|
||||
- Includes support for on-board TMS9918 video and keyboard
|
||||
including VT-100/ANSI terminal emulation.
|
||||
- Includes support for on-board SD Card as hard disk and
|
||||
assumes a production level N8 board (date code >= 2312).
|
||||
|
||||
MK4 (MK4_std.rom):
|
||||
- CPU speed is detected at startup
|
||||
- Console on Z180 onboard primary ASCI serial port at 38400 baud
|
||||
- Includes support for on-board IDE port (CF Card via adapter).
|
||||
- Includes support for on-board SD Card port.
|
||||
- Auto-detects PropIO or PropIO V2 and installs associated
|
||||
video, keyboard and SD Card support if present.
|
||||
- Includes support for CVDU and VGA3 boards. If detected at
|
||||
startup, support for video and keyboard is installed
|
||||
including VT-100/ANSI terminal emulation.
|
||||
|
||||
RCZ80 (RCZ80_std.rom):
|
||||
- Assumes CPU oscillator of 7.3728 MHz
|
||||
- Requires 512K RAM/ROM module
|
||||
- Auto detects Serial I/O Module (ACIA) and Dual Serial
|
||||
Module (SIO/2). Either one may be used.
|
||||
- Console on whichever serial module is installed,
|
||||
but will use the SIO/2 if both are installed. Baud
|
||||
rate is determined by hardware, but normally 115200.
|
||||
- Includes support for RC2014 Compact Flash Module
|
||||
- Support for RC2014 PPIDE Module may be enabled in config
|
||||
- Support for Scott Baker SIO board may be enabled in config
|
||||
- Support for Scott Baker floppy controllers (SMC & WDC) may
|
||||
be enabled in config
|
||||
|
||||
RCZ80 w/ KIO (RCZ80_kio.rom):
|
||||
- Assumes CPU oscillator of 7.3728 MHz
|
||||
- Requires 512K RAM/ROM module
|
||||
- Requires KIO module
|
||||
- Console on KIO primary serial port at 115200 baud
|
||||
- Includes support for RC2014 Compact Flash Module
|
||||
- Includes support for RC2014 PPIDE Module
|
||||
- Support for Scott Baker SIO board may be enabled in config
|
||||
- Support for Scott Baker floppy controllers (SMC & WDC) may
|
||||
be enabled in config
|
||||
|
||||
RCZ180 (RCZ180_nat.rom & RCZ180_ext.rom):
|
||||
- Assumes CPU oscillator of 18.432 MHz
|
||||
- Console on Z180 onboard primary ASCI serial port at 115200 baud
|
||||
- Includes support for RC2014 Compact Flash Module
|
||||
- Includes support for RC2014 PPIDE Module
|
||||
- Support for alternative serial modules may be enabled in config
|
||||
- Support for Scott Baker floppy controllers (SMC & WDC) may
|
||||
be enabled in config
|
||||
- You must pick the _nat or _ext variant depending on which
|
||||
memory module you are using:
|
||||
- RCZ180_nat.rom uses the built-in Z180 memory manager
|
||||
for use with memory modules allow direct physical
|
||||
addressing of memory, such as the SC119
|
||||
- RCZ180_ext.rom uses external bank management to access
|
||||
memory, such as the 512K RAM/ROM module.
|
||||
|
||||
SCZ180 (SCZ180_126.rom, SCZ180_130.rom, SCZ180_131.rom):
|
||||
- Assumes CPU oscillator of 18.432 MHz
|
||||
- Console on Z180 onboard primary ASCI serial port at 115200 baud
|
||||
- Includes support for RC2014 Compact Flash Module
|
||||
- Includes support for RC2014 PPIDE Module
|
||||
- Support for alternative serial modules may be enabled in config
|
||||
- Support for Scott Baker floppy controllers (SMC & WDC) may
|
||||
be enabled in config
|
||||
- The 3 different variants of SCZ180 are provided to match the
|
||||
3 corresponding systems (SC126, SC130, and SC131) designed by
|
||||
Stephen Cousins.
|
||||
|
||||
EZZ80 (EZZ80_std.rom):
|
||||
- Assumes CPU oscillator of 10.000 MHz
|
||||
- Console on primary SIO serial port at 115200 baud
|
||||
- Includes support for on-board SIO
|
||||
- Includes support for RC2014 Compact Flash Module
|
||||
- Includes support for RC2014 PPIDE Module
|
||||
|
||||
DYNO (DYNO_std.rom):
|
||||
- Assumes CPU oscillator of 18.432 MHz
|
||||
- Console on Z180 onboard serial ports at 38400 baud
|
||||
- Includes support for BQ4842 RTC
|
||||
- Includes support for onboard PPIDE
|
||||
- Support for Dyno floppy controllers may be enabled in config
|
||||
@@ -1,4 +0,0 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
pushd Source && call BuildCommon && popd
|
||||
@@ -1,4 +0,0 @@
|
||||
@echo off
|
||||
setlocal
|
||||
|
||||
pushd Images && Build && popd
|
||||
11
Clean.cmd
11
Clean.cmd
@@ -1,11 +0,0 @@
|
||||
@echo off
|
||||
|
||||
setlocal
|
||||
|
||||
pushd Source && call Clean && popd
|
||||
pushd Images && call Clean && popd
|
||||
|
||||
if exist *.img del *.img /Q
|
||||
if exist *.log del *.log /Q
|
||||
|
||||
if exist Output\*.* del Output\*.* /Q
|
||||
350
Doc/Build.txt
350
Doc/Build.txt
@@ -1,350 +0,0 @@
|
||||
Building a Custom ROM
|
||||
---------------------
|
||||
|
||||
At present, the build environment assumes you are running
|
||||
a current version of Microsoft Windows (either 32-bit or
|
||||
64-bit). Additionally, you will need Microsoft PowerShell.
|
||||
PowerShell is included in all distributions of Microsoft
|
||||
Windows starting with Vista. It is available as a free
|
||||
download for Windows XP from Microsoft
|
||||
|
||||
Other than PowerShell, all required tools are included in
|
||||
the distribution. You should not need anything other than
|
||||
what comes as part of Windows or as part of the distribution.
|
||||
|
||||
In summary, the process involves the 4 steps below. You must
|
||||
configure PowerShell prior to these steps, but this only needs
|
||||
to be done once.
|
||||
|
||||
The basic steps to create a custom ROM are:
|
||||
|
||||
1) Create/update configuration file
|
||||
|
||||
2) Update/Add/Delete any files you want incorporated in
|
||||
the ROM Disk
|
||||
|
||||
3) Run the build scripts and
|
||||
confirm there are no errors.
|
||||
|
||||
4) Burn the resultant ROM image and try it.
|
||||
|
||||
I strongly recommend that you initially SKIP steps
|
||||
1 & 2. Just try steps 3 & 4 to make sure you are
|
||||
able to build a ROM and test it in your hardware.
|
||||
|
||||
Each of the 4 steps above is described in more detail
|
||||
below.
|
||||
|
||||
Acquiring the Distribution
|
||||
--------------------------
|
||||
|
||||
Preparing PowerShell
|
||||
--------------------
|
||||
|
||||
|
||||
1. Create/Update Configuration File
|
||||
-----------------------------------
|
||||
|
||||
The settings for a build are primarily controled by
|
||||
a configuration file that is included in the build
|
||||
process. In order to customize your settings, you
|
||||
need to modify an existing configuration file or
|
||||
create your own.
|
||||
|
||||
Configuration files are found in the Source\BIOS\Config
|
||||
directory. If you look in the this directory, you will see
|
||||
a series of files named XXXX_yyyy.asm. Each of
|
||||
them corresponds to one of the standard configurations
|
||||
listed in the ROMList.txt file.
|
||||
|
||||
You have two choices. You can simply modify the existing
|
||||
configuration file that is closest to your situation, or
|
||||
you can copy it to a new XXXX_yyyy.asm file and modify
|
||||
that. I recommend that you copy one to your own name so
|
||||
that you will always have the unmodified standard configuration
|
||||
files left in place. So, for example, you could just
|
||||
copy ZETA_std.asm to ZETA_wayne.asm. You MUST
|
||||
name your config file as XXXX_yyyy.asm. The XXXX portion
|
||||
must match your platform (N8VEM, ZETA, ZETA2, N8, UNA).
|
||||
The yyyy portion can be whatever you want.
|
||||
|
||||
The config files are simply text files with various
|
||||
settings. Open your target config file with your
|
||||
favorite text editor and modify the settings as desired.
|
||||
|
||||
Unfortunately, I have not yet documented each of the
|
||||
settings in detail; that will be a separate document
|
||||
provided in the future. However, there are comments
|
||||
in the config file that will probably be sufficient
|
||||
for the most part.
|
||||
|
||||
2. Update/Add/Delete ROM Disk Files
|
||||
-----------------------------------
|
||||
|
||||
The files that are included on the ROM Disk of your
|
||||
ROM are copied from a set of directories during the
|
||||
build process. This allows you to have complete
|
||||
flexibility over the files you want included in your
|
||||
ROM.
|
||||
|
||||
If you look at the RomDsk directory, you will see
|
||||
a variety of subdirectories. These subdirectories
|
||||
contain the files that will be included in the
|
||||
ROM disk. The build process will determine
|
||||
which subdirectories to include files from based
|
||||
on the following rules:
|
||||
|
||||
First, all files from either ROM_512KB or ROM_1024KB will
|
||||
be included depending on on the size of the ROM you
|
||||
are building. If you are building a 512KB ROM, then
|
||||
all the files from ROM_512KB will be included. If you
|
||||
are building a 1MB ROM, then all the files from ROM_1024KB
|
||||
will be included. Essentialy, the files in ROM_1204KB are
|
||||
a superset of the ones in ROM_512KB because there is more
|
||||
space available for the ROM drive.
|
||||
|
||||
Second, all files from the directory that corresponds to
|
||||
your configuration file will be included. If you build
|
||||
the "ZETA_std" configuration, all files in ZETA_std will
|
||||
be added. Note that these files will be in addition
|
||||
to the files from the ROM_XXXKB directory.
|
||||
|
||||
If you created your own config file (like ZETA_wayne.asm
|
||||
described above), you MUST create a subdirectory within
|
||||
the RomDsk directory and populate it with the files
|
||||
you want added. Normally, you would include the
|
||||
files from the original standard config. So, if
|
||||
you created ZETA_wayne.asm from ZETA_std.asm,
|
||||
then you would create a subdirectory in RomDsk called
|
||||
ZETA_wayne and copy all the files from ZETA_std to
|
||||
ZETA_wayne.
|
||||
|
||||
3. Run the Build Process
|
||||
------------------------
|
||||
|
||||
NOTE: The process described here is the more commonly
|
||||
used build script. If you wish to use a makefile
|
||||
instead, refer to the comments in the makefile in
|
||||
the Source directory as an alternative to the
|
||||
process described here.
|
||||
|
||||
The build involves running commands at the command
|
||||
prompt. From a Command Prompt window, you will need
|
||||
to change to the high level directory for the build.
|
||||
Normally, you would be changing to the RomWBW directory
|
||||
unless you renamed it.
|
||||
|
||||
First, you will need to build the components that are
|
||||
common to all configurations. These components do not
|
||||
require any configuration. To build these, use the
|
||||
following command and ensure it completes
|
||||
without error:
|
||||
|
||||
BuildCommon
|
||||
|
||||
To run the configuration specific build and be prompted
|
||||
for required information, just enter "Build". You will
|
||||
be prompted for the information described below and the
|
||||
build should run. If an error is encountered, the build
|
||||
should stop and display an error in red text.
|
||||
|
||||
If you immediately receive the error "the execution of
|
||||
scripts is disabled on this system", then you will need to
|
||||
change the PowerShell Execution-Polcy to "RemoteSigned".
|
||||
To do this, you need to right-click on FixPowerShell.cmd and
|
||||
choose "Run as Administrator" to make the change. It is
|
||||
critical that you right-click and use "Run as Administrator"
|
||||
or the change will not work (you will get an error
|
||||
indicating "Access to the registry denied" if you fail to
|
||||
use "Run as Administrator".
|
||||
|
||||
The build script will prompt you for the following information
|
||||
which you will need to provide (don't worry, it is simple):
|
||||
|
||||
Platform:
|
||||
|
||||
Respond with the name of the platform that you are targeting.
|
||||
It must be one of N8VEM, ZETA, ZETA2, N8, or UNA.
|
||||
|
||||
Configuration:
|
||||
|
||||
Respond with the name of the configuration you wish to build.
|
||||
A list of all available configurations is displayed for your
|
||||
convenience. For example, if you are building the provided
|
||||
ZETA_std configuration, just enter "std". If you have created a
|
||||
custom configuration as described above, you would enter
|
||||
"wayne".
|
||||
|
||||
ROM Size [512|1024]:
|
||||
|
||||
Respond with either "512" for a 512KB ROM build or "1024" for a
|
||||
1MB ROM build. Only the two choices are possible at this time.
|
||||
It is important that you choose a ROM size that is no larger than
|
||||
the size of the ROM you will ultimately be burning. This is
|
||||
dependant on your hardware.
|
||||
|
||||
At this point, the build should run and you will see output related
|
||||
to the assembler runs and some utility invocations. Just review
|
||||
the output for any obvioius errors. Normally, all errors will
|
||||
cause the build to stop immediately and display an error message
|
||||
in red.
|
||||
|
||||
You will see some lines in the output indicating the amount of
|
||||
space various components have taken. You should check these
|
||||
to make sure you do not see any negative numbers which would
|
||||
indicate that you have included too many features/drivers for
|
||||
the available memory space. Here are examples of the lines
|
||||
showing the space used:
|
||||
|
||||
DATA space remaining: 39 bytes.
|
||||
BOOT LOADER space remaining: 3503 bytes.
|
||||
CBIOS space remaining: 161 bytes.
|
||||
DBGMON space remaining: 860 bytes.
|
||||
ROMX space remaining: 8191 bytes.
|
||||
BOOT LOADER space remaining: 3503 bytes.
|
||||
|
||||
4. Deploy the ROM
|
||||
-----------------
|
||||
|
||||
If you look in the Output directory. You should find the following files:
|
||||
|
||||
<config>.rom - binary ROM image to burn to EEPROM
|
||||
<config>.com - executable version of the system image that can be
|
||||
copied via xmodem to a running system to test
|
||||
the build.
|
||||
<config>.img - system image that can be written to an SD/CF Card
|
||||
and loaded via the UNA FS FAT loader.
|
||||
|
||||
The actual ROM image is the file ending in .rom. It should be exactly
|
||||
512KB or 1MB depending on the ROM size you chose. Simply burn the .rom
|
||||
image to your ROM and install it in your hardware.
|
||||
|
||||
Specifying Build Options on Command Line
|
||||
----------------------------------------
|
||||
|
||||
If you don't want to be prompted for the options to the "Build"
|
||||
command, you can specify the options right on the command line.
|
||||
|
||||
For example:
|
||||
|
||||
Build ZETA std 512
|
||||
|
||||
In this case, you will not be prompted. This is useful if you
|
||||
wish to automate your build process.
|
||||
|
||||
Example Build Run
|
||||
-----------------
|
||||
|
||||
C:\Users\WWarthen\Projects\N8VEM\Build\RomWBW>Build.cmd
|
||||
Platform [N8VEM|ZETA|N8|UNA|S100]: ZETA
|
||||
Configurations available:
|
||||
> ppp
|
||||
> std
|
||||
Configuration: std
|
||||
ROM Size [512|1024]: 512
|
||||
|
||||
Building ZETA_std: 512KB ROM configuration std for Z80...
|
||||
|
||||
tasm -t80 -g3 ccpb03.asm cp.bin
|
||||
TASM Z80 Assembler. Version 3.2 September, 2001.
|
||||
Copyright (C) 2001 Squak Valley Software
|
||||
tasm: pass 1 complete.
|
||||
tasm: pass 2 complete.
|
||||
tasm: Number of errors = 0
|
||||
tasm -t80 -g3 bdosb01.asm dos.bin
|
||||
TASM Z80 Assembler. Version 3.2 September, 2001.
|
||||
Copyright (C) 2001 Squak Valley Software
|
||||
tasm: pass 1 complete.
|
||||
tasm: pass 2 complete.
|
||||
tasm: Number of errors = 0
|
||||
tasm -t80 -g3 syscfg.asm syscfg.bin
|
||||
TASM Z80 Assembler. Version 3.2 September, 2001.
|
||||
Copyright (C) 2001 Squak Valley Software
|
||||
tasm: pass 1 complete.
|
||||
Configuration: ZETA Z80 SBC, FLOPPY (AUTOSIZE), PPIDE (STD)
|
||||
tasm: pass 2 complete.
|
||||
tasm: Number of errors = 0
|
||||
tasm -t80 -g3 -dBLD_SYS=SYS_CPM cbios.asm cbios.bin
|
||||
TASM Z80 Assembler. Version 3.2 September, 2001.
|
||||
Copyright (C) 2001 Squak Valley Software
|
||||
tasm: pass 1 complete.
|
||||
Configuration: ZETA Z80 SBC, FLOPPY (AUTOSIZE), PPIDE (STD)
|
||||
INFOLIST occupies 18 bytes.
|
||||
UTIL occupies 484 bytes.
|
||||
FD_DATA occupies 340 bytes.
|
||||
PPIDE_DATA occupies 1116 bytes.
|
||||
CBIOS space remaining: 2092 bytes.
|
||||
tasm: pass 2 complete.
|
||||
tasm: Number of errors = 0
|
||||
tasm -t80 -g3 dbgmon.asm dbgmon.bin
|
||||
TASM Z80 Assembler. Version 3.2 September, 2001.
|
||||
Copyright (C) 2001 Squak Valley Software
|
||||
tasm: pass 1 complete.
|
||||
Configuration: ZETA Z80 SBC, FLOPPY (AUTOSIZE), PPIDE (STD)
|
||||
DBGMON space remaining: 795 bytes.
|
||||
tasm: pass 2 complete.
|
||||
tasm: Number of errors = 0
|
||||
tasm -t80 -g3 prefix.asm prefix.bin
|
||||
TASM Z80 Assembler. Version 3.2 September, 2001.
|
||||
Copyright (C) 2001 Squak Valley Software
|
||||
tasm: pass 1 complete.
|
||||
Configuration: ZETA Z80 SBC, FLOPPY (AUTOSIZE), PPIDE (STD)
|
||||
tasm: pass 2 complete.
|
||||
tasm: Number of errors = 0
|
||||
tasm -t80 -g3 bootrom.asm bootrom.bin
|
||||
TASM Z80 Assembler. Version 3.2 September, 2001.
|
||||
Copyright (C) 2001 Squak Valley Software
|
||||
tasm: pass 1 complete.
|
||||
Configuration: ZETA Z80 SBC, FLOPPY (AUTOSIZE), PPIDE (STD)
|
||||
tasm: pass 2 complete.
|
||||
tasm: Number of errors = 0
|
||||
tasm -t80 -g3 bootapp.asm bootapp.bin
|
||||
TASM Z80 Assembler. Version 3.2 September, 2001.
|
||||
Copyright (C) 2001 Squak Valley Software
|
||||
tasm: pass 1 complete.
|
||||
Configuration: ZETA Z80 SBC, FLOPPY (AUTOSIZE), PPIDE (STD)
|
||||
tasm: pass 2 complete.
|
||||
tasm: Number of errors = 0
|
||||
tasm -t80 -g3 loader.asm loader.bin
|
||||
TASM Z80 Assembler. Version 3.2 September, 2001.
|
||||
Copyright (C) 2001 Squak Valley Software
|
||||
tasm: pass 1 complete.
|
||||
Configuration: ZETA Z80 SBC, FLOPPY (AUTOSIZE), PPIDE (STD)
|
||||
LOADER space remaining: 1205 bytes.
|
||||
tasm: pass 2 complete.
|
||||
tasm: Number of errors = 0
|
||||
tasm -t80 -g3 pgzero.asm pgzero.bin
|
||||
TASM Z80 Assembler. Version 3.2 September, 2001.
|
||||
Copyright (C) 2001 Squak Valley Software
|
||||
tasm: pass 1 complete.
|
||||
tasm: pass 2 complete.
|
||||
tasm: Number of errors = 0
|
||||
tasm -t80 -g3 hbios.asm hbios.bin
|
||||
TASM Z80 Assembler. Version 3.2 September, 2001.
|
||||
Copyright (C) 2001 Squak Valley Software
|
||||
tasm: pass 1 complete.
|
||||
Configuration: ZETA Z80 SBC, FLOPPY (AUTOSIZE), PPIDE (STD)
|
||||
UART occupies 146 bytes.
|
||||
FD occupies 2071 bytes.
|
||||
PPIDE occupies 809 bytes.
|
||||
HBIOS space remaining: 24428 bytes.
|
||||
STACK space remaining: 145 bytes.
|
||||
tasm: pass 2 complete.
|
||||
tasm: Number of errors = 0
|
||||
tasm -t80 -g3 hbfill.asm hbfill.bin
|
||||
TASM Z80 Assembler. Version 3.2 September, 2001.
|
||||
Copyright (C) 2001 Squak Valley Software
|
||||
tasm: pass 1 complete.
|
||||
Configuration: ZETA Z80 SBC, FLOPPY (AUTOSIZE), PPIDE (STD)
|
||||
tasm: pass 2 complete.
|
||||
tasm: Number of errors = 0
|
||||
tasm -t80 -g3 romfill.asm romfill.bin
|
||||
TASM Z80 Assembler. Version 3.2 September, 2001.
|
||||
Copyright (C) 2001 Squak Valley Software
|
||||
tasm: pass 1 complete.
|
||||
tasm: pass 2 complete.
|
||||
tasm: Number of errors = 0
|
||||
Building ZETA_std output files...
|
||||
Building 512KB ZETA_std ROM disk data file...
|
||||
|
||||
C:\Users\WWarthen\Projects\N8VEM\Build\RomWBW>
|
||||
BIN
Doc/CPM Manual.pdf
Normal file
BIN
Doc/CPM Manual.pdf
Normal file
Binary file not shown.
BIN
Doc/CPM3 Command Summary.pdf
Normal file
BIN
Doc/CPM3 Command Summary.pdf
Normal file
Binary file not shown.
BIN
Doc/CPM3 Programmers Guide.pdf
Normal file
BIN
Doc/CPM3 Programmers Guide.pdf
Normal file
Binary file not shown.
BIN
Doc/CPM3 System Guide.pdf
Normal file
BIN
Doc/CPM3 System Guide.pdf
Normal file
Binary file not shown.
BIN
Doc/CPM3 Users Guide.pdf
Normal file
BIN
Doc/CPM3 Users Guide.pdf
Normal file
Binary file not shown.
@@ -1,10 +1,159 @@
|
||||
Version 3.0.0
|
||||
-------------
|
||||
- WBW: v2.9.2 -> 3.0 version upgrade due to scope of changes
|
||||
|
||||
Version 2.9.2
|
||||
-------------
|
||||
- PMS: Fixed DS1210-related issue resulting in "Invalid BIOS" errors
|
||||
- SCC: Support for SC126 motherboard
|
||||
- WBW: Enable Auto-CTS/DCD in SIO driver for pacing output data
|
||||
- WBW: Support missing pull-up resistors on SPI SD adapter boards (common)
|
||||
- WBW: Support two SIO modules w/ auto-detection
|
||||
- PMS: Support ECB USB-FIFO board
|
||||
- WBW: Fixed ASSIGN issue with incorrect DPB selection
|
||||
- WBW: Add RC2014 Z180 AY sound support to TUNE app
|
||||
- WBW: Add RC2014 AY sound support to AY driver
|
||||
- WBW: Add SC126 platform
|
||||
- WBW: Config files cleanup
|
||||
- WBW: Add interrupt support to ASCI driver
|
||||
- WBW: Refactored XModem overlay, merged USB-FIFO support
|
||||
- PMS: Added DS1210 low battery detection/message
|
||||
- PMS: Added note playing ability to SPK driver
|
||||
- WBW: Support disk I/O to any memory bank
|
||||
- WBW: Fix floppy I/O error on slow CPUs w/ ints active (credit Jorge Rodrigues)
|
||||
- WBW: Support for KIO chip (based on board by Tom Szolyga)
|
||||
- N?B: Made ZCAL Y2K compliant
|
||||
- WBW: Show disk activity on diagnostic LEDs
|
||||
- WBW: DSRTC now detects DS-1302 presence dynamically
|
||||
- WBW: SC126 platform renamed to SCZ180 w/ configs for SC126, SC130
|
||||
- WBW: Add status LED support
|
||||
- WBW: Add support for secondry SPI (SD Card) on SC126
|
||||
- PMS: Add sound support to NASCOM BASIC
|
||||
- WBW: Updated FAT to add MD and FORMAT commands
|
||||
- WBW: Add CP/M 3 (experimental)
|
||||
- M?T: Support Shift register SPI WIZNET for RC2014
|
||||
- PLS: Added seconds register in HBIOS
|
||||
- WBW: More flexible table-driven config in TUNE.COM
|
||||
- PMS: Added timer support for Zilog Peripherals ECB Board
|
||||
- PLS: Enhanced Intel Hex Load in dbgmon
|
||||
- WBW: Overhaul disk image creation
|
||||
- WBW: Added support for Dyno platform (based on work by Steve Garcia)
|
||||
- SLG: Added support for BQ4845 RTC (bqrtc.asm)
|
||||
- PMS: Added 80x30 video mode to VGA3 driver
|
||||
- PMS: Added 80x43 video mode
|
||||
- PMS: Added font compression option
|
||||
- PMS: Added a "safe mode" startup w/ minimal device support
|
||||
- WBW: Switch RC/SC Z180 platforms to 115,200 default baud rate
|
||||
- PMS: Enhanced PPIDE driver to handle multiple PPI interfaces
|
||||
- PMS: Added a ROM based game
|
||||
- WBW: Only assign drive letters to hard disk devices with media
|
||||
- WBW: Enhanced IDE driver to handle multiple IDE interfaces
|
||||
- D?R: Contributed SC126 How-To: Preparing a MicroSD Card to Transfer Files to/from a Linux System
|
||||
- PMS: Updated romldr to handle more than 9 drives
|
||||
- PMS: Added "user" rom module template
|
||||
- PMS: Added CP/M 3 manuals
|
||||
- WBW: Boot from any slice
|
||||
- C?M: Added Unix build process
|
||||
- PLS: FreeRTOS compatibility
|
||||
- WWB: Removed OSLDR application (can't handle new OSes)
|
||||
|
||||
Version 2.9.1
|
||||
-------------
|
||||
- E?B: Added support for RC2014 RTC
|
||||
- WBW: Converted PTXPLAY to TUNE (now plays PT2/PT3/MYM sounds files)
|
||||
- WBW: Updated Win32DiskImager to v1.0
|
||||
- WBW: Implemented character attributes on Propeller based consoles
|
||||
- MS: Added support for BEL function in Propeller based consoles
|
||||
- WBW: Support additional escape sequences in Propeller console ANSI emulation
|
||||
- WBW: Map LPT: to second serial port, UL1: to third serial port
|
||||
- WBW: Update default IOBYTE so that LST:=LPT: by default
|
||||
- WBW: Fixed missing drive/head setup for writes in PPIDE
|
||||
- WBW: Fixed XModem HBIOS console driver for file send operations
|
||||
- WBW: Preliminary support for RC180 platform (Z180 module in RC2014)
|
||||
- WBW: Added NZCOM distribution files to third slice of hard disk image
|
||||
- WBW: Fixed getnum32 bug in MODE command (found by Phil Summers)
|
||||
- PMS: Added serial support for Zilog Peripherals Baord
|
||||
- WBW: Added preliminary support for interrupt management API
|
||||
- PMS: Improved boot messages in RAM-Floppy driver
|
||||
- PMS: Added charge setting display to RTC boot messages
|
||||
- WBW: Add SmallZ80 support to FDU
|
||||
- WBW: Refactored Debug Monitor w/ improved syntax parsing and help
|
||||
- PMS: Added Forth, Nascom BASIC, and Tasty BASIC to ROM
|
||||
- PMS: Refactored ROM Loader to support more ROM images, now table driven
|
||||
- WBW: Refactored DSKY code
|
||||
- SK: Initial support for Easy Z80
|
||||
- PMS: Enhance VDU driver to support alternative screen dimensions
|
||||
- WBW: DDT and DDTZ modified to use RST 30 instead of RST 38 to avoid conflicts with IM 1 interrupts
|
||||
- WBW: Added timer interrupt support for CTC under Zeta 2 and Easy Z80
|
||||
- WBW: Support LBA style access in floppy driver
|
||||
- WBW: Added beta version of FAT filesystem utility (copy, dir, del, ren)
|
||||
- SCC: Added support for native memory addressing on Z180-based RC2014
|
||||
- PMS: Dynamically discover and display processor type at boot
|
||||
- J?L: Added German keyboard support to PPK and KBD drivers
|
||||
|
||||
Version 2.9.0
|
||||
-------------
|
||||
- WBW: Implemented multi-sector I/O in all disk drivers
|
||||
- WBW: Added support for RC2014 SMB Floppy controller modules (SMC and WDC)
|
||||
- WBW: New function dispatching for character/disk/video drivers
|
||||
- WBW: Updated FDU app to support RC2014 floppy controllers
|
||||
- WBW: Added TIMER app to display system timer value
|
||||
- WBW: Refactored interrupt management code
|
||||
- WBW: Added PTXPLAY application and sample tunes
|
||||
|
||||
Version 2.8.6
|
||||
-------------
|
||||
- WBW: Added support for RC2014 (SIO and ACIA drivers primarily)
|
||||
- WBW: Automatically detect and run PROFILE.SUB on boot drive if it exists
|
||||
- WBW: Fixed Dual SD Board detection
|
||||
- WBW: Added console support to XModem (for RC2014 primarily)
|
||||
- E?B: Fixed IDE/PPIDE when used with non-CF drives
|
||||
- WBW: Patched SUBMIT.COM so that it always puts temp file on A: for immediate execution
|
||||
- WBW: Accommodate spin up time for true IDE hard disks (IDE or PPIDE)
|
||||
|
||||
Version 2.8.5
|
||||
-------------
|
||||
- WBW: Cleaned up support in TMS driver for SCG board
|
||||
|
||||
Version 2.8.4
|
||||
-------------
|
||||
- WBW: FD.COM renamed to FDU.COM and integrated with build
|
||||
- WBW: FDU.COM enhanced to select FDC hardare at startup to
|
||||
eliminate multiple versions.
|
||||
|
||||
Version 2.8.3
|
||||
-------------
|
||||
- WBW: Added MODE command
|
||||
- WBW: Removed obsolete 1200.COM, 9600.COM, and 38400.COM
|
||||
- WBW: New XM.COM that automatically adapts to primary port of platform
|
||||
- WBW: XM.COM now handles 38400 baud at 4MHz
|
||||
- WBW: Removed obsolete XM versions: XM5.COM, XM-A0.COM, XM-A1.COM
|
||||
|
||||
Version 2.8.2
|
||||
-------------
|
||||
- WBW: Adjusted VGA3 register setup per John's recommendations
|
||||
|
||||
Version 2.8.1
|
||||
-------------
|
||||
- WBW: Fix FDISK80
|
||||
- WBW: Upgrade to latest production UNA 2.1-45
|
||||
|
||||
Version 2.8.0
|
||||
-------------
|
||||
- WBW: Add support for VGA3 board
|
||||
|
||||
Version 2.7.1
|
||||
- WBW: Support loading from image file (UNA FSFAT)
|
||||
-------------
|
||||
- WBW: Replace ZX with XP compatible build (no functional changes)
|
||||
- WBW: Reset BDOS serial number on warm start
|
||||
- WBW: Turn off DRAM refresh on Z180 (fixes Z180 CPU speed detection)
|
||||
|
||||
Version 2.7.0
|
||||
-------------
|
||||
- WBW: Memory page reorganization
|
||||
- WBW: Support for Zeta 2 (from Sergey Kiselev)
|
||||
- WBW: Support loading from image file (UNA FSFAT)
|
||||
- WBW: Dynamic CPU speed detection
|
||||
|
||||
Version 2.6.5
|
||||
-------------
|
||||
|
||||
BIN
Doc/Contrib/DSKY.pdf
Normal file
BIN
Doc/Contrib/DSKY.pdf
Normal file
Binary file not shown.
@@ -5,21 +5,21 @@
|
||||
= Warning =
|
||||
|
||||
FLASH4 has been tested and confirmed working on:
|
||||
* SBCv2
|
||||
* N8-2312
|
||||
* Mark IV SBC
|
||||
* N8VEM SBCv2
|
||||
* N8VEM N8-2312
|
||||
* N8VEM Mark IV SBC
|
||||
* DX-Designs P112
|
||||
* ZETA SBC v2
|
||||
|
||||
However it remains somewhat experimental. If it works for you, please let me
|
||||
know. If it breaks please also let me know so I can fix it! Until it is more
|
||||
widely tested please ensure you have some other means to reprogram your flash
|
||||
ROM before exclusively trusting FLASH4.
|
||||
know. If it breaks please also let me know so I can fix it!
|
||||
|
||||
|
||||
= Introduction =
|
||||
|
||||
FLASH4 is a CP/M program which can read, write and verify Flash ROM contents to
|
||||
or from an image file stored on a CP/M filesystem. It is intended for in-system
|
||||
programming of Flash ROM chips on N8VEM Z80 and Z180 systems.
|
||||
programming of Flash ROM chips on Z80 and Z180 systems.
|
||||
|
||||
FLASH4 aims to support a range of Flash ROM chips. Ideally I would like to
|
||||
support all Flash ROM chips that are in use in Z80/Z180 N8VEM machines. If
|
||||
@@ -46,23 +46,26 @@ the "srec_cat" program from SRecord:
|
||||
$ srec_cat image.hex -intel -fill 0xFF 0 0x80000 -output image.bin -binary
|
||||
$ srec_cat image.bin -binary -output image.hex -intel
|
||||
|
||||
FLASH4 can use three different methods to access the Flash ROM chip. The best
|
||||
FLASH4 can use several different methods to access the Flash ROM chip. The best
|
||||
available method is determined automatically at run time. Alternatively you may
|
||||
provide a command-line option to force the use of a specific method.
|
||||
|
||||
The first two methods use bank switching to map sections of the ROM into the
|
||||
CPU address space. FLASH4 will detect the presence of RomWBW or UNA BIOS and
|
||||
use the bank switching methods they provide.
|
||||
use the bank switching methods they provide.
|
||||
|
||||
If neither RomWBW nor UNA BIOS is detected and the system has a Z180 CPU,
|
||||
FLASH4 will use the Z180 DMA engine to access the Flash ROM chip. This does not
|
||||
require any bank switching but it is slower and will not work on all platforms.
|
||||
On P112 systems the P112 B/P BIOS is detected and P112 bank switching is used.
|
||||
|
||||
If no bank switching method can be auto-detected, and the system has a Z180
|
||||
CPU, FLASH4 will use the Z180 DMA engine to access the Flash ROM chip. This
|
||||
does not require any bank switching but it is slower and will not work on all
|
||||
platforms.
|
||||
|
||||
Z180 DMA access requires the flash ROM to be linearly mapped into the lower
|
||||
region of physical memory, as it is on the Mark IV SBC. The N8-2312 has
|
||||
additional memory mapping hardware, consequently Z180 DMA access on the N8-2312
|
||||
is NOT SUPPORTED and if forced will corrupt the contents of RAM; use bank
|
||||
switched access instead.
|
||||
region of physical memory, as it is on the Mark IV SBC (for example). The
|
||||
N8-2312 has additional memory mapping hardware, consequently Z180 DMA access on
|
||||
the N8-2312 is NOT SUPPORTED and if forced will corrupt the contents of RAM;
|
||||
use one of the supported bank switching methods instead.
|
||||
|
||||
Z180 DMA access requires the Z180 CPU I/O base control register configured to
|
||||
locate the internal I/O addresses at 0x40 (ie ICR bits IOA7, IOA6 = 0, 1).
|
||||
@@ -93,13 +96,27 @@ If your ROM chip is larger than the image you wish to write, use the "/PARTIAL"
|
||||
the image file must be an exact multiple of 32KB in length. The portion of the
|
||||
ROM not occupied by the image file is left either unmodified or erased.
|
||||
|
||||
If you are using an ROM/EPROM/EEPROM chip which cannot be programmed in-system,
|
||||
FLASH4 will not be able to recognise it, however the software can still
|
||||
usefully READ and VERIFY the chip. Use the "/ROM" command line option to enable
|
||||
"READ" or "VERIFY" mode with unrecognised chips. This mode assumes a 512K ROM
|
||||
is fitted; smaller ROMs will be treated as a 512K ROM with the data repated
|
||||
multiple times -- with a 256K chip the data is repeated twice, four times for a
|
||||
128K chip, etc.
|
||||
|
||||
One of the following optional command line arguments may be specified at the
|
||||
end of the command line to force FLASH4 to use a particular method to access
|
||||
the flash ROM chip:
|
||||
|
||||
/ROMWBW
|
||||
/UNABIOS
|
||||
/Z180DMA
|
||||
BIOS interfaces:
|
||||
/ROMWBW For ROMWBW BIOS version 2.6 and later
|
||||
/ROMWBWOLD For ROMWBW BIOS version 2.5 and earlier
|
||||
/UNABIOS For UNA BIOS
|
||||
|
||||
Direct hardware interfaces:
|
||||
/Z180DMA For Z180 DMA
|
||||
/P112 For DX-Designs P112
|
||||
/N8VEMSBC For N8VEM SBC (v1, v2), Zeta (v1) SBC
|
||||
|
||||
If no option is specified FLASH4 attempts to determine the best available
|
||||
method automatically.
|
||||
BIN
Doc/Contrib/Microsoft NASCOM BASIC.docx
Normal file
BIN
Doc/Contrib/Microsoft NASCOM BASIC.docx
Normal file
Binary file not shown.
BIN
Doc/Contrib/SC126_How-To_No_1_Serial_Comms_Using_Minicom.pdf
Normal file
BIN
Doc/Contrib/SC126_How-To_No_1_Serial_Comms_Using_Minicom.pdf
Normal file
Binary file not shown.
Binary file not shown.
@@ -1,3 +1,9 @@
|
||||
ZSDOS Adaptation Notes for RomWBW
|
||||
---------------------------------
|
||||
|
||||
Wayne Warthen
|
||||
wwarthen@gmail.com
|
||||
|
||||
This file is a log of the work done to adapt the ZSDOS distribution to the N8VEM platforms under RomWBW. I strongly recommend reviewing the zsdos.pdf file in the Doc directory.
|
||||
|
||||
The starting point was the general public release of ZSDOS that is generally available. The first line of the README file is "ZSDOS-GP. General Public Release of the ZSDOS 1.x Operating System."
|
||||
@@ -14,7 +20,7 @@ Beyond the construction and integration of the actual DOS itself, the majority o
|
||||
|
||||
The remainder of this document details the changes I made as I went along. In all cases, my goal was to keep the result as close to the original distribution as possible. I started by copying all of the files from the distribution (contained in zsdos2.zip) into Support\ZSDOS. From there I tested, modified, updated, and customized as documented below. Finally, I cherry picked files that made sense to include on the ZSystem ROM disks.
|
||||
|
||||
1. CLOCKS.DAT has been updated to include the N8VEM clock drivers, N8VEMCLK AND N8CLK. I have also added the SIMHCLOK clock driver.
|
||||
1. CLOCKS.DAT has been updated to include the RomWBW clock driver, HBCLK. I have also added the SIMHCLOK clock driver.
|
||||
|
||||
2. STAMPS.DAT has been replaced with an updated version. The update was called STAMPS11.DAT and was found on the Walnut Creek CP/M CDROM. The original version has a bug that prevents RSX (resident system extension) mode to load properly.
|
||||
|
||||
@@ -26,6 +32,8 @@ The remainder of this document details the changes I made as I went along. In a
|
||||
|
||||
6. Updated FILEATTR to v1.6A. Original FILEATTR.CFG was invalid. FILEATTR.CFG replaced with FA16.CFG. Added associated files FA16.DOC, FA16A.FOR, FA16CFG.TXT.
|
||||
|
||||
7. ZCAL patched to be Y2K compliant. Contributed by Nick Brok.
|
||||
|
||||
|
||||
Usage Notes
|
||||
-----------
|
||||
564
Doc/DDTZ.doc
Normal file
564
Doc/DDTZ.doc
Normal file
@@ -0,0 +1,564 @@
|
||||
|
||||
DDTZ v2.7
|
||||
by C.B. Falconer
|
||||
edited by George A. Havach
|
||||
|
||||
Introduction:
|
||||
============
|
||||
DDTZ v2.7 is a complete replacement for DDT, Digital Research's
|
||||
famous Dynamic Debugging Tool, with improved functionality, bug
|
||||
extermination, and full Z80 support. In general, DDTZ is fully
|
||||
compatible with the original utility, but it has extra and
|
||||
extended commands and many fewer quirks. All Z80-specific
|
||||
instructions can be (dis)assembled, though in Intel rather then
|
||||
Zilog format. Furthermore, DDTZ will correctly trace ('T' and 'U'
|
||||
commands) both 8080 and Z80 instructions, depending on which CPU
|
||||
is operating. On startup, the program announces which CPU it is
|
||||
running on.
|
||||
|
||||
DDTZ v2.7 now handles the 64180 added opcodes. It does NOT test
|
||||
for a 64180 CPU, since this cannot be done without executing
|
||||
illegal Z80 instructions, which in turn will crash some
|
||||
simulators. However v2.7 does not execute any 64180 instructions
|
||||
internally, only in the subject program.
|
||||
|
||||
This issue supplies the "M" version assembled, to avoid errors
|
||||
when switching between MSDOS and CPM systems. The command table
|
||||
is updated accordingly. Most CPM users are also MSDOS users, but
|
||||
not vice-versa.
|
||||
|
||||
The program is invoked by typing
|
||||
|
||||
ddtz<ret>
|
||||
or
|
||||
ddtz [d:]filespec<ret>
|
||||
|
||||
In the second form, DDTZ will load the specified file into
|
||||
memory starting at 0100H, unless it's a .HEX file that sets its
|
||||
own load address. Besides reporting the NEXT free address and
|
||||
the PC (program counter) after a successful load, DDTZ also shows
|
||||
the number of memory pages needed for a SAVE. Instead of having
|
||||
to write all this down, just use the 'X' command at any time to
|
||||
redisplay these three values for the current application.
|
||||
|
||||
NOTE: loading more code above the NEXT pointer revises these
|
||||
values.
|
||||
|
||||
As in DDT, when a program is loaded above the area holding the
|
||||
'A' and 'U' (and now 'W') command code, these commands are
|
||||
disabled, and the extra memory is released to the user. Thus,
|
||||
DDTZ can occupy as little as 3K total memory space. Unlike DDT,
|
||||
however, DDTZ will not overwrite itself or the system on program
|
||||
loads (except .HEX files).
|
||||
|
||||
At initialization, the stack pointer (SP) points to a return to
|
||||
DDTZ, just like for the CCP. Thus, programs that normally return
|
||||
to the CCP will be returned to DDTZ. The 'B' command
|
||||
reinitializes this condition.
|
||||
|
||||
|
||||
The intercept vector copies the BDOS version number, etc., so
|
||||
an object program does not know that DDTZ is running (except
|
||||
for BIOS-BDOS vector size). Thus, programs that check the version
|
||||
number should execute correctly under DDTZ.
|
||||
|
||||
All input parameters can now be entered in any of three formats:
|
||||
|
||||
(1) hexadecimal (as in DDT),
|
||||
(2) decimal, by adding a leading '#' character,
|
||||
(3) ASCII, by enclosing between either single or double
|
||||
quotes; either one or two characters are allowed.
|
||||
|
||||
Leading blanks in command lines and parameters are absorbed.
|
||||
Either a comma or a (single) space is a valid delimiter.
|
||||
Either uppercase or lowercase input is accepted.
|
||||
|
||||
The default command (for anything not otherwise recognizable)
|
||||
is 'H'. This allows convenient calculation, along with the other
|
||||
features described below. So, to convert a number, just enter
|
||||
it!
|
||||
|
||||
As in DDT, the prompt character is '-', and the only error
|
||||
message is the query ('?'), which generally kicks you back to
|
||||
command mode.
|
||||
|
||||
New Commands (Over DDT):
|
||||
=======================
|
||||
|
||||
NOTE: letters in parenthesis, e.g. "(U)", show the equivalent
|
||||
command for DDTZM version (compatible with MSDOS debug).
|
||||
|
||||
@ Sets or shows (with no parameter) the internally stored
|
||||
"base" value. Also used with the 'S' and 'D' commands as
|
||||
an optional parameter (though without the '@') to display
|
||||
memory from an arbitrary base marker (offset). When set to
|
||||
zero (the default), it does not affect any screen displays.
|
||||
|
||||
B B)egin: resets the USER stack pointer to its initial value,
|
||||
such that any program that exits by an RET will return to
|
||||
DDTZ. DDTZ provides a default stack space of
|
||||
approximately 24 bytes for user programs.
|
||||
|
||||
C C)ompare first_address,last_address,against_address: shows
|
||||
all the byte differences between two memory areas, in the
|
||||
format
|
||||
|
||||
XXXX aa YYYY bb
|
||||
|
||||
where XXXX and YYYY are the comparative memory addresses,
|
||||
and aa and bb are the corresponding byte values. Can be
|
||||
used to verify the identity of two files by first
|
||||
loading them into different memory areas with the 'R'
|
||||
command (see below).
|
||||
|
||||
|
||||
W Write: stores the modified memory area to disk under the
|
||||
(K) filename specified by the 'I' command, overwriting the
|
||||
original file from which it was loaded (the user is queried
|
||||
before doing so). By default, the image of memory from
|
||||
0100H through the "NEXT" value -1 is saved. "K first_addr,
|
||||
last_address" overrides this and allows writing ANY memory
|
||||
area to a file. Almost a necessity for CPM 3.0 (no SAVE!).
|
||||
K)eep on DDTZ
|
||||
|
||||
X eXamine: redisplays the "NEXT PC SAVE" report at any time.
|
||||
(Q) Q)uery size on DDTZ.
|
||||
|
||||
S S)earch first_address, last_addr, value: searches the
|
||||
(W) specified memory area for the value (a 16-bit word, not a
|
||||
byte) and shows the locations of all such. Very useful for
|
||||
finding CALL's or JMP's to a particular address, etc.
|
||||
W)here on DDTZ
|
||||
|
||||
Y Y)our_option parm1,parm2,address: executes an arbitrary
|
||||
routine at the specified address, with the BC and DE
|
||||
registers set to parm1 and parm2, respectively.
|
||||
|
||||
Z Displays (but does not alter) the Z80's alternate register
|
||||
set, including the index registers (disabled if running on
|
||||
an 8080). On Z80's, automatically included as the last
|
||||
part of the display by the 'X' command.
|
||||
|
||||
|
||||
Based (Offset) Displays:
|
||||
=======================
|
||||
|
||||
The 'D' and 'E' commands can use a stored base value (offset),
|
||||
as set by the '@' command. The current @ value may be
|
||||
overridden for a single execution of these commands by adding the
|
||||
base as an extra parameter in the command line. The effect is
|
||||
to add this value to the first/last address and display
|
||||
accordingly. The address listing on the left becomes XXXX:YYYY,
|
||||
where XXXX is the offset address and YYYY is the actual memory
|
||||
address being displayed. For example, if you have a data area
|
||||
located at 42B7H and wish to preserve easy access, just enter
|
||||
"@42b7". Now, "d0,3f" will dump memory starting at 4237H.
|
||||
|
||||
|
||||
Further Changes from DDT:
|
||||
========================
|
||||
|
||||
A A)ssemble now accepts the full Z80 as well as 8080
|
||||
instruction set, although it expects them in Intel rather
|
||||
than Zilog format (see notes below under the 'L'
|
||||
command). When in doubt, see the mnemnonic list below.
|
||||
|
||||
D D)isplay or D)ump will accept an optional third parameter
|
||||
to set the base value for a single execution only. Format
|
||||
has been cleaned up.
|
||||
|
||||
H H)ex_arithmetic on two values also shows their
|
||||
difference in decimal. With only one value, converts to
|
||||
hexadecimal, decimal, and ASCII (low-order byte only).
|
||||
|
||||
|
||||
N N)ame now allows drive specification (d:...) and sets up
|
||||
(I) the complete command line, including both FCB's (at
|
||||
addresses 005CH and 006CH). The tail (stored at 0081H up)
|
||||
is NOT upshifted.
|
||||
I)nput on DDTZ
|
||||
|
||||
U U)nassemble now displays the raw hexcode, especially handy
|
||||
(L) when examining non-code areas. Intel (8080 style) mnemonics
|
||||
are used, so some disassembled instructions may look
|
||||
strange. E.g., the Z80's 'IN B,(C)' and 'OUT (C),B' become
|
||||
'INP B' and 'OUTP B', respectively; 'LD (nnnn),BC' becomes
|
||||
'SBCD nnnn', 'ADD IX, BC' becomes 'DADX B', and 'JP (IX)'
|
||||
becomes 'PCIX'.
|
||||
L)ist on DDTZ
|
||||
|
||||
L L)oad now permits loading a file into memory with an
|
||||
(R) offset, which is added to the default load address of
|
||||
0100H. When reading in a .HEX file with a preset bias,
|
||||
the 'R' command will not transfer control to an invalid
|
||||
execution point. Another execution of the 'R' command will
|
||||
reread the input file, e.g.:
|
||||
|
||||
n blah<ret>
|
||||
l<ret>
|
||||
...modify the code and generally mess about...
|
||||
l<ret>
|
||||
|
||||
The original file is reloaded, and the modifications are
|
||||
removed.
|
||||
R)ead on DDTZ
|
||||
|
||||
E E)nter, like D)isplay, now accepts an optional second
|
||||
(S) parameter to set the base value for a single execution
|
||||
only.
|
||||
S)ubstitute or S)et on DDTZ
|
||||
|
||||
T T)rap/trace on termination now shows the complete CPU
|
||||
state. Traps and traces no longer lock up when a user RST
|
||||
7 instruction is executed. Tracing of BDOS/BIOS calls is
|
||||
heavily trun cated, avoiding clutter and preventing system
|
||||
crashes.
|
||||
|
||||
NOTE: Most of the UNDOCUMENTED Z80 op-codes are handled. Others
|
||||
can crash the system.
|
||||
|
||||
R R)egisters also shows what two-byte values the HL and SP
|
||||
(X) registers are actually pointing to. On Z80's, displays the
|
||||
alternate register set.
|
||||
eX)amine on DDTZ
|
||||
|
||||
NOTE: Any use of the 'W' or 'L' command resets the system DMA
|
||||
transfer address to the standard default value of 0080H.
|
||||
|
||||
|
||||
; This is the output of DDTZ when disassembling OPTYPE.TRY
|
||||
NOP LDA 06A4 MOV M,H
|
||||
LXI B,06A4 DCX SP MOV M,L
|
||||
STAX B INR A HLT
|
||||
INX B DCR A MOV M,A
|
||||
INR B MVI A,20 MOV A,B
|
||||
DCR B CMC MOV A,C
|
||||
MVI B,20 MOV B,B MOV A,D
|
||||
RLC MOV B,C MOV A,E
|
||||
EXAF MOV B,D MOV A,H
|
||||
DAD B MOV B,E MOV A,L
|
||||
LDAX B MOV B,H MOV A,M
|
||||
DCX B MOV B,L MOV A,A
|
||||
INR C MOV B,M ADD B
|
||||
DCR C MOV B,A ADD C
|
||||
MVI C,20 MOV C,B ADD D
|
||||
RRC MOV C,C ADD E
|
||||
DJNZ 0134 MOV C,D ADD H
|
||||
LXI D,06A4 MOV C,E ADD L
|
||||
STAX D MOV C,H ADD M
|
||||
INX D MOV C,L ADD A
|
||||
INR D MOV C,M ADC B
|
||||
DCR D MOV C,A ADC C
|
||||
MVI D,20 MOV D,B ADC D
|
||||
RAL MOV D,C ADC E
|
||||
JR 0134 MOV D,D ADC H
|
||||
DAD D MOV D,E ADC L
|
||||
LDAX D MOV D,H ADC M
|
||||
DCX D MOV D,L ADC A
|
||||
INR E MOV D,M SUB B
|
||||
DCR E MOV D,A SUB C
|
||||
MVI E,20 MOV E,B SUB D
|
||||
RAR MOV E,C SUB E
|
||||
JRNZ 0134 MOV E,D SUB H
|
||||
LXI H,06A4 MOV E,E SUB L
|
||||
SHLD 06A4 MOV E,H SUB M
|
||||
INX H MOV E,L SUB A
|
||||
INR H MOV E,M SBB B
|
||||
DCR H MOV E,A SBB C
|
||||
MVI H,20 MOV H,B SBB D
|
||||
DAA MOV H,C SBB E
|
||||
JRZ 0134 MOV H,D SBB H
|
||||
DAD H MOV H,E SBB L
|
||||
LHLD 06A4 MOV H,H SBB M
|
||||
DCX H MOV H,L SBB A
|
||||
INR L MOV H,M ANA B
|
||||
DCR L MOV H,A ANA C
|
||||
MVI L,20 MOV L,B ANA D
|
||||
CMA MOV L,C ANA E
|
||||
JRNC 0134 MOV L,D ANA H
|
||||
LXI SP,06A4 MOV L,E ANA L
|
||||
STA 06A4 MOV L,H ANA M
|
||||
INX SP MOV L,L ANA A
|
||||
INR M MOV L,M XRA B
|
||||
DCR M MOV L,A XRA C
|
||||
MVI M,20 MOV M,B XRA D
|
||||
STC MOV M,C XRA E
|
||||
JRC 0134 MOV M,D XRA H
|
||||
DAD SP MOV M,E XRA L
|
||||
|
||||
|
||||
XRA M JPE 06A4 SLAR M
|
||||
XRA A XCHG SLAR A
|
||||
ORA B CPE 06A4 SRAR B
|
||||
ORA C XRI 20 SRAR C
|
||||
ORA D RST 5 SRAR D
|
||||
ORA E RP SRAR E
|
||||
ORA H POP PSW SRAR H
|
||||
ORA L JP 06A4 SRAR L
|
||||
ORA M DI SRAR M
|
||||
ORA A CP 06A4 SRAR A
|
||||
CMP B PUSH PSW SLLR B
|
||||
CMP C ORI 20 SLLR C
|
||||
CMP D RST 6 SLLR D
|
||||
CMP E RM SLLR E
|
||||
CMP H SPHL SLLR H
|
||||
CMP L JM 06A4 SLLR L
|
||||
CMP M EI SLLR M
|
||||
CMP A CM 06A4 SLLR A
|
||||
RNZ CPI 20 SRLR B
|
||||
POP B RST 7 SRLR C
|
||||
JNZ 06A4 RLCR B SRLR D
|
||||
JMP 06A4 RLCR C SRLR E
|
||||
CNZ 06A4 RLCR D SRLR H
|
||||
PUSH B RLCR E SRLR L
|
||||
ADI 20 RLCR H SRLR M
|
||||
RST 0 RLCR L SRLR A
|
||||
RZ RLCR M BIT 0,B
|
||||
RET RLCR A BIT 0,C
|
||||
JZ 06A4 RRCR B BIT 0,D
|
||||
CZ 06A4 RRCR C BIT 0,E
|
||||
CALL 06A4 RRCR D BIT 0,H
|
||||
ACI 20 RRCR E BIT 0,L
|
||||
RST 1 RRCR H BIT 0,M
|
||||
RNC RRCR L BIT 0,A
|
||||
POP D RRCR M BIT 1,B
|
||||
JNC 06A4 RRCR A BIT 1,C
|
||||
OUT 20 RALR B BIT 1,D
|
||||
CNC 06A4 RALR C BIT 1,E
|
||||
PUSH D RALR D BIT 1,H
|
||||
SUI 20 RALR E BIT 1,L
|
||||
RST 2 RALR H BIT 1,M
|
||||
RC RALR L BIT 1,A
|
||||
EXX RALR M BIT 2,B
|
||||
JC 06A4 RALR A BIT 2,C
|
||||
IN 20 RARR B BIT 2,D
|
||||
CC 06A4 RARR C BIT 2,E
|
||||
SBI 20 RARR D BIT 2,H
|
||||
RST 3 RARR E BIT 2,L
|
||||
RPO RARR H BIT 2,M
|
||||
POP H RARR L BIT 2,A
|
||||
JPO 06A4 RARR M BIT 3,B
|
||||
XTHL RARR A BIT 3,C
|
||||
CPO 06A4 SLAR B BIT 3,D
|
||||
PUSH H SLAR C BIT 3,E
|
||||
ANI 20 SLAR D BIT 3,H
|
||||
RST 4 SLAR E BIT 3,L
|
||||
RPE SLAR H BIT 3,M
|
||||
PCHL SLAR L BIT 3,A
|
||||
|
||||
|
||||
BIT 4,B RES 3,D SET 2,H
|
||||
BIT 4,C RES 3,E SET 2,L
|
||||
BIT 4,D RES 3,H SET 2,M
|
||||
BIT 4,E RES 3,L SET 2,A
|
||||
BIT 4,H RES 3,M SET 3,B
|
||||
BIT 4,L RES 3,A SET 3,C
|
||||
BIT 4,M RES 4,B SET 3,D
|
||||
BIT 4,A RES 4,C SET 3,E
|
||||
BIT 5,B RES 4,D SET 3,H
|
||||
BIT 5,C RES 4,E SET 3,L
|
||||
BIT 5,D RES 4,H SET 3,M
|
||||
BIT 5,E RES 4,L SET 3,A
|
||||
BIT 5,H RES 4,M SET 4,B
|
||||
BIT 5,L RES 4,A SET 4,C
|
||||
BIT 5,M RES 5,B SET 4,D
|
||||
BIT 5,A RES 5,C SET 4,E
|
||||
BIT 6,B RES 5,D SET 4,H
|
||||
BIT 6,C RES 5,E SET 4,L
|
||||
BIT 6,D RES 5,H SET 4,M
|
||||
BIT 6,E RES 5,L SET 4,A
|
||||
BIT 6,H RES 5,M SET 5,B
|
||||
BIT 6,L RES 5,A SET 5,C
|
||||
BIT 6,M RES 6,B SET 5,D
|
||||
BIT 6,A RES 6,C SET 5,E
|
||||
BIT 7,B RES 6,D SET 5,H
|
||||
BIT 7,C RES 6,E SET 5,L
|
||||
BIT 7,D RES 6,H SET 5,M
|
||||
BIT 7,E RES 6,L SET 5,A
|
||||
BIT 7,H RES 6,M SET 6,B
|
||||
BIT 7,L RES 6,A SET 6,C
|
||||
BIT 7,M RES 7,B SET 6,D
|
||||
BIT 7,A RES 7,C SET 6,E
|
||||
RES 0,B RES 7,D SET 6,H
|
||||
RES 0,C RES 7,E SET 6,L
|
||||
RES 0,D RES 7,H SET 6,M
|
||||
RES 0,E RES 7,L SET 6,A
|
||||
RES 0,H RES 7,M SET 7,B
|
||||
RES 0,L RES 7,A SET 7,C
|
||||
RES 0,M SET 0,B SET 7,D
|
||||
RES 0,A SET 0,C SET 7,E
|
||||
RES 1,B SET 0,D SET 7,H
|
||||
RES 1,C SET 0,E SET 7,L
|
||||
RES 1,D SET 0,H SET 7,M
|
||||
RES 1,E SET 0,L SET 7,A
|
||||
RES 1,H SET 0,M DADX B
|
||||
RES 1,L SET 0,A DADX D
|
||||
RES 1,M SET 1,B LXI X,06A4
|
||||
RES 1,A SET 1,C SIXD 06A4
|
||||
RES 2,B SET 1,D INX X
|
||||
RES 2,C SET 1,E DADX X
|
||||
RES 2,D SET 1,H LIXD 06A4
|
||||
RES 2,E SET 1,L DCX X
|
||||
RES 2,H SET 1,M INR [X+05]
|
||||
RES 2,L SET 1,A DCR [X+05]
|
||||
RES 2,M SET 2,B MVI [X+05],20
|
||||
RES 2,A SET 2,C DADX SP
|
||||
RES 3,B SET 2,D MOV B,[X+05]
|
||||
RES 3,C SET 2,E MOV C,[X+05]
|
||||
|
||||
|
||||
MOV D,[X+05] DSBC B DADY B
|
||||
MOV E,[X+05] SBCD 06A4 DADY D
|
||||
MOV H,[X+05] NEG LXI Y,06A4
|
||||
MOV L,[X+05] RETN SIYD 06A4
|
||||
MOV [X+05],B IM0 INX Y
|
||||
MOV [X+05],C LDIA DADY Y
|
||||
MOV [X+05],D INP C LIYD 06A4
|
||||
MOV [X+05],E OUTP C DCX Y
|
||||
MOV [X+05],H DADC B INR [Y+05]
|
||||
MOV [X+05],L LBCD 06A4 DCR [Y+05]
|
||||
MOV [X+05],A RETI MVI [Y+05],2
|
||||
MOV A,[X+05] LDRA DADY SP
|
||||
ADD [X+05] INP D MOV B,[Y+05]
|
||||
ADC [X+05] OUTP D MOV C,[Y+05]
|
||||
SUB [X+05] DSBC D MOV D,[Y+05]
|
||||
SBB [X+05] SDED 06A4 MOV E,[Y+05]
|
||||
ANA [X+05] IM1 MOV H,[Y+05]
|
||||
XRA [X+05] LDAI MOV L,[Y+05]
|
||||
ORA [X+05] INP E MOV [Y+05],B
|
||||
CMP [X+05] OUTP E MOV [Y+05],C
|
||||
POP X DADC D MOV [Y+05],D
|
||||
XTIX LDED 06A4 MOV [Y+05],E
|
||||
PUSH X IM2 MOV [Y+05],H
|
||||
PCIX LDAR MOV [Y+05],L
|
||||
SPIX INP H MOV [Y+05],A
|
||||
RLCR [X+05] OUTP H MOV A,[Y+05]
|
||||
RRCR [X+05] DSBC H ADD [Y+05]
|
||||
RALR [X+05] shld 06A4 ADC [Y+05]
|
||||
RARR [X+05] RRD SUB [Y+05]
|
||||
SLAR [X+05] INP L SBB [Y+05]
|
||||
SRAR [X+05] OUTP L ANA [Y+05]
|
||||
SRLR [X+05] DADC H XRA [Y+05]
|
||||
BIT 0,[X+05] lhld 06A4 ORA [Y+05]
|
||||
BIT 1,[X+05] RLD CMP [Y+05]
|
||||
BIT 2,[X+05] INP M POP Y
|
||||
BIT 3,[X+05] OUTP M XTIY
|
||||
BIT 4,[X+05] DSBC SP PUSH Y
|
||||
BIT 5,[X+05] SSPD 06A4 PCIY
|
||||
BIT 6,[X+05] INP A SPIY
|
||||
BIT 7,[X+05] OUTP A RLCR [Y+05]
|
||||
RES 0,[X+05] DADC SP RRCR [Y+05]
|
||||
RES 1,[X+05] LSPD 06A4 RALR [Y+05]
|
||||
RES 2,[X+05] LDI RARR [Y+05]
|
||||
RES 3,[X+05] CCI SLAR [Y+05]
|
||||
RES 4,[X+05] INI SRAR [Y+05]
|
||||
RES 5,[X+05] OTI SRLR [Y+05]
|
||||
RES 6,[X+05] LDD BIT 0,[Y+05]
|
||||
RES 7,[X+05] CCD BIT 1,[Y+05]
|
||||
SET 0,[X+05] IND BIT 2,[Y+05]
|
||||
SET 1,[X+05] OTD BIT 3,[Y+05]
|
||||
SET 2,[X+05] LDIR BIT 4,[Y+05]
|
||||
SET 3,[X+05] CCIR BIT 5,[Y+05]
|
||||
SET 4,[X+05] INIR BIT 6,[Y+05]
|
||||
SET 5,[X+05] OTIR BIT 7,[Y+05]
|
||||
SET 6,[X+05] LDDR RES 0,[Y+05]
|
||||
SET 7,[X+05] CCDR RES 1,[Y+05]
|
||||
INP B INDR RES 2,[Y+05]
|
||||
OUTP B OTDR RES 3,[Y+05]
|
||||
|
||||
|
||||
RES 4,[Y+05] SET 0,[Y+05] SET 4,[Y+05]
|
||||
RES 5,[Y+05] SET 1,[Y+05] SET 5,[Y+05]
|
||||
RES 6,[Y+05] SET 2,[Y+05] SET 6,[Y+05]
|
||||
RES 7,[Y+05] SET 3,[Y+05] SET 7,[Y+05]
|
||||
|
||||
; These are the result of disassembling 64180OPS.TRY
|
||||
; These opcodes are available ONLY on the 64180 CPU
|
||||
; DDTZ will both assemble and disassemble these.
|
||||
IN0 B,20 TST E MLT B
|
||||
OUT0 20,B IN0 H,20 MLT D
|
||||
TST B OUT0 20,H TSTI 20
|
||||
IN0 C,20 TST H MLT H
|
||||
OUT0 20,C IN0 L,20 TSIO 20
|
||||
TST C OUT0 20,L SLP
|
||||
IN0 D,20 TST L MLT SP
|
||||
OUT0 20,D TST M OTIM
|
||||
TST D IN0 A,20 OTDM
|
||||
IN0 E,20 OUT0 20,A OIMR
|
||||
OUT0 20,E TST A ODMR
|
||||
|
||||
; The following are UNDOCUMENTED z80 opcodes from XTDOPS.TRY.
|
||||
; DDTZ will disassemble these, but will not assemble them.
|
||||
; They use xh/xl (or yh/yl) as separate byte registers.
|
||||
; Use these at your own risk.
|
||||
INRX H ACXR H MOVY H,B
|
||||
DCRX H ACXR L MOVY H,C
|
||||
MVIX H,20 SUXR H MOVY H,D
|
||||
INRX L SUXR L MOVY H,E
|
||||
DCRX L SBXR H MOVY H,A
|
||||
MVIX L,20 SBXR L MOVY L,B
|
||||
MOVX B,H NDXR H MOVY L,C
|
||||
MOVX B,L NDXR L MOVY L,D
|
||||
MOVX C,H XRXR H MOVY L,E
|
||||
MOVX C,L XRXR L MOVY L,A
|
||||
MOVX D,H ORXR H MOVY A,H
|
||||
MOVX D,L ORXR L MOVY A,L
|
||||
MOVX E,H CPXR H ADYR H
|
||||
MOVX E,L CPXR L ADYR L
|
||||
MOVX H,B INRY H ACYR H
|
||||
MOVX H,C DCRY H ACYR L
|
||||
MOVX H,D MVIY H,20 SUYR H
|
||||
MOVX H,E INRY L SUYR L
|
||||
MOVX H,A DCRY L SBYR H
|
||||
MOVX L,B MVIY L,20 SBYR L
|
||||
MOVX L,C MOVY B,H NDYR H
|
||||
MOVX L,D MOVY B,L NDYR L
|
||||
MOVX L,E MOVY C,H XRYR H
|
||||
MOVX L,A MOVY C,L XRYR L
|
||||
MOVX A,H MOVY D,H ORYR H
|
||||
MOVX A,L MOVY D,L ORYR L
|
||||
ADXR H MOVY E,H CPYR H
|
||||
ADXR L MOVY E,L CPYR L
|
||||
|
||||
|
||||
Command Summary:
|
||||
===============
|
||||
|
||||
DDTZM command DDTZ command
|
||||
============= ============
|
||||
@ (base)
|
||||
A)ssemble first_address A
|
||||
B)egin {i.e., initialize stack and return} B
|
||||
C)ompare first_address,last_address,against_address C
|
||||
D)ump first_address[,last_address[,base]] D
|
||||
E)nter_in_memory first_address[,base] S)ubstitute
|
||||
F)ill first_address,last_address,value F
|
||||
G)o_to [address][,trap1[,trap2]] G
|
||||
H)ex_arithmetic value1(,value2) H
|
||||
L)oad_file (offset) R)ead
|
||||
M)ove first_address,last_address,destination M
|
||||
N)nput FCBs_command_line I)nput
|
||||
Q)uit (not avail)
|
||||
R)egister examine/change [register|flag] X)amine
|
||||
S)earch first_address,last_address,word W)hereis
|
||||
T)race_execution [count] T
|
||||
Untrace_execution [count] (i.e. do count instr) U)ntrace
|
||||
U)nassemble_code first_address[,last_address] L)ist code
|
||||
W)rite [first_address,last_address] K)eep
|
||||
X)amine {i.e. display memory parameters for application} Q)uery
|
||||
Y)our_option BC:=parm1,DE:=parm2,call_address Y
|
||||
Z)80_register_display Z
|
||||
|
||||
|
||||
If you find this program useful, contributions will be gratefully
|
||||
accepted and will encourage further development and release of
|
||||
useful CPM programs. My practice is to include source.
|
||||
|
||||
C.B. Falconer
|
||||
680 Hartford Turnpike,
|
||||
Hamden, Conn. 06517 (203) 281-1438
|
||||
|
||||
DDTZ and its associated documentation and other files are
|
||||
copyright (c) 1980-1988 by C.B. Falconer. They may be freely
|
||||
copied and used for non-commercial purposes ONLY.
|
||||
ôÙ
|
||||
514
Doc/FDU.txt
Normal file
514
Doc/FDU.txt
Normal file
@@ -0,0 +1,514 @@
|
||||
================================================================
|
||||
Floppy Disk Utility (FDU) v5.3 for RetroBrew Computers
|
||||
Disk IO / Zeta / Dual-IDE / N8 / RC2014 / SmallZ80 / Dyno
|
||||
================================================================
|
||||
|
||||
Updated January 5, 2020
|
||||
by Wayne Warthen (wwarthen@gmail.com)
|
||||
|
||||
Application to test the hardware functionality of the Floppy
|
||||
Disk Controller (FDC) on the ECB DISK I/O, DISK I/O V3, ZETA
|
||||
SBC, Dual IDE w/ Floppy, or N8 board.
|
||||
|
||||
The intent is to provide a testbed that allows direct testing
|
||||
of all possible media types and modes of access. The
|
||||
application supports read, write, and format by sector, track,
|
||||
and disk as well as a random read/write test.
|
||||
|
||||
The application supports access modes of polling, interrupt,
|
||||
INT/WAIT, and DRQ/WAIT. At present, it supports 3.5" media at
|
||||
DD (720KB) and HD (1.44MB) capacities. It also now supports
|
||||
5.25" media (720KB and 1.2MB) and 8" media (1.11MB) as well.
|
||||
Additional media will be added when I have time and access to
|
||||
required hardware. Not all modes are supported on all
|
||||
platforms and some modes are experimental in all cases.
|
||||
|
||||
In many ways this application is merely reinventing the wheel
|
||||
and performs functionality similar to existing applications,
|
||||
but I have not seen any other applications for RetroBrew
|
||||
Computers hardware that provide this range of functionality.
|
||||
|
||||
While the application is now almost entirely new code, I would
|
||||
like to acknowledge that much was derived from the previous
|
||||
work of Andrew Lynch and Dan Werner. I also want to credit
|
||||
Sergio Gimenez with testing the 5.25" drive support and Jim
|
||||
Harre with testing the 8" drive support. Support for Zeta 2
|
||||
comes from Segey Kiselev. Thanks!
|
||||
|
||||
General Usage
|
||||
-------------
|
||||
|
||||
In general, usage is self explanatory. At invocation, you
|
||||
must select the floppy disk controller (FDC) that you are
|
||||
using. Subsequently, the main menu allows you to set the
|
||||
unit, media, and mode to test. These settings MUST match your
|
||||
situation. Read, write, format, and verify functions are
|
||||
provided. A sub-menu will allow you to choose sector, track,
|
||||
disk, or random tests.
|
||||
|
||||
The verify function requires a little explanation. It will
|
||||
take the contents of the current in-memory disk buffer, save
|
||||
it, and compare it to the selected sectors. So, you must
|
||||
ensure that the sectors to be verified already have been
|
||||
written with the same pattern as the buffer contains. I
|
||||
typically init the buffer to a pattern, write the pattern to
|
||||
the entire disk, then verify the entire disk.
|
||||
|
||||
Another submenu is provided for FDC commands. This sub-menu
|
||||
allows you to send low-level commands directly to FDC. You
|
||||
*must* know what you are doing to use this sub-menu. For
|
||||
example, in order to read a sector using this sub-menu, you
|
||||
will need to perform specify, seek, sense int, and read
|
||||
commands specifying correct values (nothing is value checked
|
||||
in this menu).
|
||||
|
||||
Required Hardware/BIOS
|
||||
----------------------
|
||||
|
||||
Of course, the starting point is to have a supported hardware
|
||||
configuration. The following Z80 / Z180 based CPU boards are
|
||||
supported:
|
||||
|
||||
- SBC V1/2
|
||||
- Zeta
|
||||
- Zeta 2
|
||||
- N8
|
||||
- Mark IV
|
||||
- RC2014 w/ SMC
|
||||
- RC2014 w/ WDC
|
||||
- SmallZ80
|
||||
- Dyno
|
||||
|
||||
You must be using either a RomWBW or UBA based OS version.
|
||||
|
||||
You must have one of the following floppy disk controllers:
|
||||
|
||||
- Disk IO ECB Board FDC
|
||||
- Disk IO 3 ECB Board FDC
|
||||
- Dual-IDE ECB Board FDC
|
||||
- Zeta SBC onboard FDC
|
||||
- Zeta 2 SBC onboard FDC
|
||||
- N8 SBC onboard FDC
|
||||
- RC2014 Scott Baker SMC-based Floppy Module
|
||||
- RC2014 Scott Baker WDC-based Floppy Module
|
||||
|
||||
Finally, you will need a floppy drive connected via an
|
||||
appropriate cable:
|
||||
|
||||
Disk IO - no twist in cable, drive unit 0/1 must be selected by jumper on drive
|
||||
DISK IO 3, Zeta, Zeta 2, RC2014, Dyno - cable with twist, unit 0 after twist, unit 1 before twist
|
||||
DIDE, N8, Mark IV, SmallZ80 - cable with twist, unit 0 before twist, unit 1 after twist
|
||||
|
||||
Note that FDU does not utilize your systems ROM or OS to
|
||||
access the floppy system. FDU interacts directly with
|
||||
hardware. Upon exit, you may need to reset your OS to get the
|
||||
floppy system back into a state that is expected.
|
||||
|
||||
The Disk I/O should be jumpered as follows:
|
||||
|
||||
J1: depends on use of interrupt modes (see interrupt modes below)
|
||||
J2: pins 1-2, & 3-4 jumpered
|
||||
J3: hardware dependent timing for DMA mode (see DMA modes below)
|
||||
J4: pins 2-3 jumpered
|
||||
J5: off
|
||||
J6: pins 2-3 jumpered
|
||||
J7: pins 2-3 jumpered
|
||||
J8: off
|
||||
J9: off
|
||||
J10: off
|
||||
J11: off
|
||||
J12: off
|
||||
|
||||
Note that J1 can be left on even when not using interrupt
|
||||
modes. As long as the BIOS is OK with it, that is fine. Note
|
||||
also that J3 is only relevant for DMA modes, but also can be
|
||||
left in place when using other modes.
|
||||
|
||||
The Disk I/O 3 board should be jumpered at the default settings:
|
||||
|
||||
JP2: 3-4
|
||||
JP3: 1-2 for int mode support, otherwise no jumper
|
||||
JP4: 1-2, 3-4
|
||||
JP5: 1-2
|
||||
JP6: 1-2
|
||||
JP7: 1-2, 3-4
|
||||
|
||||
Zeta & Zeta 2 do not have any relevant jumper settings. The
|
||||
hardwired I/O ranges are assumed in the code.
|
||||
|
||||
The Dual-IDE board should be jumpered as follows:
|
||||
|
||||
K3 (DT/R or /RD): /RD
|
||||
P5 (bd ID): 1-2, 3-4 (for $20-$3F port range)
|
||||
|
||||
There are no specific N8 jumper settings, but the default
|
||||
I/O range starting at $80 is assumed in the published code.
|
||||
|
||||
The RC2014 Scott Baker SMC-based floppy module should be jumpered
|
||||
for I/O base address 0x50 (SV1: 11-12), JP1 (TS) shorted,
|
||||
JP2 (/FAULT) shorted, JP3 (MINI): 2-3, JP4 (/DC/RDY): 2-3.
|
||||
|
||||
The RC2014 Scott Baker WDC-based floppy module should be jumpered
|
||||
for I/O base address 0x50 (SV1: 11-12), JP1 (/DACK): 1-2,
|
||||
JP2 (TC): 2-3.
|
||||
|
||||
SmallZ80 does not have any relevant jumper settings. The
|
||||
hardwired I/O ranges are assumed in the code.
|
||||
|
||||
Dyno does not have any relevant jumper settings. The
|
||||
hardwired I/O ranges are assumed in the code.
|
||||
|
||||
Modes of Operation
|
||||
------------------
|
||||
|
||||
You can select the following test modes. Please refer to the
|
||||
chart that follows to determine which modes should work with
|
||||
combinations of Z80 CPU speed and media format.
|
||||
|
||||
WARNING: In general, only the polling mode is considered fully
|
||||
reliable. The other modes are basically experimental and
|
||||
should only be used if you know exactly what you are doing.
|
||||
|
||||
Polling: Traditional polled input/output. Works well and very
|
||||
reliable with robust timeouts and good error recovery. Also,
|
||||
the slowest performance which precludes it from being used
|
||||
with 1.44MB floppy on a 4MHz Z80. This is definitely the mode
|
||||
you want to get working before any others. It does not require
|
||||
J1 (interrupt enable) on DISK I/O and does not care about the
|
||||
setting of J3.
|
||||
|
||||
Interrupt: Relies on FDC interrupts to determine when a byte
|
||||
is ready to be read/written. It does *not* implement a
|
||||
timeout during disk operations. For example, if there is no
|
||||
disk in the drive, this mode will just hang until a disk is
|
||||
inserted. This mode *requires* that the host has interrupts
|
||||
active using interrupt mode 1 (IM1) and interrupts attached to
|
||||
the FDC controller. The BIOS must be configured to handle
|
||||
these interrupts safely.
|
||||
|
||||
Fast Interrupt: Same as above, but sacrifices additional
|
||||
reliability for faster operation. This mode will allow a
|
||||
1.44MB floppy to work with a 4MHz Z80 CPU. However, if any
|
||||
errors occur (even a transient read error which is not
|
||||
unusual), this mode will hang. The same FDC interrupt
|
||||
requirements as above are required.
|
||||
|
||||
INT/WAIT: Same as Fast Interrupt, but uses CPU wait instead of
|
||||
actual interrupt. This mode is exclusive to the original Disk
|
||||
IO board. It is subject to all the same issues as Fast
|
||||
Interrupt, but does not need J1 shorted. J3 is irrelevant.
|
||||
|
||||
DRQ/WAIT: Uses pseudo DMA to handle input/output. Does not
|
||||
require that interrupts (J1) be enabled on the DISK I/O.
|
||||
However, it is subject to all of the same reliability issues
|
||||
as "Fast Interrupt". This mode is exclusive to the original
|
||||
Disk IO board. At present, the mode is *not* implemented!
|
||||
|
||||
The chart below attempts to describe the combinations that
|
||||
work for me. By far, the most reliable mode is Polling, but
|
||||
it requires 8MHz CPU for HD disks.
|
||||
|
||||
DRQ/WAIT --------------------------------+
|
||||
INT/WAIT -----------------------------+ |
|
||||
Fast Interrupt --------------------+ | |
|
||||
Interrupt ----------------------+ | | |
|
||||
Polling ---------------------+ | | | |
|
||||
| | | | |
|
||||
CPU Speed --------------+ | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
|
||||
3.5" DD (720K) ------ 4MHz Y Y Y Y X
|
||||
8MHz+ Y Y Y Y X
|
||||
|
||||
3.5" HD (1.44M) ----- 4MHz N N Y Y X
|
||||
8MHz+ Y Y Y Y X
|
||||
|
||||
5.25" DD (360K) ----- 4MHz Y Y Y Y X
|
||||
8MHz+ Y Y Y Y X
|
||||
|
||||
5.25" HD (1.2M) ----- 4MHz N N Y Y X
|
||||
8MHz+ Y Y Y Y X
|
||||
|
||||
8" DD (1.11M) ------- 4MHz N N Y Y X
|
||||
8MHz+ Y Y Y Y X
|
||||
|
||||
Y = Yes, works
|
||||
N = No, does not work
|
||||
X = Experimental, probably won't work
|
||||
|
||||
Tracing
|
||||
-------
|
||||
|
||||
Command/result activity to/from the FDC will be written out if
|
||||
the trace setting is changed from '00' to '01' in setup.
|
||||
Additionally, if a command failure is detected on any command,
|
||||
that specific comand and results are written regardless of the
|
||||
trace setting.
|
||||
|
||||
The format of the line written is:
|
||||
<OPERATION>: <COMMAND BYTES> --> <RESULT BYTES> [<RESULT>]
|
||||
|
||||
For example, this is the output of a normal read operation:
|
||||
READ: 46 01 00 00 01 02 09 1B FF --> 01 00 00 00 00 02 02 [OK]
|
||||
|
||||
Please refer to the i8272 data sheet for information on the
|
||||
command and result bytes.
|
||||
|
||||
Note that the sense interrupt command can return a non-OK
|
||||
result. This is completely normal in some cases. It is
|
||||
necessary to "poll" the drive for seek status using sense
|
||||
interrupt. If there is nothing to report, then the result
|
||||
will be INVALID COMMAND. Additionally, during a recalibrate
|
||||
operation, it may be necessary to issue the command twice
|
||||
because the command will only step the drive 77 times looking
|
||||
for track 0, but the head may be up to 80 tracks away. In
|
||||
this case, the first recalibrate fails, but the second should
|
||||
succeed. Here is what this would look like if trace is turned
|
||||
on:
|
||||
|
||||
RECALIBRATE: 07 01 --> <EMPTY> [OK]
|
||||
SENSE INTERRUPT: 08 --> 80 [INVALID COMMAND]
|
||||
...
|
||||
...
|
||||
...
|
||||
SENSE INTERRUPT: 08 --> 80 [INVALID COMMAND]
|
||||
SENSE INTERRUPT: 08 --> 71 00 [ABNORMAL TERMINATION]
|
||||
RECALIBRATE: 07 01 --> <EMPTY> [OK]
|
||||
SENSE INTERRUPT: 08 --> 21 00 [OK]
|
||||
|
||||
Another example is when the FDC has just been reset. In this
|
||||
case, you will see up to 4 disk change errors. Again these
|
||||
are not a real problem and to be expected.
|
||||
|
||||
When tracing is turned off, the application tries to be
|
||||
intelligent about error reporting. The specific errors from
|
||||
sense interrupt documented above will be suppressed because
|
||||
they are not a real problem. All other errors will be
|
||||
displayed.
|
||||
|
||||
Error Handling
|
||||
--------------
|
||||
|
||||
There is no automated error retry logic. This is very
|
||||
intentional since the point is to expose the controller and
|
||||
drive activity. Any error detected will result in a prompt to
|
||||
abort, retry, or continue. Note that some number of errors is
|
||||
considered normal for this technology. An occasional error
|
||||
would not necessarily be considered a problem.
|
||||
|
||||
CPU Speed
|
||||
---------
|
||||
|
||||
Starting with v5.0, the application adjusts it's timing loops
|
||||
to the actual system CPU speed by querying the BIOS for the
|
||||
current CPU speed.
|
||||
|
||||
Interleave
|
||||
----------
|
||||
|
||||
The format command now allows the specification of a sector
|
||||
interleave. It is almost always the case that the optimal
|
||||
interleave will be 2 (meaning 2:1).
|
||||
|
||||
360K Media
|
||||
----------
|
||||
|
||||
The 360K media definition should work well for true 360K
|
||||
drives. However, it will generally not work with 1.2M
|
||||
drives. This is because these drives spin at 360RPM instead
|
||||
of the 300RPM speed of true 360K drives. Additionally, 1.2M
|
||||
drives are 80 tracks and 360K drives are 40 tracks and, so
|
||||
far, there is no mechanism in FD to "double step" as a way to
|
||||
use 40 track media in 80 track drives.
|
||||
|
||||
With this said, it is possible to configure some 1.2M 5.25"
|
||||
drives to automatically spin down to 300RPM based on a density
|
||||
select signal (DENSEL). This signal is asserted by FD for
|
||||
360K media, so IF you have configured your drive to react to
|
||||
this signal correctly, you will be able to use the 360K media
|
||||
defintion. Most 1.2M 5.25" drives are NOT configured this way
|
||||
by default. TEAC drives are generally easy to modify and have
|
||||
been tested by the author and do work in this manner. Note
|
||||
that this does not address the issue of double stepping above;
|
||||
you will just be using the first 40 of 80 tracks.
|
||||
|
||||
Support
|
||||
-------
|
||||
|
||||
I am happy to answer questions as fast and well as I am able.
|
||||
Best contact is wwarthen@gmail.com or post something on the
|
||||
RetroBrew Computers Forum
|
||||
https://www.retrobrewcomputers.org/forum/.
|
||||
|
||||
Changes
|
||||
-------
|
||||
|
||||
WW 8/12/2011
|
||||
|
||||
Removed call to pulse TC in the FDC initialization after
|
||||
determining that it periodically caused the FDC to write bad
|
||||
sectors. I am mystified by this, but definitely found it to
|
||||
be true. Will revisit at some point -- probably a timing
|
||||
issue between puslsing TC and whatever happens next.
|
||||
|
||||
Non-DMA mode was being set incorrectly for FAST-DMA mode. It
|
||||
was set for non-DMA even though we were doing DMA. It is
|
||||
interesting that it worked fine anyway. Fixed it anyway.
|
||||
|
||||
DIO_SETMEDIA was not clearing DCD_DSKRDY as it should. Fixed.
|
||||
|
||||
WW 8/26/2011: v1.1
|
||||
|
||||
Added support for Zeta. Note that INT/WAIT and DRQ/WAIT are
|
||||
not available on Zeta. Note that Zeta provides the ability to
|
||||
perform a reset of the FDC independent of a full CPU reset.
|
||||
This is VERY useful and the FDC is reset anytime a drive reset
|
||||
is required.
|
||||
|
||||
Added INT/WAIT support.
|
||||
|
||||
WW 8/28/2011: V1.2
|
||||
|
||||
All changes in this version are Zeta specific. Fixed FDC
|
||||
reset logic and motor status display for Zeta (code from
|
||||
Sergey).
|
||||
|
||||
Modified Zeta disk change display to include it in the command
|
||||
output line. This makes more sense because a command must be
|
||||
issued to select the desired drive first. You can use the
|
||||
SENSE INT command id you want to check the disk change value
|
||||
at any time. It will also be displayed with any other command
|
||||
output display.
|
||||
|
||||
WW 9/1/2011: V1.3
|
||||
|
||||
Added CPUFREQ configuration setting to tune delays based on
|
||||
cpu speed. The build app is set for 8MHz which also seems to
|
||||
work well for 4MHz CPU's. Faster CPU speeds will probably
|
||||
require tuning this setting.
|
||||
|
||||
WW 9/5/2011: V1.4
|
||||
|
||||
Changed the polling execution routines to utilize CPUFREQ
|
||||
variable to optimize timeout counter. Most importantly, this
|
||||
should allow the use of faster CPUs (like 20MHz).
|
||||
|
||||
WW 9/19/2011: V1.5
|
||||
|
||||
Zeta changes only. Added a call to FDC RESET after any
|
||||
command failure. This solves an issue where the drive remains
|
||||
selected if a command error occurs. Also added FDC RESET to
|
||||
FDC CONTROL menu.
|
||||
|
||||
WW 10/7/2011: V2.0
|
||||
|
||||
Added support for DIDE. Only supports polling IO and it does
|
||||
not appear any other modes are possible given the hardware
|
||||
constraints.
|
||||
|
||||
WW 10/13/2011: V2.1
|
||||
|
||||
Modified to support N8. N8 is essentially identical to Dual
|
||||
IDE. The only real change is the IO addresses. In theory, I
|
||||
should be able to support true DMA on N8 and will work on that.
|
||||
|
||||
WW 10/20/2011: v2.2
|
||||
|
||||
I had some problems with the results being read were sometimes
|
||||
missing a byte. Fixed this by taking a more strict approach
|
||||
to watching the MSR for the exact bits that are expected.
|
||||
|
||||
WW 10/22/2011: V2.3
|
||||
|
||||
After spending a few days trying to track down an intermittent
|
||||
data corruption issue with my Dual IDE board, I added a verify
|
||||
function. This helped me isolate the problem very nicely
|
||||
(turned out to be interference from the bus monitor).
|
||||
|
||||
WW 11/25/2011: V2.4
|
||||
|
||||
Preliminary support for DISKIO V3. Basically just assumed
|
||||
that it operates just like the Zeta. Needs to be verified
|
||||
with real hardware as soon as I can.
|
||||
|
||||
WW 1/9/2012: V2.5
|
||||
|
||||
Modified program termination to use CP/M reset call so that a
|
||||
warm start is done and all drives are logged out. This is
|
||||
important because media may have been formatted during the
|
||||
program execution.
|
||||
|
||||
WW 2/6/2012: v2.6
|
||||
|
||||
Added support for 5.25" drives as tested by Sergio.
|
||||
|
||||
WW 4/5/2012: v2.7
|
||||
|
||||
Added support for 8" drives as tested by Jim Harre.
|
||||
|
||||
WW 4/6/2012: v2.7a
|
||||
|
||||
Fixed issue with media selection menu to remove duplicate
|
||||
entries.
|
||||
|
||||
WW 4/8/2012: v2.7b
|
||||
|
||||
Corrected the handling of the density select signal.
|
||||
|
||||
WW 5/22/2012: v2.8
|
||||
|
||||
Added new media definitions (5.25", 320K).
|
||||
|
||||
WW 6/1/2012: v2.9
|
||||
|
||||
Added interleave capability on format.
|
||||
|
||||
WW 6/5/2012: v3.0
|
||||
|
||||
Documentation cleanup.
|
||||
|
||||
WW 7/1/2012: v3.1
|
||||
|
||||
Modified head load time (HLT) for 8" media based on YD-180
|
||||
spec. Now set to 50ms.
|
||||
|
||||
WW 6/17/2013: v3.2
|
||||
|
||||
Cleaned up SRT, HLT, and HUT values.
|
||||
|
||||
SK 2/10/2015: v3.3
|
||||
|
||||
Added Zeta SBC v2 support (Sergey Kiselev)
|
||||
|
||||
WW 3/25/2015: v4.0
|
||||
|
||||
Renamed from FDTST --> FD
|
||||
|
||||
WW 9/2/2017: v5.0
|
||||
|
||||
Renamed from FD to FDU.
|
||||
Added runtime selection of FDC hardware.
|
||||
Added runtime timing adjustment.
|
||||
|
||||
WW 12/16/2017: v5.1
|
||||
|
||||
Improved polling version of read/write to fix occasional overrun errors.
|
||||
|
||||
WW 1/8/2018: v5.2
|
||||
|
||||
Added support for RC2014 hardware:
|
||||
- Scott Baker SMC 9266 FDC module
|
||||
- Scott Baker WDC 37C65 FDC module
|
||||
|
||||
WW 9/5/2018: v5.3
|
||||
- Removed use of pulsing TC to end R/W operations after one sector and
|
||||
instead set EOT = R (sector number) so that after desired sector is
|
||||
read, R/W stops with end of cylinder error which is a documented
|
||||
method for controling number of sectors R/W. This specific termination
|
||||
condition is no longer considered an error, but a successful end of
|
||||
operation.
|
||||
- Added support for SmallZ80
|
||||
|
||||
WW 5/1/2020: v5.4
|
||||
- Added support for Dyno (based on work by Steve Garcia)
|
||||
BIN
Doc/FDisk Manual.pdf
Normal file
BIN
Doc/FDisk Manual.pdf
Normal file
Binary file not shown.
429
Doc/FdTst.txt
429
Doc/FdTst.txt
@@ -1,429 +0,0 @@
|
||||
================================================================
|
||||
FDTST v3.1 for N8VEM DISKIO / DISKIO V3 / ZETA / DIDE / N8
|
||||
================================================================
|
||||
|
||||
Updated JuLY 1, 2012
|
||||
by Wayne Warthen (wwarthen@gmail.com)
|
||||
|
||||
Application to test the hardware functionality of the Floppy Disk
|
||||
Controller (FDC) on the ECB DISK I/O, DISK I/O V3, ZETA SBC,
|
||||
Dual IDE w/ Floppy, or N8 board.
|
||||
|
||||
The intent is to provide a testbed that allows direct testing
|
||||
of all possible media types and modes of access. The application
|
||||
supports read, write, and format by sector, track, and disk as
|
||||
well as a random read/write test.
|
||||
|
||||
The application supports access modes of polling, interrupt,
|
||||
INT/WAIT, and DRQ/WAIT. At present, it supports 3.5" media at DD (720KB) and
|
||||
HD (1.44MB) capacities. It also now supports 5.25" media (720KB and 1.2MB)
|
||||
and 8" media (1.11MB) as well. Additonal media will be added when I have
|
||||
time and access to required hardware. Not all modes are supported
|
||||
on all platforms and some modes are experimental in all cases.
|
||||
|
||||
In many ways this application is merely reinventing the wheel and
|
||||
performs functionality similer to existing applications, but I have
|
||||
not seen any other applications for DISK I/O that provide this range
|
||||
of functionality.
|
||||
|
||||
While the application is now almost entirely new code, I would like to
|
||||
acknowledge that much was derived from the previous work of Andrew Lynch
|
||||
and Dan Werner. I also want to credit Sergio Gimenez with testing the 5.25"
|
||||
drive support and Jim Harre with testing the 8" drive support. Thanks!
|
||||
|
||||
General Usage
|
||||
-------------
|
||||
|
||||
In general, usage is self explanatory. The main menu allows you to set
|
||||
the unit, media, and mode to test. These settings MUST match your
|
||||
situation. Read, write, format, and verify functions are provided. A sub-menu
|
||||
will allow you to choose sector, track, disk, or random tests.
|
||||
|
||||
The verify function requires a little explanation. It will take the contents
|
||||
of the buffer, save it, and compare it to the selected sectors. So, you
|
||||
must ensure that the sectors to be verified already have been written
|
||||
with the same pattern as the buffer contains. I typically init the buffer
|
||||
to a pattern, write the pattern to the entire disk, then verify the entire
|
||||
disk.
|
||||
|
||||
Another submenu is provided for FDC commands. This sub-menu allows you to
|
||||
send low-level commands directly to FDC. You MUST know what you are doing
|
||||
to use this sub-menu. For example, in order to read a sector using this
|
||||
sub-menu, you will need to perform specify, seek, sense int, and read
|
||||
commands specifying correct values (nothing is value checked in this menu).
|
||||
|
||||
Required Hardware/BIOS
|
||||
----------------------
|
||||
|
||||
Of course, the starting point is one of the support hardware platforms.
|
||||
You need to start with either an N8VEM SBC, backplane, and ECB DISK I/O
|
||||
card or a Zeta SBC. Additionally, a floppy drive connected via an
|
||||
appropriate cable:
|
||||
|
||||
DISKIO - no twist in cable, drive unit 0/1 must be selected by jumper on drive
|
||||
ZETA - cable with twist, unit 0 after twist, unit 1 before twist
|
||||
DIDE/N8 - cable with twist, unit 0 before twist, unit 1 after twist
|
||||
|
||||
|
||||
It is preferable that the BIOS you use does not have DISK I/O support
|
||||
enabled since the application assumes it has complete control of the
|
||||
DISK I/O hardware.
|
||||
|
||||
The DISK I/O should be jumpered as follows:
|
||||
|
||||
J1: depends on use of interrupt modes (see interrupt modes below)
|
||||
J2: pins 1-2, & 3-4 jumpered
|
||||
J3: hardware dependent timing for DMA mode (see DMA modes below)
|
||||
J4: pins 2-3 jumpered
|
||||
J5: off
|
||||
J6: pins 2-3 jumpered
|
||||
J7: pins 2-3 jumpered
|
||||
J8: off
|
||||
J9: off
|
||||
J10: off
|
||||
J11: off
|
||||
J12: off
|
||||
|
||||
Note that J1 can be left on even when not using interrupt modes. As
|
||||
long as the BIOS is OK with it, that is fine. Note also that J3 is
|
||||
only relevant for DMA modes, but also can be left in place when
|
||||
using other modes.
|
||||
|
||||
The DISK I/O V3 should be jumpered at the default settings:
|
||||
|
||||
JP2: 3-4
|
||||
JP3: 1-2 for int mode support, otherwise no jumper
|
||||
JP4: 1-2, 3-4
|
||||
JP5: 1-2
|
||||
JP6: 1-2
|
||||
JP7: 1-2, 3-4
|
||||
|
||||
Zeta does not have any relevant jumper settings.
|
||||
|
||||
DIDE should be jumpered as follows:
|
||||
|
||||
K3 (DT/R or /RD): /RD
|
||||
P5 (bd ID): 1-2, 3-4 (for $20-$3F port range)
|
||||
|
||||
There are no specific N8 jumper settings, but the default
|
||||
I/O range starting at $80 is assumed in the published code.
|
||||
|
||||
|
||||
Modes of Operation
|
||||
------------------
|
||||
|
||||
You can select the following test modes. Please refer to the chart
|
||||
that follows to determine which modes should work with combinations
|
||||
of Z80 CPU speed and media format.
|
||||
|
||||
Polling: Traditional polled input/output. Works well and very reliable
|
||||
including timeouts and good error recovery. Also, the slowest performance
|
||||
which precludes it from being used with 1.44MB floppy on a 4MHz Z80.
|
||||
This is definitely the mode you want to get working before any others.
|
||||
It does not require J1 (interrupt enable) on DISK I/O and does not care about
|
||||
the setting of J3.
|
||||
|
||||
Interrupt: Input/output is interrupt driven. Works pretty well, but
|
||||
is not able to recover from some errors. For example, if there is
|
||||
no disk in the drive, this mode will just hang until a disk is inserted.
|
||||
This mode REQUIRES that interrupts be enabled on the DISK I/O via
|
||||
jumper at J1. On Zeta it requires the INT/NMI jumper be set for
|
||||
INT. Mode not supported on DIDE or N8. Some BIOS variants will not
|
||||
handle interrupts during boot.
|
||||
|
||||
Fast Interrupt: As above, but sacrifices additional reliability for
|
||||
faster operation. This mode will allow a 1.44MB floppy to work
|
||||
with a 4MHz Z80 CPU. However, if any errors occur (even a transient
|
||||
read error which is not unusual), this mode will hang. As above
|
||||
you MUST have the appropriate jumpers for DISKIO and Zeta. DIDE
|
||||
does not support this mode.
|
||||
|
||||
INT/WAIT: Same as Fast Interrupt, but uses CPU wait instead of
|
||||
actual interrupt. Subject to all the same issues as Fast
|
||||
Interrupt, but does not need J1 shorted. J3 is irrelevant.
|
||||
This mode is available on only on DISKIO (and not DISKIO V3).
|
||||
|
||||
DRQ/WAIT: Uses pseudo DMA to handle input/output. Does not require that
|
||||
interrupts (J1) be enabled on the DISK I/O. However, it is subject to
|
||||
all of the same reliability issues as "Fast Interrupt". This
|
||||
mode is known to not work on N8VEM DISKIO!!! It is included
|
||||
for testing only. It is dependent on setting of J3. This
|
||||
mode is NOT available on Zeta, DIDE, N8, or DISKIO V3.
|
||||
|
||||
The chart below attempts to describe the combinations that
|
||||
work for me. By far, the most reliable mode is Polling,
|
||||
but it requires 8MHz CPU for HD disks.
|
||||
|
||||
DRQ/WAIT --------------------------------+
|
||||
INT/WAIT -----------------------------+ |
|
||||
Fast Interrupt --------------------+ | |
|
||||
Interrupt ----------------------+ | | |
|
||||
Polling ---------------------+ | | | |
|
||||
| | | | |
|
||||
CPU Speed --------------+ | | | | |
|
||||
| | | | | |
|
||||
| | | | | |
|
||||
|
||||
3.5" DD (720K) ------ 4MHz Y Y Y Y X
|
||||
8MHz+ Y Y Y Y X
|
||||
|
||||
3.5" HD (1.44M) ----- 4MHz N N Y Y X
|
||||
8MHz+ Y Y Y Y X
|
||||
|
||||
5.25" DD (360K) ----- 4MHz Y Y Y Y X
|
||||
8MHz+ Y Y Y Y X
|
||||
|
||||
5.25" HD (1.2M) ----- 4MHz N N Y Y X
|
||||
8MHz+ Y Y Y Y X
|
||||
|
||||
8" DD (1.11M) ------- 4MHz N N Y Y X
|
||||
8MHz+ Y Y Y Y X
|
||||
|
||||
Y = Yes, works
|
||||
N = No, does not work
|
||||
X = Experimental, probably won't work
|
||||
|
||||
Tracing
|
||||
-------
|
||||
|
||||
Command/result activity to/from the FDC will be written out
|
||||
if the trace setting is changed from '00' to '01' in setup.
|
||||
Additionally, if a command failure is detected on any
|
||||
command, that specific comand and results are written
|
||||
regardless of the trace setting.
|
||||
|
||||
The format of the line written is:
|
||||
<OPERATION>: <COMMAND BYTES> --> <RESULT BYTES> [<RESULT>]
|
||||
|
||||
For example, this is the output of a normal read operation:
|
||||
READ: 46 01 00 00 01 02 09 1B FF --> 01 00 00 00 00 02 02 [OK]
|
||||
|
||||
Please refer to the i8272 data sheet for information on the
|
||||
command and result bytes.
|
||||
|
||||
Note that the sense interrupt command can return a non-OK
|
||||
result. This is completely normal in some cases. It is
|
||||
necessary to "poll" the drive for seek status using
|
||||
sense interrupt. If there is nothing to report, then
|
||||
the result will be INVALID COMMAND. Additionally,
|
||||
during a recalibrate operation, it may be necessary to
|
||||
issue the command twice because the command will only step
|
||||
the drive 77 times looking for track 0, but the head may be
|
||||
up to 80 tracks away. In this case, the first recalibrate
|
||||
fails, but the second should succeed. Here is what this
|
||||
would look like if trace is turned on:
|
||||
|
||||
RECALIBRATE: 07 01 --> <EMPTY> [OK]
|
||||
SENSE INTERRUPT: 08 --> 80 [INVALID COMMAND]
|
||||
...
|
||||
...
|
||||
...
|
||||
SENSE INTERRUPT: 08 --> 80 [INVALID COMMAND]
|
||||
SENSE INTERRUPT: 08 --> 71 00 [ABNORMAL TERMINATION]
|
||||
RECALIBRATE: 07 01 --> <EMPTY> [OK]
|
||||
SENSE INTERRUPT: 08 --> 21 00 [OK]
|
||||
|
||||
Another example is when the FDC has just been reset. In
|
||||
this case, you will see up to 4 disk change errors. Again
|
||||
these are not a real problem and to be expected.
|
||||
|
||||
When tracing is turned off, the application tries to be
|
||||
intelligent about error reporting. The specific errors
|
||||
from sense interrupt documented above will be suppressed
|
||||
because they are not a real problem. All other
|
||||
errors will be displayed.
|
||||
|
||||
Error Handling
|
||||
--------------
|
||||
|
||||
There is no automated error retry logic. This is very
|
||||
intentional since the point is to expose the controller
|
||||
and drive activity. Any error detected will result in
|
||||
a prompt to abort, retry, or continue. Note that some
|
||||
number of errors is considered normal for this
|
||||
technology. An occasional error would not necessarily
|
||||
be considered a problem.
|
||||
|
||||
CPU Speed
|
||||
---------
|
||||
|
||||
I distribute the binary version of the application optimized for
|
||||
20MHz CPUs. There is a configuration variable called CPUFREQ
|
||||
at the top of the source file. Ideally, you should build
|
||||
with that set appropriately. However, I have found that the
|
||||
default build setting of 20MHz seems to work for 4-20MHz CPUs.
|
||||
|
||||
Interleave
|
||||
----------
|
||||
|
||||
The format command now allows the specification of a sector
|
||||
interleave. It is almost always the case that the optimal
|
||||
interleave will be 2 (meaning 2:1).
|
||||
|
||||
360K Media
|
||||
----------
|
||||
|
||||
The 360K media definition should work well for true 360K
|
||||
drives. However, it will generally not work
|
||||
with 1.2M drives. This is because these drives spin at 360RPM
|
||||
instead of the 300RPM speed of true 360K drives. Additionally,
|
||||
1.2M drives are 80 tracks and 360K drives are 40 tracks and, so
|
||||
far, there is no mechanism in FDTST to "double step" as a way
|
||||
to use 40 track media in 80 track drives.
|
||||
|
||||
With this said, it is possible to configure some 1.2M 5.25" drives
|
||||
to automatically spin down to 300RPM based on a density select
|
||||
signal (DENSEL). This signal is asserted by FDTST for 360K
|
||||
media, so IF you have configured your drive to react to this
|
||||
signal correctly, you will be able to use the 360K media defintion.
|
||||
Most 1.2M 5.25" drives are NOT configured this way by default.
|
||||
TEAC drives are generally easy to modify and have been tested by
|
||||
the author and do work in this manner. Note that this does not
|
||||
address the issue of double stepping above; you will just be
|
||||
using the first 40 of 80 tracks.
|
||||
|
||||
Support
|
||||
-------
|
||||
|
||||
I am happy to answer questions as fast and well as I am able.
|
||||
Best contact is wwarthen@gmail.com or post something on the
|
||||
N8VEM Google Group https://groups.google.com/forum/#!forum/n8vem.
|
||||
|
||||
Changes
|
||||
-------
|
||||
|
||||
WW 8/12/2011
|
||||
|
||||
Removed call to pulse TC in the FDC initialization
|
||||
after determining that it periodically caused the FDC to write
|
||||
bad sectors. I am mystified by this, but definitely found it
|
||||
to be true. Will revisit at some point -- probably a timing
|
||||
issue between puslsing TC and whatever happens next.
|
||||
|
||||
Non-DMA mode was being set incorrectly for FAST-DMA mode.
|
||||
It was set for non-DMA even though we were doing DMA. It is
|
||||
interesting that it worked fine anyway. Fixed it anyway.
|
||||
|
||||
DIO_SETMEDIA was not clearing DCD_DSKRDY as it should. Fixed.
|
||||
|
||||
WW 8/26/2011: v1.1
|
||||
|
||||
Added support for Zeta. Note that INT/WAIT and DRQ/WAIT are
|
||||
not available on Zeta. Note that Zeta provides the ability
|
||||
to perform a reset of the FDC independent of a full CPU
|
||||
reset. This is VERY useful and the FDC is reset anytime
|
||||
a drive reset is required.
|
||||
|
||||
Added INT/WAIT support.
|
||||
|
||||
WW 8/28/2011: V1.2
|
||||
|
||||
All changes in this version are Zeta specific. Fixed FDC reset
|
||||
logic and motor status display for Zeta (code from Sergey).
|
||||
|
||||
Modified Zeta disk change display to include it in the
|
||||
command output line. This makes more sense because a command
|
||||
must be issued to select the desired drive first. You can
|
||||
use the SENSE INT command id you want to check the disk
|
||||
change value at any time. It will also be displayed with
|
||||
any other command output display.
|
||||
|
||||
WW 9/1/2011: V1.3
|
||||
|
||||
Added CPUFREQ configuration setting to tune
|
||||
delays based on cpu speed. The build app
|
||||
is set for 8MHz which also seems to work well
|
||||
for 4MHz CPU's. Faster CPU speeds will
|
||||
probably require tuning this setting.
|
||||
|
||||
WW 9/5/2011: V1.4
|
||||
|
||||
Changed the polling execution routines to utilize CPUFREQ
|
||||
variable to optimize timeout counter. Most importantly,
|
||||
this should allow the use of faster CPUs (like 20MHz).
|
||||
|
||||
WW 9/19/2011: V1.5
|
||||
|
||||
Zeta changes only. Added a call to FDC RESET after any
|
||||
command failure. This solves an issue where the drive
|
||||
remains selected if a command error occurs. Also
|
||||
added FDC RESET to FDC CONTROL menu.
|
||||
|
||||
WW 10/7/2011: V2.0
|
||||
|
||||
Added support for DIDE. Only supports polling IO and it
|
||||
does not appear any other modes are possible given the
|
||||
hardware constraints.
|
||||
|
||||
WW 10/13/2011: V2.1
|
||||
|
||||
Modified to support N8. N8 is essentially identical to
|
||||
Dual IDE. The only real change is the IO addresses. In
|
||||
theory, I should be able to support true DMA on N8 and
|
||||
will work on that.
|
||||
|
||||
WW 10/20/2011: v2.2
|
||||
|
||||
I had some problems with the results being read were
|
||||
sometimes missing a byte. Fixed this by taking a more
|
||||
strict approach to watching the MSR for the exact
|
||||
bits that are expected.
|
||||
|
||||
WW 10/22/2011: V2.3
|
||||
|
||||
After spending a few days trying to track down an
|
||||
intermittent data corruption issue with my Dual IDE
|
||||
board, I added a verify function. This helped
|
||||
me isolate the problem very nicely (turned out to
|
||||
be interference from the bus monitor).
|
||||
|
||||
WW 11/25/2011: V2.4
|
||||
|
||||
Preliminary support for DISKIO V3. Basically just
|
||||
assumed that it operates just like the Zeta. Needs
|
||||
to be verified with real hardware as soon as I can.
|
||||
|
||||
WW 1/9/2012: V2.5
|
||||
|
||||
Modified program termination to use CP/M reset
|
||||
call so that a warm start is done and all
|
||||
drives are logged out. This is important
|
||||
because media may have been formatted during
|
||||
the program execution.
|
||||
|
||||
WW 2/6/2012: v2.6
|
||||
|
||||
Added support for 5.25" drives as tested by
|
||||
Sergio.
|
||||
|
||||
WW 4/5/2012: v2.7
|
||||
|
||||
Added support for 8" drives as tested by
|
||||
Jim Harre.
|
||||
|
||||
WW 4/6/2012: v2.7a
|
||||
|
||||
Fixed issue with media selection menu to remove
|
||||
duplicate entries.
|
||||
|
||||
WW 4/8/2012: v2.7b
|
||||
|
||||
Corrected the handling of the density select
|
||||
signal.
|
||||
|
||||
WW 5/22/2012: v2.8
|
||||
|
||||
Added new media definitions (5.25", 320K)
|
||||
|
||||
WW 6/1/2012: v2.9
|
||||
|
||||
Added interleave capability on format
|
||||
|
||||
WW 6/5/2012: v3.0
|
||||
|
||||
Documentation cleanup
|
||||
|
||||
WW 7/1/2012: v3.1
|
||||
|
||||
Modified head load time (HLT) for 8" media based on
|
||||
YD-180 spec. Now set to 50ms.
|
||||
BIN
Doc/Hard Disk Anatomy.pdf
Normal file
BIN
Doc/Hard Disk Anatomy.pdf
Normal file
Binary file not shown.
@@ -1,45 +0,0 @@
|
||||
Assembling the RomWBW firmware under Linux.
|
||||
|
||||
Note: Updated on 6/25/2013 to eliminate the need for the separate Linux
|
||||
makefile. The standard makefile now has conditionals to allow it to be
|
||||
used under Windows or Linux (I hope) --WW
|
||||
|
||||
This method has been used under Ubuntu Linux and may have to be adapted for
|
||||
other distributions. It is a bit more involved than the Windows procedure.
|
||||
|
||||
What you need
|
||||
You will need the TASM assembler, make, dos2unix and cpmtools.
|
||||
|
||||
The TASM assembler is shareware and the Linux version is only available as
|
||||
source code from the Author. I found one bug during compiling version 3.2 for
|
||||
Ubuntu. In /src/tasm.c change the reference CLK_TIC to CLOCKS_PER_SEC.
|
||||
After compiling install the tasm executable to /usr/local/bin and the table
|
||||
files to /usr/local/lib. If you choose to place them somewhere else you will
|
||||
have to edit the "makefile.linux" file to suit.
|
||||
|
||||
The make, dos2unix and cpmtools packages are found in the Linux repository and
|
||||
installed as for any other package.
|
||||
|
||||
Before assembly
|
||||
Some changes need to be made to cater for the differences between Linux and the
|
||||
DOS/Windows environments. The examples below refer to the /RomWBW/current
|
||||
directory, you'll have to allow for the stable or branches directories if used.
|
||||
These are all done from a terminal. (: is end of the command prompt)
|
||||
|
||||
1. Go to the RomWBW Source directory.e.g.
|
||||
:cd /n8vem/RomWBW/current/Source
|
||||
|
||||
2. The Linux version of TASM can't handle the CR-LF line endings. So from the
|
||||
command prompt use dos2unix to convert all the source files.
|
||||
:~/RomWBW/current/Source dos2unix -f *.asm *.inc *.z80 *.lib diskdefs
|
||||
|
||||
3. You'll have to alter the disk definitions for the cpmtools package to cater
|
||||
for the new roms. Easiest way is to copy the one given in the source over the
|
||||
old. This must be done as superuser.
|
||||
:~/RomWBW/current/Source sudo cp diskdefs /etc/cpmtools/diskdefs
|
||||
|
||||
4. From now on it's the same as using the DOS/Windows instructions in Build.txt.
|
||||
Make any last changes, go to the Source directory and make
|
||||
:~/RomWBW/current/Source make clean ; make
|
||||
|
||||
DGG
|
||||
BIN
Doc/NZCOM Users Manual.pdf
Normal file
BIN
Doc/NZCOM Users Manual.pdf
Normal file
Binary file not shown.
95
Doc/ReadMe.txt
Normal file
95
Doc/ReadMe.txt
Normal file
@@ -0,0 +1,95 @@
|
||||
***********************************************************************
|
||||
*** ***
|
||||
*** R o m W B W ***
|
||||
*** ***
|
||||
*** Z80/Z180 System Software ***
|
||||
*** ***
|
||||
***********************************************************************
|
||||
|
||||
This directory ("Doc") is part of the RomWBW System Software
|
||||
distribution archive. It contains documentation for components of
|
||||
the system.
|
||||
|
||||
|
||||
CPM Manual ("CPM Manual.pdf")
|
||||
-----------------------------
|
||||
|
||||
The original DRI CP/M 2.x Operating System Manual. This should be
|
||||
considered the primary reference for system operation. The section
|
||||
on CP/M 2 Alteration can be ignored since this work has already been
|
||||
completed as part of the RomWBW distribution.
|
||||
|
||||
|
||||
CPM3 Command Summary ("CPM3 Command Summary.pdf")
|
||||
CPM3 Programmer's Guide ("CPM3 Programmers Guide.pdf")
|
||||
CPM3 System Guide ("CPM3 System Guide.pdf")
|
||||
CPM3 User's Guide ("CPM3 Users Guide.pdf")
|
||||
------------------------------------------------------
|
||||
|
||||
The original DRI CP/M 3.0 Operating System Documentation Set. This
|
||||
should be considered the primary reference for CP/M 3 system operation.
|
||||
|
||||
|
||||
DDTZ Manual ("DDTZ.doc")
|
||||
------------------------
|
||||
|
||||
Manual for the DDTZ v2.7 debug tool included on the ROM drive.
|
||||
|
||||
|
||||
FDisk Manual ("FDisk Manual.pdf")
|
||||
---------------------------------
|
||||
|
||||
The operational manual for John Coffman's hard disk partitioning
|
||||
program. This program is included in RomWBW as FDISK80.
|
||||
|
||||
|
||||
Floppy Disk Utility Documentation ("FDU.tst")
|
||||
---------------------------------------------
|
||||
|
||||
Operational documentation for the RomWBW FDU application.
|
||||
|
||||
|
||||
Hard Disk Anatomy ("Hard Disk Anatomy.pdf")
|
||||
-------------------------------------------
|
||||
|
||||
Diagram of a CP/M & MS-DOS (FAT) hybrid hard disk layout.
|
||||
|
||||
|
||||
NZCOM User's Manual ("NZCOM Users Manual.pdf")
|
||||
----------------------------------------------
|
||||
|
||||
NZCOM operating system operation manual.
|
||||
|
||||
|
||||
RomWBW Architecture ("RomWBW Architecture.pdf")
|
||||
-----------------------------------------------
|
||||
|
||||
Document describing the architecture of the RomWBW HBIOS. It
|
||||
includes reference information for the HBIOS calls.
|
||||
|
||||
|
||||
Z180 ASCI Baud Rate Options ("Z180 ASCI Baud Rate Options.pdf")
|
||||
---------------------------------------------------------------
|
||||
|
||||
The Z180 processor's ASCI serial ports have a limited set of
|
||||
baud rate divisors. These divisors are relative to the CPU
|
||||
clock rate. This document provides a list of the possible
|
||||
baud rates for typical CPU clock rates.
|
||||
|
||||
|
||||
ZCPR Manual ("ZCPR Manual.pdf")
|
||||
-------------------------------
|
||||
|
||||
ZCPR is the command proccessor portion of Z-System. This is the
|
||||
manual for ZCPR 1.x as included in RomWBW. The installation
|
||||
instructions can be ignored since that work has already been
|
||||
completed as part of the RomWBW distribution.
|
||||
|
||||
|
||||
ZSDOS Manual ("ZSDOS Manual.pdf")
|
||||
---------------------------------
|
||||
|
||||
ZSDOS is the DOS portion of Z-System. This is the manual fo ZSDOS
|
||||
1.x as included in RomWBW. The installation instructions can be
|
||||
ignored since that work has already been completed as part of the
|
||||
RomWBW distribution.
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
Doc/RomWBW Applications.pdf
Normal file
BIN
Doc/RomWBW Applications.pdf
Normal file
Binary file not shown.
Binary file not shown.
BIN
Doc/RomWBW Getting Started.pdf
Normal file
BIN
Doc/RomWBW Getting Started.pdf
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
165
Doc/Testing Notes.txt
Normal file
165
Doc/Testing Notes.txt
Normal file
@@ -0,0 +1,165 @@
|
||||
SIMH (X)
|
||||
----
|
||||
- Test UART driver
|
||||
- Test HDSK driver
|
||||
|
||||
Zeta 1 (X)
|
||||
------
|
||||
- Test UART driver
|
||||
- Test PPP detection (startup w/ and w/o PPP)
|
||||
- Test boot to CRT
|
||||
- Test PPPSD driver
|
||||
- Test PPPCON driver (video & kbd)
|
||||
- Test FD driver
|
||||
- Test FDU app
|
||||
|
||||
Zeta 2 (X)
|
||||
------
|
||||
- Test UART driver
|
||||
- Test PPP detection (startup w/ and w/o PPP)
|
||||
- Test boot to CRT
|
||||
- Test PPPSD driver
|
||||
- Test PPPCON driver (video & kbd)
|
||||
- Test FD driver
|
||||
- Test FDU app
|
||||
|
||||
RC2014 (X)
|
||||
------
|
||||
- Test SIO driver (Serial Module)
|
||||
- Test ACIA driver (Dual Serial Module)
|
||||
- Test IDE driver (Compact Flash Module)
|
||||
- Test PPIDE driver (IDE Module)
|
||||
- Test FD driver (SMC and WDC)
|
||||
- Test FDU app (SMC and WDC)
|
||||
|
||||
N8-2312 (X)
|
||||
-------
|
||||
- Test ASCI driver
|
||||
- Test SD driver (CSIO mode)
|
||||
- Test FD driver
|
||||
- Test FDU app
|
||||
- Test TMS driver (video & kbd)
|
||||
|
||||
N8-2511 ( )
|
||||
-------
|
||||
- Test ASCI driver
|
||||
- Test SD driver (Juha mode)
|
||||
- Test FD driver
|
||||
- Test FDU app
|
||||
- Test TMS driver (video & kbd)
|
||||
|
||||
SBC (X)
|
||||
---
|
||||
- Test UART driver
|
||||
- Test PPIDE driver
|
||||
- Test PPISD driver
|
||||
- Test PRP detection
|
||||
- Test boot to CRT console
|
||||
|
||||
MK4 (X)
|
||||
---
|
||||
- Test ASCI driver
|
||||
- Test IDE driver
|
||||
- Test SD driver
|
||||
- Test PRP detection
|
||||
|
||||
RAMF (X)
|
||||
----
|
||||
- Test RAMF driver
|
||||
|
||||
PRP (X)
|
||||
---
|
||||
- Test PRPSD driver
|
||||
- Test PRPCON driver (video & kbd)
|
||||
|
||||
SCG (X)
|
||||
---
|
||||
- Test TMS driver (video)
|
||||
|
||||
VDU (X)
|
||||
---
|
||||
- Test CVDU driver (video & kbd)
|
||||
|
||||
CVDU (X)
|
||||
----
|
||||
- Test CVDU driver (video & kbd)
|
||||
|
||||
VGA (X)
|
||||
---
|
||||
- Test VGA driver (video & kbd)
|
||||
|
||||
DIO (X)
|
||||
---
|
||||
- Test FD driver
|
||||
- Test FDU app
|
||||
- Test IDE driver
|
||||
|
||||
DIO3 (X)
|
||||
----
|
||||
- Test FD driver
|
||||
- Test FDU app
|
||||
- Test PPIDE driver
|
||||
|
||||
DIDE (X)
|
||||
----
|
||||
- Test FD driver
|
||||
- Test FDU app
|
||||
- Test IDE driver
|
||||
|
||||
DSD (X)
|
||||
---
|
||||
- Test SD driver
|
||||
|
||||
4UART (X)
|
||||
-----
|
||||
- Test UART driver
|
||||
|
||||
|
||||
UNA (X)
|
||||
---
|
||||
- General Startup
|
||||
- Boot from disk functionality
|
||||
- Image loading
|
||||
- Monitor
|
||||
- XM app
|
||||
- ASSIGN app
|
||||
- MODE app
|
||||
- SYSCOPY app
|
||||
- OSLDR app
|
||||
- FDU app
|
||||
- FDISK80 app
|
||||
|
||||
GENERAL (X)
|
||||
-------
|
||||
- Boot to ROM
|
||||
- Boot to Disk
|
||||
- Boot to Monitor
|
||||
- XM app
|
||||
- XM port auto-detect
|
||||
- ASSIGN app
|
||||
- MODE app
|
||||
- SYSCOPY app
|
||||
- OSLDR app
|
||||
- FDU app
|
||||
- FDISK80 app
|
||||
- TUNE app
|
||||
|
||||
RESULTS
|
||||
-------
|
||||
- Missing HBIOS startup banner (X)
|
||||
- PANIC while printing Serial device inventory (X)
|
||||
- Unexpected interrupt signals not handled well (X)
|
||||
- Fix IT_??? usage (X)
|
||||
- Fix HB_DI/HB_EI in PEEK/POKE/BNKCPY (X)
|
||||
- Fix SIMH timer interrupt setup (X)
|
||||
- Move DI/EI in PEEK/POKE/BNKCPY to API layer? (X)
|
||||
- RETI vs. JP in page zero when INTMODE = 0 (X)
|
||||
- Check interrupt stack space (X)
|
||||
- If an early INT fires, we return with INTs enabled (not good) (X)
|
||||
- PPPCON init should display ANSI 80x25 or similar (X)
|
||||
- Add INT MODE X message to early boot messages (X)
|
||||
- OSLDR fails when LDDS is loaded (X)
|
||||
- Add "!!!" to force assembly error as needed ( )
|
||||
- TIMER app should check for HBIOS active (X)
|
||||
- Halt system after bad interrupt??? ( )
|
||||
- Adapt and bundle PLAYER.COM (X)
|
||||
BIN
Doc/Z180 ASCI Baud Rate Options.pdf
Normal file
BIN
Doc/Z180 ASCI Baud Rate Options.pdf
Normal file
Binary file not shown.
@@ -1,19 +0,0 @@
|
||||
The table below can be used to determine the correct value for CLKDIV AND CNTLB
|
||||
in an Z180 (N8) configuration file. OSC Freq refers to the hardware clock
|
||||
oscillator frequency you are using. You can then choose a CLKDIV value which
|
||||
will result in the CPU speed (frequency) shown below the oscillator frequency.
|
||||
|
||||
Using your oscillator frequency (OSC) and chosen value for CLKDIV, you can
|
||||
use the appropriate column to derive values to use for CNTLB for different
|
||||
baud rates.
|
||||
|
||||
----- CLKDIV = 0 ----- ----- CLKDIV = 1 -----
|
||||
OSC Freq (MHz) 6.144 12.288 18.432 6.144 12.288 18.432
|
||||
CPU Freq (MHz) 3.072 6.144 9.216 6.144 12.288 18.432
|
||||
|
||||
1200 baud 04H 05H 24H 05H 06H 25H
|
||||
2400 baud 03H 04H 23H 04H 05H 24H
|
||||
4800 baud 02H 03H 22H 03H 04H 23H
|
||||
9600 baud 01H 02H 21H 02H 03H 22H
|
||||
19200 baud 00H 01H 20H 01H 02H 21H
|
||||
38400 baud --- 00H --- 00H 01H 20H
|
||||
BIN
Doc/ZCPR Manual.pdf
Normal file
BIN
Doc/ZCPR Manual.pdf
Normal file
Binary file not shown.
@@ -1,29 +0,0 @@
|
||||
@echo off
|
||||
echo By default, PowerShell is configured to block the
|
||||
echo execution of unsigned scripts on your local system.
|
||||
echo This command file will attempt to modify your
|
||||
echo PowerShell ExecutionPolicy to "Unrestricted"
|
||||
echo which means that local scripts can be run without
|
||||
echo being signed. This is required to use the RomWBW
|
||||
echo build process.
|
||||
echo.
|
||||
PowerShell -command Write-Host "Your PowerShell ExecutionPolicy is currently set to: `'(Get-ExecutionPolicy)`'"
|
||||
echo.
|
||||
echo In order to modify the ExecutionPolicy, this command
|
||||
echo file *MUST* be run with administrator privileges.
|
||||
echo Generally, this means you want to right-click the
|
||||
echo command file called FixPowerShell.cmd and choose
|
||||
echo "Run as Administrator". If you attempt to continue
|
||||
echo without administrator privileges, the modification
|
||||
echo will fail with an error message, but no harm is done.
|
||||
echo.
|
||||
choice /m "Do you want to proceed"
|
||||
if errorlevel 2 goto :eof
|
||||
echo.
|
||||
echo Attempting to change Execution Policy...
|
||||
echo.
|
||||
PowerShell Set-ExecutionPolicy Unrestricted
|
||||
echo.
|
||||
PowerShell -command Write-Host "Your new PowerShell ExecutionPolicy is now set to: `'(Get-ExecutionPolicy)`'"
|
||||
echo.
|
||||
pause
|
||||
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
rem ..\..\..\Tools\bst\bstc -Ox -ls -e -p0 -dCOM5: PropIO2.spin
|
||||
..\..\..\Tools\bst\bstc -Ox -ls -e PropIO2.spin
|
||||
@@ -1 +0,0 @@
|
||||
{{
|
||||
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -1,920 +0,0 @@
|
||||
{{
|
||||
SPI interface routines for SD & SDHC & MMC cards
|
||||
|
||||
Jonathan "lonesock" Dummer
|
||||
version 0.3.0 2009 July 19
|
||||
|
||||
Using multiblock SPI mode exclusively.
|
||||
|
||||
This is the "SAFE" version...uses
|
||||
* 1 instruction per bit writes
|
||||
* 2 instructions per bit reads
|
||||
|
||||
For the fsrw project:
|
||||
fsrw.sf.net
|
||||
}}
|
||||
|
||||
CON
|
||||
' possible card types
|
||||
type_MMC = 1
|
||||
type_SD = 2
|
||||
type_SDHC = 3
|
||||
|
||||
' Error codes
|
||||
ERR_CARD_NOT_RESET = -1
|
||||
ERR_3v3_NOT_SUPPORTED = -2
|
||||
ERR_OCR_FAILED = -3
|
||||
ERR_BLOCK_NOT_LONG_ALIGNED = -4
|
||||
'...
|
||||
' These errors are for the assembly engine...they are negated inside, and need to be <= 511
|
||||
ERR_ASM_NO_READ_TOKEN = 100
|
||||
ERR_ASM_BLOCK_NOT_WRITTEN = 101
|
||||
' NOTE: errors -128 to -255 are reserved for reporting R1 response errors
|
||||
'...
|
||||
ERR_SPI_ENGINE_NOT_RUNNING = -999
|
||||
ERR_CARD_BUSY_TIMEOUT = -1000
|
||||
|
||||
' SDHC/SD/MMC command set for SPI
|
||||
CMD0 = $40+0 ' GO_IDLE_STATE
|
||||
CMD1 = $40+1 ' SEND_OP_COND (MMC)
|
||||
ACMD41 = $C0+41 ' SEND_OP_COND (SDC)
|
||||
CMD8 = $40+8 ' SEND_IF_COND
|
||||
CMD9 = $40+9 ' SEND_CSD
|
||||
CMD10 = $40+10 ' SEND_CID
|
||||
CMD12 = $40+12 ' STOP_TRANSMISSION
|
||||
CMD13 = $40+13 ' SEND_STATUS
|
||||
ACMD13 = $C0+13 ' SD_STATUS (SDC)
|
||||
CMD16 = $40+16 ' SET_BLOCKLEN
|
||||
CMD17 = $40+17 ' READ_SINGLE_BLOCK
|
||||
CMD18 = $40+18 ' READ_MULTIPLE_BLOCK
|
||||
CMD23 = $40+23 ' SET_BLOCK_COUNT (MMC)
|
||||
ACMD23 = $C0+23 ' SET_WR_BLK_ERASE_COUNT (SDC)
|
||||
CMD24 = $40+24 ' WRITE_BLOCK
|
||||
CMD25 = $40+25 ' WRITE_MULTIPLE_BLOCK
|
||||
CMD55 = $40+55 ' APP_CMD
|
||||
CMD58 = $40+58 ' READ_OCR
|
||||
CMD59 = $40+59 ' CRC_ON_OFF
|
||||
|
||||
' buffer size for my debug cmd log
|
||||
'LOG_SIZE = 256<<1
|
||||
|
||||
{
|
||||
VAR
|
||||
long SPI_engine_cog
|
||||
' these are used for interfacing with the assembly engine | temporary initialization usage
|
||||
long SPI_command ' "t", "r", "w", 0 =>done, <0 => error | pin mask
|
||||
long SPI_block_index ' which 512-byte block to read/write | cnt at init
|
||||
long SPI_buffer_address ' where to get/put the data in Hub RAM | unused
|
||||
'}
|
||||
DAT
|
||||
'' I'm placing these variables in a DAT section to make this driver a singleton.
|
||||
'' If for some reason you really need more than one driver (e.g. if you have more
|
||||
'' than a single SD socket), move these back into VAR.
|
||||
SPI_engine_cog long 0
|
||||
' these are used for interfacing with the assembly engine | temporary initialization usage
|
||||
SPI_command long 0 ' "t", "r", "w", 0 =>done, <0 => error | unused
|
||||
SPI_block_index long 0 ' which 512-byte block to read/write | cnt at init
|
||||
SPI_buffer_address long 0 ' where to get/put the data in Hub RAM | unused
|
||||
|
||||
{
|
||||
VAR
|
||||
' for debug ONLY
|
||||
byte log_cmd_resp[LOG_SIZE+1]
|
||||
PUB get_log_pointer
|
||||
return @log_cmd_resp
|
||||
'}
|
||||
|
||||
PUB start( basepin )
|
||||
{{
|
||||
This is a compatibility wrapper, and requires that the pins be
|
||||
both consecutive, and in the order DO CLK DI CS.
|
||||
}}
|
||||
return start_explicit( basepin, basepin+1, basepin+2, basepin+3 )
|
||||
|
||||
PUB readblock( block_index, buffer_address )
|
||||
if SPI_engine_cog == 0
|
||||
abort ERR_SPI_ENGINE_NOT_RUNNING
|
||||
if (buffer_address & 3)
|
||||
abort ERR_BLOCK_NOT_LONG_ALIGNED
|
||||
SPI_block_index := block_index
|
||||
SPI_buffer_address := buffer_address
|
||||
SPI_command := "r"
|
||||
repeat while SPI_command == "r"
|
||||
if SPI_command < 0
|
||||
abort SPI_command
|
||||
|
||||
PUB writeblock( block_index, buffer_address )
|
||||
if SPI_engine_cog == 0
|
||||
abort ERR_SPI_ENGINE_NOT_RUNNING
|
||||
if (buffer_address & 3)
|
||||
abort ERR_BLOCK_NOT_LONG_ALIGNED
|
||||
SPI_block_index := block_index
|
||||
SPI_buffer_address := buffer_address
|
||||
SPI_command := "w"
|
||||
repeat while SPI_command == "w"
|
||||
if SPI_command < 0
|
||||
abort SPI_command
|
||||
|
||||
PUB get_seconds
|
||||
if SPI_engine_cog == 0
|
||||
abort ERR_SPI_ENGINE_NOT_RUNNING
|
||||
SPI_command := "t"
|
||||
repeat while SPI_command == "t"
|
||||
' secods are in SPI_block_index, remainder is in SPI_buffer_address
|
||||
return SPI_block_index
|
||||
|
||||
PUB get_milliseconds : ms
|
||||
if SPI_engine_cog == 0
|
||||
abort ERR_SPI_ENGINE_NOT_RUNNING
|
||||
SPI_command := "t"
|
||||
repeat while SPI_command == "t"
|
||||
' secods are in SPI_block_index, remainder is in SPI_buffer_address
|
||||
ms := SPI_block_index * 1000
|
||||
ms += SPI_buffer_address * 1000 / clkfreq
|
||||
|
||||
PUB start_explicit( DO, CLK, DI, CS ) : card_type | tmp, i
|
||||
{{
|
||||
Do all of the card initialization in SPIN, then hand off the pin
|
||||
information to the assembly cog for hot SPI block R/W action!
|
||||
}}
|
||||
' Start from scratch
|
||||
stop
|
||||
' clear my log buffer
|
||||
{
|
||||
bytefill( @log_cmd_resp, 0, LOG_SIZE+1 )
|
||||
dbg_ptr := @log_cmd_resp
|
||||
dbg_end := dbg_ptr + LOG_SIZE
|
||||
'}
|
||||
' wait ~4 milliseconds
|
||||
waitcnt( 500 + (clkfreq>>8) + cnt )
|
||||
' (start with cog variables, _BEFORE_ loading the cog)
|
||||
pinDO := DO
|
||||
maskDO := |< DO
|
||||
pinCLK := CLK
|
||||
pinDI := DI
|
||||
maskDI := |< DI
|
||||
maskCS := |< CS
|
||||
adrShift := 9 ' block = 512 * index, and 512 = 1<<9
|
||||
' pass the output pin mask via the command register
|
||||
maskAll := maskCS | (|<pinCLK) | maskDI
|
||||
dira |= maskAll
|
||||
' get the card in a ready state: set DI and CS high, send => 74 clocks
|
||||
outa |= maskAll
|
||||
repeat 4096
|
||||
outa[CLK]~~
|
||||
outa[CLK]~
|
||||
' time-hack
|
||||
SPI_block_index := cnt
|
||||
' reset the card
|
||||
tmp~
|
||||
repeat i from 0 to 9
|
||||
if tmp <> 1
|
||||
tmp := send_cmd_slow( CMD0, 0, $95 )
|
||||
if (tmp & 4)
|
||||
' the card said CMD0 ("go idle") was invalid, so we're possibly stuck in read or write mode
|
||||
if i & 1
|
||||
' exit multiblock read mode
|
||||
repeat 4
|
||||
read_32_slow ' these extra clocks are required for some MMC cards
|
||||
send_slow( $FD, 8 ) ' stop token
|
||||
read_32_slow
|
||||
repeat while read_slow <> $FF
|
||||
else
|
||||
' exit multiblock read mode
|
||||
send_cmd_slow( CMD12, 0, $61 )
|
||||
if tmp <> 1
|
||||
' the reset command failed!
|
||||
crash( ERR_CARD_NOT_RESET )
|
||||
' Is this a SD type 2 card?
|
||||
if send_cmd_slow( CMD8, $1AA, $87 ) == 1
|
||||
' Type2 SD, check to see if it's a SDHC card
|
||||
tmp := read_32_slow
|
||||
' check the supported voltage
|
||||
if (tmp & $1FF) <> $1AA
|
||||
crash( ERR_3v3_NOT_SUPPORTED )
|
||||
' try to initialize the type 2 card with the High Capacity bit
|
||||
repeat while send_cmd_slow( ACMD41, |<30, $77 )
|
||||
' the card is initialized, let's read back the High Capacity bit
|
||||
if send_cmd_slow( CMD58, 0, $FD ) <> 0
|
||||
crash( ERR_OCR_FAILED )
|
||||
' get back the data
|
||||
tmp := read_32_slow
|
||||
' check the bit
|
||||
if tmp & |<30
|
||||
card_type := type_SDHC
|
||||
adrShift := 0
|
||||
else
|
||||
card_type := type_SD
|
||||
else
|
||||
' Either a type 1 SD card, or it's MMC, try SD 1st
|
||||
if send_cmd_slow( ACMD41, 0, $E5 ) < 2
|
||||
' this is a type 1 SD card (1 means busy, 0 means done initializing)
|
||||
card_type := type_SD
|
||||
repeat while send_cmd_slow( ACMD41, 0, $E5 )
|
||||
else
|
||||
' mark that it's MMC, and try to initialize
|
||||
card_type := type_MMC
|
||||
repeat while send_cmd_slow( CMD1, 0, $F9 )
|
||||
' some SD or MMC cards may have the wrong block size, set it here
|
||||
send_cmd_slow( CMD16, 512, $15 )
|
||||
' card is mounted, make sure the CRC is turned off
|
||||
send_cmd_slow( CMD59, 0, $91 )
|
||||
' check the status
|
||||
'send_cmd_slow( CMD13, 0, $0D )
|
||||
' done with the SPI bus for now
|
||||
outa |= maskCS
|
||||
' set my counter modes for super fast SPI operation
|
||||
' writing: NCO single-ended mode, output on DI
|
||||
writeMode := (%00100 << 26) | (DI << 0)
|
||||
' reading
|
||||
'readMode := (%11000 << 26) | (DO << 0) | (CLK << 9)
|
||||
' clock
|
||||
'clockLineMode := (%00110 << 26) | (CLK << 0) ' DUTY, 25% duty cycle
|
||||
' clock
|
||||
clockLineMode := (%00100 << 26) | (CLK << 0) ' NCO, 50% duty cycle
|
||||
' how many bytes (8 clocks, >>3) fit into 1/2 of a second (>>1), 4 clocks per instruction (>>2)?
|
||||
N_in8_500ms := clkfreq >> constant(1+2+3)
|
||||
' how long should we wait before auto-exiting any multiblock mode?
|
||||
idle_limit := 125 ' ms, NEVER make this > 1000
|
||||
idle_limit := clkfreq / (1000 / idle_limit) ' convert to counts
|
||||
' Hand off control to the assembly engine's cog
|
||||
bufAdr := @SPI_buffer_address
|
||||
sdAdr := @SPI_block_index
|
||||
SPI_command := 0 ' just make sure it's not 1
|
||||
' start my driver cog and wait till I hear back that it's done
|
||||
SPI_engine_cog := cognew( @SPI_engine_entry, @SPI_command ) + 1
|
||||
if( SPI_engine_cog == 0 )
|
||||
crash( ERR_SPI_ENGINE_NOT_RUNNING )
|
||||
repeat while SPI_command <> -1
|
||||
' and we no longer need to control any pins from here
|
||||
dira &= !maskAll
|
||||
' the return variable is card_type
|
||||
|
||||
PUB release
|
||||
{{
|
||||
I do not want to abort if the cog is not
|
||||
running, as this is called from stop, which
|
||||
is called from start/ [8^)
|
||||
}}
|
||||
if SPI_engine_cog
|
||||
SPI_command := "z"
|
||||
repeat while SPI_command == "z"
|
||||
|
||||
PUB stop
|
||||
{{
|
||||
kill the assembly driver cog.
|
||||
}}
|
||||
release
|
||||
if SPI_engine_cog
|
||||
cogstop( SPI_engine_cog~ - 1 )
|
||||
|
||||
PRI crash( abort_code )
|
||||
{{
|
||||
In case of Bad Things(TM) happening,
|
||||
exit as gracefully as possible.
|
||||
}}
|
||||
' and we no longer need to control any pins from here
|
||||
dira &= !maskAll
|
||||
' and report our error
|
||||
abort abort_code
|
||||
|
||||
PRI send_cmd_slow( cmd, val, crc ) : reply | time_stamp
|
||||
{{
|
||||
Send down a command and return the reply.
|
||||
Note: slow is an understatement!
|
||||
Note: this uses the assembly DAT variables for pin IDs,
|
||||
which means that if you run this multiple times (say for
|
||||
multiple SD cards), these values will change for each one.
|
||||
But this is OK as all of these functions will be called
|
||||
during the initialization only, before the PASM engine is
|
||||
running.
|
||||
}}
|
||||
' if this is an application specific command, handle it
|
||||
if (cmd & $80)
|
||||
' ACMD<n> is the command sequense of CMD55-CMD<n>
|
||||
cmd &= $7F
|
||||
reply := send_cmd_slow( CMD55, 0, $65 )
|
||||
if (reply > 1)
|
||||
return reply
|
||||
' the CS line needs to go low during this operation
|
||||
outa |= maskCS
|
||||
outa &= !maskCS
|
||||
' give the card a few cocks to finish whatever it was doing
|
||||
read_32_slow
|
||||
' send the command byte
|
||||
send_slow( cmd, 8 )
|
||||
' send the value long
|
||||
send_slow( val, 32 )
|
||||
' send the CRC byte
|
||||
send_slow( crc, 8 )
|
||||
' is this a CMD12?, if so, stuff byte
|
||||
if cmd == CMD12
|
||||
read_slow
|
||||
' read back the response (spec declares 1-8 reads max for SD, MMC is 0-8)
|
||||
time_stamp := 9
|
||||
repeat
|
||||
reply := read_slow
|
||||
while( reply & $80 ) and ( time_stamp-- )
|
||||
' done, and 'reply' is already pre-loaded
|
||||
{
|
||||
if dbg_ptr < (dbg_end-1)
|
||||
byte[dbg_ptr++] := cmd
|
||||
byte[dbg_ptr++] := reply
|
||||
if (cmd&63) == 13
|
||||
' get the second byte
|
||||
byte[dbg_ptr++] := cmd
|
||||
byte[dbg_ptr++] := read_slow
|
||||
'}
|
||||
|
||||
PRI send_slow( value, bits_to_send )
|
||||
value ><= bits_to_send
|
||||
repeat bits_to_send
|
||||
outa[pinCLK]~
|
||||
outa[pinDI] := value
|
||||
value >>= 1
|
||||
outa[pinCLK]~~
|
||||
|
||||
PRI read_32_slow : r
|
||||
repeat 4
|
||||
r <<= 8
|
||||
r |= read_slow
|
||||
|
||||
PRI read_slow : r
|
||||
{{
|
||||
Read back 8 bits from the card
|
||||
}}
|
||||
' we need the DI line high so a read can occur
|
||||
outa[pinDI]~~
|
||||
' get 8 bits (remember, r is initialized to 0 by SPIN)
|
||||
repeat 8
|
||||
outa[pinCLK]~
|
||||
outa[pinCLK]~~
|
||||
r += r + ina[pinDO]
|
||||
' error check
|
||||
if( (cnt - SPI_block_index) > (clkfreq << 2) )
|
||||
crash( ERR_CARD_BUSY_TIMEOUT )
|
||||
|
||||
DAT
|
||||
{{
|
||||
This is the assembly engine for doing fast block
|
||||
reads and writes. This is *ALL* it does!
|
||||
}}
|
||||
ORG 0
|
||||
SPI_engine_entry
|
||||
' Counter A drives data out
|
||||
mov ctra,writeMode
|
||||
' Counter B will always drive my clock line
|
||||
mov ctrb,clockLineMode
|
||||
' set our output pins to match the pin mask
|
||||
mov dira,maskAll
|
||||
' handshake that we now control the pins
|
||||
neg user_request,#1
|
||||
wrlong user_request,par
|
||||
' start my seconds' counter here
|
||||
mov last_time,cnt
|
||||
|
||||
waiting_for_command
|
||||
' update my seconds counter, but also track the idle
|
||||
' time so we can to release the card after timeout.
|
||||
call #handle_time
|
||||
' read the command, and make sure it's from the user (> 0)
|
||||
rdlong user_request,par
|
||||
cmps user_request,#0 wz,wc
|
||||
if_be jmp #waiting_for_command
|
||||
' handle our card based commands
|
||||
cmp user_request,#"r" wz
|
||||
if_z jmp #read_ahead
|
||||
cmp user_request,#"w" wz
|
||||
if_z jmp #write_behind
|
||||
cmp user_request,#"z" wz
|
||||
if_z jmp #release_card
|
||||
' time requests are handled differently
|
||||
cmp user_request,#"t" wz ' time
|
||||
if_z wrlong seconds,sdAdr ' seconds goes into the SD index register
|
||||
if_z wrlong dtime,bufAdr ' the remainder goes into the buffer address register
|
||||
' in all other cases, clear the user's request
|
||||
mov user_request,#0
|
||||
wrlong user_request,par
|
||||
jmp #waiting_for_command
|
||||
|
||||
|
||||
release_card
|
||||
mov user_cmd,#"z" ' request a release
|
||||
neg lastIndexPlus,#1 ' reset the last block index
|
||||
neg user_idx,#1 ' and make this match it
|
||||
call #handle_command
|
||||
mov user_request,user_cmd
|
||||
wrlong user_request,par
|
||||
jmp #waiting_for_command
|
||||
|
||||
read_ahead
|
||||
rdlong user_idx,sdAdr
|
||||
' if the correct block is not already loaded, load it
|
||||
mov tmp1,user_idx
|
||||
add tmp1,#1
|
||||
cmp tmp1,lastIndexPlus wz
|
||||
if_z cmp lastCommand,#"r" wz
|
||||
if_z jmp #:get_on_with_it
|
||||
mov user_cmd,#"r"
|
||||
call #handle_command
|
||||
:get_on_with_it
|
||||
' copy the data up into Hub RAM
|
||||
movi transfer_long,#%000010_000 'set to wrlong
|
||||
call #hub_cog_transfer
|
||||
' signify that the data is ready, Spin can continue
|
||||
mov user_request,user_cmd
|
||||
wrlong user_request,par
|
||||
' request the next block
|
||||
mov user_cmd,#"r"
|
||||
add user_idx,#1
|
||||
call #handle_command
|
||||
' done
|
||||
jmp #waiting_for_command
|
||||
|
||||
write_behind
|
||||
rdlong user_idx,sdAdr
|
||||
' copy data in from Hub RAM
|
||||
movi transfer_long,#%000010_001 'set to rdlong
|
||||
call #hub_cog_transfer
|
||||
' signify that we have the data, Spin can continue
|
||||
mov user_request,user_cmd
|
||||
wrlong user_request,par
|
||||
' write out the block
|
||||
mov user_cmd,#"w"
|
||||
call #handle_command
|
||||
' done
|
||||
jmp #waiting_for_command
|
||||
|
||||
{{
|
||||
Set user_cmd and user_idx before calling this
|
||||
}}
|
||||
handle_command
|
||||
' Can we stay in the old mode? (address = old_address+1) && (old mode == new_mode)
|
||||
cmp lastIndexPlus,user_idx wz
|
||||
if_z cmp user_cmd,lastCommand wz
|
||||
if_z jmp #:execute_block_command
|
||||
' we fell through, must exit the old mode! (except if the old mode was "release")
|
||||
cmp lastCommand,#"w" wz
|
||||
if_z call #stop_mb_write
|
||||
cmp lastCommand,#"r" wz
|
||||
if_z call #stop_mb_read
|
||||
' and start up the new mode!
|
||||
cmp user_cmd,#"w" wz
|
||||
if_z call #start_mb_write
|
||||
cmp user_cmd,#"r" wz
|
||||
if_z call #start_mb_read
|
||||
cmp user_cmd,#"z" wz
|
||||
if_z call #release_DO
|
||||
:execute_block_command
|
||||
' track the (new) last index and command
|
||||
mov lastIndexPlus,user_idx
|
||||
add lastIndexPlus,#1
|
||||
mov lastCommand,user_cmd
|
||||
' do the block read or write or terminate!
|
||||
cmp user_cmd,#"w" wz
|
||||
if_z call #write_single_block
|
||||
cmp user_cmd,#"r" wz
|
||||
if_z call #read_single_block
|
||||
cmp user_cmd,#"z" wz
|
||||
if_z mov user_cmd,#0
|
||||
' done
|
||||
handle_command_ret
|
||||
ret
|
||||
|
||||
{=== these PASM functions get me in and out of multiblock mode ===}
|
||||
release_DO
|
||||
' we're already out of multiblock mode, so
|
||||
' deselect the card and send out some clocks
|
||||
or outa,maskCS
|
||||
call #in8
|
||||
call #in8
|
||||
' if you are using pull-up resistors, and need all
|
||||
' lines tristated, then uncomment the following line.
|
||||
' for Cluso99
|
||||
'mov dira,#0
|
||||
release_DO_ret
|
||||
ret
|
||||
|
||||
start_mb_read
|
||||
movi block_cmd,#CMD18<<1
|
||||
call #send_SPI_command_fast
|
||||
start_mb_read_ret
|
||||
ret
|
||||
|
||||
stop_mb_read
|
||||
movi block_cmd,#CMD12<<1
|
||||
call #send_SPI_command_fast
|
||||
call #busy_fast
|
||||
stop_mb_read_ret
|
||||
ret
|
||||
|
||||
start_mb_write
|
||||
movi block_cmd,#CMD25<<1
|
||||
call #send_SPI_command_fast
|
||||
start_mb_write_ret
|
||||
ret
|
||||
|
||||
stop_mb_write
|
||||
call #busy_fast
|
||||
' only some cards need these extra clocks
|
||||
mov tmp1,#16
|
||||
:loopity
|
||||
call #in8
|
||||
djnz tmp1,#:loopity
|
||||
' done with hack
|
||||
movi phsa,#$FD<<1
|
||||
call #out8
|
||||
call #in8 ' stuff byte
|
||||
call #busy_fast
|
||||
stop_mb_write_ret
|
||||
ret
|
||||
|
||||
send_SPI_command_fast
|
||||
' make sure we have control of the output lines
|
||||
mov dira,maskAll
|
||||
' make sure the CS line transitions low
|
||||
or outa,maskCS
|
||||
andn outa,maskCS
|
||||
' 8 clocks
|
||||
call #in8
|
||||
' send the data
|
||||
mov phsa,block_cmd ' do which ever block command this is (already in the top 8 bits)
|
||||
call #out8 ' write the byte
|
||||
mov phsa,user_idx ' read in the desired block index
|
||||
shl phsa,adrShift ' this will multiply by 512 (bytes/sector) for MMC and SD
|
||||
call #out8 ' move out the 1st MSB '
|
||||
rol phsa,#1
|
||||
call #out8 ' move out the 1st MSB '
|
||||
rol phsa,#1
|
||||
call #out8 ' move out the 1st MSB '
|
||||
rol phsa,#1
|
||||
call #out8 ' move out the 1st MSB '
|
||||
' bogus CRC value
|
||||
call #in8 ' in8 looks like out8 with $FF
|
||||
' CMD12 requires a stuff byte
|
||||
shr block_cmd,#24
|
||||
cmp block_cmd,#CMD12 wz
|
||||
if_z call #in8 ' 8 clocks
|
||||
' get the response
|
||||
mov tmp1,#9
|
||||
:cmd_response
|
||||
call #in8
|
||||
test readback,#$80 wc,wz
|
||||
if_c djnz tmp1,#:cmd_response
|
||||
if_nz neg user_cmd,readback
|
||||
' done
|
||||
send_SPI_command_fast_ret
|
||||
ret
|
||||
|
||||
|
||||
busy_fast
|
||||
mov tmp1,N_in8_500ms
|
||||
:still_busy
|
||||
call #in8
|
||||
cmp readback,#$FF wz
|
||||
if_nz djnz tmp1,#:still_busy
|
||||
busy_fast_ret
|
||||
ret
|
||||
|
||||
|
||||
out8
|
||||
andn outa,maskDI
|
||||
'movi phsb,#%11_0000000
|
||||
mov phsb,#0
|
||||
movi frqb,#%01_0000000
|
||||
rol phsa,#1
|
||||
rol phsa,#1
|
||||
rol phsa,#1
|
||||
rol phsa,#1
|
||||
rol phsa,#1
|
||||
rol phsa,#1
|
||||
rol phsa,#1
|
||||
mov frqb,#0
|
||||
' don't shift out the final bit...already sent, but be aware
|
||||
' of this when sending consecutive bytes (send_cmd, for e.g.)
|
||||
out8_ret
|
||||
ret
|
||||
|
||||
{
|
||||
in8
|
||||
or outa,maskDI
|
||||
mov ctra,readMode
|
||||
' Start my clock
|
||||
mov frqa,#1<<7
|
||||
mov phsa,#0
|
||||
movi phsb,#%11_0000000
|
||||
movi frqb,#%01_0000000
|
||||
' keep reading in my value, one bit at a time! (Kuneko - "Wh)
|
||||
shr frqa,#1
|
||||
shr frqa,#1
|
||||
shr frqa,#1
|
||||
shr frqa,#1
|
||||
shr frqa,#1
|
||||
shr frqa,#1
|
||||
shr frqa,#1
|
||||
mov frqb,#0 ' stop the clock
|
||||
mov readback,phsa
|
||||
mov frqa,#0
|
||||
mov ctra,writeMode
|
||||
in8_ret
|
||||
ret
|
||||
}
|
||||
in8
|
||||
neg phsa,#1' DI high
|
||||
mov readback,#0
|
||||
' set up my clock, and start it
|
||||
movi phsb,#%011_000000
|
||||
movi frqb,#%001_000000
|
||||
' keep reading in my value
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
mov frqb,#0 ' stop the clock
|
||||
rcl readback,#1
|
||||
mov phsa,#0 'DI low
|
||||
in8_ret
|
||||
ret
|
||||
|
||||
|
||||
' this is called more frequently than 1 Hz, and
|
||||
' is only called when the user command is 0.
|
||||
handle_time
|
||||
mov tmp1,cnt ' get the current timestamp
|
||||
add idle_time,tmp1 ' add the current time to my idle time counter
|
||||
sub idle_time,last_time ' subtract the last time from my idle counter (hence delta)
|
||||
add dtime,tmp1 ' add to my accumulator,
|
||||
sub dtime,last_time ' and subtract the old (adding delta)
|
||||
mov last_time,tmp1 ' update my "last timestamp"
|
||||
rdlong tmp1,#0 ' what is the clock frequency?
|
||||
cmpsub dtime,tmp1 wc ' if I have more than a second in my accumulator
|
||||
addx seconds,#0 ' then add it to "seconds"
|
||||
' this part is to auto-release the card after a timeout
|
||||
cmp idle_time,idle_limit wz,wc
|
||||
if_b jmp #handle_time_ret ' don't clear if we haven't hit the limit
|
||||
mov user_cmd,#"z" ' we can't overdo it, the command handler makes sure
|
||||
neg lastIndexPlus,#1 ' reset the last block index
|
||||
neg user_idx,#1 ' and make this match it
|
||||
call #handle_command ' release the card, but don't mess with the user's request register
|
||||
handle_time_ret
|
||||
ret
|
||||
|
||||
hub_cog_transfer
|
||||
' setup for all 4 passes
|
||||
mov ctrb,clockXferMode
|
||||
mov frqb,#1
|
||||
rdlong buf_ptr,bufAdr
|
||||
mov ops_left,#4
|
||||
movd transfer_long,#speed_buf
|
||||
four_transfer_passes
|
||||
' sync to the Hub RAM access
|
||||
rdlong tmp1,tmp1
|
||||
' how many long to move on this pass? (512 bytes / 4)longs / 4 passes
|
||||
mov tmp1,#(512 / 4 / 4)
|
||||
' get my starting address right (phsb is incremented 1 per clock, so 16 each Hub access)
|
||||
mov phsb,buf_ptr
|
||||
' write the longs, stride 4...low 2 bits of phsb are ignored
|
||||
transfer_long
|
||||
rdlong 0-0,phsb
|
||||
add transfer_long,incDest4
|
||||
djnz tmp1,#transfer_long
|
||||
' go back to where I started, but advanced 1 long
|
||||
sub transfer_long,decDestNminus1
|
||||
' offset my Hub pointer by one long per pass
|
||||
add buf_ptr,#4
|
||||
' do all 4 passes
|
||||
djnz ops_left,#four_transfer_passes
|
||||
' restore the counter mode
|
||||
mov frqb,#0
|
||||
mov phsb,#0
|
||||
mov ctrb,clockLineMode
|
||||
hub_cog_transfer_ret
|
||||
ret
|
||||
|
||||
|
||||
read_single_block
|
||||
' where am I sending the data?
|
||||
movd :store_read_long,#speed_buf
|
||||
mov ops_left,#128
|
||||
' wait until the card is ready
|
||||
mov tmp1,N_in8_500ms
|
||||
:get_resp
|
||||
call #in8
|
||||
cmp readback,#$FE wz
|
||||
if_nz djnz tmp1,#:get_resp
|
||||
if_nz neg user_cmd,#ERR_ASM_NO_READ_TOKEN
|
||||
if_nz jmp #read_single_block_ret
|
||||
' set DI high
|
||||
neg phsa,#1
|
||||
' read the data
|
||||
mov ops_left,#128
|
||||
:read_loop
|
||||
mov tmp1,#4
|
||||
movi phsb,#%011_000000
|
||||
:in_byte
|
||||
' Start my clock
|
||||
movi frqb,#%001_000000
|
||||
' keep reading in my value, BACKWARDS! (Brilliant idea by Tom Rokicki!)
|
||||
test maskDO,ina wc
|
||||
rcl readback,#8
|
||||
test maskDO,ina wc
|
||||
muxc readback,#2
|
||||
test maskDO,ina wc
|
||||
muxc readback,#4
|
||||
test maskDO,ina wc
|
||||
muxc readback,#8
|
||||
test maskDO,ina wc
|
||||
muxc readback,#16
|
||||
test maskDO,ina wc
|
||||
muxc readback,#32
|
||||
test maskDO,ina wc
|
||||
muxc readback,#64
|
||||
test maskDO,ina wc
|
||||
mov frqb,#0 ' stop the clock
|
||||
muxc readback,#128
|
||||
' go back for more
|
||||
djnz tmp1,#:in_byte
|
||||
' make it...NOT backwards [8^)
|
||||
rev readback,#0
|
||||
:store_read_long
|
||||
mov 0-0,readback ' due to some counter weirdness, we need this mov
|
||||
add :store_read_long,const512
|
||||
djnz ops_left,#:read_loop
|
||||
|
||||
' set DI low
|
||||
mov phsa,#0
|
||||
|
||||
' now read 2 trailing bytes (CRC)
|
||||
call #in8 ' out8 is 2x faster than in8
|
||||
call #in8 ' and I'm not using the CRC anyway
|
||||
' give an extra 8 clocks in case we pause for a long time
|
||||
call #in8 ' in8 looks like out8($FF)
|
||||
|
||||
' all done successfully
|
||||
mov idle_time,#0
|
||||
mov user_cmd,#0
|
||||
read_single_block_ret
|
||||
ret
|
||||
|
||||
write_single_block
|
||||
' where am I getting the data? (all 512 bytes / 128 longs of it?)
|
||||
movs :write_loop,#speed_buf
|
||||
' read in 512 bytes (128 longs) from Hub RAM and write it to the card
|
||||
mov ops_left,#128
|
||||
' just hold your horses
|
||||
call #busy_fast
|
||||
' $FC for multiblock, $FE for single block
|
||||
movi phsa,#$FC<<1
|
||||
call #out8
|
||||
mov phsb,#0 ' make sure my clock accumulator is right
|
||||
'movi phsb,#%11_0000000
|
||||
:write_loop
|
||||
' read 4 bytes
|
||||
mov phsa,speed_buf
|
||||
add :write_loop,#1
|
||||
' a long in LE order is DCBA
|
||||
rol phsa,#24 ' move A7 into position, so I can do the swizzled version
|
||||
movi frqb,#%010000000 ' start the clock (remember A7 is already in place)
|
||||
rol phsa,#1 ' A7 is going out, at the end of this instr, A6 is in place
|
||||
rol phsa,#1 ' A5
|
||||
rol phsa,#1 ' A4
|
||||
rol phsa,#1 ' A3
|
||||
rol phsa,#1 ' A2
|
||||
rol phsa,#1 ' A1
|
||||
rol phsa,#1 ' A0
|
||||
rol phsa,#17 ' B7
|
||||
rol phsa,#1 ' B6
|
||||
rol phsa,#1 ' B5
|
||||
rol phsa,#1 ' B4
|
||||
rol phsa,#1 ' B3
|
||||
rol phsa,#1 ' B2
|
||||
rol phsa,#1 ' B1
|
||||
rol phsa,#1 ' B0
|
||||
rol phsa,#17 ' C7
|
||||
rol phsa,#1 ' C6
|
||||
rol phsa,#1 ' C5
|
||||
rol phsa,#1 ' C4
|
||||
rol phsa,#1 ' C3
|
||||
rol phsa,#1 ' C2
|
||||
rol phsa,#1 ' C1
|
||||
rol phsa,#1 ' C0
|
||||
rol phsa,#17 ' D7
|
||||
rol phsa,#1 ' D6
|
||||
rol phsa,#1 ' D5
|
||||
rol phsa,#1 ' D4
|
||||
rol phsa,#1 ' D3
|
||||
rol phsa,#1 ' D2
|
||||
rol phsa,#1 ' D1
|
||||
rol phsa,#1 ' D0 will be in place _after_ this instruction
|
||||
mov frqb,#0 ' shuts the clock off, _after_ this instruction
|
||||
djnz ops_left,#:write_loop
|
||||
' write out my two (bogus, using $FF) CRC bytes
|
||||
call #in8
|
||||
call #in8
|
||||
' now read response (I need this response, so can't spoof using out8)
|
||||
call #in8
|
||||
and readback,#$1F
|
||||
cmp readback,#5 wz
|
||||
if_z mov user_cmd,#0 ' great
|
||||
if_nz neg user_cmd,#ERR_ASM_BLOCK_NOT_WRITTEN ' oops
|
||||
' send out another 8 clocks
|
||||
call #in8
|
||||
' all done
|
||||
mov idle_time,#0
|
||||
write_single_block_ret
|
||||
ret
|
||||
|
||||
|
||||
{=== Assembly Interface Variables ===}
|
||||
pinDO long 0 ' pin is controlled by a counter
|
||||
pinCLK long 0 ' pin is controlled by a counter
|
||||
pinDI long 0 ' pin is controlled by a counter
|
||||
maskDO long 0 ' mask for reading the DO line from the card
|
||||
maskDI long 0 ' mask for setting the pin high while reading
|
||||
maskCS long 0 ' mask = (1<<pin), and is controlled directly
|
||||
maskAll long 0
|
||||
adrShift long 9 ' will be 0 for SDHC, 9 for MMC & SD
|
||||
bufAdr long 0 ' where in Hub RAM is the buffer to copy to/from?
|
||||
sdAdr long 0 ' where on the SD card does it read/write?
|
||||
writeMode long 0 ' the counter setup in NCO single ended, clocking data out on pinDI
|
||||
'clockOutMode long 0 ' the counter setup in NCO single ended, driving the clock line on pinCLK
|
||||
N_in8_500ms long 1_000_000 ' used for timeout checking in PASM
|
||||
'readMode long 0
|
||||
clockLineMode long 0
|
||||
clockXferMode long %11111 << 26
|
||||
const512 long 512
|
||||
const1024 long 1024
|
||||
incDest4 long 4 << 9
|
||||
decDestNminus1 long (512 / 4 - 1) << 9
|
||||
|
||||
{=== Initialized PASM Variables ===}
|
||||
seconds long 0
|
||||
dtime long 0
|
||||
idle_time long 0
|
||||
idle_limit long 0
|
||||
|
||||
{=== Multiblock State Machine ===}
|
||||
lastIndexPlus long -1 ' state handler will check against lastIndexPlus, which will not have been -1
|
||||
lastCommand long 0 ' this will never be the last command.
|
||||
|
||||
{=== Debug Logging Pointers ===}
|
||||
{
|
||||
dbg_ptr long 0
|
||||
dbg_end long 0
|
||||
'}
|
||||
|
||||
{=== Assembly Scratch Variables ===}
|
||||
ops_left res 1 ' used as a counter for bytes, words, longs, whatever (start w/ # byte clocks out)
|
||||
readback res 1 ' all reading from the card goes through here
|
||||
tmp1 res 1 ' this may get used in all subroutines...don't use except in lowest
|
||||
user_request res 1 ' the main command variable, read in from Hub: "r"-read single, "w"-write single
|
||||
user_cmd res 1 ' used internally to handle actual commands to be executed
|
||||
user_idx res 1 ' the pointer to the Hub RAM where the data block is/goes
|
||||
block_cmd res 1 ' one of the SD/MMC command codes, no app-specific allowed
|
||||
buf_ptr res 1 ' moving pointer to the Hub RAM buffer
|
||||
last_time res 1 ' tracking the timestamp
|
||||
|
||||
{{
|
||||
496 longs is my total available space in the cog,
|
||||
and I want 128 longs for eventual use as one 512-
|
||||
byte buffer. This gives me a total of 368 longs
|
||||
to use for umount, and a readblock and writeblock
|
||||
for both Hub RAM and Cog buffers.
|
||||
}}
|
||||
speed_buf res 128 ' 512 bytes to be used for read-ahead / write-behind
|
||||
|
||||
'fit 467
|
||||
FIT 496
|
||||
|
||||
'' MIT LICENSE
|
||||
{{
|
||||
' Permission is hereby granted, free of charge, to any person obtaining
|
||||
' a copy of this software and associated documentation files
|
||||
' (the "Software"), to deal in the Software without restriction,
|
||||
' including without limitation the rights to use, copy, modify, merge,
|
||||
' publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
' and to permit persons to whom the Software is furnished to do so,
|
||||
' subject to the following conditions:
|
||||
'
|
||||
' The above copyright notice and this permission notice shall be included
|
||||
' in all copies or substantial portions of the Software.
|
||||
'
|
||||
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
' EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
' MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
' IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
' CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
' TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
' SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
}}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1 +0,0 @@
|
||||
bstc -Ox -ls -e -p0 -dCOM5: vgademo.spin
|
||||
@@ -1,17 +0,0 @@
|
||||
SPINC= bstc.linux
|
||||
SPINC_FLAGS= -Ox -ls -e -p0 -d/dev/ttyS0
|
||||
INCLUDES= -L../lib
|
||||
|
||||
VERSION= 0.0.4
|
||||
|
||||
all: vgademo
|
||||
|
||||
vgademo: vgademo.spin vga8x8d.spin vt100.spin
|
||||
$(SPINC) $(SPINC_FLAGS) $(INCLUDES) -o $@ $<
|
||||
|
||||
clean:
|
||||
rm -f *.eeprom *.lst *.list *.bck *.o
|
||||
|
||||
dist: clean
|
||||
cd .. && rm -f vgademo-$(VERSION).zip && \
|
||||
zip -r vgademo-$(VERSION).zip vga2
|
||||
Binary file not shown.
@@ -1,619 +0,0 @@
|
||||
'' This object generates a 640x480 VGA signal which contains 80 columns x 30
|
||||
'' rows of 8x8 double scan characters. Each character can have a unique forground
|
||||
'' and background color combination and each character can be inversed and highlit.
|
||||
'' There are also two cursors which can be independently controlled (ie. mouse
|
||||
'' and keyboard). A sync indicator signals each time the screen is refreshed
|
||||
'' (you may ignore).
|
||||
''
|
||||
'' You must provide buffers for the screen, cursors, and sync. Once started,
|
||||
'' all interfacing is done via memory. To this object, all buffers are
|
||||
'' read-only, with the exception of the sync indicator which gets written with
|
||||
'' -1. You may freely write all buffers to affect screen appearance. Have fun!
|
||||
''
|
||||
|
||||
CON
|
||||
|
||||
' 640 x 480 @ 69Hz settings: 80 x 30 characters
|
||||
|
||||
hp = 640 ' horizontal pixels
|
||||
vp = 480 ' vertical pixels
|
||||
hf = 24 ' horizontal front porch pixels
|
||||
hs = 40 ' horizontal sync pixels
|
||||
hb = 128 ' horizontal back porch pixels
|
||||
vf = 20 ' vertical front porch lines
|
||||
vs = 3 ' vertical sync lines
|
||||
vb = 17 ' vertical back porch lines
|
||||
hn = 1 ' horizontal normal sync state (0|1)
|
||||
vn = 1 ' vertical normal sync state (0|1)
|
||||
pr = 30 ' pixel rate in MHz at 80MHz system clock (5MHz granularity)
|
||||
|
||||
' columns and rows
|
||||
|
||||
cols = hp / 8
|
||||
rows = vp / 16
|
||||
|
||||
|
||||
VAR long cog[2]
|
||||
|
||||
PUB start(BasePin, ScreenPtr, CursorPtr, SyncPtr) : okay | i, j
|
||||
|
||||
'' Start VGA driver - starts two COGs
|
||||
'' returns false if two COGs not available
|
||||
''
|
||||
'' BasePin = VGA starting pin (0, 8, 16, 24, etc.)
|
||||
''
|
||||
'' ScreenPtr = Pointer to 80x30 words containing Latin-1 codes and colors for
|
||||
'' each of the 80x30 screen characters. The lower byte of the word
|
||||
'' contains the Latin-1 code to display. The upper byte contains
|
||||
'' the foreground colour in bits 11..8 and the background colour in
|
||||
'' bits 15..12.
|
||||
''
|
||||
'' screen word example: %00011111_01000001 = "A", white on blue
|
||||
''
|
||||
'' CursorPtr = Pointer to 6 bytes which control the cursors:
|
||||
''
|
||||
'' bytes 0,1,2: X, Y, and MODE of cursor 0
|
||||
'' bytes 3,4,5: X, Y, and MODE of cursor 1
|
||||
''
|
||||
'' X and Y are in terms of screen characters
|
||||
'' (left-to-right, top-to-bottom)
|
||||
''
|
||||
'' MODE uses three bottom bits:
|
||||
''
|
||||
'' %x00 = cursor off
|
||||
'' %x01 = cursor on
|
||||
'' %x10 = cursor on, blink slow
|
||||
'' %x11 = cursor on, blink fast
|
||||
'' %0xx = cursor is solid block
|
||||
'' %1xx = cursor is underscore
|
||||
''
|
||||
'' cursor example: 127, 63, %010 = blinking block in lower-right
|
||||
''
|
||||
'' SyncPtr = Pointer to long which gets written with -1 upon each screen
|
||||
'' refresh. May be used to time writes/scrolls, so that chopiness
|
||||
'' can be avoided. You must clear it each time if you want to see
|
||||
'' it re-trigger.
|
||||
|
||||
' if driver is already running, stop it
|
||||
stop
|
||||
|
||||
' implant pin settings
|
||||
reg_vcfg := $200000FF + (BasePin & %111000) << 6
|
||||
i := $FF << (BasePin & %011000)
|
||||
j := BasePin & %100000 == 0
|
||||
reg_dira := i & j
|
||||
reg_dirb := i & !j
|
||||
|
||||
' implant CNT value to sync COGs to
|
||||
sync_cnt := cnt + $10000
|
||||
|
||||
' implant pointers
|
||||
longmove(@screen_base, @ScreenPtr, 2)
|
||||
font_base := @font
|
||||
|
||||
' implant unique settings and launch first COG
|
||||
vf_lines.byte := vf
|
||||
vb_lines.byte := vb
|
||||
font_part := 1
|
||||
cog[1] := cognew(@entry, SyncPtr) + 1
|
||||
|
||||
' allow time for first COG to launch
|
||||
waitcnt($2000 + cnt)
|
||||
|
||||
' differentiate settings and launch second COG
|
||||
vf_lines.byte := vf+8
|
||||
vb_lines.byte := vb-8
|
||||
font_part := 0
|
||||
cog[0] := cognew(@entry, SyncPtr) + 1
|
||||
|
||||
' if both COGs launched, return true
|
||||
if cog[0] and cog[1]
|
||||
return true
|
||||
|
||||
' else, stop any launched COG and return false
|
||||
stop
|
||||
|
||||
|
||||
PUB stop | i
|
||||
|
||||
'' Stop VGA driver - frees two COGs
|
||||
|
||||
repeat i from 0 to 1
|
||||
if cog[i]
|
||||
cogstop(cog[i]~ - 1)
|
||||
|
||||
|
||||
CON
|
||||
hv_inactive = (hn << 1 + vn) * $0101 'H,V inactive states
|
||||
|
||||
|
||||
DAT
|
||||
|
||||
'*****************************************************
|
||||
'* Assembly language VGA high-resolution text driver *
|
||||
'*****************************************************
|
||||
|
||||
' This program runs concurrently in two different COGs.
|
||||
'
|
||||
' Each COG's program has different values implanted for front-porch lines and
|
||||
' back-porch lines which surround the vertical sync pulse lines. This allows
|
||||
' timed interleaving of their active display signals during the visible portion
|
||||
' of the field scan. Also, they are differentiated so that one COG displays
|
||||
' even four-line groups while the other COG displays odd four-line groups.
|
||||
'
|
||||
' These COGs are launched in the PUB 'start' and are programmed to synchronize
|
||||
' their PLL-driven video circuits so that they can alternately prepare sets of
|
||||
' four scan lines and then display them. The COG-to-COG switchover is seemless
|
||||
' due to two things: exact synchronization of the two video circuits and the
|
||||
' fact that all COGs' driven output states get OR'd together, allowing one COG
|
||||
' to output lows during its preparatory state while the other COG effectively
|
||||
' drives the pins to create the visible and sync portions of its scan lines.
|
||||
' During non-visible scan lines, both COGs output together in unison.
|
||||
'
|
||||
org 0 ' set origin to $000 for start of program
|
||||
entry
|
||||
' Initialization code and data - after execution, space gets reused as scanbuff
|
||||
|
||||
' Init I/O registers and sync COGs' video circuits
|
||||
|
||||
mov dira, reg_dira ' set pin directions
|
||||
mov dirb, reg_dirb
|
||||
movi frqa, #(pr / 5) << 2 ' set pixel rate
|
||||
mov vcfg, reg_vcfg ' set video configuration
|
||||
mov vscl, #1 ' set video to reload on every pixel
|
||||
waitcnt sync_cnt, colormask ' wait for start value in cnt, add ~1ms
|
||||
movi ctra, #%00001_110 ' COGs in sync! enable PLLs now - NCOs locked!
|
||||
waitcnt sync_cnt, #0 ' wait ~1ms for PLLs to stabilize - PLLs locked!
|
||||
mov vscl, #100 ' insure initial WAITVIDs lock cleanly
|
||||
|
||||
' Main loop, display field - each COG alternately builds and displays four scan lines
|
||||
|
||||
vsync mov x, #vs ' do vertical sync lines
|
||||
call #blank_vsync
|
||||
|
||||
vb_lines mov x, #vb ' do vertical back porch lines (# set at runtime)
|
||||
call #blank_vsync
|
||||
|
||||
mov screen_ptr, screen_base ' reset screen pointer to upper-left character
|
||||
mov row, #0 ' reset row counter for cursor insertion
|
||||
mov fours, #rows ' set number of 4-line builds for whole screen
|
||||
|
||||
' Build four scan lines into scanbuff
|
||||
|
||||
fourline mov font_ptr, font_part ' get address of appropriate font section
|
||||
shl font_ptr, #7+2
|
||||
add font_ptr, font_base
|
||||
|
||||
movd :pixa, #scanbuff-1 ' reset scanbuff address (pre-decremented)
|
||||
movd :pixb, #scanbuff-1 ' reset scanbuff address (pre-decremented)
|
||||
movd :cola, #colorbuff-1 ' reset colorbuff address (pre-decremented)
|
||||
movd :colb, #colorbuff-1
|
||||
|
||||
mov y, #4 ' must build scanbuff in four sections because
|
||||
mov vscl, vscl_line2x ' ..pixel counter is limited to twelve bits
|
||||
|
||||
:halfrow waitvid underscore, #0 ' output lows to let other COG drive VGA pins
|
||||
mov x, #cols/4 ' ..for 2 scan lines, ready for a quarter row
|
||||
|
||||
:column rdword z, screen_ptr ' get character and colors from screen memory
|
||||
mov bg, z
|
||||
ror z, #7
|
||||
shr z, #32 - 9 wc
|
||||
add z, font_ptr ' add font section address to point to 8*4 pixels
|
||||
add :pixa, d0 ' increment scanbuff destination addresses
|
||||
add :pixb, d0 ' increment scanbuff destination addresses
|
||||
add screen_ptr, #2 ' increment screen memory address
|
||||
cmp font_part, #1 wz
|
||||
:pixa rdlong scanbuff, z ' read pixel long (8*4) into scanbuff
|
||||
:pixb if_c_and_z or scanbuff, underline
|
||||
|
||||
ror bg, #12 ' background color in bits 3..0
|
||||
mov fg, bg ' foreground color in bits 31..28
|
||||
shr fg, #28 ' bits 3..0
|
||||
add fg, #fg_clut ' + offset to foreground CLUT
|
||||
movs :cola, fg
|
||||
add :cola, d0
|
||||
add bg, #bg_clut ' + offset to background CLUT
|
||||
movs :colb, bg
|
||||
add :colb, d0
|
||||
:cola mov colorbuff, 0-0
|
||||
:colb or colorbuff, 0-0
|
||||
|
||||
djnz x, #:column ' another character in this half-row?
|
||||
djnz y, #:halfrow ' loop to do 2nd half-row, time for 2nd WAITVID
|
||||
|
||||
' Insert cursors into scanbuff
|
||||
|
||||
mov z, #2 ' ready for two cursors
|
||||
|
||||
:cursor rdbyte x, cursor_base ' x in range?
|
||||
add cursor_base, #1
|
||||
cmp x, #cols wc
|
||||
|
||||
rdbyte y, cursor_base ' y match?
|
||||
add cursor_base, #1
|
||||
cmp y, row wz
|
||||
|
||||
rdbyte y, cursor_base ' get cursor mode
|
||||
add cursor_base, #1
|
||||
|
||||
if_nc_or_nz jmp #:nocursor ' if cursor not in scanbuff, no cursor
|
||||
|
||||
add x, #scanbuff ' cursor in scanbuff, set scanbuff address
|
||||
movd :xor, x
|
||||
|
||||
test y, #%010 wc ' get mode bits into flags
|
||||
test y, #%001 wz
|
||||
if_nc_and_z jmp #:nocursor ' if cursor disabled, no cursor
|
||||
|
||||
if_c_and_z test slowbit, cnt wc ' if blink mode, get blink state
|
||||
if_c_and_nz test fastbit, cnt wc
|
||||
|
||||
test y, #%100 wz ' get box or underscore cursor piece
|
||||
if_z mov x, longmask
|
||||
if_nz mov x, underscore
|
||||
if_nz cmp font_part, #1 wz ' if underscore, must be last font section
|
||||
|
||||
:xor if_nc_and_z xor scanbuff, x ' conditionally xor cursor into scanbuff
|
||||
|
||||
:nocursor djnz z, #:cursor ' second cursor?
|
||||
|
||||
sub cursor_base, #3*2 ' restore cursor base
|
||||
|
||||
' Display four scan lines from scanbuff
|
||||
|
||||
mov y, #4 ' ready for four scan lines
|
||||
scanline
|
||||
mov x, #2 wc ' clear carry and set sweep count
|
||||
sweep
|
||||
mov vscl, vscl_chr
|
||||
waitvid colorbuff+ 0, scanbuff+ 0
|
||||
if_c ror scanbuff+ 0, #8
|
||||
waitvid colorbuff+ 1, scanbuff+ 1
|
||||
if_c ror scanbuff+ 1, #8
|
||||
waitvid colorbuff+ 2, scanbuff+ 2
|
||||
if_c ror scanbuff+ 2, #8
|
||||
waitvid colorbuff+ 3, scanbuff+ 3
|
||||
if_c ror scanbuff+ 3, #8
|
||||
waitvid colorbuff+ 4, scanbuff+ 4
|
||||
if_c ror scanbuff+ 4, #8
|
||||
waitvid colorbuff+ 5, scanbuff+ 5
|
||||
if_c ror scanbuff+ 5, #8
|
||||
waitvid colorbuff+ 6, scanbuff+ 6
|
||||
if_c ror scanbuff+ 6, #8
|
||||
waitvid colorbuff+ 7, scanbuff+ 7
|
||||
if_c ror scanbuff+ 7, #8
|
||||
|
||||
waitvid colorbuff+ 8, scanbuff+ 8
|
||||
if_c ror scanbuff+ 8, #8
|
||||
waitvid colorbuff+ 9, scanbuff+ 9
|
||||
if_c ror scanbuff+ 9, #8
|
||||
waitvid colorbuff+10, scanbuff+10
|
||||
if_c ror scanbuff+10, #8
|
||||
waitvid colorbuff+11, scanbuff+11
|
||||
if_c ror scanbuff+11, #8
|
||||
waitvid colorbuff+12, scanbuff+12
|
||||
if_c ror scanbuff+12, #8
|
||||
waitvid colorbuff+13, scanbuff+13
|
||||
if_c ror scanbuff+13, #8
|
||||
waitvid colorbuff+14, scanbuff+14
|
||||
if_c ror scanbuff+14, #8
|
||||
waitvid colorbuff+15, scanbuff+15
|
||||
if_c ror scanbuff+15, #8
|
||||
|
||||
waitvid colorbuff+16, scanbuff+16
|
||||
if_c ror scanbuff+16, #8
|
||||
waitvid colorbuff+17, scanbuff+17
|
||||
if_c ror scanbuff+17, #8
|
||||
waitvid colorbuff+18, scanbuff+18
|
||||
if_c ror scanbuff+18, #8
|
||||
waitvid colorbuff+19, scanbuff+19
|
||||
if_c ror scanbuff+19, #8
|
||||
waitvid colorbuff+20, scanbuff+20
|
||||
if_c ror scanbuff+20, #8
|
||||
waitvid colorbuff+21, scanbuff+21
|
||||
if_c ror scanbuff+21, #8
|
||||
waitvid colorbuff+22, scanbuff+22
|
||||
if_c ror scanbuff+22, #8
|
||||
waitvid colorbuff+23, scanbuff+23
|
||||
if_c ror scanbuff+23, #8
|
||||
|
||||
waitvid colorbuff+24, scanbuff+24
|
||||
if_c ror scanbuff+24, #8
|
||||
waitvid colorbuff+25, scanbuff+25
|
||||
if_c ror scanbuff+25, #8
|
||||
waitvid colorbuff+26, scanbuff+26
|
||||
if_c ror scanbuff+26, #8
|
||||
waitvid colorbuff+27, scanbuff+27
|
||||
if_c ror scanbuff+27, #8
|
||||
waitvid colorbuff+28, scanbuff+28
|
||||
if_c ror scanbuff+28, #8
|
||||
waitvid colorbuff+29, scanbuff+29
|
||||
if_c ror scanbuff+29, #8
|
||||
waitvid colorbuff+30, scanbuff+30
|
||||
if_c ror scanbuff+30, #8
|
||||
waitvid colorbuff+31, scanbuff+31
|
||||
if_c ror scanbuff+31, #8
|
||||
|
||||
waitvid colorbuff+32, scanbuff+32
|
||||
if_c ror scanbuff+32, #8
|
||||
waitvid colorbuff+33, scanbuff+33
|
||||
if_c ror scanbuff+33, #8
|
||||
waitvid colorbuff+34, scanbuff+34
|
||||
if_c ror scanbuff+34, #8
|
||||
waitvid colorbuff+35, scanbuff+35
|
||||
if_c ror scanbuff+35, #8
|
||||
waitvid colorbuff+36, scanbuff+36
|
||||
if_c ror scanbuff+36, #8
|
||||
waitvid colorbuff+37, scanbuff+37
|
||||
if_c ror scanbuff+37, #8
|
||||
waitvid colorbuff+38, scanbuff+38
|
||||
if_c ror scanbuff+38, #8
|
||||
waitvid colorbuff+39, scanbuff+39
|
||||
if_c ror scanbuff+39, #8
|
||||
|
||||
waitvid colorbuff+40, scanbuff+40
|
||||
if_c ror scanbuff+40, #8
|
||||
waitvid colorbuff+41, scanbuff+41
|
||||
if_c ror scanbuff+41, #8
|
||||
waitvid colorbuff+42, scanbuff+42
|
||||
if_c ror scanbuff+42, #8
|
||||
waitvid colorbuff+43, scanbuff+43
|
||||
if_c ror scanbuff+43, #8
|
||||
waitvid colorbuff+44, scanbuff+44
|
||||
if_c ror scanbuff+44, #8
|
||||
waitvid colorbuff+45, scanbuff+45
|
||||
if_c ror scanbuff+45, #8
|
||||
waitvid colorbuff+46, scanbuff+46
|
||||
if_c ror scanbuff+46, #8
|
||||
waitvid colorbuff+47, scanbuff+47
|
||||
if_c ror scanbuff+47, #8
|
||||
|
||||
waitvid colorbuff+48, scanbuff+48
|
||||
if_c ror scanbuff+48, #8
|
||||
waitvid colorbuff+49, scanbuff+49
|
||||
if_c ror scanbuff+49, #8
|
||||
waitvid colorbuff+50, scanbuff+50
|
||||
if_c ror scanbuff+50, #8
|
||||
waitvid colorbuff+51, scanbuff+51
|
||||
if_c ror scanbuff+51, #8
|
||||
waitvid colorbuff+52, scanbuff+52
|
||||
if_c ror scanbuff+52, #8
|
||||
waitvid colorbuff+53, scanbuff+53
|
||||
if_c ror scanbuff+53, #8
|
||||
waitvid colorbuff+54, scanbuff+54
|
||||
if_c ror scanbuff+54, #8
|
||||
waitvid colorbuff+55, scanbuff+55
|
||||
if_c ror scanbuff+55, #8
|
||||
|
||||
waitvid colorbuff+56, scanbuff+56
|
||||
if_c ror scanbuff+56, #8
|
||||
waitvid colorbuff+57, scanbuff+57
|
||||
if_c ror scanbuff+57, #8
|
||||
waitvid colorbuff+58, scanbuff+58
|
||||
if_c ror scanbuff+58, #8
|
||||
waitvid colorbuff+59, scanbuff+59
|
||||
if_c ror scanbuff+59, #8
|
||||
waitvid colorbuff+60, scanbuff+60
|
||||
if_c ror scanbuff+60, #8
|
||||
waitvid colorbuff+61, scanbuff+61
|
||||
if_c ror scanbuff+61, #8
|
||||
waitvid colorbuff+62, scanbuff+62
|
||||
if_c ror scanbuff+62, #8
|
||||
waitvid colorbuff+63, scanbuff+63
|
||||
if_c ror scanbuff+63, #8
|
||||
|
||||
waitvid colorbuff+64, scanbuff+64
|
||||
if_c ror scanbuff+64, #8
|
||||
waitvid colorbuff+65, scanbuff+65
|
||||
if_c ror scanbuff+65, #8
|
||||
waitvid colorbuff+66, scanbuff+66
|
||||
if_c ror scanbuff+66, #8
|
||||
waitvid colorbuff+67, scanbuff+67
|
||||
if_c ror scanbuff+67, #8
|
||||
waitvid colorbuff+68, scanbuff+68
|
||||
if_c ror scanbuff+68, #8
|
||||
waitvid colorbuff+69, scanbuff+69
|
||||
if_c ror scanbuff+69, #8
|
||||
waitvid colorbuff+70, scanbuff+70
|
||||
if_c ror scanbuff+70, #8
|
||||
waitvid colorbuff+71, scanbuff+71
|
||||
if_c ror scanbuff+71, #8
|
||||
|
||||
waitvid colorbuff+72, scanbuff+72
|
||||
if_c ror scanbuff+72, #8
|
||||
waitvid colorbuff+73, scanbuff+73
|
||||
if_c ror scanbuff+73, #8
|
||||
waitvid colorbuff+74, scanbuff+74
|
||||
if_c ror scanbuff+74, #8
|
||||
waitvid colorbuff+75, scanbuff+75
|
||||
if_c ror scanbuff+75, #8
|
||||
waitvid colorbuff+76, scanbuff+76
|
||||
if_c ror scanbuff+76, #8
|
||||
waitvid colorbuff+77, scanbuff+77
|
||||
if_c ror scanbuff+77, #8
|
||||
waitvid colorbuff+78, scanbuff+78
|
||||
if_c ror scanbuff+78, #8
|
||||
waitvid colorbuff+79, scanbuff+79
|
||||
|
||||
mov vscl, #hf ' do horizontal front porch pixels
|
||||
waitvid hvsync, #0 ' #0 makes hsync inactive
|
||||
mov vscl, #hs ' do horizontal sync pixels
|
||||
waitvid hvsync, #1 ' #1 makes hsync active
|
||||
mov vscl, #hb ' do horizontal back porch pixels
|
||||
waitvid hvsync, #0 ' #0 makes hsync inactive
|
||||
if_c ror scanbuff+79, #8
|
||||
test x, #2 wc ' set carry
|
||||
djnz x, #sweep
|
||||
djnz y, #scanline ' another scan line?
|
||||
|
||||
' Next group of four scan lines
|
||||
|
||||
add row, #1 ' if new row, increment row counter
|
||||
djnz fours, #fourline ' another 4-line build/display?
|
||||
|
||||
' Visible section done, do vertical sync front porch lines
|
||||
|
||||
wrlong longmask,par ' write -1 to refresh indicator
|
||||
|
||||
vf_lines mov x,#vf ' do vertical front porch lines (# set at runtime)
|
||||
call #blank
|
||||
|
||||
jmp #vsync ' new field, loop to vsync
|
||||
|
||||
' Subroutine - do blank lines
|
||||
|
||||
blank_vsync xor hvsync,#$101 ' flip vertical sync bits
|
||||
|
||||
blank mov vscl, hx ' do blank pixels
|
||||
waitvid hvsync, #0
|
||||
mov vscl, #hf ' do horizontal front porch pixels
|
||||
waitvid hvsync, #0
|
||||
mov vscl, #hs ' do horizontal sync pixels
|
||||
waitvid hvsync, #1
|
||||
mov vscl, #hb ' do horizontal back porch pixels
|
||||
waitvid hvsync, #0
|
||||
djnz x, #blank ' another line?
|
||||
blank_ret
|
||||
blank_vsync_ret
|
||||
ret
|
||||
|
||||
' Data
|
||||
|
||||
screen_base long 0 ' set at runtime (3 contiguous longs)
|
||||
cursor_base long 0 ' set at runtime
|
||||
|
||||
font_base long 0 ' set at runtime
|
||||
font_part long 0 ' set at runtime
|
||||
|
||||
hx long hp ' visible pixels per scan line
|
||||
vscl_line2x long (hp + hf + hs + hb) * 2 ' total number of pixels per 2 scan lines
|
||||
vscl_chr long 1 << 12 + 8 ' 1 clock per pixel and 8 pixels per set
|
||||
colormask long $fcfc ' mask to isolate R,G,B bits from H,V
|
||||
longmask long $ffffffff ' all bits set
|
||||
slowbit long 1 << 25 ' cnt mask for slow cursor blink
|
||||
fastbit long 1 << 24 ' cnt mask for fast cursor blink
|
||||
underscore long $ffff0000 ' underscore cursor pattern
|
||||
underline long $ff000000
|
||||
hv long hv_inactive ' -H,-V states
|
||||
hvsync long hv_inactive ^ $200 ' +/-H,-V states
|
||||
d0 long 1 << 9
|
||||
d0s0 long 1 << 9 + 1
|
||||
d1 long 1 << 10
|
||||
reg_dira long 0 ' set at runtime
|
||||
reg_dirb long 0 ' set at runtime
|
||||
reg_vcfg long 0 ' set at runtime
|
||||
sync_cnt long 0 ' set at runtime
|
||||
|
||||
bg_clut long %00000011_00000011 ' black
|
||||
long %00000011_00001011 ' dark blue
|
||||
long %00000011_00100011 ' dark green
|
||||
long %00000011_00101011 ' dark cyan
|
||||
long %00000011_10000011 ' dark red
|
||||
long %00000011_10001011 ' dark magenta
|
||||
long %00000011_10100011 ' brown
|
||||
long %00000011_10101011 ' light gray
|
||||
long %00000011_01010111 ' dark gray
|
||||
long %00000011_00001111 ' light blue
|
||||
long %00000011_00110011 ' light green
|
||||
long %00000011_00111111 ' light cyan
|
||||
long %00000011_11000011 ' light red
|
||||
long %00000011_11001111 ' light magenta
|
||||
long %00000011_11110011 ' light yellow
|
||||
long %00000011_11111111 ' white
|
||||
|
||||
fg_clut long %00000011_00000011 ' black
|
||||
long %00000111_00000011 ' dark blue
|
||||
long %00010011_00000011 ' dark green
|
||||
long %00010111_00000011 ' dark cyan
|
||||
long %01000011_00000011 ' dark red
|
||||
long %01000111_00000011 ' dark magenta
|
||||
long %01010011_00000011 ' brown
|
||||
long %10101011_00000011 ' light gray
|
||||
long %01010111_00000011 ' dark gray
|
||||
long %00001011_00000011 ' blue
|
||||
long %00100011_00000011 ' green
|
||||
long %00101011_00000011 ' cyan
|
||||
long %10000011_00000011 ' red
|
||||
long %10001011_00000011 ' magenta
|
||||
long %10100011_00000011 ' yellow
|
||||
long %11111111_00000011 ' white
|
||||
|
||||
' Uninitialized data
|
||||
|
||||
screen_ptr res 1
|
||||
font_ptr res 1
|
||||
|
||||
x res 1
|
||||
y res 1
|
||||
z res 1
|
||||
fg res 1
|
||||
bg res 1
|
||||
|
||||
row res 1
|
||||
fours res 1
|
||||
|
||||
scanbuff res 80
|
||||
colorbuff res 80
|
||||
|
||||
fit $1f0
|
||||
|
||||
' 8 x 12 font - characters 0..127
|
||||
'
|
||||
' Each long holds four scan lines of a single character. The longs are arranged into
|
||||
' groups of 128 which represent all characters (0..127). There are four groups which
|
||||
' each contain a vertical part of all characters. They are ordered top, middle, and
|
||||
' bottom.
|
||||
|
||||
font long
|
||||
long $00000000,$0f0f0f0f,$f0f0f0f0,$ffffffff,$00000000,$0f0f0f0f,$f0f0f0f0,$ffffffff
|
||||
long $00000000,$0f0f0f0f,$f0f0f0f0,$ffffffff,$00000000,$0f0f0f0f,$f0f0f0f0,$ffffffff
|
||||
long $7e5a3c00,$7e3c1800,$7e7e2400,$7e3c1800,$f8000000,$1f000000,$f8181818,$1f181818
|
||||
long $18181818,$ff000000,$1f181818,$f8181818,$ff181818,$ff000000,$ff181818,$aa55aa55
|
||||
long $00000000,$18181800,$66666600,$66ff6600,$3c067c18,$18366600,$1c386c38,$18181800
|
||||
long $0c0c1830,$3030180c,$ff3c6600,$7e181800,$00000000,$7e000000,$00000000,$18306000
|
||||
long $76663c00,$181c1800,$30663c00,$18307e00,$3c383000,$3e067e00,$3e063c00,$30607e00
|
||||
long $3c663c00,$7c663c00,$18180000,$18180000,$0c183060,$007e0000,$30180c06,$30663c00
|
||||
long $76663c00,$663c1800,$3e663e00,$06663c00,$66361e00,$3e067e00,$3e067e00,$06067c00
|
||||
long $7e666600,$18187e00,$60606000,$1e366600,$06060600,$feeec600,$7e6e6600,$66663c00
|
||||
long $66663e00,$66663c00,$66663e00,$3c063c00,$18187e00,$66666600,$66666600,$d6c6c600
|
||||
long $3c666600,$3c666600,$18307e00,$0c0c0c3c,$0c060200,$3030303c,$c66c3810,$00000000
|
||||
long $30180c00,$603c0000,$3e060600,$063c0000,$7c606000,$663c0000,$7c187000,$667c0000
|
||||
long $3e060600,$1c001800,$60006000,$36060600,$18181c00,$fe660000,$663e0000,$663c0000
|
||||
long $663e0000,$667c0000,$663e0000,$067c0000,$187e1800,$66660000,$66660000,$d6c60000
|
||||
long $3c660000,$66660000,$307e0000,$0c181830,$18181800,$3018180c,$0000366c,$142a142a
|
||||
|
||||
long $00000000,$00000000,$00000000,$00000000,$0f0f0f0f,$0f0f0f0f,$0f0f0f0f,$0f0f0f0f
|
||||
long $f0f0f0f0,$f0f0f0f0,$f0f0f0f0,$f0f0f0f0,$ffffffff,$ffffffff,$ffffffff,$ffffffff
|
||||
long $007e187e,$007e187e,$00183c7e,$00183c7e,$181818f8,$1818181f,$000000f8,$0000001f
|
||||
long $18181818,$000000ff,$1818181f,$181818f8,$000000ff,$181818ff,$181818ff,$aa55aa55
|
||||
long $00000000,$00180018,$00000000,$0066ff66,$00183e60,$0062660c,$00dc66f6,$00000000
|
||||
long $30180c0c,$0c183030,$0000663c,$00001818,$0c181800,$00000000,$00181800,$0002060c
|
||||
long $003c666e,$007e1818,$007e0c18,$003c6630,$00307e36,$003c6660,$003c6666,$000c0c18
|
||||
long $003c6666,$001c3060,$00181800,$0c181800,$00603018,$00007e00,$00060c18,$00180018
|
||||
long $007c0676,$00667e66,$003e6666,$003c6606,$001e3666,$007e0606,$00060606,$007c6676
|
||||
long $00666666,$007e1818,$003c6660,$0066361e,$007e0606,$00c6c6d6,$0066767e,$003c6666
|
||||
long $0006063e,$006c3666,$0066363e,$003c6060,$00181818,$007e6666,$00183c66,$00c6eefe
|
||||
long $0066663c,$00181818,$007e060c,$3c0c0c0c,$00603018,$3c303030,$00000000,$ff000000
|
||||
long $00000000,$007c667c,$003e6666,$003c0606,$007c6666,$003c067e,$00181818,$3e607c66
|
||||
long $00666666,$003c1818,$3c606060,$0066361e,$003c1818,$00c6d6fe,$00666666,$003c6666
|
||||
long $06063e66,$60607c66,$00060606,$003e603c,$00701818,$007c6666,$00183c66,$006c7cfe
|
||||
long $00663c18,$1e307c66,$007e0c18,$00301818,$00181818,$000c1818,$00000000,$002a142a
|
||||
|
||||
|
||||
{{
|
||||
+------------------------------------------------------------------------------------------------------------------------------+
|
||||
| TERMS OF USE: Parallax Object Exchange License |
|
||||
+------------------------------------------------------------------------------------------------------------------------------+
|
||||
|Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation | |files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, |
|
||||
|modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software|
|
||||
|is furnished to do so, subject to the following conditions: |
|
||||
| |
|
||||
|The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.|
|
||||
| |
|
||||
|THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE |
|
||||
|WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
|
||||
|COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
|
||||
|ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
||||
+------------------------------------------------------------------------------------------------------------------------------+
|
||||
}}
|
||||
@@ -1,602 +0,0 @@
|
||||
''***************************************
|
||||
''* VGA High-Res Text Driver v1.0 *
|
||||
''* Author: Chip Gracey *
|
||||
''* Copyright (c) 2006 Parallax, Inc. *
|
||||
''* See end of file for terms of use. *
|
||||
''***************************************
|
||||
''
|
||||
'' This object generates a 640x480 VGA signal which contains 80 columns x 30
|
||||
'' rows of 8x16 characters. Each character can have a unique forground/background
|
||||
'' color combination and each character can be inversed and high-lighted.
|
||||
'' There are also two cursors which can be independently controlled (ie. mouse
|
||||
'' and keyboard). A sync indicator signals each time the screen is refreshed
|
||||
'' (you may ignore).
|
||||
''
|
||||
'' You must provide buffers for the screen, cursors, and sync. Once started,
|
||||
'' all interfacing is done via memory. To this object, all buffers are
|
||||
'' read-only, with the exception of the sync indicator which gets written with
|
||||
'' -1. You may freely write all buffers to affect screen appearance. Have fun!
|
||||
''
|
||||
|
||||
CON
|
||||
|
||||
' 640 x 480 @ 69Hz settings: 80 x 30 characters
|
||||
|
||||
hp = 640 ' horizontal pixels
|
||||
vp = 480 ' vertical pixels
|
||||
hf = 24 ' horizontal front porch pixels
|
||||
hs = 40 ' horizontal sync pixels
|
||||
hb = 128 ' horizontal back porch pixels
|
||||
vf = 20 ' vertical front porch lines
|
||||
vs = 3 ' vertical sync lines
|
||||
vb = 17 ' vertical back porch lines
|
||||
hn = 1 ' horizontal normal sync state (0|1)
|
||||
vn = 1 ' vertical normal sync state (0|1)
|
||||
pr = 30 ' pixel rate in MHz at 80MHz system clock (5MHz granularity)
|
||||
|
||||
' columns and rows
|
||||
|
||||
cols = hp / 8
|
||||
rows = vp / 16
|
||||
|
||||
|
||||
VAR long cog[2]
|
||||
|
||||
PUB start(BasePin, ScreenPtr, CursorPtr, SyncPtr) : okay | i, j
|
||||
|
||||
'' Start VGA driver - starts two COGs
|
||||
'' returns false if two COGs not available
|
||||
''
|
||||
'' BasePin = VGA starting pin (0, 8, 16, 24, etc.)
|
||||
''
|
||||
'' ScreenPtr = Pointer to 80x30 words containing Latin-1 codes and colors for
|
||||
'' each of the 80x30 screen characters. The lower byte of the word
|
||||
'' contains the Latin-1 code to display. The upper byte contains
|
||||
'' the foreground colour in bits 11..8 and the background colour in
|
||||
'' bits 15..12.
|
||||
''
|
||||
'' screen word example: %00011111_01000001 = "A", white on blue
|
||||
''
|
||||
'' CursorPtr = Pointer to 6 bytes which control the cursors:
|
||||
''
|
||||
'' bytes 0,1,2: X, Y, and MODE of cursor 0
|
||||
'' bytes 3,4,5: X, Y, and MODE of cursor 1
|
||||
''
|
||||
'' X and Y are in terms of screen characters
|
||||
'' (left-to-right, top-to-bottom)
|
||||
''
|
||||
'' MODE uses three bottom bits:
|
||||
''
|
||||
'' %x00 = cursor off
|
||||
'' %x01 = cursor on
|
||||
'' %x10 = cursor on, blink slow
|
||||
'' %x11 = cursor on, blink fast
|
||||
'' %0xx = cursor is solid block
|
||||
'' %1xx = cursor is underscore
|
||||
''
|
||||
'' cursor example: 127, 63, %010 = blinking block in lower-right
|
||||
''
|
||||
'' SyncPtr = Pointer to long which gets written with -1 upon each screen
|
||||
'' refresh. May be used to time writes/scrolls, so that chopiness
|
||||
'' can be avoided. You must clear it each time if you want to see
|
||||
'' it re-trigger.
|
||||
|
||||
' if driver is already running, stop it
|
||||
stop
|
||||
|
||||
' implant pin settings
|
||||
reg_vcfg := $200000FF + (BasePin & %111000) << 6
|
||||
i := $FF << (BasePin & %011000)
|
||||
j := BasePin & %100000 == 0
|
||||
reg_dira := i & j
|
||||
reg_dirb := i & !j
|
||||
|
||||
' implant CNT value to sync COGs to
|
||||
sync_cnt := cnt + $10000
|
||||
|
||||
' implant pointers
|
||||
longmove(@screen_base, @ScreenPtr, 2)
|
||||
font_base := @font
|
||||
|
||||
' implant unique settings and launch first COG
|
||||
vf_lines.byte := vf
|
||||
vb_lines.byte := vb
|
||||
font_part := 1
|
||||
cog[1] := cognew(@d0, SyncPtr) + 1
|
||||
|
||||
' allow time for first COG to launch
|
||||
waitcnt($2000 + cnt)
|
||||
|
||||
' differentiate settings and launch second COG
|
||||
vf_lines.byte := vf+4
|
||||
vb_lines.byte := vb-4
|
||||
font_part := 0
|
||||
cog[0] := cognew(@d0, SyncPtr) + 1
|
||||
|
||||
' if both COGs launched, return true
|
||||
if cog[0] and cog[1]
|
||||
return true
|
||||
|
||||
' else, stop any launched COG and return false
|
||||
stop
|
||||
|
||||
|
||||
PUB stop | i
|
||||
|
||||
'' Stop VGA driver - frees two COGs
|
||||
|
||||
repeat i from 0 to 1
|
||||
if cog[i]
|
||||
cogstop(cog[i]~ - 1)
|
||||
|
||||
|
||||
CON
|
||||
|
||||
#1, scanbuff[80], colorbuff[80], scancode[2*80-1+3], maincode 'enumerate COG RAM usage
|
||||
|
||||
main_size = $1F0 - maincode 'size of main program
|
||||
|
||||
hv_inactive = (hn << 1 + vn) * $0101 'H,V inactive states
|
||||
|
||||
|
||||
DAT
|
||||
|
||||
'*****************************************************
|
||||
'* Assembly language VGA high-resolution text driver *
|
||||
'*****************************************************
|
||||
|
||||
' This program runs concurrently in two different COGs.
|
||||
'
|
||||
' Each COG's program has different values implanted for front-porch lines and
|
||||
' back-porch lines which surround the vertical sync pulse lines. This allows
|
||||
' timed interleaving of their active display signals during the visible portion
|
||||
' of the field scan. Also, they are differentiated so that one COG displays
|
||||
' even four-line groups while the other COG displays odd four-line groups.
|
||||
'
|
||||
' These COGs are launched in the PUB 'start' and are programmed to synchronize
|
||||
' their PLL-driven video circuits so that they can alternately prepare sets of
|
||||
' four scan lines and then display them. The COG-to-COG switchover is seemless
|
||||
' due to two things: exact synchronization of the two video circuits and the
|
||||
' fact that all COGs' driven output states get OR'd together, allowing one COG
|
||||
' to output lows during its preparatory state while the other COG effectively
|
||||
' drives the pins to create the visible and sync portions of its scan lines.
|
||||
' During non-visible scan lines, both COGs output together in unison.
|
||||
'
|
||||
' COG RAM usage: $000 = d0 - used to inc destination fields for indirection
|
||||
' $001-$050 = scanbuff - longs which hold 4 scan lines
|
||||
' $051-$010 = colorbuff - longs which hold colors for 80 characters
|
||||
' $0a1-$142 = scancode - stacked WAITVID/SHR for fast display
|
||||
' $143-$1EF = maincode - main program loop which drives display
|
||||
|
||||
org 0 ' set origin to $000 for start of program
|
||||
|
||||
d0 long 1 << 9 ' d0 always resides here at $000, executes as NOP
|
||||
|
||||
|
||||
' Initialization code and data - after execution, space gets reused as scanbuff
|
||||
|
||||
' Move main program into maincode area
|
||||
|
||||
:move mov $1EF, main_begin + main_size - 1
|
||||
sub :move,d0s0 ' (do reverse move to avoid overwrite)
|
||||
djnz main_ctr,#:move
|
||||
|
||||
' Build scanbuff display routine into scancode
|
||||
|
||||
:waitvid mov scancode+0, i0 ' org scancode
|
||||
:shr mov scancode+1, i1 ' waitvid colorbuff+0, scanbuff+0
|
||||
add :waitvid, d1 ' shr scanbuff+0,#8
|
||||
add :shr, d1 ' waitvid colorbuff+1, scanbuff+1
|
||||
add i0, d0s0 ' shr scanbuff+1,#8
|
||||
add i1, d0 ' ...
|
||||
djnz scan_ctr, #:waitvid ' waitvid colorbuff+cols-1, scanbuff+cols-1
|
||||
|
||||
mov scancode+cols*2-1, i2 ' mov vscl,#hf
|
||||
mov scancode+cols*2+0, i3 ' waitvid hvsync,#0
|
||||
mov scancode+cols*2+1, i4 ' jmp #scanret
|
||||
|
||||
' Init I/O registers and sync COGs' video circuits
|
||||
|
||||
mov dira, reg_dira ' set pin directions
|
||||
mov dirb, reg_dirb
|
||||
movi frqa, #(pr / 5) << 2 ' set pixel rate
|
||||
mov vcfg, reg_vcfg ' set video configuration
|
||||
mov vscl, #1 ' set video to reload on every pixel
|
||||
waitcnt sync_cnt, colormask ' wait for start value in cnt, add ~1ms
|
||||
movi ctra, #%00001_110 ' COGs in sync! enable PLLs now - NCOs locked!
|
||||
waitcnt sync_cnt, #0 ' wait ~1ms for PLLs to stabilize - PLLs locked!
|
||||
mov vscl, #100 ' insure initial WAITVIDs lock cleanly
|
||||
|
||||
' Jump to main loop
|
||||
|
||||
jmp #vsync ' jump to vsync - WAITVIDs will now be locked!
|
||||
|
||||
' Data
|
||||
|
||||
d0s0 long 1 << 9 + 1
|
||||
d1 long 1 << 10
|
||||
main_ctr long main_size
|
||||
scan_ctr long cols
|
||||
|
||||
i0 waitvid colorbuff+0, scanbuff+0
|
||||
i1 shr scanbuff+0, #8
|
||||
i2 mov vscl, #hf
|
||||
i3 waitvid hvsync, #0
|
||||
i4 jmp #scanret
|
||||
|
||||
reg_dira long 0 ' set at runtime
|
||||
reg_dirb long 0 ' set at runtime
|
||||
reg_vcfg long 0 ' set at runtime
|
||||
sync_cnt long 0 ' set at runtime
|
||||
|
||||
' Directives
|
||||
|
||||
fit scancode ' make sure initialization code and data fit
|
||||
main_begin org maincode ' main code follows (gets moved into maincode)
|
||||
|
||||
|
||||
' Main loop, display field - each COG alternately builds and displays four scan lines
|
||||
|
||||
vsync mov x, #vs ' do vertical sync lines
|
||||
call #blank_vsync
|
||||
|
||||
vb_lines mov x, #vb ' do vertical back porch lines (# set at runtime)
|
||||
call #blank_vsync
|
||||
|
||||
mov screen_ptr, screen_base ' reset screen pointer to upper-left character
|
||||
mov row, #0 ' reset row counter for cursor insertion
|
||||
mov fours, #rows * 4 / 2 ' set number of 4-line builds for whole screen
|
||||
|
||||
' Build four scan lines into scanbuff
|
||||
|
||||
fourline mov font_ptr, font_part ' get address of appropriate font section
|
||||
shl font_ptr, #8+2
|
||||
add font_ptr, font_base
|
||||
|
||||
movd :pixa, #scanbuff-1 ' reset scanbuff address (pre-decremented)
|
||||
movd :cola, #colorbuff-1 ' reset colorbuff address (pre-decremented)
|
||||
movd :colb, #colorbuff-1
|
||||
|
||||
mov y, #2 ' must build scanbuff in two sections because
|
||||
mov vscl, vscl_line2x ' ..pixel counter is limited to twelve bits
|
||||
|
||||
:halfrow waitvid underscore, #0 ' output lows to let other COG drive VGA pins
|
||||
mov x, #cols/2 ' ..for 2 scan lines, ready for half a row
|
||||
|
||||
:column rdword z, screen_ptr ' get character and colors from screen memory
|
||||
mov bg, z
|
||||
and z, #$ff ' mask character code
|
||||
shl z, #2 ' * 4
|
||||
add z, font_ptr ' add font section address to point to 8*4 pixels
|
||||
add :pixa, d0 ' increment scanbuff destination addresses
|
||||
add screen_ptr, #2 ' increment screen memory address
|
||||
:pixa rdlong scanbuff, z ' read pixel long (8*4) into scanbuff
|
||||
|
||||
ror bg, #12 ' background color in bits 3..0
|
||||
mov fg, bg ' foreground color in bits 31..28
|
||||
shr fg, #28 ' bits 3..0
|
||||
add fg, #fg_clut ' + offset to foreground CLUT
|
||||
movs :cola, fg
|
||||
add :cola, d0
|
||||
add bg, #bg_clut ' + offset to background CLUT
|
||||
movs :colb, bg
|
||||
add :colb, d0
|
||||
:cola mov colorbuff, 0-0
|
||||
:colb or colorbuff, 0-0
|
||||
|
||||
djnz x, #:column ' another character in this half-row?
|
||||
|
||||
djnz y, #:halfrow ' loop to do 2nd half-row, time for 2nd WAITVID
|
||||
|
||||
sub screen_ptr, #2*cols ' back up to start of same row in screen memory
|
||||
|
||||
' Insert cursors into scanbuff
|
||||
|
||||
mov z, #2 ' ready for two cursors
|
||||
|
||||
:cursor rdbyte x, cursor_base ' x in range?
|
||||
add cursor_base, #1
|
||||
cmp x, #cols wc
|
||||
|
||||
rdbyte y, cursor_base ' y match?
|
||||
add cursor_base, #1
|
||||
cmp y, row wz
|
||||
|
||||
rdbyte y, cursor_base ' get cursor mode
|
||||
add cursor_base, #1
|
||||
|
||||
if_nc_or_nz jmp #:nocursor ' if cursor not in scanbuff, no cursor
|
||||
|
||||
add x, #scanbuff ' cursor in scanbuff, set scanbuff address
|
||||
movd :xor, x
|
||||
|
||||
test y, #%010 wc ' get mode bits into flags
|
||||
test y, #%001 wz
|
||||
if_nc_and_z jmp #:nocursor ' if cursor disabled, no cursor
|
||||
|
||||
if_c_and_z test slowbit, cnt wc ' if blink mode, get blink state
|
||||
if_c_and_nz test fastbit, cnt wc
|
||||
|
||||
test y, #%100 wz ' get box or underscore cursor piece
|
||||
if_z mov x, longmask
|
||||
if_nz mov x, underscore
|
||||
if_nz cmp font_part, #3 wz ' if underscore, must be last font section
|
||||
|
||||
:xor if_nc_and_z xor scanbuff, x ' conditionally xor cursor into scanbuff
|
||||
|
||||
:nocursor djnz z, #:cursor ' second cursor?
|
||||
|
||||
sub cursor_base, #3*2 ' restore cursor base
|
||||
|
||||
' Display four scan lines from scanbuff
|
||||
|
||||
mov y, #4 ' ready for four scan lines
|
||||
|
||||
scanline mov vscl, vscl_chr ' set pixel rate for characters
|
||||
jmp #scancode ' jump to scanbuff display routine in scancode
|
||||
scanret mov vscl, #hs ' do horizontal sync pixels
|
||||
waitvid hvsync, #1 ' #1 makes hsync active
|
||||
mov vscl, #hb ' do horizontal back porch pixels
|
||||
waitvid hvsync, #0 ' #0 makes hsync inactive
|
||||
shr scanbuff+cols-1, #8 ' shift last column's pixels right by 8
|
||||
djnz y, #scanline ' another scan line?
|
||||
|
||||
' Next group of four scan lines
|
||||
|
||||
add font_part, #2 ' if font_part + 2 => 4, subtract 4 (new row)
|
||||
cmpsub font_part, #4 wc ' c=0 for same row, c=1 for new row
|
||||
if_c add screen_ptr, #2*cols ' if new row, advance screen pointer
|
||||
if_c add row, #1 ' if new row, increment row counter
|
||||
djnz fours, #fourline ' another 4-line build/display?
|
||||
|
||||
' Visible section done, do vertical sync front porch lines
|
||||
|
||||
wrlong longmask,par ' write -1 to refresh indicator
|
||||
|
||||
vf_lines mov x,#vf ' do vertical front porch lines (# set at runtime)
|
||||
call #blank
|
||||
|
||||
jmp #vsync ' new field, loop to vsync
|
||||
|
||||
' Subroutine - do blank lines
|
||||
|
||||
blank_vsync xor hvsync,#$101 ' flip vertical sync bits
|
||||
|
||||
blank mov vscl, hx ' do blank pixels
|
||||
waitvid hvsync, #0
|
||||
mov vscl, #hf ' do horizontal front porch pixels
|
||||
waitvid hvsync, #0
|
||||
mov vscl, #hs ' do horizontal sync pixels
|
||||
waitvid hvsync, #1
|
||||
mov vscl, #hb ' do horizontal back porch pixels
|
||||
waitvid hvsync, #0
|
||||
djnz x,#blank ' another line?
|
||||
blank_ret
|
||||
blank_vsync_ret
|
||||
ret
|
||||
|
||||
' Data
|
||||
|
||||
screen_base long 0 ' set at runtime (3 contiguous longs)
|
||||
cursor_base long 0 ' set at runtime
|
||||
|
||||
font_base long 0 ' set at runtime
|
||||
font_part long 0 ' set at runtime
|
||||
|
||||
hx long hp ' visible pixels per scan line
|
||||
vscl_line long hp + hf + hs + hb ' total number of pixels per scan line
|
||||
vscl_line2x long (hp + hf + hs + hb) * 2 ' total number of pixels per 2 scan lines
|
||||
vscl_chr long 1 << 12 + 8 ' 1 clock per pixel and 8 pixels per set
|
||||
colormask long $FCFC ' mask to isolate R,G,B bits from H,V
|
||||
longmask long $FFFFFFFF ' all bits set
|
||||
slowbit long 1 << 25 ' cnt mask for slow cursor blink
|
||||
fastbit long 1 << 24 ' cnt mask for fast cursor blink
|
||||
underscore long $FFFF0000 ' underscore cursor pattern
|
||||
hv long hv_inactive ' -H,-V states
|
||||
hvsync long hv_inactive ^ $200 ' +/-H,-V states
|
||||
|
||||
bg_clut long %00000011_00000011 ' black
|
||||
long %00000011_00001011 ' dark blue
|
||||
long %00000011_00100011 ' dark green
|
||||
long %00000011_00101011 ' dark cyan
|
||||
long %00000011_10000011 ' dark red
|
||||
long %00000011_10001011 ' dark magenta
|
||||
long %00000011_10100011 ' brown
|
||||
long %00000011_10101011 ' light gray
|
||||
long %00000011_01010111 ' dark gray
|
||||
long %00000011_00001111 ' light blue
|
||||
long %00000011_00110011 ' light green
|
||||
long %00000011_00111111 ' light cyan
|
||||
long %00000011_11000011 ' light red
|
||||
long %00000011_11001111 ' light magenta
|
||||
long %00000011_11110011 ' light yellow
|
||||
long %00000011_11111111 ' white
|
||||
|
||||
fg_clut long %00000011_00000011 ' black
|
||||
long %00000111_00000011 ' dark blue
|
||||
long %00010011_00000011 ' dark green
|
||||
long %00010111_00000011 ' dark cyan
|
||||
long %01000011_00000011 ' dark red
|
||||
long %01000111_00000011 ' dark magenta
|
||||
long %01010011_00000011 ' brown
|
||||
long %10101011_00000011 ' light gray
|
||||
long %01010111_00000011 ' dark gray
|
||||
long %00001011_00000011 ' blue
|
||||
long %00100011_00000011 ' green
|
||||
long %00101011_00000011 ' cyan
|
||||
long %10000011_00000011 ' red
|
||||
long %10001011_00000011 ' magenta
|
||||
long %10100011_00000011 ' yellow
|
||||
long %11111111_00000011 ' white
|
||||
|
||||
' Uninitialized data
|
||||
|
||||
screen_ptr res 1
|
||||
font_ptr res 1
|
||||
|
||||
x res 1
|
||||
y res 1
|
||||
z res 1
|
||||
fg res 1
|
||||
bg res 1
|
||||
|
||||
row res 1
|
||||
fours res 1
|
||||
|
||||
|
||||
fit $1f0
|
||||
|
||||
' 8 x 12 font - characters 0..127
|
||||
'
|
||||
' Each long holds four scan lines of a single character. The longs are arranged into
|
||||
' groups of 128 which represent all characters (0..127). There are four groups which
|
||||
' each contain a vertical part of all characters. They are ordered top, middle, and
|
||||
' bottom.
|
||||
|
||||
font long
|
||||
long $0082ba00,$00000000,$2a552a00,$36360000,$061e0000,$061c0000,$06060000,$3c000000
|
||||
long $00000000,$6e660000,$66660000,$18181818,$00000000,$00000000,$18181818,$18181818
|
||||
long $0000ffff,$00000000,$00000000,$00000000,$00000000,$18181818,$18181818,$18181818
|
||||
long $00000000,$18181818,$60000000,$06000000,$00000000,$00000000,$38000000,$00000000
|
||||
long $00000000,$18000000,$36000000,$24000000,$18000000,$4e000000,$1c000000,$18000000
|
||||
long $30000000,$0c000000,$00000000,$00000000,$00000000,$00000000,$00000000,$60000000
|
||||
long $18000000,$18000000,$3c000000,$7e000000,$60000000,$7e000000,$3c000000,$7e000000
|
||||
long $3c000000,$3c000000,$00000000,$00000000,$60000000,$00000000,$06000000,$3c000000
|
||||
long $3c000000,$3c000000,$3e000000,$3c000000,$3e000000,$7e000000,$7e000000,$3c000000
|
||||
long $66000000,$7e000000,$60000000,$46000000,$06000000,$42000000,$66000000,$3c000000
|
||||
long $3e000000,$3c000000,$3e000000,$3c000000,$7e000000,$66000000,$66000000,$66000000
|
||||
long $42000000,$66000000,$7e000000,$3c000000,$06000000,$3c000000,$18000000,$00000000
|
||||
long $180c0000,$00000000,$06000000,$00000000,$60000000,$00000000,$38000000,$00000000
|
||||
long $06000000,$18000000,$60000000,$06000000,$1c000000,$00000000,$00000000,$00000000
|
||||
long $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
|
||||
long $00000000,$00000000,$00000000,$38000000,$18000000,$1c000000,$4c000000,$aa55aa55
|
||||
long $00000000,$00000000,$2a552a00,$36360000,$061e0000,$061c0000,$06060000,$3c000000
|
||||
long $00000000,$6e660000,$66660000,$24242424,$00000000,$00000000,$24242424,$24242424
|
||||
long $00ff00ff,$ff000000,$00000000,$00000000,$00000000,$24242424,$24242424,$24242424
|
||||
long $00000000,$24242424,$60000000,$06000000,$00000000,$00000000,$38000000,$00000000
|
||||
long $00000000,$18000000,$36000000,$24000000,$18000000,$4e000000,$1c000000,$18000000
|
||||
long $30000000,$0c000000,$00000000,$00000000,$00000000,$00000000,$00000000,$60000000
|
||||
long $18000000,$18000000,$3c000000,$7e000000,$60000000,$7e000000,$3c000000,$7e000000
|
||||
long $3c000000,$3c000000,$00000000,$00000000,$60000000,$00000000,$06000000,$3c000000
|
||||
long $3c000000,$3c000000,$3e000000,$3c000000,$3e000000,$7e000000,$7e000000,$3c000000
|
||||
long $66000000,$7e000000,$60000000,$46000000,$06000000,$42000000,$66000000,$3c000000
|
||||
long $3e000000,$3c000000,$3e000000,$3c000000,$7e000000,$66000000,$66000000,$66000000
|
||||
long $42000000,$66000000,$7e000000,$3c000000,$06000000,$3c000000,$18000000,$00000000
|
||||
long $180c0000,$00000000,$06000000,$00000000,$60000000,$00000000,$38000000,$00000000
|
||||
long $06000000,$18000000,$60000000,$06000000,$1c000000,$00000000,$00000000,$00000000
|
||||
long $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
|
||||
long $00000000,$00000000,$00000000,$38000000,$18000000,$1c000000,$4c000000,$aa55aa55
|
||||
long $82008282,$3c180000,$2a552a55,$0036363e,$0006060e,$001c0606,$001e0606,$003c6666
|
||||
long $187e1818,$0066767e,$00183c24,$1f181818,$1f000000,$f8000000,$f8181818,$ff181818
|
||||
long $00000000,$0000ffff,$00000000,$00000000,$00000000,$f8181818,$1f181818,$ff181818
|
||||
long $ff000000,$18181818,$0c060c30,$3060300c,$667e0000,$187e3030,$3e0c0c6c,$18180000
|
||||
long $00000000,$18181818,$00003636,$247e7e24,$3c1a5a3c,$18302e6a,$1c363636,$00181818
|
||||
long $0c0c1818,$30301818,$7e182400,$7e181800,$00000000,$00000000,$00000000,$18303060
|
||||
long $66666624,$18181a1c,$38606666,$3c183060,$666c7870,$663e0606,$3e060666,$30306060
|
||||
long $3c666666,$7c666666,$183c1800,$183c1800,$060c1830,$007e0000,$6030180c,$38606666
|
||||
long $6a7a6262,$7e666666,$3e666666,$06060666,$66666666,$3e060606,$3e060606,$76060666
|
||||
long $7e666666,$18181818,$60606060,$0e1e3666,$06060606,$667e7e66,$7e6e6e66,$66666666
|
||||
long $3e666666,$66666666,$3e666666,$3c060666,$18181818,$66666666,$24246666,$66666666
|
||||
long $183c2466,$183c3c66,$18306060,$0c0c0c0c,$180c0c06,$30303030,$0042663c,$00000000
|
||||
long $00000030,$603c0000,$663e0606,$663c0000,$667c6060,$663c0000,$1e0c0c6c,$665c0000
|
||||
long $663e0606,$181c0018,$60600060,$36660606,$18181818,$fe6a0000,$663e0000,$663c0000
|
||||
long $663e0000,$667c0000,$663e0000,$663c0000,$0c3e0c0c,$66660000,$66660000,$66660000
|
||||
long $66660000,$66660000,$607e0000,$0c180c0c,$18181818,$30183030,$0000327e,$aa55aa55
|
||||
long $00000000,$3c180000,$2a552a55,$0036363e,$0006060e,$001c0606,$001e0606,$003c6666
|
||||
long $187e1818,$0066767e,$00183c24,$20272424,$203f0000,$04fc0000,$04e42424,$00e72424
|
||||
long $00000000,$0000ff00,$ff000000,$00000000,$00000000,$04e42424,$20272424,$00e72424
|
||||
long $00ff0000,$24242424,$0c060c30,$3060300c,$667e0000,$187e3030,$3e0c0c6c,$18180000
|
||||
long $00000000,$18181818,$00003636,$247e7e24,$3c1a5a3c,$18302e6a,$1c363636,$00181818
|
||||
long $0c0c1818,$30301818,$7e182400,$7e181800,$00000000,$00000000,$00000000,$18303060
|
||||
long $66666624,$18181a1c,$38606666,$3c183060,$666c7870,$663e0606,$3e060666,$30306060
|
||||
long $3c666666,$7c666666,$183c1800,$183c1800,$060c1830,$007e0000,$6030180c,$38606666
|
||||
long $76766666,$7e666666,$3e666666,$06060666,$66666666,$3e060606,$3e060606,$76060666
|
||||
long $7e666666,$18181818,$60606060,$0e1e3666,$06060606,$667e7e66,$7e6e6e66,$66666666
|
||||
long $3e666666,$66666666,$3e666666,$3c060666,$18181818,$66666666,$24246666,$66666666
|
||||
long $183c2466,$183c3c66,$18306060,$0c0c0c0c,$180c0c06,$30303030,$0042663c,$00000000
|
||||
long $00000030,$603c0000,$663e0606,$663c0000,$667c6060,$663c0000,$1e0c0c6c,$665c0000
|
||||
long $663e0606,$181c0018,$60600060,$36660606,$18181818,$fe6a0000,$663e0000,$663c0000
|
||||
long $663e0000,$667c0000,$663e0000,$663c0000,$0c3e0c0c,$66660000,$66660000,$66660000
|
||||
long $66660000,$66660000,$607e0000,$0c180c0c,$18181818,$30183030,$0000327e,$aa55aa55
|
||||
long $82820082,$00183c7e,$2a552a55,$30303078,$18381878,$58385838,$18381878,$00000000
|
||||
long $007e0018,$18181818,$30303078,$0000001f,$1818181f,$181818f8,$000000f8,$181818ff
|
||||
long $00000000,$00000000,$0000ffff,$ff000000,$00000000,$181818f8,$1818181f,$000000ff
|
||||
long $181818ff,$18181818,$7e006030,$7e00060c,$66666666,$0c0c7e18,$3a6c0c0c,$00000000
|
||||
long $00000000,$18180018,$00000000,$24247e7e,$183c5a58,$7256740c,$5c367656,$00000000
|
||||
long $3018180c,$0c181830,$0024187e,$0018187e,$18383800,$0000007e,$3c180000,$06060c0c
|
||||
long $18246666,$7e181818,$7e06060c,$3c666060,$60607e66,$3c666060,$3c666666,$0c0c1818
|
||||
long $3c666666,$3c666060,$3c180000,$18383800,$6030180c,$00007e00,$060c1830,$18180018
|
||||
long $3c62027a,$66666666,$3e666666,$3c660606,$3e666666,$7e060606,$06060606,$7c666666
|
||||
long $66666666,$7e181818,$3c666060,$4666361e,$7e060606,$66666666,$66667676,$3c666666
|
||||
long $06060606,$3c766e66,$4666361e,$3c666060,$18181818,$3c666666,$1818183c,$42667e7e
|
||||
long $4266243c,$18181818,$7e06060c,$3c0c0c0c,$60603030,$3c303030,$00000000,$fe000000
|
||||
long $00000000,$7c66667c,$3e666666,$3c660606,$7c666666,$3c66067e,$0c0c0c0c,$3c063c66
|
||||
long $66666666,$7e181818,$60606060,$66361e1e,$7e181818,$c6c6d6d6,$66666666,$3c666666
|
||||
long $063e6666,$607c6666,$06060606,$3c66300c,$386c0c0c,$7c666666,$183c3c66,$247e7e66
|
||||
long $66663c3c,$607c6666,$7e060c30,$380c0c18,$18181818,$1c303018,$00000000,$aa55aa55
|
||||
long $00000000,$00183c7e,$2a552a55,$30303078,$18381878,$58385838,$18381878,$00000000
|
||||
long $007e0018,$18181818,$30303078,$00003f20,$24242720,$2424e404,$0000fc04,$2424e700
|
||||
long $00000000,$00000000,$0000ff00,$00ff0000,$00000000,$2424e404,$24242720,$0000ff00
|
||||
long $2424e700,$24242424,$7e006030,$7e00060c,$66666666,$0c0c7e18,$3a6c0c0c,$00000000
|
||||
long $00000000,$18180018,$00000000,$24247e7e,$183c5a58,$7256740c,$5c367656,$00000000
|
||||
long $3018180c,$0c181830,$0024187e,$0018187e,$18383800,$0000007e,$3c180000,$06060c0c
|
||||
long $18246666,$7e181818,$7e06060c,$3c666060,$60607e66,$3c666060,$3c666666,$0c0c1818
|
||||
long $3c666666,$3c666060,$3c180000,$18383800,$6030180c,$00007e00,$060c1830,$18180018
|
||||
long $3c660676,$66666666,$3e666666,$3c660606,$3e666666,$7e060606,$06060606,$7c666666
|
||||
long $66666666,$7e181818,$3c666060,$4666361e,$7e060606,$66666666,$66667676,$3c666666
|
||||
long $06060606,$3c766e66,$4666361e,$3c666060,$18181818,$3c666666,$1818183c,$42667e7e
|
||||
long $4266243c,$18181818,$7e06060c,$3c0c0c0c,$60603030,$3c303030,$00000000,$fe000000
|
||||
long $00000000,$7c66667c,$3e666666,$3c660606,$7c666666,$3c66067e,$0c0c0c0c,$3c063c66
|
||||
long $66666666,$7e181818,$60606060,$66361e1e,$7e181818,$c6c6d6d6,$66666666,$3c666666
|
||||
long $063e6666,$607c6666,$06060606,$3c66300c,$386c0c0c,$7c666666,$183c3c66,$247e7e66
|
||||
long $66663c3c,$607c6666,$7e060c30,$380c0c18,$18181818,$1c303018,$00000000,$aa55aa55
|
||||
long $00ba8200,$00000000,$00002a55,$00000030,$00000018,$00000058,$00000018,$00000000
|
||||
long $00000000,$00000078,$00000030,$00000000,$18181818,$18181818,$00000000,$18181818
|
||||
long $00000000,$00000000,$00000000,$000000ff,$ffff0000,$18181818,$18181818,$00000000
|
||||
long $18181818,$18181818,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
|
||||
long $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
|
||||
long $00000000,$00000000,$00000000,$00000000,$0000000c,$00000000,$00000018,$00000000
|
||||
long $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
|
||||
long $00000000,$00000000,$00000018,$0000000c,$00000000,$00000000,$00000000,$00000000
|
||||
long $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
|
||||
long $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
|
||||
long $00000000,$00000060,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
|
||||
long $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$000000fe
|
||||
long $00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000,$00003c66
|
||||
long $00000000,$00000000,$00003c66,$00000000,$00000000,$00000000,$00000000,$00000000
|
||||
long $00000606,$00006060,$00000000,$00000000,$00000000,$00000000,$00000000,$00000000
|
||||
long $00000000,$00003c66,$00000000,$00000000,$00000000,$00000000,$00000000,$aa55aa55
|
||||
long $ff000000,$ff000000,$ff002a55,$ff000030,$ff000018,$ff000058,$ff000018,$ff000000
|
||||
long $ff000000,$ff000078,$ff000030,$00000000,$24242424,$24242424,$00000000,$24242424
|
||||
long $00000000,$00000000,$00000000,$000000ff,$ff00ff00,$24242424,$24242424,$00000000
|
||||
long $24242424,$24242424,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000
|
||||
long $ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000
|
||||
long $ff000000,$ff000000,$ff000000,$ff000000,$ff00000c,$ff000000,$ff000018,$ff000000
|
||||
long $ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000
|
||||
long $ff000000,$ff000000,$ff000018,$ff00000c,$ff000000,$ff000000,$ff000000,$ff000000
|
||||
long $ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000
|
||||
long $ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000
|
||||
long $ff000000,$ff000060,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000
|
||||
long $ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff0000fe
|
||||
long $ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff003c66
|
||||
long $ff000000,$ff000000,$ff003c66,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000
|
||||
long $ff000606,$ff006060,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000
|
||||
long $ff000000,$ff003c66,$ff000000,$ff000000,$ff000000,$ff000000,$ff000000,$ff55aa55
|
||||
|
||||
|
||||
{{
|
||||
+------------------------------------------------------------------------------------------------------------------------------+
|
||||
| TERMS OF USE: Parallax Object Exchange License |
|
||||
+------------------------------------------------------------------------------------------------------------------------------+
|
||||
|Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation | |files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, |
|
||||
|modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software|
|
||||
|is furnished to do so, subject to the following conditions: |
|
||||
| |
|
||||
|The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.|
|
||||
| |
|
||||
|THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE |
|
||||
|WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
|
||||
|COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
|
||||
|ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
|
||||
+------------------------------------------------------------------------------------------------------------------------------+
|
||||
}}
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -1,102 +0,0 @@
|
||||
CON
|
||||
_xinfreq = 5_000_000 ' Quartz is 5MHz
|
||||
_clkmode = xtal1 + pll16x ' System clock is 80MHz
|
||||
|
||||
#define DracBladeProp
|
||||
|
||||
CHAR_W = 80
|
||||
CHAR_H = 30
|
||||
|
||||
OBJ
|
||||
' vga : "vga8x8d"
|
||||
vga : "vgacolour"
|
||||
vt100 : "vt100"
|
||||
|
||||
VAR
|
||||
long params[6]
|
||||
long seed
|
||||
|
||||
PUB main
|
||||
vga.start(16, @screen, @cursor, @sync)
|
||||
params[0] := @command
|
||||
params[1] := @screen
|
||||
params[2] := @cursor
|
||||
params[3] := @sync
|
||||
params[4] := CHAR_W
|
||||
params[5] := CHAR_H
|
||||
|
||||
vt100.start(@params)
|
||||
|
||||
seed := cnt
|
||||
|
||||
str(string(27,"[2;34m",27,"[2J",27,"[H","Hello World!",13,10))
|
||||
str(string(27,"[7m","Inverse on",13,10))
|
||||
str(string(27,"[27m","Inverse off",13,10))
|
||||
str(string(27,"[1m","Highlite on",13,10))
|
||||
str(string(27,"[2m","Highlite off",13,10))
|
||||
str(string(27,"[4m","Underline on ",27,"[1m + highlite ",27,"[2m",27,"[7m + inverse ",27,"[0m all off + default color.",13,10))
|
||||
str(string(27,"[40m","BGD 0"))
|
||||
str(string(27,"[41m","BGD 1"))
|
||||
str(string(27,"[42m","BGD 2"))
|
||||
str(string(27,"[43m","BGD 3"))
|
||||
str(string(27,"[44m","BGD 4"))
|
||||
str(string(27,"[45m","BGD 5"))
|
||||
str(string(27,"[46m","BGD 6"))
|
||||
str(string(27,"[47m","BGD 7",13,10))
|
||||
|
||||
str(string(27,"[41m"))
|
||||
|
||||
str(string(27,"[30m","FGD 0"))
|
||||
str(string(27,"[31m","FGD 1"))
|
||||
str(string(27,"[32m","FGD 2"))
|
||||
str(string(27,"[33m","FGD 3"))
|
||||
str(string(27,"[34m","FGD 4"))
|
||||
str(string(27,"[35m","FGD 5"))
|
||||
str(string(27,"[36m","FGD 6"))
|
||||
str(string(27,"[37m","FGD 7",13,10))
|
||||
str(string(27,"[1;40m"))
|
||||
str(string(27,"[30m","FGD 0"))
|
||||
str(string(27,"[31m","FGD 1"))
|
||||
str(string(27,"[32m","FGD 2"))
|
||||
str(string(27,"[33m","FGD 3"))
|
||||
str(string(27,"[34m","FGD 4"))
|
||||
str(string(27,"[35m","FGD 5"))
|
||||
str(string(27,"[36m","FGD 6"))
|
||||
str(string(27,"[37m","FGD 7",13,10))
|
||||
str(string(27,"[2m","The quick brown fox jumps over the lazy dog.", 13, 10))
|
||||
|
||||
str(string("Setting a scroll range below here.",13,10))
|
||||
str(string(27,"[24H","This part of the screen remains ",27,"[4mstatic",27,"[24m, since it is below the scrolling region."))
|
||||
str(string(27,"[12;23r",27,"[41m"))
|
||||
repeat
|
||||
chr(27)
|
||||
chr("[")
|
||||
chr("3")
|
||||
chr("0" + rand & 7)
|
||||
chr("m")
|
||||
chr(27)
|
||||
chr("[")
|
||||
chr("4")
|
||||
chr("0" + rand & 7)
|
||||
chr("m")
|
||||
str(string("Four score and seven years ago our ",27,"[1mfathers",27,"[2m brought forth, upon this continent, a new ",27,"[1mnation",27,"[2m, conceived in Liberty, and dedicated to the proposition that all men are created equal. "))
|
||||
waitcnt(clkfreq/4 + cnt)
|
||||
|
||||
|
||||
PUB chr(ch)
|
||||
command := $100 | ch
|
||||
repeat while command
|
||||
|
||||
PUB str(strptr) | i
|
||||
repeat i from 0 to strsize(strptr)
|
||||
chr(byte[strptr][i])
|
||||
|
||||
PUB rand
|
||||
seed := seed * 1103515245 + 12345 + CNT / 7777
|
||||
return seed
|
||||
|
||||
DAT
|
||||
command long 0
|
||||
screen word $0720[CHAR_W*CHAR_H]
|
||||
cursor byte 0,0,%110,0,0,0,0,0
|
||||
sync long 0
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -1 +0,0 @@
|
||||
{{
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,920 +0,0 @@
|
||||
{{
|
||||
SPI interface routines for SD & SDHC & MMC cards
|
||||
|
||||
Jonathan "lonesock" Dummer
|
||||
version 0.3.0 2009 July 19
|
||||
|
||||
Using multiblock SPI mode exclusively.
|
||||
|
||||
This is the "SAFE" version...uses
|
||||
* 1 instruction per bit writes
|
||||
* 2 instructions per bit reads
|
||||
|
||||
For the fsrw project:
|
||||
fsrw.sf.net
|
||||
}}
|
||||
|
||||
CON
|
||||
' possible card types
|
||||
type_MMC = 1
|
||||
type_SD = 2
|
||||
type_SDHC = 3
|
||||
|
||||
' Error codes
|
||||
ERR_CARD_NOT_RESET = -1
|
||||
ERR_3v3_NOT_SUPPORTED = -2
|
||||
ERR_OCR_FAILED = -3
|
||||
ERR_BLOCK_NOT_LONG_ALIGNED = -4
|
||||
'...
|
||||
' These errors are for the assembly engine...they are negated inside, and need to be <= 511
|
||||
ERR_ASM_NO_READ_TOKEN = 100
|
||||
ERR_ASM_BLOCK_NOT_WRITTEN = 101
|
||||
' NOTE: errors -128 to -255 are reserved for reporting R1 response errors
|
||||
'...
|
||||
ERR_SPI_ENGINE_NOT_RUNNING = -999
|
||||
ERR_CARD_BUSY_TIMEOUT = -1000
|
||||
|
||||
' SDHC/SD/MMC command set for SPI
|
||||
CMD0 = $40+0 ' GO_IDLE_STATE
|
||||
CMD1 = $40+1 ' SEND_OP_COND (MMC)
|
||||
ACMD41 = $C0+41 ' SEND_OP_COND (SDC)
|
||||
CMD8 = $40+8 ' SEND_IF_COND
|
||||
CMD9 = $40+9 ' SEND_CSD
|
||||
CMD10 = $40+10 ' SEND_CID
|
||||
CMD12 = $40+12 ' STOP_TRANSMISSION
|
||||
CMD13 = $40+13 ' SEND_STATUS
|
||||
ACMD13 = $C0+13 ' SD_STATUS (SDC)
|
||||
CMD16 = $40+16 ' SET_BLOCKLEN
|
||||
CMD17 = $40+17 ' READ_SINGLE_BLOCK
|
||||
CMD18 = $40+18 ' READ_MULTIPLE_BLOCK
|
||||
CMD23 = $40+23 ' SET_BLOCK_COUNT (MMC)
|
||||
ACMD23 = $C0+23 ' SET_WR_BLK_ERASE_COUNT (SDC)
|
||||
CMD24 = $40+24 ' WRITE_BLOCK
|
||||
CMD25 = $40+25 ' WRITE_MULTIPLE_BLOCK
|
||||
CMD55 = $40+55 ' APP_CMD
|
||||
CMD58 = $40+58 ' READ_OCR
|
||||
CMD59 = $40+59 ' CRC_ON_OFF
|
||||
|
||||
' buffer size for my debug cmd log
|
||||
'LOG_SIZE = 256<<1
|
||||
|
||||
{
|
||||
VAR
|
||||
long SPI_engine_cog
|
||||
' these are used for interfacing with the assembly engine | temporary initialization usage
|
||||
long SPI_command ' "t", "r", "w", 0 =>done, <0 => error | pin mask
|
||||
long SPI_block_index ' which 512-byte block to read/write | cnt at init
|
||||
long SPI_buffer_address ' where to get/put the data in Hub RAM | unused
|
||||
'}
|
||||
DAT
|
||||
'' I'm placing these variables in a DAT section to make this driver a singleton.
|
||||
'' If for some reason you really need more than one driver (e.g. if you have more
|
||||
'' than a single SD socket), move these back into VAR.
|
||||
SPI_engine_cog long 0
|
||||
' these are used for interfacing with the assembly engine | temporary initialization usage
|
||||
SPI_command long 0 ' "t", "r", "w", 0 =>done, <0 => error | unused
|
||||
SPI_block_index long 0 ' which 512-byte block to read/write | cnt at init
|
||||
SPI_buffer_address long 0 ' where to get/put the data in Hub RAM | unused
|
||||
|
||||
{
|
||||
VAR
|
||||
' for debug ONLY
|
||||
byte log_cmd_resp[LOG_SIZE+1]
|
||||
PUB get_log_pointer
|
||||
return @log_cmd_resp
|
||||
'}
|
||||
|
||||
PUB start( basepin )
|
||||
{{
|
||||
This is a compatibility wrapper, and requires that the pins be
|
||||
both consecutive, and in the order DO CLK DI CS.
|
||||
}}
|
||||
return start_explicit( basepin, basepin+1, basepin+2, basepin+3 )
|
||||
|
||||
PUB readblock( block_index, buffer_address )
|
||||
if SPI_engine_cog == 0
|
||||
abort ERR_SPI_ENGINE_NOT_RUNNING
|
||||
if (buffer_address & 3)
|
||||
abort ERR_BLOCK_NOT_LONG_ALIGNED
|
||||
SPI_block_index := block_index
|
||||
SPI_buffer_address := buffer_address
|
||||
SPI_command := "r"
|
||||
repeat while SPI_command == "r"
|
||||
if SPI_command < 0
|
||||
abort SPI_command
|
||||
|
||||
PUB writeblock( block_index, buffer_address )
|
||||
if SPI_engine_cog == 0
|
||||
abort ERR_SPI_ENGINE_NOT_RUNNING
|
||||
if (buffer_address & 3)
|
||||
abort ERR_BLOCK_NOT_LONG_ALIGNED
|
||||
SPI_block_index := block_index
|
||||
SPI_buffer_address := buffer_address
|
||||
SPI_command := "w"
|
||||
repeat while SPI_command == "w"
|
||||
if SPI_command < 0
|
||||
abort SPI_command
|
||||
|
||||
PUB get_seconds
|
||||
if SPI_engine_cog == 0
|
||||
abort ERR_SPI_ENGINE_NOT_RUNNING
|
||||
SPI_command := "t"
|
||||
repeat while SPI_command == "t"
|
||||
' secods are in SPI_block_index, remainder is in SPI_buffer_address
|
||||
return SPI_block_index
|
||||
|
||||
PUB get_milliseconds : ms
|
||||
if SPI_engine_cog == 0
|
||||
abort ERR_SPI_ENGINE_NOT_RUNNING
|
||||
SPI_command := "t"
|
||||
repeat while SPI_command == "t"
|
||||
' secods are in SPI_block_index, remainder is in SPI_buffer_address
|
||||
ms := SPI_block_index * 1000
|
||||
ms += SPI_buffer_address * 1000 / clkfreq
|
||||
|
||||
PUB start_explicit( DO, CLK, DI, CS ) : card_type | tmp, i
|
||||
{{
|
||||
Do all of the card initialization in SPIN, then hand off the pin
|
||||
information to the assembly cog for hot SPI block R/W action!
|
||||
}}
|
||||
' Start from scratch
|
||||
stop
|
||||
' clear my log buffer
|
||||
{
|
||||
bytefill( @log_cmd_resp, 0, LOG_SIZE+1 )
|
||||
dbg_ptr := @log_cmd_resp
|
||||
dbg_end := dbg_ptr + LOG_SIZE
|
||||
'}
|
||||
' wait ~4 milliseconds
|
||||
waitcnt( 500 + (clkfreq>>8) + cnt )
|
||||
' (start with cog variables, _BEFORE_ loading the cog)
|
||||
pinDO := DO
|
||||
maskDO := |< DO
|
||||
pinCLK := CLK
|
||||
pinDI := DI
|
||||
maskDI := |< DI
|
||||
maskCS := |< CS
|
||||
adrShift := 9 ' block = 512 * index, and 512 = 1<<9
|
||||
' pass the output pin mask via the command register
|
||||
maskAll := maskCS | (|<pinCLK) | maskDI
|
||||
dira |= maskAll
|
||||
' get the card in a ready state: set DI and CS high, send => 74 clocks
|
||||
outa |= maskAll
|
||||
repeat 4096
|
||||
outa[CLK]~~
|
||||
outa[CLK]~
|
||||
' time-hack
|
||||
SPI_block_index := cnt
|
||||
' reset the card
|
||||
tmp~
|
||||
repeat i from 0 to 9
|
||||
if tmp <> 1
|
||||
tmp := send_cmd_slow( CMD0, 0, $95 )
|
||||
if (tmp & 4)
|
||||
' the card said CMD0 ("go idle") was invalid, so we're possibly stuck in read or write mode
|
||||
if i & 1
|
||||
' exit multiblock read mode
|
||||
repeat 4
|
||||
read_32_slow ' these extra clocks are required for some MMC cards
|
||||
send_slow( $FD, 8 ) ' stop token
|
||||
read_32_slow
|
||||
repeat while read_slow <> $FF
|
||||
else
|
||||
' exit multiblock read mode
|
||||
send_cmd_slow( CMD12, 0, $61 )
|
||||
if tmp <> 1
|
||||
' the reset command failed!
|
||||
crash( ERR_CARD_NOT_RESET )
|
||||
' Is this a SD type 2 card?
|
||||
if send_cmd_slow( CMD8, $1AA, $87 ) == 1
|
||||
' Type2 SD, check to see if it's a SDHC card
|
||||
tmp := read_32_slow
|
||||
' check the supported voltage
|
||||
if (tmp & $1FF) <> $1AA
|
||||
crash( ERR_3v3_NOT_SUPPORTED )
|
||||
' try to initialize the type 2 card with the High Capacity bit
|
||||
repeat while send_cmd_slow( ACMD41, |<30, $77 )
|
||||
' the card is initialized, let's read back the High Capacity bit
|
||||
if send_cmd_slow( CMD58, 0, $FD ) <> 0
|
||||
crash( ERR_OCR_FAILED )
|
||||
' get back the data
|
||||
tmp := read_32_slow
|
||||
' check the bit
|
||||
if tmp & |<30
|
||||
card_type := type_SDHC
|
||||
adrShift := 0
|
||||
else
|
||||
card_type := type_SD
|
||||
else
|
||||
' Either a type 1 SD card, or it's MMC, try SD 1st
|
||||
if send_cmd_slow( ACMD41, 0, $E5 ) < 2
|
||||
' this is a type 1 SD card (1 means busy, 0 means done initializing)
|
||||
card_type := type_SD
|
||||
repeat while send_cmd_slow( ACMD41, 0, $E5 )
|
||||
else
|
||||
' mark that it's MMC, and try to initialize
|
||||
card_type := type_MMC
|
||||
repeat while send_cmd_slow( CMD1, 0, $F9 )
|
||||
' some SD or MMC cards may have the wrong block size, set it here
|
||||
send_cmd_slow( CMD16, 512, $15 )
|
||||
' card is mounted, make sure the CRC is turned off
|
||||
send_cmd_slow( CMD59, 0, $91 )
|
||||
' check the status
|
||||
'send_cmd_slow( CMD13, 0, $0D )
|
||||
' done with the SPI bus for now
|
||||
outa |= maskCS
|
||||
' set my counter modes for super fast SPI operation
|
||||
' writing: NCO single-ended mode, output on DI
|
||||
writeMode := (%00100 << 26) | (DI << 0)
|
||||
' reading
|
||||
'readMode := (%11000 << 26) | (DO << 0) | (CLK << 9)
|
||||
' clock
|
||||
'clockLineMode := (%00110 << 26) | (CLK << 0) ' DUTY, 25% duty cycle
|
||||
' clock
|
||||
clockLineMode := (%00100 << 26) | (CLK << 0) ' NCO, 50% duty cycle
|
||||
' how many bytes (8 clocks, >>3) fit into 1/2 of a second (>>1), 4 clocks per instruction (>>2)?
|
||||
N_in8_500ms := clkfreq >> constant(1+2+3)
|
||||
' how long should we wait before auto-exiting any multiblock mode?
|
||||
idle_limit := 125 ' ms, NEVER make this > 1000
|
||||
idle_limit := clkfreq / (1000 / idle_limit) ' convert to counts
|
||||
' Hand off control to the assembly engine's cog
|
||||
bufAdr := @SPI_buffer_address
|
||||
sdAdr := @SPI_block_index
|
||||
SPI_command := 0 ' just make sure it's not 1
|
||||
' start my driver cog and wait till I hear back that it's done
|
||||
SPI_engine_cog := cognew( @SPI_engine_entry, @SPI_command ) + 1
|
||||
if( SPI_engine_cog == 0 )
|
||||
crash( ERR_SPI_ENGINE_NOT_RUNNING )
|
||||
repeat while SPI_command <> -1
|
||||
' and we no longer need to control any pins from here
|
||||
dira &= !maskAll
|
||||
' the return variable is card_type
|
||||
|
||||
PUB release
|
||||
{{
|
||||
I do not want to abort if the cog is not
|
||||
running, as this is called from stop, which
|
||||
is called from start/ [8^)
|
||||
}}
|
||||
if SPI_engine_cog
|
||||
SPI_command := "z"
|
||||
repeat while SPI_command == "z"
|
||||
|
||||
PUB stop
|
||||
{{
|
||||
kill the assembly driver cog.
|
||||
}}
|
||||
release
|
||||
if SPI_engine_cog
|
||||
cogstop( SPI_engine_cog~ - 1 )
|
||||
|
||||
PRI crash( abort_code )
|
||||
{{
|
||||
In case of Bad Things(TM) happening,
|
||||
exit as gracefully as possible.
|
||||
}}
|
||||
' and we no longer need to control any pins from here
|
||||
dira &= !maskAll
|
||||
' and report our error
|
||||
abort abort_code
|
||||
|
||||
PRI send_cmd_slow( cmd, val, crc ) : reply | time_stamp
|
||||
{{
|
||||
Send down a command and return the reply.
|
||||
Note: slow is an understatement!
|
||||
Note: this uses the assembly DAT variables for pin IDs,
|
||||
which means that if you run this multiple times (say for
|
||||
multiple SD cards), these values will change for each one.
|
||||
But this is OK as all of these functions will be called
|
||||
during the initialization only, before the PASM engine is
|
||||
running.
|
||||
}}
|
||||
' if this is an application specific command, handle it
|
||||
if (cmd & $80)
|
||||
' ACMD<n> is the command sequense of CMD55-CMD<n>
|
||||
cmd &= $7F
|
||||
reply := send_cmd_slow( CMD55, 0, $65 )
|
||||
if (reply > 1)
|
||||
return reply
|
||||
' the CS line needs to go low during this operation
|
||||
outa |= maskCS
|
||||
outa &= !maskCS
|
||||
' give the card a few cocks to finish whatever it was doing
|
||||
read_32_slow
|
||||
' send the command byte
|
||||
send_slow( cmd, 8 )
|
||||
' send the value long
|
||||
send_slow( val, 32 )
|
||||
' send the CRC byte
|
||||
send_slow( crc, 8 )
|
||||
' is this a CMD12?, if so, stuff byte
|
||||
if cmd == CMD12
|
||||
read_slow
|
||||
' read back the response (spec declares 1-8 reads max for SD, MMC is 0-8)
|
||||
time_stamp := 9
|
||||
repeat
|
||||
reply := read_slow
|
||||
while( reply & $80 ) and ( time_stamp-- )
|
||||
' done, and 'reply' is already pre-loaded
|
||||
{
|
||||
if dbg_ptr < (dbg_end-1)
|
||||
byte[dbg_ptr++] := cmd
|
||||
byte[dbg_ptr++] := reply
|
||||
if (cmd&63) == 13
|
||||
' get the second byte
|
||||
byte[dbg_ptr++] := cmd
|
||||
byte[dbg_ptr++] := read_slow
|
||||
'}
|
||||
|
||||
PRI send_slow( value, bits_to_send )
|
||||
value ><= bits_to_send
|
||||
repeat bits_to_send
|
||||
outa[pinCLK]~
|
||||
outa[pinDI] := value
|
||||
value >>= 1
|
||||
outa[pinCLK]~~
|
||||
|
||||
PRI read_32_slow : r
|
||||
repeat 4
|
||||
r <<= 8
|
||||
r |= read_slow
|
||||
|
||||
PRI read_slow : r
|
||||
{{
|
||||
Read back 8 bits from the card
|
||||
}}
|
||||
' we need the DI line high so a read can occur
|
||||
outa[pinDI]~~
|
||||
' get 8 bits (remember, r is initialized to 0 by SPIN)
|
||||
repeat 8
|
||||
outa[pinCLK]~
|
||||
outa[pinCLK]~~
|
||||
r += r + ina[pinDO]
|
||||
' error check
|
||||
if( (cnt - SPI_block_index) > (clkfreq << 2) )
|
||||
crash( ERR_CARD_BUSY_TIMEOUT )
|
||||
|
||||
DAT
|
||||
{{
|
||||
This is the assembly engine for doing fast block
|
||||
reads and writes. This is *ALL* it does!
|
||||
}}
|
||||
ORG 0
|
||||
SPI_engine_entry
|
||||
' Counter A drives data out
|
||||
mov ctra,writeMode
|
||||
' Counter B will always drive my clock line
|
||||
mov ctrb,clockLineMode
|
||||
' set our output pins to match the pin mask
|
||||
mov dira,maskAll
|
||||
' handshake that we now control the pins
|
||||
neg user_request,#1
|
||||
wrlong user_request,par
|
||||
' start my seconds' counter here
|
||||
mov last_time,cnt
|
||||
|
||||
waiting_for_command
|
||||
' update my seconds counter, but also track the idle
|
||||
' time so we can to release the card after timeout.
|
||||
call #handle_time
|
||||
' read the command, and make sure it's from the user (> 0)
|
||||
rdlong user_request,par
|
||||
cmps user_request,#0 wz,wc
|
||||
if_be jmp #waiting_for_command
|
||||
' handle our card based commands
|
||||
cmp user_request,#"r" wz
|
||||
if_z jmp #read_ahead
|
||||
cmp user_request,#"w" wz
|
||||
if_z jmp #write_behind
|
||||
cmp user_request,#"z" wz
|
||||
if_z jmp #release_card
|
||||
' time requests are handled differently
|
||||
cmp user_request,#"t" wz ' time
|
||||
if_z wrlong seconds,sdAdr ' seconds goes into the SD index register
|
||||
if_z wrlong dtime,bufAdr ' the remainder goes into the buffer address register
|
||||
' in all other cases, clear the user's request
|
||||
mov user_request,#0
|
||||
wrlong user_request,par
|
||||
jmp #waiting_for_command
|
||||
|
||||
|
||||
release_card
|
||||
mov user_cmd,#"z" ' request a release
|
||||
neg lastIndexPlus,#1 ' reset the last block index
|
||||
neg user_idx,#1 ' and make this match it
|
||||
call #handle_command
|
||||
mov user_request,user_cmd
|
||||
wrlong user_request,par
|
||||
jmp #waiting_for_command
|
||||
|
||||
read_ahead
|
||||
rdlong user_idx,sdAdr
|
||||
' if the correct block is not already loaded, load it
|
||||
mov tmp1,user_idx
|
||||
add tmp1,#1
|
||||
cmp tmp1,lastIndexPlus wz
|
||||
if_z cmp lastCommand,#"r" wz
|
||||
if_z jmp #:get_on_with_it
|
||||
mov user_cmd,#"r"
|
||||
call #handle_command
|
||||
:get_on_with_it
|
||||
' copy the data up into Hub RAM
|
||||
movi transfer_long,#%000010_000 'set to wrlong
|
||||
call #hub_cog_transfer
|
||||
' signify that the data is ready, Spin can continue
|
||||
mov user_request,user_cmd
|
||||
wrlong user_request,par
|
||||
' request the next block
|
||||
mov user_cmd,#"r"
|
||||
add user_idx,#1
|
||||
call #handle_command
|
||||
' done
|
||||
jmp #waiting_for_command
|
||||
|
||||
write_behind
|
||||
rdlong user_idx,sdAdr
|
||||
' copy data in from Hub RAM
|
||||
movi transfer_long,#%000010_001 'set to rdlong
|
||||
call #hub_cog_transfer
|
||||
' signify that we have the data, Spin can continue
|
||||
mov user_request,user_cmd
|
||||
wrlong user_request,par
|
||||
' write out the block
|
||||
mov user_cmd,#"w"
|
||||
call #handle_command
|
||||
' done
|
||||
jmp #waiting_for_command
|
||||
|
||||
{{
|
||||
Set user_cmd and user_idx before calling this
|
||||
}}
|
||||
handle_command
|
||||
' Can we stay in the old mode? (address = old_address+1) && (old mode == new_mode)
|
||||
cmp lastIndexPlus,user_idx wz
|
||||
if_z cmp user_cmd,lastCommand wz
|
||||
if_z jmp #:execute_block_command
|
||||
' we fell through, must exit the old mode! (except if the old mode was "release")
|
||||
cmp lastCommand,#"w" wz
|
||||
if_z call #stop_mb_write
|
||||
cmp lastCommand,#"r" wz
|
||||
if_z call #stop_mb_read
|
||||
' and start up the new mode!
|
||||
cmp user_cmd,#"w" wz
|
||||
if_z call #start_mb_write
|
||||
cmp user_cmd,#"r" wz
|
||||
if_z call #start_mb_read
|
||||
cmp user_cmd,#"z" wz
|
||||
if_z call #release_DO
|
||||
:execute_block_command
|
||||
' track the (new) last index and command
|
||||
mov lastIndexPlus,user_idx
|
||||
add lastIndexPlus,#1
|
||||
mov lastCommand,user_cmd
|
||||
' do the block read or write or terminate!
|
||||
cmp user_cmd,#"w" wz
|
||||
if_z call #write_single_block
|
||||
cmp user_cmd,#"r" wz
|
||||
if_z call #read_single_block
|
||||
cmp user_cmd,#"z" wz
|
||||
if_z mov user_cmd,#0
|
||||
' done
|
||||
handle_command_ret
|
||||
ret
|
||||
|
||||
{=== these PASM functions get me in and out of multiblock mode ===}
|
||||
release_DO
|
||||
' we're already out of multiblock mode, so
|
||||
' deselect the card and send out some clocks
|
||||
or outa,maskCS
|
||||
call #in8
|
||||
call #in8
|
||||
' if you are using pull-up resistors, and need all
|
||||
' lines tristated, then uncomment the following line.
|
||||
' for Cluso99
|
||||
'mov dira,#0
|
||||
release_DO_ret
|
||||
ret
|
||||
|
||||
start_mb_read
|
||||
movi block_cmd,#CMD18<<1
|
||||
call #send_SPI_command_fast
|
||||
start_mb_read_ret
|
||||
ret
|
||||
|
||||
stop_mb_read
|
||||
movi block_cmd,#CMD12<<1
|
||||
call #send_SPI_command_fast
|
||||
call #busy_fast
|
||||
stop_mb_read_ret
|
||||
ret
|
||||
|
||||
start_mb_write
|
||||
movi block_cmd,#CMD25<<1
|
||||
call #send_SPI_command_fast
|
||||
start_mb_write_ret
|
||||
ret
|
||||
|
||||
stop_mb_write
|
||||
call #busy_fast
|
||||
' only some cards need these extra clocks
|
||||
mov tmp1,#16
|
||||
:loopity
|
||||
call #in8
|
||||
djnz tmp1,#:loopity
|
||||
' done with hack
|
||||
movi phsa,#$FD<<1
|
||||
call #out8
|
||||
call #in8 ' stuff byte
|
||||
call #busy_fast
|
||||
stop_mb_write_ret
|
||||
ret
|
||||
|
||||
send_SPI_command_fast
|
||||
' make sure we have control of the output lines
|
||||
mov dira,maskAll
|
||||
' make sure the CS line transitions low
|
||||
or outa,maskCS
|
||||
andn outa,maskCS
|
||||
' 8 clocks
|
||||
call #in8
|
||||
' send the data
|
||||
mov phsa,block_cmd ' do which ever block command this is (already in the top 8 bits)
|
||||
call #out8 ' write the byte
|
||||
mov phsa,user_idx ' read in the desired block index
|
||||
shl phsa,adrShift ' this will multiply by 512 (bytes/sector) for MMC and SD
|
||||
call #out8 ' move out the 1st MSB '
|
||||
rol phsa,#1
|
||||
call #out8 ' move out the 1st MSB '
|
||||
rol phsa,#1
|
||||
call #out8 ' move out the 1st MSB '
|
||||
rol phsa,#1
|
||||
call #out8 ' move out the 1st MSB '
|
||||
' bogus CRC value
|
||||
call #in8 ' in8 looks like out8 with $FF
|
||||
' CMD12 requires a stuff byte
|
||||
shr block_cmd,#24
|
||||
cmp block_cmd,#CMD12 wz
|
||||
if_z call #in8 ' 8 clocks
|
||||
' get the response
|
||||
mov tmp1,#9
|
||||
:cmd_response
|
||||
call #in8
|
||||
test readback,#$80 wc,wz
|
||||
if_c djnz tmp1,#:cmd_response
|
||||
if_nz neg user_cmd,readback
|
||||
' done
|
||||
send_SPI_command_fast_ret
|
||||
ret
|
||||
|
||||
|
||||
busy_fast
|
||||
mov tmp1,N_in8_500ms
|
||||
:still_busy
|
||||
call #in8
|
||||
cmp readback,#$FF wz
|
||||
if_nz djnz tmp1,#:still_busy
|
||||
busy_fast_ret
|
||||
ret
|
||||
|
||||
|
||||
out8
|
||||
andn outa,maskDI
|
||||
'movi phsb,#%11_0000000
|
||||
mov phsb,#0
|
||||
movi frqb,#%01_0000000
|
||||
rol phsa,#1
|
||||
rol phsa,#1
|
||||
rol phsa,#1
|
||||
rol phsa,#1
|
||||
rol phsa,#1
|
||||
rol phsa,#1
|
||||
rol phsa,#1
|
||||
mov frqb,#0
|
||||
' don't shift out the final bit...already sent, but be aware
|
||||
' of this when sending consecutive bytes (send_cmd, for e.g.)
|
||||
out8_ret
|
||||
ret
|
||||
|
||||
{
|
||||
in8
|
||||
or outa,maskDI
|
||||
mov ctra,readMode
|
||||
' Start my clock
|
||||
mov frqa,#1<<7
|
||||
mov phsa,#0
|
||||
movi phsb,#%11_0000000
|
||||
movi frqb,#%01_0000000
|
||||
' keep reading in my value, one bit at a time! (Kuneko - "Wh)
|
||||
shr frqa,#1
|
||||
shr frqa,#1
|
||||
shr frqa,#1
|
||||
shr frqa,#1
|
||||
shr frqa,#1
|
||||
shr frqa,#1
|
||||
shr frqa,#1
|
||||
mov frqb,#0 ' stop the clock
|
||||
mov readback,phsa
|
||||
mov frqa,#0
|
||||
mov ctra,writeMode
|
||||
in8_ret
|
||||
ret
|
||||
}
|
||||
in8
|
||||
neg phsa,#1' DI high
|
||||
mov readback,#0
|
||||
' set up my clock, and start it
|
||||
movi phsb,#%011_000000
|
||||
movi frqb,#%001_000000
|
||||
' keep reading in my value
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
mov frqb,#0 ' stop the clock
|
||||
rcl readback,#1
|
||||
mov phsa,#0 'DI low
|
||||
in8_ret
|
||||
ret
|
||||
|
||||
|
||||
' this is called more frequently than 1 Hz, and
|
||||
' is only called when the user command is 0.
|
||||
handle_time
|
||||
mov tmp1,cnt ' get the current timestamp
|
||||
add idle_time,tmp1 ' add the current time to my idle time counter
|
||||
sub idle_time,last_time ' subtract the last time from my idle counter (hence delta)
|
||||
add dtime,tmp1 ' add to my accumulator,
|
||||
sub dtime,last_time ' and subtract the old (adding delta)
|
||||
mov last_time,tmp1 ' update my "last timestamp"
|
||||
rdlong tmp1,#0 ' what is the clock frequency?
|
||||
cmpsub dtime,tmp1 wc ' if I have more than a second in my accumulator
|
||||
addx seconds,#0 ' then add it to "seconds"
|
||||
' this part is to auto-release the card after a timeout
|
||||
cmp idle_time,idle_limit wz,wc
|
||||
if_b jmp #handle_time_ret ' don't clear if we haven't hit the limit
|
||||
mov user_cmd,#"z" ' we can't overdo it, the command handler makes sure
|
||||
neg lastIndexPlus,#1 ' reset the last block index
|
||||
neg user_idx,#1 ' and make this match it
|
||||
call #handle_command ' release the card, but don't mess with the user's request register
|
||||
handle_time_ret
|
||||
ret
|
||||
|
||||
hub_cog_transfer
|
||||
' setup for all 4 passes
|
||||
mov ctrb,clockXferMode
|
||||
mov frqb,#1
|
||||
rdlong buf_ptr,bufAdr
|
||||
mov ops_left,#4
|
||||
movd transfer_long,#speed_buf
|
||||
four_transfer_passes
|
||||
' sync to the Hub RAM access
|
||||
rdlong tmp1,tmp1
|
||||
' how many long to move on this pass? (512 bytes / 4)longs / 4 passes
|
||||
mov tmp1,#(512 / 4 / 4)
|
||||
' get my starting address right (phsb is incremented 1 per clock, so 16 each Hub access)
|
||||
mov phsb,buf_ptr
|
||||
' write the longs, stride 4...low 2 bits of phsb are ignored
|
||||
transfer_long
|
||||
rdlong 0-0,phsb
|
||||
add transfer_long,incDest4
|
||||
djnz tmp1,#transfer_long
|
||||
' go back to where I started, but advanced 1 long
|
||||
sub transfer_long,decDestNminus1
|
||||
' offset my Hub pointer by one long per pass
|
||||
add buf_ptr,#4
|
||||
' do all 4 passes
|
||||
djnz ops_left,#four_transfer_passes
|
||||
' restore the counter mode
|
||||
mov frqb,#0
|
||||
mov phsb,#0
|
||||
mov ctrb,clockLineMode
|
||||
hub_cog_transfer_ret
|
||||
ret
|
||||
|
||||
|
||||
read_single_block
|
||||
' where am I sending the data?
|
||||
movd :store_read_long,#speed_buf
|
||||
mov ops_left,#128
|
||||
' wait until the card is ready
|
||||
mov tmp1,N_in8_500ms
|
||||
:get_resp
|
||||
call #in8
|
||||
cmp readback,#$FE wz
|
||||
if_nz djnz tmp1,#:get_resp
|
||||
if_nz neg user_cmd,#ERR_ASM_NO_READ_TOKEN
|
||||
if_nz jmp #read_single_block_ret
|
||||
' set DI high
|
||||
neg phsa,#1
|
||||
' read the data
|
||||
mov ops_left,#128
|
||||
:read_loop
|
||||
mov tmp1,#4
|
||||
movi phsb,#%011_000000
|
||||
:in_byte
|
||||
' Start my clock
|
||||
movi frqb,#%001_000000
|
||||
' keep reading in my value, BACKWARDS! (Brilliant idea by Tom Rokicki!)
|
||||
test maskDO,ina wc
|
||||
rcl readback,#8
|
||||
test maskDO,ina wc
|
||||
muxc readback,#2
|
||||
test maskDO,ina wc
|
||||
muxc readback,#4
|
||||
test maskDO,ina wc
|
||||
muxc readback,#8
|
||||
test maskDO,ina wc
|
||||
muxc readback,#16
|
||||
test maskDO,ina wc
|
||||
muxc readback,#32
|
||||
test maskDO,ina wc
|
||||
muxc readback,#64
|
||||
test maskDO,ina wc
|
||||
mov frqb,#0 ' stop the clock
|
||||
muxc readback,#128
|
||||
' go back for more
|
||||
djnz tmp1,#:in_byte
|
||||
' make it...NOT backwards [8^)
|
||||
rev readback,#0
|
||||
:store_read_long
|
||||
mov 0-0,readback ' due to some counter weirdness, we need this mov
|
||||
add :store_read_long,const512
|
||||
djnz ops_left,#:read_loop
|
||||
|
||||
' set DI low
|
||||
mov phsa,#0
|
||||
|
||||
' now read 2 trailing bytes (CRC)
|
||||
call #in8 ' out8 is 2x faster than in8
|
||||
call #in8 ' and I'm not using the CRC anyway
|
||||
' give an extra 8 clocks in case we pause for a long time
|
||||
call #in8 ' in8 looks like out8($FF)
|
||||
|
||||
' all done successfully
|
||||
mov idle_time,#0
|
||||
mov user_cmd,#0
|
||||
read_single_block_ret
|
||||
ret
|
||||
|
||||
write_single_block
|
||||
' where am I getting the data? (all 512 bytes / 128 longs of it?)
|
||||
movs :write_loop,#speed_buf
|
||||
' read in 512 bytes (128 longs) from Hub RAM and write it to the card
|
||||
mov ops_left,#128
|
||||
' just hold your horses
|
||||
call #busy_fast
|
||||
' $FC for multiblock, $FE for single block
|
||||
movi phsa,#$FC<<1
|
||||
call #out8
|
||||
mov phsb,#0 ' make sure my clock accumulator is right
|
||||
'movi phsb,#%11_0000000
|
||||
:write_loop
|
||||
' read 4 bytes
|
||||
mov phsa,speed_buf
|
||||
add :write_loop,#1
|
||||
' a long in LE order is DCBA
|
||||
rol phsa,#24 ' move A7 into position, so I can do the swizzled version
|
||||
movi frqb,#%010000000 ' start the clock (remember A7 is already in place)
|
||||
rol phsa,#1 ' A7 is going out, at the end of this instr, A6 is in place
|
||||
rol phsa,#1 ' A5
|
||||
rol phsa,#1 ' A4
|
||||
rol phsa,#1 ' A3
|
||||
rol phsa,#1 ' A2
|
||||
rol phsa,#1 ' A1
|
||||
rol phsa,#1 ' A0
|
||||
rol phsa,#17 ' B7
|
||||
rol phsa,#1 ' B6
|
||||
rol phsa,#1 ' B5
|
||||
rol phsa,#1 ' B4
|
||||
rol phsa,#1 ' B3
|
||||
rol phsa,#1 ' B2
|
||||
rol phsa,#1 ' B1
|
||||
rol phsa,#1 ' B0
|
||||
rol phsa,#17 ' C7
|
||||
rol phsa,#1 ' C6
|
||||
rol phsa,#1 ' C5
|
||||
rol phsa,#1 ' C4
|
||||
rol phsa,#1 ' C3
|
||||
rol phsa,#1 ' C2
|
||||
rol phsa,#1 ' C1
|
||||
rol phsa,#1 ' C0
|
||||
rol phsa,#17 ' D7
|
||||
rol phsa,#1 ' D6
|
||||
rol phsa,#1 ' D5
|
||||
rol phsa,#1 ' D4
|
||||
rol phsa,#1 ' D3
|
||||
rol phsa,#1 ' D2
|
||||
rol phsa,#1 ' D1
|
||||
rol phsa,#1 ' D0 will be in place _after_ this instruction
|
||||
mov frqb,#0 ' shuts the clock off, _after_ this instruction
|
||||
djnz ops_left,#:write_loop
|
||||
' write out my two (bogus, using $FF) CRC bytes
|
||||
call #in8
|
||||
call #in8
|
||||
' now read response (I need this response, so can't spoof using out8)
|
||||
call #in8
|
||||
and readback,#$1F
|
||||
cmp readback,#5 wz
|
||||
if_z mov user_cmd,#0 ' great
|
||||
if_nz neg user_cmd,#ERR_ASM_BLOCK_NOT_WRITTEN ' oops
|
||||
' send out another 8 clocks
|
||||
call #in8
|
||||
' all done
|
||||
mov idle_time,#0
|
||||
write_single_block_ret
|
||||
ret
|
||||
|
||||
|
||||
{=== Assembly Interface Variables ===}
|
||||
pinDO long 0 ' pin is controlled by a counter
|
||||
pinCLK long 0 ' pin is controlled by a counter
|
||||
pinDI long 0 ' pin is controlled by a counter
|
||||
maskDO long 0 ' mask for reading the DO line from the card
|
||||
maskDI long 0 ' mask for setting the pin high while reading
|
||||
maskCS long 0 ' mask = (1<<pin), and is controlled directly
|
||||
maskAll long 0
|
||||
adrShift long 9 ' will be 0 for SDHC, 9 for MMC & SD
|
||||
bufAdr long 0 ' where in Hub RAM is the buffer to copy to/from?
|
||||
sdAdr long 0 ' where on the SD card does it read/write?
|
||||
writeMode long 0 ' the counter setup in NCO single ended, clocking data out on pinDI
|
||||
'clockOutMode long 0 ' the counter setup in NCO single ended, driving the clock line on pinCLK
|
||||
N_in8_500ms long 1_000_000 ' used for timeout checking in PASM
|
||||
'readMode long 0
|
||||
clockLineMode long 0
|
||||
clockXferMode long %11111 << 26
|
||||
const512 long 512
|
||||
const1024 long 1024
|
||||
incDest4 long 4 << 9
|
||||
decDestNminus1 long (512 / 4 - 1) << 9
|
||||
|
||||
{=== Initialized PASM Variables ===}
|
||||
seconds long 0
|
||||
dtime long 0
|
||||
idle_time long 0
|
||||
idle_limit long 0
|
||||
|
||||
{=== Multiblock State Machine ===}
|
||||
lastIndexPlus long -1 ' state handler will check against lastIndexPlus, which will not have been -1
|
||||
lastCommand long 0 ' this will never be the last command.
|
||||
|
||||
{=== Debug Logging Pointers ===}
|
||||
{
|
||||
dbg_ptr long 0
|
||||
dbg_end long 0
|
||||
'}
|
||||
|
||||
{=== Assembly Scratch Variables ===}
|
||||
ops_left res 1 ' used as a counter for bytes, words, longs, whatever (start w/ # byte clocks out)
|
||||
readback res 1 ' all reading from the card goes through here
|
||||
tmp1 res 1 ' this may get used in all subroutines...don't use except in lowest
|
||||
user_request res 1 ' the main command variable, read in from Hub: "r"-read single, "w"-write single
|
||||
user_cmd res 1 ' used internally to handle actual commands to be executed
|
||||
user_idx res 1 ' the pointer to the Hub RAM where the data block is/goes
|
||||
block_cmd res 1 ' one of the SD/MMC command codes, no app-specific allowed
|
||||
buf_ptr res 1 ' moving pointer to the Hub RAM buffer
|
||||
last_time res 1 ' tracking the timestamp
|
||||
|
||||
{{
|
||||
496 longs is my total available space in the cog,
|
||||
and I want 128 longs for eventual use as one 512-
|
||||
byte buffer. This gives me a total of 368 longs
|
||||
to use for umount, and a readblock and writeblock
|
||||
for both Hub RAM and Cog buffers.
|
||||
}}
|
||||
speed_buf res 128 ' 512 bytes to be used for read-ahead / write-behind
|
||||
|
||||
'fit 467
|
||||
FIT 496
|
||||
|
||||
'' MIT LICENSE
|
||||
{{
|
||||
' Permission is hereby granted, free of charge, to any person obtaining
|
||||
' a copy of this software and associated documentation files
|
||||
' (the "Software"), to deal in the Software without restriction,
|
||||
' including without limitation the rights to use, copy, modify, merge,
|
||||
' publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
' and to permit persons to whom the Software is furnished to do so,
|
||||
' subject to the following conditions:
|
||||
'
|
||||
' The above copyright notice and this permission notice shall be included
|
||||
' in all copies or substantial portions of the Software.
|
||||
'
|
||||
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
' EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
' MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
' IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
' CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
' TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
' SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
}}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,704 +0,0 @@
|
||||
'' VGA_1024.spin
|
||||
''
|
||||
'' MODIFIED BY VINCE BRIEL FOR POCKETERM FEATURES
|
||||
'' MODIIFED BY JEFF LEDGER / AKA OLDBITCOLLECTOR
|
||||
''
|
||||
|
||||
CON
|
||||
cols = 80 '128 ' number of screen columns
|
||||
lcols = cols / 4 ' number of long in columns
|
||||
rows = 40 '64 ' number of screen rows
|
||||
chars = rows*cols ' number of screen characters
|
||||
esc = $CB ' keyboard esc char
|
||||
rowsnow = 36 ' adjusted for split screen effect
|
||||
maxChars = rowsnow*cols ' adjusted value for split screen effect
|
||||
lastChar = maxChars / 4 ' last screen position in longs adjusted for split
|
||||
lastLine = (rowsnow - 1) * cols ' character position of last row
|
||||
cols1 = 81 ' adjusted value for 80th character
|
||||
TURQUOISE = $29
|
||||
|
||||
OBJ
|
||||
vga : "vga_Hires_Text"
|
||||
|
||||
VAR
|
||||
byte screen[chars] ' screen character buffer
|
||||
byte tmpl[cols] ' temporary line buffer
|
||||
word colors[rows] ' color specs for each screen row (see ColorPtr description above)
|
||||
byte cursor[6] ' cursor info array (see CursorPtr description above)
|
||||
long sync, loc, xloc, yloc ' sync used by VGA routine, others are local screen pointers
|
||||
long kbdreq ' global val of kbdflag
|
||||
long BR[8]
|
||||
long Brate
|
||||
byte inverse
|
||||
byte invs
|
||||
byte state ' Current state of state machine
|
||||
word pos ' Current Position on the screen
|
||||
word oldpos ' Previous location of cursor before update
|
||||
word regionTop, regionBot ' Scroll region top/bottom
|
||||
long arg0 ' First argument of escape sequence
|
||||
long arg1 ' Second argument of escape sequence
|
||||
byte lastc ' Last displayed char
|
||||
word statpos
|
||||
long vgabasepin
|
||||
|
||||
PUB start(BasePin) | i, char
|
||||
vgabasepin := BasePin
|
||||
|
||||
''init screen colors to gold on blue
|
||||
repeat i from 0 to rows - 1
|
||||
colors[i] := $08F0 '$2804 (if you want cyan on blue)
|
||||
|
||||
''init cursor attributes
|
||||
cursor[2] := %110 ' init cursor to underscore with slow blink
|
||||
BR[0]:=300
|
||||
BR[1]:=1200
|
||||
BR[2]:=2400
|
||||
BR[3]:=4800
|
||||
BR[4]:=9600
|
||||
BR[5]:=19200
|
||||
BR[6]:=38400
|
||||
BR[7]:=57600
|
||||
BR[8]:=115200
|
||||
xloc := cursor[0] := 0
|
||||
yloc := cursor[1] := 0
|
||||
loc := xloc + yloc*cols
|
||||
|
||||
pos := 0
|
||||
regionTop := 0
|
||||
regionBot := 35 * cols
|
||||
state := 0
|
||||
statpos := 37 * cols
|
||||
|
||||
PUB vidon
|
||||
if (!vga.start(vgabasepin, @screen, @colors, @cursor, @sync))
|
||||
return false
|
||||
|
||||
waitcnt(clkfreq * 1 + cnt) 'wait 1 second for cogs to start
|
||||
|
||||
|
||||
PUB vidoff
|
||||
vga.stop
|
||||
|
||||
|
||||
PUB inv(c)
|
||||
inverse:=c
|
||||
|
||||
PUB color(colorVal) | i
|
||||
repeat i from 0 to rows - 1
|
||||
colors[i] := $0000 | colorVal
|
||||
|
||||
PUB cursorset(c) | i
|
||||
i:=%000
|
||||
if c == 1
|
||||
i:= %001
|
||||
if c == 2
|
||||
i:= %010
|
||||
if c == 3
|
||||
i:= %011
|
||||
if c == 4
|
||||
i:= %101
|
||||
if c == 5
|
||||
i:= %110
|
||||
if c == 6
|
||||
i:= %111
|
||||
if c == 7
|
||||
i:= %000
|
||||
cursor[2] := i
|
||||
|
||||
PUB bin(value, digits)
|
||||
|
||||
'' Print a binary number, specify number of digits
|
||||
|
||||
repeat while digits > 32
|
||||
outc("0")
|
||||
digits--
|
||||
|
||||
value <<= 32 - digits
|
||||
|
||||
repeat digits
|
||||
outc((value <-= 1) & 1 + "0")
|
||||
|
||||
|
||||
PUB clrbtm(ColorVal) | i
|
||||
repeat i from 36 to rows - 1 'was 35
|
||||
colors[i] := $0000 + ColorVal
|
||||
|
||||
PUB cls1(c,screencolor,pcport,ascii,CR) | i,x,y
|
||||
|
||||
longfill(@screen[0], $20202020, chars / 4)
|
||||
|
||||
clrbtm(TURQUOISE)
|
||||
|
||||
inverse := 1
|
||||
|
||||
statprint(36,0, string(" N8VEM PropIO | RomWBW v0.94"))
|
||||
inverse := 0
|
||||
statprint(37,0, string(" "))
|
||||
statprint(38,0, string(" "))
|
||||
statprint(39,0, string(" "))
|
||||
|
||||
|
||||
{{
|
||||
x :=xloc
|
||||
y := yloc
|
||||
invs := inverse
|
||||
''clrbtm(TURQUOISE)
|
||||
longfill(@screen, $20202020, chars/4)
|
||||
xloc := 0
|
||||
yloc :=0
|
||||
loc := xloc + yloc*cols
|
||||
repeat 80
|
||||
outc(32)
|
||||
xloc := 0
|
||||
yloc :=36
|
||||
loc := xloc + yloc*cols
|
||||
inverse := 1
|
||||
str(string(" propIO V 0.91 "))
|
||||
inverse := 0
|
||||
str(string("Baud Rate: "))
|
||||
i:= BR[6]
|
||||
dec(i)
|
||||
str(string(" "))
|
||||
xloc := 18
|
||||
loc := xloc + yloc*cols
|
||||
str(string("Color "))
|
||||
str(string("PC Port: "))
|
||||
if pcport == 1
|
||||
str(string("OFF "))
|
||||
if pcport == 0
|
||||
str(string("ON "))
|
||||
str(string(" Force 7 bit: "))
|
||||
if ascii == 0
|
||||
str(string("NO "))
|
||||
if ascii == 1
|
||||
str(string("YES "))
|
||||
str(string(" Cursor CR W/LF: "))
|
||||
if CR == 1
|
||||
str(string("YES"))
|
||||
if CR == 0
|
||||
str(string("NO "))
|
||||
outc(13)
|
||||
outc(10)
|
||||
|
||||
inverse:=1
|
||||
xloc := 6
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F1"))
|
||||
xloc := 19
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F2"))
|
||||
xloc := 30
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F3"))
|
||||
xloc := 46
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F4"))
|
||||
xloc := 58
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F5"))
|
||||
xloc := 70
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F6"))
|
||||
inverse := invs
|
||||
xloc := cursor[0] := x 'right & left was 0
|
||||
yloc := cursor[1] := y 'from top was 1
|
||||
loc := xloc + yloc*cols
|
||||
}}
|
||||
|
||||
PUB clsupdate(c,screencolor,PCPORT,ascii,CR) | i,x,y,locold
|
||||
|
||||
invs := inverse
|
||||
locold := loc
|
||||
x := xloc
|
||||
y := yloc
|
||||
''(TURQUOISE)
|
||||
xloc := 0
|
||||
yloc :=36
|
||||
loc := xloc + yloc*cols
|
||||
inverse := 1
|
||||
str(string(" propIO V 0.81 "))
|
||||
inverse := 0
|
||||
xloc := 0
|
||||
yloc :=37
|
||||
loc := xloc + yloc*cols
|
||||
str(string("Baud Rate: "))
|
||||
i:= BR[6]
|
||||
dec(i)
|
||||
str(string(" "))
|
||||
xloc := 18
|
||||
loc := xloc + yloc*cols
|
||||
|
||||
str(string("Color "))
|
||||
str(string("PC Port: "))
|
||||
if pcport == 1
|
||||
str(string("OFF "))
|
||||
if pcport == 0
|
||||
str(string("ON "))
|
||||
str(string(" Force 7 bit: "))
|
||||
if ascii == 0
|
||||
str(string("NO "))
|
||||
if ascii == 1
|
||||
str(string("YES "))
|
||||
str(string(" Cursor CR W/LF: "))
|
||||
if CR == 1
|
||||
str(string("YES"))
|
||||
if CR == 0
|
||||
str(string("NO "))
|
||||
xloc := 0
|
||||
yloc :=38
|
||||
loc := xloc + yloc*cols
|
||||
inverse:=1
|
||||
xloc := 6
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F1"))
|
||||
xloc := 19
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F2"))
|
||||
xloc := 30
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F3"))
|
||||
xloc := 46
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F4"))
|
||||
xloc := 58
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F5"))
|
||||
xloc := 70
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F6"))
|
||||
inverse := invs
|
||||
xloc := cursor[0] := x
|
||||
yloc := cursor[1] := y
|
||||
' loc := xloc + yloc*cols
|
||||
loc := locold
|
||||
|
||||
PUB dec(value) | i
|
||||
|
||||
'' Print a decimal number
|
||||
|
||||
if value < 0
|
||||
-value
|
||||
outc("-")
|
||||
|
||||
i := 1_000_000_000
|
||||
|
||||
repeat 10
|
||||
if value => i
|
||||
outc(value/i + "0")
|
||||
value //= i
|
||||
result~~
|
||||
elseif result or i == 1
|
||||
outc("0")
|
||||
i /= 10
|
||||
|
||||
PUB hex(value, digits)
|
||||
|
||||
'' Print a hexadecimal number, specify number of digits
|
||||
|
||||
repeat while digits > 8
|
||||
outc("0")
|
||||
digits--
|
||||
|
||||
value <<= (8 - digits) << 2
|
||||
|
||||
repeat digits
|
||||
outc(lookupz((value <-= 4) & $f : "0".."9", "A".."F"))
|
||||
|
||||
|
||||
PUB str(string_ptr)
|
||||
|
||||
'' Print a zero terminated string
|
||||
|
||||
repeat strsize(string_ptr)
|
||||
process_char(byte[string_ptr++])
|
||||
|
||||
PUB statprint(r, c, str1) | x, ptr
|
||||
|
||||
ptr := r * cols + c
|
||||
repeat x from 0 to STRSIZE(str1) - 1
|
||||
putc(ptr++, BYTE[str1 + x])
|
||||
|
||||
PUB statnum(r, c, num1) | i, ptr
|
||||
|
||||
ptr := r * cols + c
|
||||
|
||||
if num1 < 0
|
||||
-num1
|
||||
putc(ptr++,"-")
|
||||
|
||||
i := 1_000_000_000
|
||||
|
||||
repeat 10
|
||||
if num1 => i
|
||||
putc(ptr++, (num1/i +"0"))
|
||||
num1 //= i
|
||||
result~~
|
||||
elseif result or i == 1
|
||||
putc(ptr++, "0")
|
||||
i /= 10
|
||||
|
||||
PUB putc(position, c)
|
||||
if inverse
|
||||
c |= $80
|
||||
screen[position] := c
|
||||
|
||||
PUB cls
|
||||
longfill (@screen, $20202020, lastChar)
|
||||
|
||||
PUB fullcls
|
||||
longfill(@screen, $20202020, 800)
|
||||
|
||||
PUB setInverse(val)
|
||||
inverse := val
|
||||
|
||||
PUB setInv(c)
|
||||
if c == 7
|
||||
setInverse(1)
|
||||
else
|
||||
setInverse(0)
|
||||
|
||||
PUB clEOL(position) | count
|
||||
count := cols - (position // cols)
|
||||
bytefill(@screen + position, $20, count)
|
||||
|
||||
PUB clBOL(position) | count
|
||||
count := position // cols
|
||||
bytefill(@screen + position - count, $20, count)
|
||||
|
||||
PUB delLine(position) | src, count
|
||||
position -= position // cols
|
||||
|
||||
src := position + cols
|
||||
|
||||
count := (maxChars - src) / 4
|
||||
|
||||
if count > 0
|
||||
longmove(@screen + position, @screen + src, count)
|
||||
|
||||
longfill(@screen + lastLine, $20202020, lcols)
|
||||
|
||||
PUB clEOS(position)
|
||||
cleol(position)
|
||||
position += cols - (position // cols)
|
||||
repeat while position < maxChars
|
||||
longfill(@screen + position, $20202020, lcols)
|
||||
pos += cols
|
||||
|
||||
PUB setCursorPos(position)
|
||||
cursor[0] := position // cols
|
||||
cursor[1] := position / cols
|
||||
|
||||
PUB insLine(position) | base, nxt
|
||||
base := position - (position // cols)
|
||||
position := lastLine
|
||||
repeat while position > base
|
||||
nxt := position - cols
|
||||
longmove(@screen + position, @screen + nxt, lcols)
|
||||
position := nxt
|
||||
clEOL(base)
|
||||
|
||||
PUB insChar(position) | count
|
||||
count := (cols - (position // cols)) - 1
|
||||
bytemove(@tmpl, @screen + position, count)
|
||||
screen[position] := " "
|
||||
bytemove(@screen + position + 1, @tmpl, count)
|
||||
|
||||
PUB delChar(position) | count
|
||||
count := (cols - (position // cols)) - 1
|
||||
bytemove(@screen + position, @screen + position + 1, count)
|
||||
screen[position + count] := " "
|
||||
|
||||
PRI inRegion : answer
|
||||
answer := (pos => regionTop) AND (pos < regionBot)
|
||||
|
||||
PRI scrollUp
|
||||
delLine(regionTop)
|
||||
if regionBot < maxChars
|
||||
insLine(regionBot)
|
||||
|
||||
PRI scrollDown
|
||||
if regionBot < maxChars
|
||||
delLine(regionBot)
|
||||
insLine(regionTop)
|
||||
|
||||
PRI ansi(c) | x, defVal
|
||||
|
||||
state := 0
|
||||
|
||||
if (c <> "r") AND (c <> "J") AND (c <> "m") AND (c <> "K")
|
||||
if arg0 == -1
|
||||
arg0 := 1
|
||||
if arg1 == -1
|
||||
arg1 := 1
|
||||
|
||||
case c
|
||||
"@":
|
||||
repeat while arg0-- > 0
|
||||
insChar(pos)
|
||||
|
||||
"b":
|
||||
repeat while arg0-- > 0
|
||||
outc(lastc)
|
||||
|
||||
"d":
|
||||
if (arg0 < 1) OR (arg0 > rows)
|
||||
arg0 := rows
|
||||
pos := ((arg0 - 1) * cols) + (pos // cols)
|
||||
|
||||
"m":
|
||||
setInv(arg0)
|
||||
if arg1 <> -1
|
||||
setInv(arg1)
|
||||
|
||||
"r":
|
||||
if arg0 < 1
|
||||
arg0 := 1
|
||||
elseif arg0 > cols
|
||||
arg0 := cols
|
||||
if arg1 < 1
|
||||
arg1 := 1
|
||||
elseif arg1 > cols
|
||||
arg1 := cols
|
||||
if arg1 < arg0
|
||||
arg1 := arg0
|
||||
|
||||
regionTop := (arg0 - 1) * cols
|
||||
regionBot := arg1 * cols
|
||||
pos := 0
|
||||
|
||||
"A":
|
||||
repeat while arg0-- > 0
|
||||
pos -= cols
|
||||
if pos < 0
|
||||
pos += cols
|
||||
return
|
||||
|
||||
"B":
|
||||
repeat while arg0-- > 0
|
||||
pos += cols
|
||||
if pos => maxChars
|
||||
pos -= cols
|
||||
return
|
||||
|
||||
"C":
|
||||
repeat while arg0-- > 0
|
||||
pos += 1
|
||||
if pos => maxChars
|
||||
pos -= 1
|
||||
return
|
||||
|
||||
"D":
|
||||
repeat while arg0-- > 0
|
||||
pos -= 1
|
||||
if pos < 0
|
||||
pos := 0
|
||||
return
|
||||
|
||||
"G":
|
||||
if (arg0 < 1) OR (arg0 > cols)
|
||||
arg0 := cols
|
||||
pos := (pos - (pos // cols)) + (arg0 - 1)
|
||||
|
||||
"H", "f":
|
||||
if arg0 =< 0
|
||||
arg0 := 1
|
||||
if arg1 =< 0
|
||||
arg1 := 1
|
||||
pos := (cols * (arg0 - 1)) + (arg1 - 1)
|
||||
if pos < 0
|
||||
pos := 0
|
||||
if pos => maxChars
|
||||
pos := maxChars - 1
|
||||
|
||||
"J":
|
||||
if arg0 == 1
|
||||
clBOL(pos)
|
||||
x := pos - cols
|
||||
x -= x // cols
|
||||
repeat while x => 0
|
||||
clEOL(x)
|
||||
x -= cols
|
||||
return
|
||||
|
||||
if arg0 == 2
|
||||
pos := 0
|
||||
|
||||
clEOL(pos)
|
||||
x := pos + cols
|
||||
x -= (x // cols)
|
||||
repeat while x < maxChars
|
||||
clEOL(x)
|
||||
x += cols
|
||||
|
||||
"K":
|
||||
if arg0 == -1
|
||||
clEOL(pos)
|
||||
elseif arg0 == 1
|
||||
clBOL(pos)
|
||||
else
|
||||
clEOL(pos - (pos // cols))
|
||||
|
||||
"L":
|
||||
if inRegion
|
||||
repeat while arg0-- > 0
|
||||
if regionBot < maxChars
|
||||
delLine(regionBot)
|
||||
insLine(pos)
|
||||
|
||||
"M":
|
||||
if inRegion
|
||||
repeat while arg0-- > 0
|
||||
delLine(pos)
|
||||
if regionBot < maxChars
|
||||
insLine(regionBot)
|
||||
|
||||
"P":
|
||||
repeat while arg0--
|
||||
delChar(pos)
|
||||
|
||||
PRI outc(c)
|
||||
|
||||
putc(pos++, lastc := c)
|
||||
if pos == regionBot
|
||||
scrollUp
|
||||
pos -= cols
|
||||
elseif pos == maxChars
|
||||
pos := lastLine
|
||||
|
||||
PUB process_char(c)
|
||||
|
||||
case state
|
||||
|
||||
0:
|
||||
if c > 127
|
||||
c := $20
|
||||
|
||||
if c => $20
|
||||
outc(c)
|
||||
setCursorPos(pos)
|
||||
return
|
||||
|
||||
if c == $1B
|
||||
state := 1
|
||||
return
|
||||
|
||||
if c == $0D
|
||||
pos := pos - (pos // cols)
|
||||
setCursorPos(pos)
|
||||
return
|
||||
|
||||
if c == $0A
|
||||
if inRegion
|
||||
pos += cols
|
||||
if pos => regionBot
|
||||
scrollUp
|
||||
pos -= cols
|
||||
else
|
||||
pos += cols
|
||||
if pos => maxChars
|
||||
pos -= cols
|
||||
setCursorPos(pos)
|
||||
return
|
||||
|
||||
if c == 9
|
||||
pos += (8 - (pos // 8))
|
||||
|
||||
if pos => maxChars
|
||||
pos := lastLine
|
||||
delLine(0)
|
||||
|
||||
setCursorPos(pos)
|
||||
return
|
||||
|
||||
if c == 8
|
||||
if pos > 0
|
||||
pos -= 1
|
||||
setCursorPos(pos)
|
||||
return
|
||||
|
||||
1:
|
||||
case c
|
||||
"[":
|
||||
arg0 := arg1 := -1
|
||||
state := 2
|
||||
return
|
||||
|
||||
"P":
|
||||
pos += cols
|
||||
if pos => maxChars
|
||||
pos -= cols
|
||||
|
||||
"K":
|
||||
if pos > 0
|
||||
pos -= 1
|
||||
|
||||
"H":
|
||||
pos -= cols
|
||||
if pos < 0
|
||||
pos += cols
|
||||
|
||||
"D":
|
||||
if inRegion
|
||||
scrollUp
|
||||
|
||||
"M":
|
||||
if inRegion
|
||||
scrollDown
|
||||
|
||||
"G":
|
||||
pos := 0
|
||||
|
||||
"(":
|
||||
state := 5
|
||||
return
|
||||
|
||||
state := 0
|
||||
return
|
||||
|
||||
2:
|
||||
if (c => "0") AND (c =< "9")
|
||||
if arg0 == -1
|
||||
arg0 := c - "0"
|
||||
else
|
||||
arg0 := (arg0 * 10) + (c - "0")
|
||||
return
|
||||
|
||||
if c == ";"
|
||||
state := 3
|
||||
return
|
||||
|
||||
ansi(c)
|
||||
setCursorPos(pos)
|
||||
return
|
||||
|
||||
3:
|
||||
if (c => "0") AND (c =< "9")
|
||||
if arg1 == -1
|
||||
arg1 := c - "0"
|
||||
else
|
||||
arg1 := (arg1 * 10) + (c - "0")
|
||||
return
|
||||
|
||||
if c == ";"
|
||||
state := 4
|
||||
return
|
||||
|
||||
ansi(c)
|
||||
setCursorPos(pos)
|
||||
return
|
||||
|
||||
4:
|
||||
if (c => "0") AND (c =< "9")
|
||||
return
|
||||
|
||||
if c == ";"
|
||||
return
|
||||
ansi(c)
|
||||
setCursorPos(pos)
|
||||
return
|
||||
|
||||
5:
|
||||
state := 0
|
||||
return
|
||||
|
||||
return
|
||||
Binary file not shown.
Binary file not shown.
@@ -1 +0,0 @@
|
||||
{{
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,704 +0,0 @@
|
||||
'' VGA_1024.spin
|
||||
''
|
||||
'' MODIFIED BY VINCE BRIEL FOR POCKETERM FEATURES
|
||||
'' MODIIFED BY JEFF LEDGER / AKA OLDBITCOLLECTOR
|
||||
''
|
||||
|
||||
CON
|
||||
cols = 80 '128 ' number of screen columns
|
||||
lcols = cols / 4 ' number of long in columns
|
||||
rows = 40 '64 ' number of screen rows
|
||||
chars = rows*cols ' number of screen characters
|
||||
esc = $CB ' keyboard esc char
|
||||
rowsnow = 36 ' adjusted for split screen effect
|
||||
maxChars = rowsnow*cols ' adjusted value for split screen effect
|
||||
lastChar = maxChars / 4 ' last screen position in longs adjusted for split
|
||||
lastLine = (rowsnow - 1) * cols ' character position of last row
|
||||
cols1 = 81 ' adjusted value for 80th character
|
||||
TURQUOISE = $29
|
||||
|
||||
OBJ
|
||||
vga : "vga_Hires_Text"
|
||||
|
||||
VAR
|
||||
byte screen[chars] ' screen character buffer
|
||||
byte tmpl[cols] ' temporary line buffer
|
||||
word colors[rows] ' color specs for each screen row (see ColorPtr description above)
|
||||
byte cursor[6] ' cursor info array (see CursorPtr description above)
|
||||
long sync, loc, xloc, yloc ' sync used by VGA routine, others are local screen pointers
|
||||
long kbdreq ' global val of kbdflag
|
||||
long BR[8]
|
||||
long Brate
|
||||
byte inverse
|
||||
byte invs
|
||||
byte state ' Current state of state machine
|
||||
word pos ' Current Position on the screen
|
||||
word oldpos ' Previous location of cursor before update
|
||||
word regionTop, regionBot ' Scroll region top/bottom
|
||||
long arg0 ' First argument of escape sequence
|
||||
long arg1 ' Second argument of escape sequence
|
||||
byte lastc ' Last displayed char
|
||||
word statpos
|
||||
long vgabasepin
|
||||
|
||||
PUB start(BasePin) | i, char
|
||||
vgabasepin := BasePin
|
||||
|
||||
''init screen colors to gold on blue
|
||||
repeat i from 0 to rows - 1
|
||||
colors[i] := $08F0 '$2804 (if you want cyan on blue)
|
||||
|
||||
''init cursor attributes
|
||||
cursor[2] := %110 ' init cursor to underscore with slow blink
|
||||
BR[0]:=300
|
||||
BR[1]:=1200
|
||||
BR[2]:=2400
|
||||
BR[3]:=4800
|
||||
BR[4]:=9600
|
||||
BR[5]:=19200
|
||||
BR[6]:=38400
|
||||
BR[7]:=57600
|
||||
BR[8]:=115200
|
||||
xloc := cursor[0] := 0
|
||||
yloc := cursor[1] := 0
|
||||
loc := xloc + yloc*cols
|
||||
|
||||
pos := 0
|
||||
regionTop := 0
|
||||
regionBot := 35 * cols
|
||||
state := 0
|
||||
statpos := 37 * cols
|
||||
|
||||
PUB vidon
|
||||
if (!vga.start(vgabasepin, @screen, @colors, @cursor, @sync))
|
||||
return false
|
||||
|
||||
waitcnt(clkfreq * 1 + cnt) 'wait 1 second for cogs to start
|
||||
|
||||
|
||||
PUB vidoff
|
||||
vga.stop
|
||||
|
||||
|
||||
PUB inv(c)
|
||||
inverse:=c
|
||||
|
||||
PUB color(colorVal) | i
|
||||
repeat i from 0 to rows - 1
|
||||
colors[i] := $0000 | colorVal
|
||||
|
||||
PUB cursorset(c) | i
|
||||
i:=%000
|
||||
if c == 1
|
||||
i:= %001
|
||||
if c == 2
|
||||
i:= %010
|
||||
if c == 3
|
||||
i:= %011
|
||||
if c == 4
|
||||
i:= %101
|
||||
if c == 5
|
||||
i:= %110
|
||||
if c == 6
|
||||
i:= %111
|
||||
if c == 7
|
||||
i:= %000
|
||||
cursor[2] := i
|
||||
|
||||
PUB bin(value, digits)
|
||||
|
||||
'' Print a binary number, specify number of digits
|
||||
|
||||
repeat while digits > 32
|
||||
outc("0")
|
||||
digits--
|
||||
|
||||
value <<= 32 - digits
|
||||
|
||||
repeat digits
|
||||
outc((value <-= 1) & 1 + "0")
|
||||
|
||||
|
||||
PUB clrbtm(ColorVal) | i
|
||||
repeat i from 36 to rows - 1 'was 35
|
||||
colors[i] := $0000 + ColorVal
|
||||
|
||||
PUB cls1(c,screencolor,pcport,ascii,CR) | i,x,y
|
||||
|
||||
longfill(@screen[0], $20202020, chars / 4)
|
||||
|
||||
clrbtm(TURQUOISE)
|
||||
|
||||
inverse := 1
|
||||
|
||||
statprint(36,0, string(" N8VEM PropIO V2 | RomWBW v0.94"))
|
||||
inverse := 0
|
||||
statprint(37,0, string(" "))
|
||||
statprint(38,0, string(" "))
|
||||
statprint(39,0, string(" "))
|
||||
|
||||
|
||||
{{
|
||||
x :=xloc
|
||||
y := yloc
|
||||
invs := inverse
|
||||
''clrbtm(TURQUOISE)
|
||||
longfill(@screen, $20202020, chars/4)
|
||||
xloc := 0
|
||||
yloc :=0
|
||||
loc := xloc + yloc*cols
|
||||
repeat 80
|
||||
outc(32)
|
||||
xloc := 0
|
||||
yloc :=36
|
||||
loc := xloc + yloc*cols
|
||||
inverse := 1
|
||||
str(string(" propIO V 0.91 "))
|
||||
inverse := 0
|
||||
str(string("Baud Rate: "))
|
||||
i:= BR[6]
|
||||
dec(i)
|
||||
str(string(" "))
|
||||
xloc := 18
|
||||
loc := xloc + yloc*cols
|
||||
str(string("Color "))
|
||||
str(string("PC Port: "))
|
||||
if pcport == 1
|
||||
str(string("OFF "))
|
||||
if pcport == 0
|
||||
str(string("ON "))
|
||||
str(string(" Force 7 bit: "))
|
||||
if ascii == 0
|
||||
str(string("NO "))
|
||||
if ascii == 1
|
||||
str(string("YES "))
|
||||
str(string(" Cursor CR W/LF: "))
|
||||
if CR == 1
|
||||
str(string("YES"))
|
||||
if CR == 0
|
||||
str(string("NO "))
|
||||
outc(13)
|
||||
outc(10)
|
||||
|
||||
inverse:=1
|
||||
xloc := 6
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F1"))
|
||||
xloc := 19
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F2"))
|
||||
xloc := 30
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F3"))
|
||||
xloc := 46
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F4"))
|
||||
xloc := 58
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F5"))
|
||||
xloc := 70
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F6"))
|
||||
inverse := invs
|
||||
xloc := cursor[0] := x 'right & left was 0
|
||||
yloc := cursor[1] := y 'from top was 1
|
||||
loc := xloc + yloc*cols
|
||||
}}
|
||||
|
||||
PUB clsupdate(c,screencolor,PCPORT,ascii,CR) | i,x,y,locold
|
||||
|
||||
invs := inverse
|
||||
locold := loc
|
||||
x := xloc
|
||||
y := yloc
|
||||
''(TURQUOISE)
|
||||
xloc := 0
|
||||
yloc :=36
|
||||
loc := xloc + yloc*cols
|
||||
inverse := 1
|
||||
str(string(" propIO V 0.81 "))
|
||||
inverse := 0
|
||||
xloc := 0
|
||||
yloc :=37
|
||||
loc := xloc + yloc*cols
|
||||
str(string("Baud Rate: "))
|
||||
i:= BR[6]
|
||||
dec(i)
|
||||
str(string(" "))
|
||||
xloc := 18
|
||||
loc := xloc + yloc*cols
|
||||
|
||||
str(string("Color "))
|
||||
str(string("PC Port: "))
|
||||
if pcport == 1
|
||||
str(string("OFF "))
|
||||
if pcport == 0
|
||||
str(string("ON "))
|
||||
str(string(" Force 7 bit: "))
|
||||
if ascii == 0
|
||||
str(string("NO "))
|
||||
if ascii == 1
|
||||
str(string("YES "))
|
||||
str(string(" Cursor CR W/LF: "))
|
||||
if CR == 1
|
||||
str(string("YES"))
|
||||
if CR == 0
|
||||
str(string("NO "))
|
||||
xloc := 0
|
||||
yloc :=38
|
||||
loc := xloc + yloc*cols
|
||||
inverse:=1
|
||||
xloc := 6
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F1"))
|
||||
xloc := 19
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F2"))
|
||||
xloc := 30
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F3"))
|
||||
xloc := 46
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F4"))
|
||||
xloc := 58
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F5"))
|
||||
xloc := 70
|
||||
loc := xloc + yloc*cols
|
||||
str(string("F6"))
|
||||
inverse := invs
|
||||
xloc := cursor[0] := x
|
||||
yloc := cursor[1] := y
|
||||
' loc := xloc + yloc*cols
|
||||
loc := locold
|
||||
|
||||
PUB dec(value) | i
|
||||
|
||||
'' Print a decimal number
|
||||
|
||||
if value < 0
|
||||
-value
|
||||
outc("-")
|
||||
|
||||
i := 1_000_000_000
|
||||
|
||||
repeat 10
|
||||
if value => i
|
||||
outc(value/i + "0")
|
||||
value //= i
|
||||
result~~
|
||||
elseif result or i == 1
|
||||
outc("0")
|
||||
i /= 10
|
||||
|
||||
PUB hex(value, digits)
|
||||
|
||||
'' Print a hexadecimal number, specify number of digits
|
||||
|
||||
repeat while digits > 8
|
||||
outc("0")
|
||||
digits--
|
||||
|
||||
value <<= (8 - digits) << 2
|
||||
|
||||
repeat digits
|
||||
outc(lookupz((value <-= 4) & $f : "0".."9", "A".."F"))
|
||||
|
||||
|
||||
PUB str(string_ptr)
|
||||
|
||||
'' Print a zero terminated string
|
||||
|
||||
repeat strsize(string_ptr)
|
||||
process_char(byte[string_ptr++])
|
||||
|
||||
PUB statprint(r, c, str1) | x, ptr
|
||||
|
||||
ptr := r * cols + c
|
||||
repeat x from 0 to STRSIZE(str1) - 1
|
||||
putc(ptr++, BYTE[str1 + x])
|
||||
|
||||
PUB statnum(r, c, num1) | i, ptr
|
||||
|
||||
ptr := r * cols + c
|
||||
|
||||
if num1 < 0
|
||||
-num1
|
||||
putc(ptr++,"-")
|
||||
|
||||
i := 1_000_000_000
|
||||
|
||||
repeat 10
|
||||
if num1 => i
|
||||
putc(ptr++, (num1/i +"0"))
|
||||
num1 //= i
|
||||
result~~
|
||||
elseif result or i == 1
|
||||
putc(ptr++, "0")
|
||||
i /= 10
|
||||
|
||||
PUB putc(position, c)
|
||||
if inverse
|
||||
c |= $80
|
||||
screen[position] := c
|
||||
|
||||
PUB cls
|
||||
longfill (@screen, $20202020, lastChar)
|
||||
|
||||
PUB fullcls
|
||||
longfill(@screen, $20202020, 800)
|
||||
|
||||
PUB setInverse(val)
|
||||
inverse := val
|
||||
|
||||
PUB setInv(c)
|
||||
if c == 7
|
||||
setInverse(1)
|
||||
else
|
||||
setInverse(0)
|
||||
|
||||
PUB clEOL(position) | count
|
||||
count := cols - (position // cols)
|
||||
bytefill(@screen + position, $20, count)
|
||||
|
||||
PUB clBOL(position) | count
|
||||
count := position // cols
|
||||
bytefill(@screen + position - count, $20, count)
|
||||
|
||||
PUB delLine(position) | src, count
|
||||
position -= position // cols
|
||||
|
||||
src := position + cols
|
||||
|
||||
count := (maxChars - src) / 4
|
||||
|
||||
if count > 0
|
||||
longmove(@screen + position, @screen + src, count)
|
||||
|
||||
longfill(@screen + lastLine, $20202020, lcols)
|
||||
|
||||
PUB clEOS(position)
|
||||
cleol(position)
|
||||
position += cols - (position // cols)
|
||||
repeat while position < maxChars
|
||||
longfill(@screen + position, $20202020, lcols)
|
||||
pos += cols
|
||||
|
||||
PUB setCursorPos(position)
|
||||
cursor[0] := position // cols
|
||||
cursor[1] := position / cols
|
||||
|
||||
PUB insLine(position) | base, nxt
|
||||
base := position - (position // cols)
|
||||
position := lastLine
|
||||
repeat while position > base
|
||||
nxt := position - cols
|
||||
longmove(@screen + position, @screen + nxt, lcols)
|
||||
position := nxt
|
||||
clEOL(base)
|
||||
|
||||
PUB insChar(position) | count
|
||||
count := (cols - (position // cols)) - 1
|
||||
bytemove(@tmpl, @screen + position, count)
|
||||
screen[position] := " "
|
||||
bytemove(@screen + position + 1, @tmpl, count)
|
||||
|
||||
PUB delChar(position) | count
|
||||
count := (cols - (position // cols)) - 1
|
||||
bytemove(@screen + position, @screen + position + 1, count)
|
||||
screen[position + count] := " "
|
||||
|
||||
PRI inRegion : answer
|
||||
answer := (pos => regionTop) AND (pos < regionBot)
|
||||
|
||||
PRI scrollUp
|
||||
delLine(regionTop)
|
||||
if regionBot < maxChars
|
||||
insLine(regionBot)
|
||||
|
||||
PRI scrollDown
|
||||
if regionBot < maxChars
|
||||
delLine(regionBot)
|
||||
insLine(regionTop)
|
||||
|
||||
PRI ansi(c) | x, defVal
|
||||
|
||||
state := 0
|
||||
|
||||
if (c <> "r") AND (c <> "J") AND (c <> "m") AND (c <> "K")
|
||||
if arg0 == -1
|
||||
arg0 := 1
|
||||
if arg1 == -1
|
||||
arg1 := 1
|
||||
|
||||
case c
|
||||
"@":
|
||||
repeat while arg0-- > 0
|
||||
insChar(pos)
|
||||
|
||||
"b":
|
||||
repeat while arg0-- > 0
|
||||
outc(lastc)
|
||||
|
||||
"d":
|
||||
if (arg0 < 1) OR (arg0 > rows)
|
||||
arg0 := rows
|
||||
pos := ((arg0 - 1) * cols) + (pos // cols)
|
||||
|
||||
"m":
|
||||
setInv(arg0)
|
||||
if arg1 <> -1
|
||||
setInv(arg1)
|
||||
|
||||
"r":
|
||||
if arg0 < 1
|
||||
arg0 := 1
|
||||
elseif arg0 > cols
|
||||
arg0 := cols
|
||||
if arg1 < 1
|
||||
arg1 := 1
|
||||
elseif arg1 > cols
|
||||
arg1 := cols
|
||||
if arg1 < arg0
|
||||
arg1 := arg0
|
||||
|
||||
regionTop := (arg0 - 1) * cols
|
||||
regionBot := arg1 * cols
|
||||
pos := 0
|
||||
|
||||
"A":
|
||||
repeat while arg0-- > 0
|
||||
pos -= cols
|
||||
if pos < 0
|
||||
pos += cols
|
||||
return
|
||||
|
||||
"B":
|
||||
repeat while arg0-- > 0
|
||||
pos += cols
|
||||
if pos => maxChars
|
||||
pos -= cols
|
||||
return
|
||||
|
||||
"C":
|
||||
repeat while arg0-- > 0
|
||||
pos += 1
|
||||
if pos => maxChars
|
||||
pos -= 1
|
||||
return
|
||||
|
||||
"D":
|
||||
repeat while arg0-- > 0
|
||||
pos -= 1
|
||||
if pos < 0
|
||||
pos := 0
|
||||
return
|
||||
|
||||
"G":
|
||||
if (arg0 < 1) OR (arg0 > cols)
|
||||
arg0 := cols
|
||||
pos := (pos - (pos // cols)) + (arg0 - 1)
|
||||
|
||||
"H", "f":
|
||||
if arg0 =< 0
|
||||
arg0 := 1
|
||||
if arg1 =< 0
|
||||
arg1 := 1
|
||||
pos := (cols * (arg0 - 1)) + (arg1 - 1)
|
||||
if pos < 0
|
||||
pos := 0
|
||||
if pos => maxChars
|
||||
pos := maxChars - 1
|
||||
|
||||
"J":
|
||||
if arg0 == 1
|
||||
clBOL(pos)
|
||||
x := pos - cols
|
||||
x -= x // cols
|
||||
repeat while x => 0
|
||||
clEOL(x)
|
||||
x -= cols
|
||||
return
|
||||
|
||||
if arg0 == 2
|
||||
pos := 0
|
||||
|
||||
clEOL(pos)
|
||||
x := pos + cols
|
||||
x -= (x // cols)
|
||||
repeat while x < maxChars
|
||||
clEOL(x)
|
||||
x += cols
|
||||
|
||||
"K":
|
||||
if arg0 == -1
|
||||
clEOL(pos)
|
||||
elseif arg0 == 1
|
||||
clBOL(pos)
|
||||
else
|
||||
clEOL(pos - (pos // cols))
|
||||
|
||||
"L":
|
||||
if inRegion
|
||||
repeat while arg0-- > 0
|
||||
if regionBot < maxChars
|
||||
delLine(regionBot)
|
||||
insLine(pos)
|
||||
|
||||
"M":
|
||||
if inRegion
|
||||
repeat while arg0-- > 0
|
||||
delLine(pos)
|
||||
if regionBot < maxChars
|
||||
insLine(regionBot)
|
||||
|
||||
"P":
|
||||
repeat while arg0--
|
||||
delChar(pos)
|
||||
|
||||
PRI outc(c)
|
||||
|
||||
putc(pos++, lastc := c)
|
||||
if pos == regionBot
|
||||
scrollUp
|
||||
pos -= cols
|
||||
elseif pos == maxChars
|
||||
pos := lastLine
|
||||
|
||||
PUB process_char(c)
|
||||
|
||||
case state
|
||||
|
||||
0:
|
||||
if c > 127
|
||||
c := $20
|
||||
|
||||
if c => $20
|
||||
outc(c)
|
||||
setCursorPos(pos)
|
||||
return
|
||||
|
||||
if c == $1B
|
||||
state := 1
|
||||
return
|
||||
|
||||
if c == $0D
|
||||
pos := pos - (pos // cols)
|
||||
setCursorPos(pos)
|
||||
return
|
||||
|
||||
if c == $0A
|
||||
if inRegion
|
||||
pos += cols
|
||||
if pos => regionBot
|
||||
scrollUp
|
||||
pos -= cols
|
||||
else
|
||||
pos += cols
|
||||
if pos => maxChars
|
||||
pos -= cols
|
||||
setCursorPos(pos)
|
||||
return
|
||||
|
||||
if c == 9
|
||||
pos += (8 - (pos // 8))
|
||||
|
||||
if pos => maxChars
|
||||
pos := lastLine
|
||||
delLine(0)
|
||||
|
||||
setCursorPos(pos)
|
||||
return
|
||||
|
||||
if c == 8
|
||||
if pos > 0
|
||||
pos -= 1
|
||||
setCursorPos(pos)
|
||||
return
|
||||
|
||||
1:
|
||||
case c
|
||||
"[":
|
||||
arg0 := arg1 := -1
|
||||
state := 2
|
||||
return
|
||||
|
||||
"P":
|
||||
pos += cols
|
||||
if pos => maxChars
|
||||
pos -= cols
|
||||
|
||||
"K":
|
||||
if pos > 0
|
||||
pos -= 1
|
||||
|
||||
"H":
|
||||
pos -= cols
|
||||
if pos < 0
|
||||
pos += cols
|
||||
|
||||
"D":
|
||||
if inRegion
|
||||
scrollUp
|
||||
|
||||
"M":
|
||||
if inRegion
|
||||
scrollDown
|
||||
|
||||
"G":
|
||||
pos := 0
|
||||
|
||||
"(":
|
||||
state := 5
|
||||
return
|
||||
|
||||
state := 0
|
||||
return
|
||||
|
||||
2:
|
||||
if (c => "0") AND (c =< "9")
|
||||
if arg0 == -1
|
||||
arg0 := c - "0"
|
||||
else
|
||||
arg0 := (arg0 * 10) + (c - "0")
|
||||
return
|
||||
|
||||
if c == ";"
|
||||
state := 3
|
||||
return
|
||||
|
||||
ansi(c)
|
||||
setCursorPos(pos)
|
||||
return
|
||||
|
||||
3:
|
||||
if (c => "0") AND (c =< "9")
|
||||
if arg1 == -1
|
||||
arg1 := c - "0"
|
||||
else
|
||||
arg1 := (arg1 * 10) + (c - "0")
|
||||
return
|
||||
|
||||
if c == ";"
|
||||
state := 4
|
||||
return
|
||||
|
||||
ansi(c)
|
||||
setCursorPos(pos)
|
||||
return
|
||||
|
||||
4:
|
||||
if (c => "0") AND (c =< "9")
|
||||
return
|
||||
|
||||
if c == ";"
|
||||
return
|
||||
ansi(c)
|
||||
setCursorPos(pos)
|
||||
return
|
||||
|
||||
5:
|
||||
state := 0
|
||||
return
|
||||
|
||||
return
|
||||
Binary file not shown.
@@ -1,920 +0,0 @@
|
||||
{{
|
||||
SPI interface routines for SD & SDHC & MMC cards
|
||||
|
||||
Jonathan "lonesock" Dummer
|
||||
version 0.3.0 2009 July 19
|
||||
|
||||
Using multiblock SPI mode exclusively.
|
||||
|
||||
This is the "SAFE" version...uses
|
||||
* 1 instruction per bit writes
|
||||
* 2 instructions per bit reads
|
||||
|
||||
For the fsrw project:
|
||||
fsrw.sf.net
|
||||
}}
|
||||
|
||||
CON
|
||||
' possible card types
|
||||
type_MMC = 1
|
||||
type_SD = 2
|
||||
type_SDHC = 3
|
||||
|
||||
' Error codes
|
||||
ERR_CARD_NOT_RESET = -1
|
||||
ERR_3v3_NOT_SUPPORTED = -2
|
||||
ERR_OCR_FAILED = -3
|
||||
ERR_BLOCK_NOT_LONG_ALIGNED = -4
|
||||
'...
|
||||
' These errors are for the assembly engine...they are negated inside, and need to be <= 511
|
||||
ERR_ASM_NO_READ_TOKEN = 100
|
||||
ERR_ASM_BLOCK_NOT_WRITTEN = 101
|
||||
' NOTE: errors -128 to -255 are reserved for reporting R1 response errors
|
||||
'...
|
||||
ERR_SPI_ENGINE_NOT_RUNNING = -999
|
||||
ERR_CARD_BUSY_TIMEOUT = -1000
|
||||
|
||||
' SDHC/SD/MMC command set for SPI
|
||||
CMD0 = $40+0 ' GO_IDLE_STATE
|
||||
CMD1 = $40+1 ' SEND_OP_COND (MMC)
|
||||
ACMD41 = $C0+41 ' SEND_OP_COND (SDC)
|
||||
CMD8 = $40+8 ' SEND_IF_COND
|
||||
CMD9 = $40+9 ' SEND_CSD
|
||||
CMD10 = $40+10 ' SEND_CID
|
||||
CMD12 = $40+12 ' STOP_TRANSMISSION
|
||||
CMD13 = $40+13 ' SEND_STATUS
|
||||
ACMD13 = $C0+13 ' SD_STATUS (SDC)
|
||||
CMD16 = $40+16 ' SET_BLOCKLEN
|
||||
CMD17 = $40+17 ' READ_SINGLE_BLOCK
|
||||
CMD18 = $40+18 ' READ_MULTIPLE_BLOCK
|
||||
CMD23 = $40+23 ' SET_BLOCK_COUNT (MMC)
|
||||
ACMD23 = $C0+23 ' SET_WR_BLK_ERASE_COUNT (SDC)
|
||||
CMD24 = $40+24 ' WRITE_BLOCK
|
||||
CMD25 = $40+25 ' WRITE_MULTIPLE_BLOCK
|
||||
CMD55 = $40+55 ' APP_CMD
|
||||
CMD58 = $40+58 ' READ_OCR
|
||||
CMD59 = $40+59 ' CRC_ON_OFF
|
||||
|
||||
' buffer size for my debug cmd log
|
||||
'LOG_SIZE = 256<<1
|
||||
|
||||
{
|
||||
VAR
|
||||
long SPI_engine_cog
|
||||
' these are used for interfacing with the assembly engine | temporary initialization usage
|
||||
long SPI_command ' "t", "r", "w", 0 =>done, <0 => error | pin mask
|
||||
long SPI_block_index ' which 512-byte block to read/write | cnt at init
|
||||
long SPI_buffer_address ' where to get/put the data in Hub RAM | unused
|
||||
'}
|
||||
DAT
|
||||
'' I'm placing these variables in a DAT section to make this driver a singleton.
|
||||
'' If for some reason you really need more than one driver (e.g. if you have more
|
||||
'' than a single SD socket), move these back into VAR.
|
||||
SPI_engine_cog long 0
|
||||
' these are used for interfacing with the assembly engine | temporary initialization usage
|
||||
SPI_command long 0 ' "t", "r", "w", 0 =>done, <0 => error | unused
|
||||
SPI_block_index long 0 ' which 512-byte block to read/write | cnt at init
|
||||
SPI_buffer_address long 0 ' where to get/put the data in Hub RAM | unused
|
||||
|
||||
{
|
||||
VAR
|
||||
' for debug ONLY
|
||||
byte log_cmd_resp[LOG_SIZE+1]
|
||||
PUB get_log_pointer
|
||||
return @log_cmd_resp
|
||||
'}
|
||||
|
||||
PUB start( basepin )
|
||||
{{
|
||||
This is a compatibility wrapper, and requires that the pins be
|
||||
both consecutive, and in the order DO CLK DI CS.
|
||||
}}
|
||||
return start_explicit( basepin, basepin+1, basepin+2, basepin+3 )
|
||||
|
||||
PUB readblock( block_index, buffer_address )
|
||||
if SPI_engine_cog == 0
|
||||
abort ERR_SPI_ENGINE_NOT_RUNNING
|
||||
if (buffer_address & 3)
|
||||
abort ERR_BLOCK_NOT_LONG_ALIGNED
|
||||
SPI_block_index := block_index
|
||||
SPI_buffer_address := buffer_address
|
||||
SPI_command := "r"
|
||||
repeat while SPI_command == "r"
|
||||
if SPI_command < 0
|
||||
abort SPI_command
|
||||
|
||||
PUB writeblock( block_index, buffer_address )
|
||||
if SPI_engine_cog == 0
|
||||
abort ERR_SPI_ENGINE_NOT_RUNNING
|
||||
if (buffer_address & 3)
|
||||
abort ERR_BLOCK_NOT_LONG_ALIGNED
|
||||
SPI_block_index := block_index
|
||||
SPI_buffer_address := buffer_address
|
||||
SPI_command := "w"
|
||||
repeat while SPI_command == "w"
|
||||
if SPI_command < 0
|
||||
abort SPI_command
|
||||
|
||||
PUB get_seconds
|
||||
if SPI_engine_cog == 0
|
||||
abort ERR_SPI_ENGINE_NOT_RUNNING
|
||||
SPI_command := "t"
|
||||
repeat while SPI_command == "t"
|
||||
' secods are in SPI_block_index, remainder is in SPI_buffer_address
|
||||
return SPI_block_index
|
||||
|
||||
PUB get_milliseconds : ms
|
||||
if SPI_engine_cog == 0
|
||||
abort ERR_SPI_ENGINE_NOT_RUNNING
|
||||
SPI_command := "t"
|
||||
repeat while SPI_command == "t"
|
||||
' secods are in SPI_block_index, remainder is in SPI_buffer_address
|
||||
ms := SPI_block_index * 1000
|
||||
ms += SPI_buffer_address * 1000 / clkfreq
|
||||
|
||||
PUB start_explicit( DO, CLK, DI, CS ) : card_type | tmp, i
|
||||
{{
|
||||
Do all of the card initialization in SPIN, then hand off the pin
|
||||
information to the assembly cog for hot SPI block R/W action!
|
||||
}}
|
||||
' Start from scratch
|
||||
stop
|
||||
' clear my log buffer
|
||||
{
|
||||
bytefill( @log_cmd_resp, 0, LOG_SIZE+1 )
|
||||
dbg_ptr := @log_cmd_resp
|
||||
dbg_end := dbg_ptr + LOG_SIZE
|
||||
'}
|
||||
' wait ~4 milliseconds
|
||||
waitcnt( 500 + (clkfreq>>8) + cnt )
|
||||
' (start with cog variables, _BEFORE_ loading the cog)
|
||||
pinDO := DO
|
||||
maskDO := |< DO
|
||||
pinCLK := CLK
|
||||
pinDI := DI
|
||||
maskDI := |< DI
|
||||
maskCS := |< CS
|
||||
adrShift := 9 ' block = 512 * index, and 512 = 1<<9
|
||||
' pass the output pin mask via the command register
|
||||
maskAll := maskCS | (|<pinCLK) | maskDI
|
||||
dira |= maskAll
|
||||
' get the card in a ready state: set DI and CS high, send => 74 clocks
|
||||
outa |= maskAll
|
||||
repeat 4096
|
||||
outa[CLK]~~
|
||||
outa[CLK]~
|
||||
' time-hack
|
||||
SPI_block_index := cnt
|
||||
' reset the card
|
||||
tmp~
|
||||
repeat i from 0 to 9
|
||||
if tmp <> 1
|
||||
tmp := send_cmd_slow( CMD0, 0, $95 )
|
||||
if (tmp & 4)
|
||||
' the card said CMD0 ("go idle") was invalid, so we're possibly stuck in read or write mode
|
||||
if i & 1
|
||||
' exit multiblock read mode
|
||||
repeat 4
|
||||
read_32_slow ' these extra clocks are required for some MMC cards
|
||||
send_slow( $FD, 8 ) ' stop token
|
||||
read_32_slow
|
||||
repeat while read_slow <> $FF
|
||||
else
|
||||
' exit multiblock read mode
|
||||
send_cmd_slow( CMD12, 0, $61 )
|
||||
if tmp <> 1
|
||||
' the reset command failed!
|
||||
crash( ERR_CARD_NOT_RESET )
|
||||
' Is this a SD type 2 card?
|
||||
if send_cmd_slow( CMD8, $1AA, $87 ) == 1
|
||||
' Type2 SD, check to see if it's a SDHC card
|
||||
tmp := read_32_slow
|
||||
' check the supported voltage
|
||||
if (tmp & $1FF) <> $1AA
|
||||
crash( ERR_3v3_NOT_SUPPORTED )
|
||||
' try to initialize the type 2 card with the High Capacity bit
|
||||
repeat while send_cmd_slow( ACMD41, |<30, $77 )
|
||||
' the card is initialized, let's read back the High Capacity bit
|
||||
if send_cmd_slow( CMD58, 0, $FD ) <> 0
|
||||
crash( ERR_OCR_FAILED )
|
||||
' get back the data
|
||||
tmp := read_32_slow
|
||||
' check the bit
|
||||
if tmp & |<30
|
||||
card_type := type_SDHC
|
||||
adrShift := 0
|
||||
else
|
||||
card_type := type_SD
|
||||
else
|
||||
' Either a type 1 SD card, or it's MMC, try SD 1st
|
||||
if send_cmd_slow( ACMD41, 0, $E5 ) < 2
|
||||
' this is a type 1 SD card (1 means busy, 0 means done initializing)
|
||||
card_type := type_SD
|
||||
repeat while send_cmd_slow( ACMD41, 0, $E5 )
|
||||
else
|
||||
' mark that it's MMC, and try to initialize
|
||||
card_type := type_MMC
|
||||
repeat while send_cmd_slow( CMD1, 0, $F9 )
|
||||
' some SD or MMC cards may have the wrong block size, set it here
|
||||
send_cmd_slow( CMD16, 512, $15 )
|
||||
' card is mounted, make sure the CRC is turned off
|
||||
send_cmd_slow( CMD59, 0, $91 )
|
||||
' check the status
|
||||
'send_cmd_slow( CMD13, 0, $0D )
|
||||
' done with the SPI bus for now
|
||||
outa |= maskCS
|
||||
' set my counter modes for super fast SPI operation
|
||||
' writing: NCO single-ended mode, output on DI
|
||||
writeMode := (%00100 << 26) | (DI << 0)
|
||||
' reading
|
||||
'readMode := (%11000 << 26) | (DO << 0) | (CLK << 9)
|
||||
' clock
|
||||
'clockLineMode := (%00110 << 26) | (CLK << 0) ' DUTY, 25% duty cycle
|
||||
' clock
|
||||
clockLineMode := (%00100 << 26) | (CLK << 0) ' NCO, 50% duty cycle
|
||||
' how many bytes (8 clocks, >>3) fit into 1/2 of a second (>>1), 4 clocks per instruction (>>2)?
|
||||
N_in8_500ms := clkfreq >> constant(1+2+3)
|
||||
' how long should we wait before auto-exiting any multiblock mode?
|
||||
idle_limit := 125 ' ms, NEVER make this > 1000
|
||||
idle_limit := clkfreq / (1000 / idle_limit) ' convert to counts
|
||||
' Hand off control to the assembly engine's cog
|
||||
bufAdr := @SPI_buffer_address
|
||||
sdAdr := @SPI_block_index
|
||||
SPI_command := 0 ' just make sure it's not 1
|
||||
' start my driver cog and wait till I hear back that it's done
|
||||
SPI_engine_cog := cognew( @SPI_engine_entry, @SPI_command ) + 1
|
||||
if( SPI_engine_cog == 0 )
|
||||
crash( ERR_SPI_ENGINE_NOT_RUNNING )
|
||||
repeat while SPI_command <> -1
|
||||
' and we no longer need to control any pins from here
|
||||
dira &= !maskAll
|
||||
' the return variable is card_type
|
||||
|
||||
PUB release
|
||||
{{
|
||||
I do not want to abort if the cog is not
|
||||
running, as this is called from stop, which
|
||||
is called from start/ [8^)
|
||||
}}
|
||||
if SPI_engine_cog
|
||||
SPI_command := "z"
|
||||
repeat while SPI_command == "z"
|
||||
|
||||
PUB stop
|
||||
{{
|
||||
kill the assembly driver cog.
|
||||
}}
|
||||
release
|
||||
if SPI_engine_cog
|
||||
cogstop( SPI_engine_cog~ - 1 )
|
||||
|
||||
PRI crash( abort_code )
|
||||
{{
|
||||
In case of Bad Things(TM) happening,
|
||||
exit as gracefully as possible.
|
||||
}}
|
||||
' and we no longer need to control any pins from here
|
||||
dira &= !maskAll
|
||||
' and report our error
|
||||
abort abort_code
|
||||
|
||||
PRI send_cmd_slow( cmd, val, crc ) : reply | time_stamp
|
||||
{{
|
||||
Send down a command and return the reply.
|
||||
Note: slow is an understatement!
|
||||
Note: this uses the assembly DAT variables for pin IDs,
|
||||
which means that if you run this multiple times (say for
|
||||
multiple SD cards), these values will change for each one.
|
||||
But this is OK as all of these functions will be called
|
||||
during the initialization only, before the PASM engine is
|
||||
running.
|
||||
}}
|
||||
' if this is an application specific command, handle it
|
||||
if (cmd & $80)
|
||||
' ACMD<n> is the command sequense of CMD55-CMD<n>
|
||||
cmd &= $7F
|
||||
reply := send_cmd_slow( CMD55, 0, $65 )
|
||||
if (reply > 1)
|
||||
return reply
|
||||
' the CS line needs to go low during this operation
|
||||
outa |= maskCS
|
||||
outa &= !maskCS
|
||||
' give the card a few cocks to finish whatever it was doing
|
||||
read_32_slow
|
||||
' send the command byte
|
||||
send_slow( cmd, 8 )
|
||||
' send the value long
|
||||
send_slow( val, 32 )
|
||||
' send the CRC byte
|
||||
send_slow( crc, 8 )
|
||||
' is this a CMD12?, if so, stuff byte
|
||||
if cmd == CMD12
|
||||
read_slow
|
||||
' read back the response (spec declares 1-8 reads max for SD, MMC is 0-8)
|
||||
time_stamp := 9
|
||||
repeat
|
||||
reply := read_slow
|
||||
while( reply & $80 ) and ( time_stamp-- )
|
||||
' done, and 'reply' is already pre-loaded
|
||||
{
|
||||
if dbg_ptr < (dbg_end-1)
|
||||
byte[dbg_ptr++] := cmd
|
||||
byte[dbg_ptr++] := reply
|
||||
if (cmd&63) == 13
|
||||
' get the second byte
|
||||
byte[dbg_ptr++] := cmd
|
||||
byte[dbg_ptr++] := read_slow
|
||||
'}
|
||||
|
||||
PRI send_slow( value, bits_to_send )
|
||||
value ><= bits_to_send
|
||||
repeat bits_to_send
|
||||
outa[pinCLK]~
|
||||
outa[pinDI] := value
|
||||
value >>= 1
|
||||
outa[pinCLK]~~
|
||||
|
||||
PRI read_32_slow : r
|
||||
repeat 4
|
||||
r <<= 8
|
||||
r |= read_slow
|
||||
|
||||
PRI read_slow : r
|
||||
{{
|
||||
Read back 8 bits from the card
|
||||
}}
|
||||
' we need the DI line high so a read can occur
|
||||
outa[pinDI]~~
|
||||
' get 8 bits (remember, r is initialized to 0 by SPIN)
|
||||
repeat 8
|
||||
outa[pinCLK]~
|
||||
outa[pinCLK]~~
|
||||
r += r + ina[pinDO]
|
||||
' error check
|
||||
if( (cnt - SPI_block_index) > (clkfreq << 2) )
|
||||
crash( ERR_CARD_BUSY_TIMEOUT )
|
||||
|
||||
DAT
|
||||
{{
|
||||
This is the assembly engine for doing fast block
|
||||
reads and writes. This is *ALL* it does!
|
||||
}}
|
||||
ORG 0
|
||||
SPI_engine_entry
|
||||
' Counter A drives data out
|
||||
mov ctra,writeMode
|
||||
' Counter B will always drive my clock line
|
||||
mov ctrb,clockLineMode
|
||||
' set our output pins to match the pin mask
|
||||
mov dira,maskAll
|
||||
' handshake that we now control the pins
|
||||
neg user_request,#1
|
||||
wrlong user_request,par
|
||||
' start my seconds' counter here
|
||||
mov last_time,cnt
|
||||
|
||||
waiting_for_command
|
||||
' update my seconds counter, but also track the idle
|
||||
' time so we can to release the card after timeout.
|
||||
call #handle_time
|
||||
' read the command, and make sure it's from the user (> 0)
|
||||
rdlong user_request,par
|
||||
cmps user_request,#0 wz,wc
|
||||
if_be jmp #waiting_for_command
|
||||
' handle our card based commands
|
||||
cmp user_request,#"r" wz
|
||||
if_z jmp #read_ahead
|
||||
cmp user_request,#"w" wz
|
||||
if_z jmp #write_behind
|
||||
cmp user_request,#"z" wz
|
||||
if_z jmp #release_card
|
||||
' time requests are handled differently
|
||||
cmp user_request,#"t" wz ' time
|
||||
if_z wrlong seconds,sdAdr ' seconds goes into the SD index register
|
||||
if_z wrlong dtime,bufAdr ' the remainder goes into the buffer address register
|
||||
' in all other cases, clear the user's request
|
||||
mov user_request,#0
|
||||
wrlong user_request,par
|
||||
jmp #waiting_for_command
|
||||
|
||||
|
||||
release_card
|
||||
mov user_cmd,#"z" ' request a release
|
||||
neg lastIndexPlus,#1 ' reset the last block index
|
||||
neg user_idx,#1 ' and make this match it
|
||||
call #handle_command
|
||||
mov user_request,user_cmd
|
||||
wrlong user_request,par
|
||||
jmp #waiting_for_command
|
||||
|
||||
read_ahead
|
||||
rdlong user_idx,sdAdr
|
||||
' if the correct block is not already loaded, load it
|
||||
mov tmp1,user_idx
|
||||
add tmp1,#1
|
||||
cmp tmp1,lastIndexPlus wz
|
||||
if_z cmp lastCommand,#"r" wz
|
||||
if_z jmp #:get_on_with_it
|
||||
mov user_cmd,#"r"
|
||||
call #handle_command
|
||||
:get_on_with_it
|
||||
' copy the data up into Hub RAM
|
||||
movi transfer_long,#%000010_000 'set to wrlong
|
||||
call #hub_cog_transfer
|
||||
' signify that the data is ready, Spin can continue
|
||||
mov user_request,user_cmd
|
||||
wrlong user_request,par
|
||||
' request the next block
|
||||
mov user_cmd,#"r"
|
||||
add user_idx,#1
|
||||
call #handle_command
|
||||
' done
|
||||
jmp #waiting_for_command
|
||||
|
||||
write_behind
|
||||
rdlong user_idx,sdAdr
|
||||
' copy data in from Hub RAM
|
||||
movi transfer_long,#%000010_001 'set to rdlong
|
||||
call #hub_cog_transfer
|
||||
' signify that we have the data, Spin can continue
|
||||
mov user_request,user_cmd
|
||||
wrlong user_request,par
|
||||
' write out the block
|
||||
mov user_cmd,#"w"
|
||||
call #handle_command
|
||||
' done
|
||||
jmp #waiting_for_command
|
||||
|
||||
{{
|
||||
Set user_cmd and user_idx before calling this
|
||||
}}
|
||||
handle_command
|
||||
' Can we stay in the old mode? (address = old_address+1) && (old mode == new_mode)
|
||||
cmp lastIndexPlus,user_idx wz
|
||||
if_z cmp user_cmd,lastCommand wz
|
||||
if_z jmp #:execute_block_command
|
||||
' we fell through, must exit the old mode! (except if the old mode was "release")
|
||||
cmp lastCommand,#"w" wz
|
||||
if_z call #stop_mb_write
|
||||
cmp lastCommand,#"r" wz
|
||||
if_z call #stop_mb_read
|
||||
' and start up the new mode!
|
||||
cmp user_cmd,#"w" wz
|
||||
if_z call #start_mb_write
|
||||
cmp user_cmd,#"r" wz
|
||||
if_z call #start_mb_read
|
||||
cmp user_cmd,#"z" wz
|
||||
if_z call #release_DO
|
||||
:execute_block_command
|
||||
' track the (new) last index and command
|
||||
mov lastIndexPlus,user_idx
|
||||
add lastIndexPlus,#1
|
||||
mov lastCommand,user_cmd
|
||||
' do the block read or write or terminate!
|
||||
cmp user_cmd,#"w" wz
|
||||
if_z call #write_single_block
|
||||
cmp user_cmd,#"r" wz
|
||||
if_z call #read_single_block
|
||||
cmp user_cmd,#"z" wz
|
||||
if_z mov user_cmd,#0
|
||||
' done
|
||||
handle_command_ret
|
||||
ret
|
||||
|
||||
{=== these PASM functions get me in and out of multiblock mode ===}
|
||||
release_DO
|
||||
' we're already out of multiblock mode, so
|
||||
' deselect the card and send out some clocks
|
||||
or outa,maskCS
|
||||
call #in8
|
||||
call #in8
|
||||
' if you are using pull-up resistors, and need all
|
||||
' lines tristated, then uncomment the following line.
|
||||
' for Cluso99
|
||||
'mov dira,#0
|
||||
release_DO_ret
|
||||
ret
|
||||
|
||||
start_mb_read
|
||||
movi block_cmd,#CMD18<<1
|
||||
call #send_SPI_command_fast
|
||||
start_mb_read_ret
|
||||
ret
|
||||
|
||||
stop_mb_read
|
||||
movi block_cmd,#CMD12<<1
|
||||
call #send_SPI_command_fast
|
||||
call #busy_fast
|
||||
stop_mb_read_ret
|
||||
ret
|
||||
|
||||
start_mb_write
|
||||
movi block_cmd,#CMD25<<1
|
||||
call #send_SPI_command_fast
|
||||
start_mb_write_ret
|
||||
ret
|
||||
|
||||
stop_mb_write
|
||||
call #busy_fast
|
||||
' only some cards need these extra clocks
|
||||
mov tmp1,#16
|
||||
:loopity
|
||||
call #in8
|
||||
djnz tmp1,#:loopity
|
||||
' done with hack
|
||||
movi phsa,#$FD<<1
|
||||
call #out8
|
||||
call #in8 ' stuff byte
|
||||
call #busy_fast
|
||||
stop_mb_write_ret
|
||||
ret
|
||||
|
||||
send_SPI_command_fast
|
||||
' make sure we have control of the output lines
|
||||
mov dira,maskAll
|
||||
' make sure the CS line transitions low
|
||||
or outa,maskCS
|
||||
andn outa,maskCS
|
||||
' 8 clocks
|
||||
call #in8
|
||||
' send the data
|
||||
mov phsa,block_cmd ' do which ever block command this is (already in the top 8 bits)
|
||||
call #out8 ' write the byte
|
||||
mov phsa,user_idx ' read in the desired block index
|
||||
shl phsa,adrShift ' this will multiply by 512 (bytes/sector) for MMC and SD
|
||||
call #out8 ' move out the 1st MSB '
|
||||
rol phsa,#1
|
||||
call #out8 ' move out the 1st MSB '
|
||||
rol phsa,#1
|
||||
call #out8 ' move out the 1st MSB '
|
||||
rol phsa,#1
|
||||
call #out8 ' move out the 1st MSB '
|
||||
' bogus CRC value
|
||||
call #in8 ' in8 looks like out8 with $FF
|
||||
' CMD12 requires a stuff byte
|
||||
shr block_cmd,#24
|
||||
cmp block_cmd,#CMD12 wz
|
||||
if_z call #in8 ' 8 clocks
|
||||
' get the response
|
||||
mov tmp1,#9
|
||||
:cmd_response
|
||||
call #in8
|
||||
test readback,#$80 wc,wz
|
||||
if_c djnz tmp1,#:cmd_response
|
||||
if_nz neg user_cmd,readback
|
||||
' done
|
||||
send_SPI_command_fast_ret
|
||||
ret
|
||||
|
||||
|
||||
busy_fast
|
||||
mov tmp1,N_in8_500ms
|
||||
:still_busy
|
||||
call #in8
|
||||
cmp readback,#$FF wz
|
||||
if_nz djnz tmp1,#:still_busy
|
||||
busy_fast_ret
|
||||
ret
|
||||
|
||||
|
||||
out8
|
||||
andn outa,maskDI
|
||||
'movi phsb,#%11_0000000
|
||||
mov phsb,#0
|
||||
movi frqb,#%01_0000000
|
||||
rol phsa,#1
|
||||
rol phsa,#1
|
||||
rol phsa,#1
|
||||
rol phsa,#1
|
||||
rol phsa,#1
|
||||
rol phsa,#1
|
||||
rol phsa,#1
|
||||
mov frqb,#0
|
||||
' don't shift out the final bit...already sent, but be aware
|
||||
' of this when sending consecutive bytes (send_cmd, for e.g.)
|
||||
out8_ret
|
||||
ret
|
||||
|
||||
{
|
||||
in8
|
||||
or outa,maskDI
|
||||
mov ctra,readMode
|
||||
' Start my clock
|
||||
mov frqa,#1<<7
|
||||
mov phsa,#0
|
||||
movi phsb,#%11_0000000
|
||||
movi frqb,#%01_0000000
|
||||
' keep reading in my value, one bit at a time! (Kuneko - "Wh)
|
||||
shr frqa,#1
|
||||
shr frqa,#1
|
||||
shr frqa,#1
|
||||
shr frqa,#1
|
||||
shr frqa,#1
|
||||
shr frqa,#1
|
||||
shr frqa,#1
|
||||
mov frqb,#0 ' stop the clock
|
||||
mov readback,phsa
|
||||
mov frqa,#0
|
||||
mov ctra,writeMode
|
||||
in8_ret
|
||||
ret
|
||||
}
|
||||
in8
|
||||
neg phsa,#1' DI high
|
||||
mov readback,#0
|
||||
' set up my clock, and start it
|
||||
movi phsb,#%011_000000
|
||||
movi frqb,#%001_000000
|
||||
' keep reading in my value
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
rcl readback,#1
|
||||
test maskDO,ina wc
|
||||
mov frqb,#0 ' stop the clock
|
||||
rcl readback,#1
|
||||
mov phsa,#0 'DI low
|
||||
in8_ret
|
||||
ret
|
||||
|
||||
|
||||
' this is called more frequently than 1 Hz, and
|
||||
' is only called when the user command is 0.
|
||||
handle_time
|
||||
mov tmp1,cnt ' get the current timestamp
|
||||
add idle_time,tmp1 ' add the current time to my idle time counter
|
||||
sub idle_time,last_time ' subtract the last time from my idle counter (hence delta)
|
||||
add dtime,tmp1 ' add to my accumulator,
|
||||
sub dtime,last_time ' and subtract the old (adding delta)
|
||||
mov last_time,tmp1 ' update my "last timestamp"
|
||||
rdlong tmp1,#0 ' what is the clock frequency?
|
||||
cmpsub dtime,tmp1 wc ' if I have more than a second in my accumulator
|
||||
addx seconds,#0 ' then add it to "seconds"
|
||||
' this part is to auto-release the card after a timeout
|
||||
cmp idle_time,idle_limit wz,wc
|
||||
if_b jmp #handle_time_ret ' don't clear if we haven't hit the limit
|
||||
mov user_cmd,#"z" ' we can't overdo it, the command handler makes sure
|
||||
neg lastIndexPlus,#1 ' reset the last block index
|
||||
neg user_idx,#1 ' and make this match it
|
||||
call #handle_command ' release the card, but don't mess with the user's request register
|
||||
handle_time_ret
|
||||
ret
|
||||
|
||||
hub_cog_transfer
|
||||
' setup for all 4 passes
|
||||
mov ctrb,clockXferMode
|
||||
mov frqb,#1
|
||||
rdlong buf_ptr,bufAdr
|
||||
mov ops_left,#4
|
||||
movd transfer_long,#speed_buf
|
||||
four_transfer_passes
|
||||
' sync to the Hub RAM access
|
||||
rdlong tmp1,tmp1
|
||||
' how many long to move on this pass? (512 bytes / 4)longs / 4 passes
|
||||
mov tmp1,#(512 / 4 / 4)
|
||||
' get my starting address right (phsb is incremented 1 per clock, so 16 each Hub access)
|
||||
mov phsb,buf_ptr
|
||||
' write the longs, stride 4...low 2 bits of phsb are ignored
|
||||
transfer_long
|
||||
rdlong 0-0,phsb
|
||||
add transfer_long,incDest4
|
||||
djnz tmp1,#transfer_long
|
||||
' go back to where I started, but advanced 1 long
|
||||
sub transfer_long,decDestNminus1
|
||||
' offset my Hub pointer by one long per pass
|
||||
add buf_ptr,#4
|
||||
' do all 4 passes
|
||||
djnz ops_left,#four_transfer_passes
|
||||
' restore the counter mode
|
||||
mov frqb,#0
|
||||
mov phsb,#0
|
||||
mov ctrb,clockLineMode
|
||||
hub_cog_transfer_ret
|
||||
ret
|
||||
|
||||
|
||||
read_single_block
|
||||
' where am I sending the data?
|
||||
movd :store_read_long,#speed_buf
|
||||
mov ops_left,#128
|
||||
' wait until the card is ready
|
||||
mov tmp1,N_in8_500ms
|
||||
:get_resp
|
||||
call #in8
|
||||
cmp readback,#$FE wz
|
||||
if_nz djnz tmp1,#:get_resp
|
||||
if_nz neg user_cmd,#ERR_ASM_NO_READ_TOKEN
|
||||
if_nz jmp #read_single_block_ret
|
||||
' set DI high
|
||||
neg phsa,#1
|
||||
' read the data
|
||||
mov ops_left,#128
|
||||
:read_loop
|
||||
mov tmp1,#4
|
||||
movi phsb,#%011_000000
|
||||
:in_byte
|
||||
' Start my clock
|
||||
movi frqb,#%001_000000
|
||||
' keep reading in my value, BACKWARDS! (Brilliant idea by Tom Rokicki!)
|
||||
test maskDO,ina wc
|
||||
rcl readback,#8
|
||||
test maskDO,ina wc
|
||||
muxc readback,#2
|
||||
test maskDO,ina wc
|
||||
muxc readback,#4
|
||||
test maskDO,ina wc
|
||||
muxc readback,#8
|
||||
test maskDO,ina wc
|
||||
muxc readback,#16
|
||||
test maskDO,ina wc
|
||||
muxc readback,#32
|
||||
test maskDO,ina wc
|
||||
muxc readback,#64
|
||||
test maskDO,ina wc
|
||||
mov frqb,#0 ' stop the clock
|
||||
muxc readback,#128
|
||||
' go back for more
|
||||
djnz tmp1,#:in_byte
|
||||
' make it...NOT backwards [8^)
|
||||
rev readback,#0
|
||||
:store_read_long
|
||||
mov 0-0,readback ' due to some counter weirdness, we need this mov
|
||||
add :store_read_long,const512
|
||||
djnz ops_left,#:read_loop
|
||||
|
||||
' set DI low
|
||||
mov phsa,#0
|
||||
|
||||
' now read 2 trailing bytes (CRC)
|
||||
call #in8 ' out8 is 2x faster than in8
|
||||
call #in8 ' and I'm not using the CRC anyway
|
||||
' give an extra 8 clocks in case we pause for a long time
|
||||
call #in8 ' in8 looks like out8($FF)
|
||||
|
||||
' all done successfully
|
||||
mov idle_time,#0
|
||||
mov user_cmd,#0
|
||||
read_single_block_ret
|
||||
ret
|
||||
|
||||
write_single_block
|
||||
' where am I getting the data? (all 512 bytes / 128 longs of it?)
|
||||
movs :write_loop,#speed_buf
|
||||
' read in 512 bytes (128 longs) from Hub RAM and write it to the card
|
||||
mov ops_left,#128
|
||||
' just hold your horses
|
||||
call #busy_fast
|
||||
' $FC for multiblock, $FE for single block
|
||||
movi phsa,#$FC<<1
|
||||
call #out8
|
||||
mov phsb,#0 ' make sure my clock accumulator is right
|
||||
'movi phsb,#%11_0000000
|
||||
:write_loop
|
||||
' read 4 bytes
|
||||
mov phsa,speed_buf
|
||||
add :write_loop,#1
|
||||
' a long in LE order is DCBA
|
||||
rol phsa,#24 ' move A7 into position, so I can do the swizzled version
|
||||
movi frqb,#%010000000 ' start the clock (remember A7 is already in place)
|
||||
rol phsa,#1 ' A7 is going out, at the end of this instr, A6 is in place
|
||||
rol phsa,#1 ' A5
|
||||
rol phsa,#1 ' A4
|
||||
rol phsa,#1 ' A3
|
||||
rol phsa,#1 ' A2
|
||||
rol phsa,#1 ' A1
|
||||
rol phsa,#1 ' A0
|
||||
rol phsa,#17 ' B7
|
||||
rol phsa,#1 ' B6
|
||||
rol phsa,#1 ' B5
|
||||
rol phsa,#1 ' B4
|
||||
rol phsa,#1 ' B3
|
||||
rol phsa,#1 ' B2
|
||||
rol phsa,#1 ' B1
|
||||
rol phsa,#1 ' B0
|
||||
rol phsa,#17 ' C7
|
||||
rol phsa,#1 ' C6
|
||||
rol phsa,#1 ' C5
|
||||
rol phsa,#1 ' C4
|
||||
rol phsa,#1 ' C3
|
||||
rol phsa,#1 ' C2
|
||||
rol phsa,#1 ' C1
|
||||
rol phsa,#1 ' C0
|
||||
rol phsa,#17 ' D7
|
||||
rol phsa,#1 ' D6
|
||||
rol phsa,#1 ' D5
|
||||
rol phsa,#1 ' D4
|
||||
rol phsa,#1 ' D3
|
||||
rol phsa,#1 ' D2
|
||||
rol phsa,#1 ' D1
|
||||
rol phsa,#1 ' D0 will be in place _after_ this instruction
|
||||
mov frqb,#0 ' shuts the clock off, _after_ this instruction
|
||||
djnz ops_left,#:write_loop
|
||||
' write out my two (bogus, using $FF) CRC bytes
|
||||
call #in8
|
||||
call #in8
|
||||
' now read response (I need this response, so can't spoof using out8)
|
||||
call #in8
|
||||
and readback,#$1F
|
||||
cmp readback,#5 wz
|
||||
if_z mov user_cmd,#0 ' great
|
||||
if_nz neg user_cmd,#ERR_ASM_BLOCK_NOT_WRITTEN ' oops
|
||||
' send out another 8 clocks
|
||||
call #in8
|
||||
' all done
|
||||
mov idle_time,#0
|
||||
write_single_block_ret
|
||||
ret
|
||||
|
||||
|
||||
{=== Assembly Interface Variables ===}
|
||||
pinDO long 0 ' pin is controlled by a counter
|
||||
pinCLK long 0 ' pin is controlled by a counter
|
||||
pinDI long 0 ' pin is controlled by a counter
|
||||
maskDO long 0 ' mask for reading the DO line from the card
|
||||
maskDI long 0 ' mask for setting the pin high while reading
|
||||
maskCS long 0 ' mask = (1<<pin), and is controlled directly
|
||||
maskAll long 0
|
||||
adrShift long 9 ' will be 0 for SDHC, 9 for MMC & SD
|
||||
bufAdr long 0 ' where in Hub RAM is the buffer to copy to/from?
|
||||
sdAdr long 0 ' where on the SD card does it read/write?
|
||||
writeMode long 0 ' the counter setup in NCO single ended, clocking data out on pinDI
|
||||
'clockOutMode long 0 ' the counter setup in NCO single ended, driving the clock line on pinCLK
|
||||
N_in8_500ms long 1_000_000 ' used for timeout checking in PASM
|
||||
'readMode long 0
|
||||
clockLineMode long 0
|
||||
clockXferMode long %11111 << 26
|
||||
const512 long 512
|
||||
const1024 long 1024
|
||||
incDest4 long 4 << 9
|
||||
decDestNminus1 long (512 / 4 - 1) << 9
|
||||
|
||||
{=== Initialized PASM Variables ===}
|
||||
seconds long 0
|
||||
dtime long 0
|
||||
idle_time long 0
|
||||
idle_limit long 0
|
||||
|
||||
{=== Multiblock State Machine ===}
|
||||
lastIndexPlus long -1 ' state handler will check against lastIndexPlus, which will not have been -1
|
||||
lastCommand long 0 ' this will never be the last command.
|
||||
|
||||
{=== Debug Logging Pointers ===}
|
||||
{
|
||||
dbg_ptr long 0
|
||||
dbg_end long 0
|
||||
'}
|
||||
|
||||
{=== Assembly Scratch Variables ===}
|
||||
ops_left res 1 ' used as a counter for bytes, words, longs, whatever (start w/ # byte clocks out)
|
||||
readback res 1 ' all reading from the card goes through here
|
||||
tmp1 res 1 ' this may get used in all subroutines...don't use except in lowest
|
||||
user_request res 1 ' the main command variable, read in from Hub: "r"-read single, "w"-write single
|
||||
user_cmd res 1 ' used internally to handle actual commands to be executed
|
||||
user_idx res 1 ' the pointer to the Hub RAM where the data block is/goes
|
||||
block_cmd res 1 ' one of the SD/MMC command codes, no app-specific allowed
|
||||
buf_ptr res 1 ' moving pointer to the Hub RAM buffer
|
||||
last_time res 1 ' tracking the timestamp
|
||||
|
||||
{{
|
||||
496 longs is my total available space in the cog,
|
||||
and I want 128 longs for eventual use as one 512-
|
||||
byte buffer. This gives me a total of 368 longs
|
||||
to use for umount, and a readblock and writeblock
|
||||
for both Hub RAM and Cog buffers.
|
||||
}}
|
||||
speed_buf res 128 ' 512 bytes to be used for read-ahead / write-behind
|
||||
|
||||
'fit 467
|
||||
FIT 496
|
||||
|
||||
'' MIT LICENSE
|
||||
{{
|
||||
' Permission is hereby granted, free of charge, to any person obtaining
|
||||
' a copy of this software and associated documentation files
|
||||
' (the "Software"), to deal in the Software without restriction,
|
||||
' including without limitation the rights to use, copy, modify, merge,
|
||||
' publish, distribute, sublicense, and/or sell copies of the Software,
|
||||
' and to permit persons to whom the Software is furnished to do so,
|
||||
' subject to the following conditions:
|
||||
'
|
||||
' The above copyright notice and this permission notice shall be included
|
||||
' in all copies or substantial portions of the Software.
|
||||
'
|
||||
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
' EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
' MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
' IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
' CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
' TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
' SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
}}
|
||||
@@ -1,14 +0,0 @@
|
||||
The Hardware directory contains files that may be needed to complete
|
||||
your system setup that would not be appropriate to include in the
|
||||
ROM itself or in the ROM disk.
|
||||
|
||||
Contents
|
||||
--------
|
||||
|
||||
VDU\vdu.rom: ROM image for VDU onboard EPROM
|
||||
|
||||
PropIO\PropIO.eeprom: PropIO firmware for use with RomWBW
|
||||
|
||||
PropIO2\PropIO2.eeprom: PropIO V2 firmware for use with RomWBW
|
||||
|
||||
ParPortProp\ParPortProp.eeprom: ParPortProp firmware for use with RomWBW
|
||||
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user