\documentclass[10pt,aspectratio=169,titlepage]{beamer}
\usetheme{Warsaw}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\title{The Art of Necromancy - Bringing Back a Dead Onlineservice}
\author{Christian Berger christian@clarke-3.de}
\date{\today}

\begin{document}
\maketitle


\section{What are we talking about}
\begin{frame} %%Eine Folie
  \frametitle{The Cept Family}
  \includegraphics[scale=0.36]{orf1980.png} 
  \includegraphics[scale=0.20]{btx3.png} 
\end{frame}
\begin{frame} %%Eine Folie
  \frametitle{Bildschirmtext}
  \begin{itemize}
  	\item Cept standard
  	\begin{itemize}
  		\item 24/20 content lines with 40 (or more) columns each
  		\item serial or parallel attributes
  		\item optional geometric and photographic layers (pre JPEG!)
  	\end{itemize}
  	\item interactive terminal via the telephone network
  	\begin{itemize}
  		\item V.23 1200 bps with 75 bps secondary channel (with optional data link layer)
  		\item X.75 over ISDN
  		\item hints of higher than 64k speeds
  		\item not limited to static pages
  		\item could be implemented without CPUs
  	\end{itemize}
  \end{itemize}
\end{frame}
\section{The Modem}
\begin{frame}
  \frametitle{Simple, isn't it?}
  \begin{itemize}
  \item Modem
  \begin{itemize}
  	\item V.23 1200/75bps answer mode is rare and hard to get
  	\item Terminals usually don't support V.8 negotiation
  \end{itemize}
  \item Connection
  \begin{itemize}
  	\item ANIS/ISDN lines are expensive
  	\item ISDN lines require hardware to connect modems (PBX, Terminaladapter, etc)
  	\item severely limited number of channels
  \end{itemize}
    \end{itemize}
\end{frame}
\begin{frame} %%Eine Folie
  \frametitle{Let's write a modem in software!}
  Asterisk may have its severe flaws, but this is something it can do.
  \begin{itemize}
  	\item Start with Echo Application
  	\item Exchange Data of Packets before sending out again
  	\item Send the data off via a normal TCP/IP connection
  	\item Modulation is trivial
  	\item Demodulation is not to hard
  	\begin{itemize}
  		\item "Downmix" to IQ
  		\item Filter
  		\item Demodulate
  		\item Find Bits  	
  	\end{itemize}
  	\item \url{https://github.com/Casandro/btx_modem} (527 lines in total)
  \end{itemize}
\end{frame}
\begin{frame}
  \frametitle{What could possibly go wrong?}
  \begin{itemize}
  	\item weird Codecs (not in Germany, as it's G.711 only)
  	\item echo cancellers in the network (insane, but Fax machines know how to turn them off)
  	\item broken echo chancellers which mix in other channels (I'm looking at you, Vodafone)
  	\item cheap ATAs have extremely wrong sampling rates generates sample/packet slips (irrelevant here as we send one frame for every one we get)
  	\item packet loss (rare, but forces us to use link layer protocol)
  \end{itemize}
\end{frame}
\section{Content}
\begin{frame}
  \frametitle{How to get content}
  \begin{itemize}
  	\item use what's already out there
  	\begin{itemize}
  		\item \url{http://btx.runningserver.com/}
  		\item \url{https://git.imzadi.de/acn/rtx}
  		\item \url{https://github.com/proquar/asterisk-Softmodem}
  		\item \url{https://github.com/Casandro/cas_btx}
  	\end{itemize}
  	\item connect to other servers (Rechnerverbund)
  	\item write a termcap definition
  \end{itemize}
\end{frame}
\section{Technical Details}
\begin{frame}
\frametitle{Structure}
%\small
\footnotesize 
\begin{tabular}{|l|l|l|l|}
\hline
\multicolumn{4}{|c|}{Videotex Presentation Data Element} \\
\hline
\multicolumn{2}{|c|}{Videotex Presentation Control Element} & \multicolumn{2}{|c|}{Videotex Service Control Element}\\
\hline
\$1F & \$20 & \multicolumn{2}{|c|}{Terminal Facility Identifier request}\\ 
\hline 
\$1F & \$21 & \multicolumn{2}{|c|}{Terminal Facility Identifier request}\\ 
\hline 
\$1F & \$23 & \multicolumn{2}{|c|}{Define DCRS (user defined characters)}\\ 
\hline 
\$1F & \$26 & \multicolumn{2}{|c|}{Define Colour}\\ 
\hline 
\$1F & \$2D & \multicolumn{2}{|c|}{Define Format}\\
\hline 
\$1F & \$2E & \multicolumn{2}{|c|}{Timing Control}\\  
\hline 
\$1F & \$2F & \multicolumn{2}{|c|}{Reset (also sets screen size)}\\
\hline 
\$1F & \$31 & \multicolumn{2}{|c|}{Geometric Data 3D}\\  
\hline 
\$1F & \$32 & \multicolumn{2}{|c|}{Geometric Data 2D}\\ 
\hline 
\$1F & \$34 & \multicolumn{2}{|c|}{Photographic Pixel Data}\\ 
\hline 
\$1F & \$35 & \multicolumn{2}{|c|}{Photographic Table Data}\\ 
\hline 
\$1F & \$3B & \multicolumn{2}{|c|}{Sound (1980s codecs)}\\ 
\hline 
\$1F & \$3E & \multicolumn{2}{|c|}{Telesoftware}\\ 
\hline 
\$1F & \$3F & length &\multicolumn{1}{|c|}{Transparent Data}\\ 
\hline
\$1F & X & Y & Alphamosaic Spalte X, Zeile Y (both \$41...)\\
\hline
\end{tabular}
\end{frame}
\begin{frame}
\frametitle{Parallel Attributes}
Just like on the PC. Every character cell has both the character code and the attributes in memory.
\begin{itemize}
\item roughly 1024 characters $\Rightarrow$ 10 Bit
\item 32 foreground colours $\Rightarrow$ 5 Bit
\item 32 background colors $\Rightarrow$ 5 Bit
\item 5 blink modes $\Rightarrow$ 3 Bit
\item 4 character sizes $\Rightarrow$ 2 Bit
\item underline, hidden, box, marked, protected $\Rightarrow$ 5 Bit
\end{itemize}
$\Rightarrow$ 4 octets needed per character. At 40x24 characters that's 30720 bits!
\end{frame} 
\begin{frame}
\frametitle{RAM in December 1981, 15 AUD for 16kbit of RAM}
\includegraphics[scale=0.3]{ETI_1981_12_December_Page_101_Applied_Technology_Advertisement.jpg}
\end{frame}

\begin{frame}
\frametitle{Serial Attributes}
RAM is expensive, so let's cheat!\\

\includegraphics[scale=0.75]{serial_attributes.png}

$\Rightarrow$ Only 1 byte needed per character. So only 7680 bits!

TV Teletext uses this to have pages of fixed size.
\end{frame}

\begin{frame}
\frametitle{Character sets}
G0: \includegraphics[scale=0.75]{g0.png}\\
G1: \includegraphics[scale=0.75]{btx_g1.png}\\
G2: \includegraphics[scale=0.75]{btx_g2.png}\\
G3: \includegraphics[scale=0.75]{btx_g3.png}\\
Additional sets for other languages in extensions. \$40-\$4f in G2 are special accent characters which combine with the next character.
\end{frame}
\begin{frame}
\frametitle{Shift}
We only have 256 (8 Bit) or 128 (7 Bit) input codepoints, but many more characters.\\

Solution: We split up the range into several parts.
\begin{itemize}
\item \$00-\$1f: control characters (mostly cursor control)
\item \$20-\$7f: left character set
\item \$80-\$9f: more control characters (mostly attributes)
\item \$A0-\$ff: right character set
\end{itemize}

There are control sequences to shift each character set either to the left or the right position. See ETS 300 072 3.8.2.
Some control sequences are accessed by ESC \$1b.
\end{frame}
\begin{frame}
Todo:

Parallel und Serial Attributes mischbar?
\end{frame}

\begin{frame}
\frametitle{Audio}

\end{frame}

\begin{frame}
\frametitle{References}
ETS 300 072 Overview\\
ETS 300 073 Geometric Display\\
ETS 300 074 Transparent Data\\
ETS 300 075 File Transfer\\
ETS 300 076 Terminal Facility Idenfifier\\
\end{frame}
\section{Why?}
\begin{frame}
  \frametitle{Why?}
  \begin{itemize}
  	\item Because we can!
  	\item it fits nicely onto badge-sized computers
  	\begin{itemize}
  		\item 40x24 characters can work on 320x240 TFTs
  		\item accessing pages works via a ITU-T E.161 keypad
  	\end{itemize}
  	\item far less complex than modern websites so you can run it on classes of SoCs which will \emph{never} get any kind of ME
  	\item easy to reverse engineer, even without specs
  	\item amount of data small enough for low bandwidth connections. (shortwave radio? cubesats?)
  \end{itemize}
\end{frame}
\end{document}