Browse code

Add file reading with .File/read DEI(2).

Andrew Alderwick authored on 17/03/2022 19:03:41
Showing 1 changed files
... ...
@@ -198,5 +198,14 @@ file_i_deo(int instance, Device *d, Uint8 port)
198 198
 Uint8
199 199
 file_i_dei(int instance, Device *d, Uint8 port)
200 200
 {
201
+	UxnFile *c = &uxn_file[instance];
202
+	Uint16 res;
203
+	switch(port) {
204
+	case 0xc:
205
+	case 0xd:
206
+		res = file_read(c, &d->dat[port], 1);
207
+		DEVPOKE16(0x2, res);
208
+		break;
209
+	}
201 210
 	return d->dat[port];
202 211
 }