-CSRCS = devlpr.c devtty.c devfd.c devhd.c devgfx.c
+CSRCS = devlpr.c devtty.c devfd.c devfd3.c devhd.c devgfx.c
CSRCS += devices.c main.c
DISCARD_CSRCS = discard.c devhd_discard.c
ASRCS = trs80.s trs80-bank.s crt0.s
-ASRCS += tricks.s commonmem.s floppy.s
+ASRCS += tricks.s commonmem.s floppy.s floppy3.s
COBJS = $(CSRCS:.c=.rel)
AOBJS = $(ASRCS:.s=.rel)
#include <vt.h>
#include <devtty.h>
#include <devgfx.h>
+#include <devfd3.h>
+#include <trs80.h>
struct devsw dev_tab[] = /* The device driver switch table */
{
return true;
}
+void floppy_setup(void)
+{
+ if (trs80_model == TRS80_MODEL3) {
+ dev_tab[1].dev_open = fd3_open;
+ dev_tab[1].dev_read = fd3_read;
+ dev_tab[1].dev_write = fd3_write;
+ }
+}
/* Time of day clock */
inittod();
#endif
+ floppy_setup();
hd_probe();
}
timer.rel
kdata.rel
platform-trs80m1/devfd.rel
+platform-trs80m1/devfd3.rel
platform-trs80m1/floppy.rel
+platform-trs80m1/floppy3.rel
platform-trs80m1/devhd.rel
platform-trs80m1/devhd_discard.rel
platform-trs80m1/devgfx.rel
#include <kdata.h>
#include <printf.h>
#include <devtty.h>
+#include <trs80.h>
uint16_t ramtop = PROGTOP;
uint8_t trs80_model;
void platform_interrupt(void)
{
uint8_t dummy;
- if (trs_model != TRS80_MODEL3) {
+ if (trs80_model != TRS80_MODEL3) {
uint8_t irq = *((volatile uint8_t *)0x37E0);
tty_interrupt();
if (irq & 0x70)
tty_interrupt();
/* We don't handle IOBUS */
- if (irq & 0x04)
+ if (irq & 0x04) {
kbd_interrupt();
timer_interrupt();
dummy = irqack3;
.globl unix_syscall_entry
.globl outcharhex
.globl null_handler
+ .globl fd_nmi_handler
.include "kernel.def"
init_early:
ld a,(4)
cp #0x30
- jr z, not_m3
+ jr nz, not_m3
ld a,#1
ld (_trs80_model),a
ld a,#0x74
ld hl, #unix_syscall_entry
ld (0x4010), hl
+ ; Model III only but just writing it does no harm
+ ld hl,#fd_nmi_handler
+ ld (0x4049), hl
jp map_kernel
; outchar: Wait for UART TX idle, then print the char in A