
/*
	GIER common variables

	(C) Copyright 2001 by Mogens Kjaer


   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

/*
	Declaration of registers
*/

extern GIERword BUS;
extern GIERword LI;
extern GIERword LI_drum;
extern GIERword OR;
extern GIERword MD;
extern GIERword H;
extern GIERword MQ;
extern GIERword AC;
extern unsigned short AD0;
extern unsigned short AD1;
extern unsigned short IN;
extern unsigned short OT,AD2,SR;
extern unsigned short TK,BL,BY,BS,BT,TD,TBA,TG,TA;

extern GIERword Ferrit[1024];
extern GIERword *Tromle;
extern GIERword *Buffer;
extern GIERword *BDisk[MAXBDISKS];
extern int BDisk_tracksize[MAXBDISKS];
extern int BDisk_present[MAXBDISKS];
extern int BDisk_size[MAXBDISKS];
extern bdisktype bdisktypes[MAXBDISKTYPES];
extern btapeblock *BTape[MAXBTAPES];
extern int BTape_len[MAXBTAPES];
extern int BTape_current[MAXBTAPES];
extern GIERword BTape_status[MAXBTAPES];
extern GIERword *BCarr[CARROUSELREELS][CARROUSELBLOCKS];
extern int Tromle_size;
extern int track0_open;
extern int track1_31_open;
extern int sound_enabled;
extern int testmode;
extern int debug;
extern FILE *debug_fh;
extern long statistics[];
extern long long timing_statistics[];

/* Execution control: */

extern void (*Mode)();
extern void (*drumsave_Mode)();
extern int MA,drumsave_MA;
extern int running;
extern int h,b,c;
extern int spild;
extern int ind_ka,ind_kb,switch_k0,aarhus_mode;
extern int TO_error;
extern int TR_error;
extern int YE_wait;
extern void Mode1();
extern void Mode2();
extern void Mode3();
extern void Mode4();
extern void Mode5();

/*
	Interface stuff:
*/

extern int normal_stop_pressed, normal_start_pressed, normal_singlestep_pressed;
extern int mikrotempi_stop_pressed, mikrotempi_start_pressed;
extern int HP_button_pressed;

extern int sound_update_interval;
extern int interface_check_interval;
extern GIERword disk_count,last_disk_count;
extern int disk_status,disk_cylinder;
extern double drum_count;
extern int drum_running,drum_wait,drum_mode,drum_address,drum_cell_count,gier_clock;
extern double drum_clock,drum_speed;

extern int typewriter_nchars;
extern char typewriter_char_table[];
extern int reader_nchars, reader_offset;
extern char reader_char_table[];
extern int reader_parity_error;

extern int selected_out[5];

extern unsigned char remove_parity(unsigned char);
extern int check_parity(unsigned char);

