diff --git a/js/components/Apple2.tsx b/js/components/Apple2.tsx index 14e4e2e..4a3bca3 100644 --- a/js/components/Apple2.tsx +++ b/js/components/Apple2.tsx @@ -13,6 +13,7 @@ import { Screen } from './Screen'; import { Drives } from './Drives'; import { Slinky } from './Slinky'; import { ThunderClock } from './ThunderClock'; +import { Videoterm } from './Videoterm'; import { spawn, Ready } from './util/promises'; import styles from './css/Apple2.module.css'; @@ -87,6 +88,7 @@ export const Apple2 = (props: Apple2Props) => {
+ {!e ? : null} diff --git a/js/components/Videoterm.tsx b/js/components/Videoterm.tsx new file mode 100644 index 0000000..bcb8056 --- /dev/null +++ b/js/components/Videoterm.tsx @@ -0,0 +1,20 @@ +import { useEffect } from 'preact/hooks'; +import Apple2IO, { slot } from 'js/apple2io'; +import VideotermImpl from 'js/cards/videoterm'; +/** + * VideoTerm component properties + */ +export interface VideotermProps { + io: Apple2IO | undefined; + slot: slot; +} + +export const Videoterm = ({ io, slot }: VideotermProps ) => { + useEffect(() => { + if (io) { + const videoterm = new VideotermImpl(); + io.setSlot(slot, videoterm); + } + }, [io, slot]); + return null; +};