-/* xscreensaver, Copyright (c) 1998-2003 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1998-2004 Jamie Zawinski <jwz@jwz.org>
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
#include "analogtv.h"
-
typedef struct apple2_state {
- u_char hireslines[192][40];
- u_char textlines[24][40];
+ unsigned char hireslines[192][40];
+ unsigned char textlines[24][40];
int gr_text;
enum {
A2_GR_FULL=1,
} apple2_state_t;
-typedef struct apple2_sim_s {
+typedef struct apple2_sim_s apple2_sim_t;
+struct apple2_sim_s {
void *controller_data;
analogtv_input *inp;
analogtv_reception reception;
- char *typing;
+ const char *typing;
char typing_buf[1024];
double typing_rate;
struct timeval basetime_tv;
double curtime;
double delay;
-} apple2_sim_t;
+
+ int stepno;
+ double next_actiontime;
+ void (*controller)(apple2_sim_t *sim,
+ int *stepno,
+ double *next_actiontime);
+
+};
enum {
A2CONTROLLER_FREE=-2
};
-extern void
-apple2(Display *dpy, Window window, int delay,
- void (*)(apple2_sim_t *sim, int *stepno, double *next_actiontime));
+
+extern apple2_sim_t * apple2_start (Display *, Window, int delay,
+ void (*)(apple2_sim_t *, int *stepno,
+ double *next_actiontime));
+extern int apple2_one_frame (apple2_sim_t *);
void a2_poke(apple2_state_t *st, int addr, int val);
void a2_cls(apple2_state_t *st);
void a2_invalidate(apple2_state_t *st);
-void a2_add_disk_item(apple2_state_t *st, char *name, u_char *data,
+void a2_add_disk_item(apple2_state_t *st, char *name, unsigned char *data,
int len, char type);
void a2_scroll(apple2_state_t *st);
void a2_printc(apple2_state_t *st, char c);
+void a2_printc_noscroll(apple2_state_t *st, char c);
void a2_prints(apple2_state_t *st, char *s);
void a2_goto(apple2_state_t *st, int r, int c);
void a2_cls(apple2_state_t *st);