File: beta.h

package info (click to toggle)
fuse-emulator 1.5.7%2Bdfsg1-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 9,024 kB
  • sloc: ansic: 87,196; sh: 11,456; perl: 3,916; makefile: 991; yacc: 245; lex: 139
file content (85 lines) | stat: -rw-r--r-- 3,120 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/* beta.h: Routines for handling the Beta disk interface
   Copyright (c) 2003-2016 Fredrick Meunier, Philip Kendall
   Copyright (c) 2015 Stuart Brady

   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.,
   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

   Author contact information:

   E-mail: philip-fuse@shadowmagic.org.uk

     Fred: fredm@spamcop.net

*/

#ifndef FUSE_BETA_H
#define FUSE_BETA_H

#include <libspectrum.h>

#include "memory_pages.h"
#include "fdd.h"

extern int beta_available;  /* Is the Beta disk interface available for use? */
extern int beta_active;     /* Is the Beta disk interface enabled? */
extern int beta_builtin;    /* Is the Beta disk interface built-in? */

/* A 16KB memory chunk accessible by the Z80 when /ROMCS is low */
extern memory_page beta_memory_map_romcs[MEMORY_PAGES_IN_16K];

extern libspectrum_word beta_pc_mask; /* Bits to mask in PC for enable check */
extern libspectrum_word beta_pc_value; /* Value to compare masked PC against */

void beta_register_startup( void );

void beta_page( void );
void beta_unpage( void );

void beta_cr_write( libspectrum_word port, libspectrum_byte b );

libspectrum_byte beta_sr_read( libspectrum_word port, libspectrum_byte *attached );

libspectrum_byte beta_tr_read( libspectrum_word port, libspectrum_byte *attached );
void beta_tr_write( libspectrum_word port, libspectrum_byte b );

libspectrum_byte beta_sec_read( libspectrum_word port, libspectrum_byte *attached );
void beta_sec_write( libspectrum_word port, libspectrum_byte b );

libspectrum_byte beta_dr_read( libspectrum_word port, libspectrum_byte *attached );
void beta_dr_write( libspectrum_word port, libspectrum_byte b );

libspectrum_byte beta_sp_read( libspectrum_word port, libspectrum_byte *attached );
void beta_sp_write( libspectrum_word port, libspectrum_byte b );

typedef enum beta_drive_number {
  BETA_DRIVE_A = 0,
  BETA_DRIVE_B,
  BETA_DRIVE_C,
  BETA_DRIVE_D,
  BETA_NUM_DRIVES,
} beta_drive_number;

int beta_disk_insert( beta_drive_number which, const char *filename,
                       int autoload );
int beta_disk_eject( beta_drive_number which );
int beta_disk_save( beta_drive_number which, int saveas );
int beta_disk_flip( beta_drive_number which, int flip );
int beta_disk_writeprotect( beta_drive_number which, int wrprot );
int beta_disk_write( beta_drive_number which, const char *filename );
fdd_t *beta_get_fdd( beta_drive_number which );

int beta_unittest( void );

#endif                  /* #ifndef FUSE_BETA_H */