summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hardsid.c11
-rw-r--r--test/sidtest.c3
2 files changed, 9 insertions, 5 deletions
diff --git a/hardsid.c b/hardsid.c
index a7bed75..6a71bca 100644
--- a/hardsid.c
+++ b/hardsid.c
@@ -44,7 +44,7 @@
/* The maximum amount we support in a write call
*/
-#define MAXREADBUFF 256
+#define MAXWRITEBUFF 256
/* The softc holds our per-instance data.
*/
@@ -84,7 +84,10 @@ static struct cdevsw hardsid_cdevsw =
*/
static void SetSIDReg(struct hardsid_softc *sc, int reg, int value)
{
- bus_space_write_2(sc->res_bt, sc->res_bh, 3, reg << 8 | value);
+ //bus_space_write_2(sc->res_bt, sc->res_bh, 2, reg << 8 | value);
+ bus_space_write_1(sc->res_bt, sc->res_bh, 2, value);
+ bus_space_write_1(sc->res_bt, sc->res_bh, 3, reg);
+ tsleep(sc, 0, "sleep", hz/200);
}
int hardsid_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
@@ -137,11 +140,11 @@ int hardsid_read(struct cdev *dev, struct uio *uio, int ioflag)
int hardsid_write(struct cdev *dev, struct uio *uio, int ioflag)
{
struct hardsid_softc *sc;
- unsigned char buff[MAXREADBUFF];
+ unsigned char buff[MAXWRITEBUFF];
int len;
int f;
- if (uio->uio_resid > MAXREADBUFF)
+ if (uio->uio_resid > MAXWRITEBUFF)
{
return EINVAL;
}
diff --git a/test/sidtest.c b/test/sidtest.c
index 7a843a9..183de5b 100644
--- a/test/sidtest.c
+++ b/test/sidtest.c
@@ -32,10 +32,10 @@ int main(int argc, char *argv[])
{
char setsound[] =
{
- 4, 17,
24, 15,
5, 97,
6, 200,
+ 4, 17,
0, 128,
1, 127
};
@@ -47,6 +47,7 @@ int main(int argc, char *argv[])
int fd;
int wrote;
+ int f;
fd = open("/dev/hardsid0", O_RDWR);