1 /* xscreensaver, Copyright (c) 1998-2004 Jamie Zawinski <jwz@jwz.org>
3 * Permission to use, copy, modify, distribute, and sell this software and its
4 * documentation for any purpose is hereby granted without fee, provided that
5 * the above copyright notice appear in all copies and that both that
6 * copyright notice and this permission notice appear in supporting
7 * documentation. No representations are made about the suitability of this
8 * software for any purpose. It is provided "as is" without express or
11 * Apple ][ CRT simulator, by Trevor Blackwell <tlb@tlb.org>
12 * with additional work by Jamie Zawinski <jwz@jwz.org>
15 #ifndef __XSCREENSAVER_APPLE_II__
16 #define __XSCREENSAVER_APPLE_II__
20 typedef struct apple2_state {
21 unsigned char hireslines[192][40];
22 unsigned char textlines[24][40];
36 typedef struct apple2_sim_s apple2_sim_t;
39 void *controller_data;
45 analogtv_reception reception;
48 char typing_buf[1024];
52 char printing_buf[1024];
58 XWindowAttributes xgwa;
61 struct timeval basetime_tv;
66 double next_actiontime;
67 void (*controller)(apple2_sim_t *sim,
69 double *next_actiontime);
91 extern apple2_sim_t * apple2_start (Display *, Window, int delay,
92 void (*)(apple2_sim_t *, int *stepno,
93 double *next_actiontime));
94 extern int apple2_one_frame (apple2_sim_t *);
97 void a2_poke(apple2_state_t *st, int addr, int val);
98 void a2_goto(apple2_state_t *st, int r, int c);
99 void a2_cls(apple2_state_t *st);
100 void a2_invalidate(apple2_state_t *st);
102 void a2_add_disk_item(apple2_state_t *st, char *name, unsigned char *data,
104 void a2_scroll(apple2_state_t *st);
105 void a2_printc(apple2_state_t *st, char c);
106 void a2_printc_noscroll(apple2_state_t *st, char c);
107 void a2_prints(apple2_state_t *st, char *s);
108 void a2_goto(apple2_state_t *st, int r, int c);
109 void a2_cls(apple2_state_t *st);
110 void a2_clear_hgr(apple2_state_t *st);
111 void a2_clear_gr(apple2_state_t *st);
112 void a2_invalidate(apple2_state_t *st);
113 void a2_poke(apple2_state_t *st, int addr, int val);
114 void a2_display_image_loading(apple2_state_t *st, unsigned char *image,
116 void a2_init_memory_active(apple2_sim_t *sim);
117 void a2_hplot(apple2_state_t *st, int hcolor, int x, int y);
118 void a2_hline(apple2_state_t *st, int hcolor, int x1, int y1, int x2, int y2);
119 void a2_plot(apple2_state_t *st, int color, int x, int y);
121 #endif /* __XSCREENSAVER_APPLE_II__ */