Subject: Re: mmem woes
To: None <port-dreamcast@netbsd.org>
From: ITOH Yasufumi <itohy@netbsd.org>
List: port-dreamcast
Date: 02/09/2003 19:08:21
logix@foobar.franken.de writes:

> Unfortunately it still doesn't work:
	:
> mapleA1 at maple0 port 0 subunit 1: a 0x2 c 0 fn 0xe d 0x7e7e3f40,0x51000,0xf4100: Visual Memory
> mmem0 at mapleA1 function 1: Memory card
> mmem0: 1 part, 512 bytes/block, 4 acc/write, 1 acc/read
> mapleA1 function 2 not configured
> mapleA1 function 3 not configured

Oops, the memory card emulates Visual Memory, not a plain memory card....
Then, will it works if

1. backout previous patch, and apply following patch, or
2. apply both patches (previous one and following one)?

-- 
ITOH Yasufumi

Index: maple.c
===================================================================
RCS file: /cvsroot/src/sys/arch/dreamcast/dev/maple/maple.c,v
retrieving revision 1.23
diff -p -u -r1.23 maple.c
--- maple.c	2003/01/01 01:28:29	1.23
+++ maple.c	2003/02/09 09:30:59
@@ -697,6 +697,17 @@ maple_attach_unit(struct maple_softc *sc
 			u->u_ping_func = f;	/* XXX using largest func */
 		}
 	}
+#define MAPLE_MEMCARD_PING_HACK
+#ifdef MAPLE_MEMCARD_PING_HACK
+	/*
+	 * Some 3rd party memory card pretend as Visual Memory,
+	 * but actually only the storage funciton is implemented.
+	 */
+	if (func == (MAPLE_FUNC(MAPLE_FN_MEMCARD) | MAPLE_FUNC(MAPLE_FN_LCD) |
+	    MAPLE_FUNC(MAPLE_FN_CLOCK))) {
+		u->u_ping_func = MAPLE_FN_MEMCARD;
+	}
+#endif
 	strcpy(sc->sc_dev.dv_xname, oldxname);
 
 	sc->sc_port_units[u->port] |= 1 << u->subunit;