DSRCS = ../dev/devide.c ../dev/blkdev.c ../dev/mbr.c
DISCARD_DSRCS = ../dev/devide_discard.c
+NSRCS = ../dev/net/net_native.c
+
CROSS_CCOPTS += -I ../dev/
ASRCS = crt0.s commonmem.s pcw8256.s
AOBJS = $(ASRCS:.s=.rel)
DISCARD_DOBJS = $(patsubst ../dev/%.c,%.rel, $(DISCARD_DSRCS))
DOBJS = $(patsubst ../dev/%.c,%.rel, $(DSRCS))
+NOBJS = $(patsubst ../dev/net/%.c,%.rel, $(NSRCS))
-OBJS = $(COBJS) $(AOBJS) $(DOBJS) $(DISCARD_DOBJS)
+OBJS = $(COBJS) $(AOBJS) $(DOBJS) $(DISCARD_DOBJS) $(NOBJS)
JUNK = $(CSRCS:.c=.lst) $(CSRCS:.c=.asm) $(CSRCS:.c=.sym) $(ASRCS:.s=.lst) $(ASRCS:.s=.sym) $(CSRCS:.c=.rst) $(ASRCS:.s=.rst)
$(DISCARD_DOBJS): %.rel: ../dev/%.c
$(CROSS_CC) $(CROSS_CCOPTS) $(CROSS_CC_SEGDISC) -c $<
+$(NOBJS): %.rel: ../dev/net/%.c
+ $(CROSS_CC) $(CROSS_CCOPTS) -c $<
+
clean:
rm -f $(OBJS) $(JUNK) core *~
The keyboard magically replaces the top 16 bytes of bank 3.
Our loader puts the screen into bank 4 and bank 5 (part of), then loads the
-OS into bank 0/1/2/3. We really need to rearrange this so we set the
-final kernel map as something like
+OS into bank 0/1/2/3.
-0 1 3 5 (4 is display in map)
+Other work needed here is to put the buffer cache at the end followed by the
+font data if we do it this way, then discard. At that point we can move the
+font into video mappings.
-except that means we must field a hole between BFF0 (keyboard) and Cxxx (
-display). We then end up with a map of
+Right now bank 0-3 are fully used if we do the buffer reclaim (which gets us
+a nice 12 or so extra buffers), bank 4 is all video and bank 5 would have
+5K left after the fonts. An obvious use for that would be to go to 256
+byte tty queues and add ptys - (costing us about 3K)
-0000-0087 Boot loader
-0088-BFEF Kernel image
-BFF0-BFFF Keyboard
-C000-D9FF Video (lower window)
-DA00-DBFF Roller map
-DC00-E3FF Font
-E400-... Video
-... -FFFF Common
+Other candidates would be the low level graphics rendering routines as we'll
+want those for a graphics mode (or we need to support an mmap like mode for
+direct mapping a 16K graphics window over the app memory)
-Whilst doing video we map over 8000-BFFF and rely upon the video and common
-mappings
-That leaves bank 2, 6+ for userspace (kernel + video costs us 80K)
#define CONFIG_INPUT_GRABMAX 2 /* We could in theory do full up/down but later */
#define MAX_BLKDEV 1 /* UIDE or FIDHD never both */
#define CONFIG_IDE /* Has an IDE controller - maybe anyway: UIDE */
+#define CONFIG_NET
#define TICKSPERSEC 50 /* Ticks per second */
#define PROGBASE 0x0000 /* memory base of program */
#define PROGLOAD 0x0100 /* load base of program */
-#define PROGTOP 0xF000 /* Top of program, base of U_DATA */
+#define PROGTOP 0xF400 /* Top of program, base of U_DATA */
#define SWAP_SIZE 0x80 /* 64K in blocks (we actually don't need all of it FIXME) */
#define SWAPBASE ((uint16_t)0x0000) /* We swap the lot in one, include the */
-#define SWAPTOP 0xF400 /* vectors. We have to swap 256 bytes of
+#define SWAPTOP 0xF800 /* vectors. We have to swap 256 bytes of
common as well */
#define BOOT_TTY (512 + 1)
/* Device parameters */
#define NUM_DEV_TTY 3
-#define NDEVS 16 /* Devices 0..NDEVS-1 are capable of being mounted */
- /* (add new mountable devices to beginning area.) */
#define TTYDEV BOOT_TTY /* Device used by kernel for messages, panics */
#define SWAPDEV 5 /* Device for swapping. */
#define NBUFS 6 /* Number of block buffers */
__sfr __at 0xD1 kemp_y;
__sfr __at 0xD4 kemp_button;
-static uint8_t has_amx, has_kemp;
+__sfr __at 0x9F kemp_js;
+
+static uint8_t has_amx, has_kemp, has_kempjs;
static uint8_t okx, oky;
static char buf[32];
return 2;
}
if (has_amx) {
- *slot++ = MOUSE_REL|BUTTONS(2);
+ *slot++ = MOUSE_REL|BUTTON(3);
r = amx_v;
*slot++ = (r >> 4) - (r & 0x0F);
*slot++ = (r & 0x0F) - (r >> 4);
- *slot++ = amx_button & 3;
+ *slot++ = ~amx_button & 7;
return 4;
}
if (has_kemp) {
*slot++ = delta(oky, ky);
/* Need to think about this eg 0xF0 -> 0x0F is a positive move
of 0x1F while 0x0F->0xF0 is a negative move of 0x1F */
- *slot++ = kemp_button;
+ *slot++ = ~kemp_button & 3;
oky = ky;
okx = kx;
return 4;
}
+ if (has_kempjs) {
+ uint8_t v = 0;
+ r = kemp_js;
+ if (r & 1)
+ v = STICK_DIGITAL_R;
+ if (r & 2)
+ v = STICK_DIGITAL_L;
+ if (r & 4)
+ v = STICK_DIGITAL_U;
+ if (r & 8)
+ v = STICK_DIGITAL_D;
+ if (r & 16)
+ v |= BUTTON(0);
+ *slot++ = STICK_DIGITAL;
+ *slot++ = v;
+ return 2;
+ }
return 0;
}
uint8_t platform_input_init(void)
{
+ /* Kempston or AMS mice - don't support both at once */
if (kemp_x != 0xFF || kemp_y != 0xFF || kemp_button != 0xFF)
has_kemp = 1;
else if (amx_ctrl != 0xFF && amx_button != 0x10) {
amx_button = 0xFF;
amx_button = 0x00;
has_amx = 1;
- } else
- return 0;
- return 1;
+ }
+ /* Could also have a keymouse */
+ /* Kempston Joystick */
+ if ((kemp_js & 0x80) == 0)
+ has_kempjs = 1;
+ /* TODO: DkTronics sound card has a joystick port too */
}
}
}
-uint8_t keyboard[12][8] = {
+const uint8_t keyboard[12][8] = {
{'2', '3', '6', '9', KEY_PASTE ,KEY_F1, '0', KEY_F3},
{'1', '5', '4', '8', KEY_COPY, KEY_CUT, KEY_PRINT, KEY_EXIT},
{KEY_PLUS, KEY_HALF, 0, '7', '#', 13, ']', KEY_DELR},
{0, 0, 0, 0, 0, 0, 0, 0} /* FIXME: js 2 */
};
-uint8_t shiftkeyboard[12][8] = {
+const uint8_t shiftkeyboard[12][8] = {
{'2', '3', '6', '9', KEY_PASTE, KEY_F2, '0', KEY_F4},
{'1', '5', '4', '8', KEY_COPY, KEY_CUT, KEY_PRINT, KEY_EXIT},
{KEY_PLUS, '@', 0, '7', '>', 13, '}', KEY_DELR},
#define KEY_ROWS 12
#define KEY_COLS 8
extern uint8_t keymap[12];
-extern uint8_t keyboard[12][8];
-extern uint8_t shiftkeyboard[12][8];
+extern const uint8_t keyboard[12][8];
+extern const uint8_t shiftkeyboard[12][8];
#endif
-mwxuy
-i fuzix.ihx
-b _CODE=0x0000
--b _COMMONMEM=0xF000
--b _DISCARD=0xE000
+-b _COMMONMEM=0xF400
+-b _DISCARD=0xE800
-l z80
platform-pcw8256/crt0.rel
platform-pcw8256/commonmem.rel
syscall_fs3.rel
syscall_proc.rel
syscall_other.rel
+syscall_net.rel
tty.rel
mm.rel
bank16k.rel
platform-pcw8256/devfhd.rel
platform-pcw8256/fidhd.rel
platform-pcw8256/devinput.rel
-
+platform-pcw8256/net_native.rel
-e
; UZI mnemonics for memory addresses etc
-U_DATA .equ 0xF000 ; (this is struct u_data from kernel.h)
+U_DATA .equ 0xF400 ; (this is struct u_data from kernel.h)
U_DATA__TOTALSIZE .equ 0x300 ; 256+256+256 bytes.
Z80_TYPE .equ 0 ; FIXME: check