~ubuntu-branches/ubuntu/wily/xmms2/wily

« back to all changes in this revision

Viewing changes to src/plugins/gme/gme/Ay_Emu.h

  • Committer: Bazaar Package Importer
  • Author(s): Benjamin Drung
  • Date: 2008-07-04 16:23:34 UTC
  • mfrom: (1.1.5 upstream) (6.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080704162334-b3esbkcapt8wbrk4
Tags: 0.5DrLecter-2ubuntu1
* Merge from debian unstable (LP: #241098), remaining changes:
  + debian/control:
    + Update Maintainer field
    + add lpia to xmms2-plugin-alsa supported architectures
    + Added liba52-0.7.4-dev to build depends
  + debian/rules: Added patch, patch-stamp and unpatch
  + changed 01_gcc4.3.patch:
    + src/include/xmmsclient/xmmsclient++/helpers.h: Added #include <climits>
* New upstream relase fixes LP: #212566, #222341

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Sinclair Spectrum AY music file emulator
 
2
 
 
3
// Game_Music_Emu 0.5.2
 
4
#ifndef AY_EMU_H
 
5
#define AY_EMU_H
 
6
 
 
7
#include "Classic_Emu.h"
 
8
#include "Ay_Apu.h"
 
9
#include "Ay_Cpu.h"
 
10
 
 
11
class Ay_Emu : private Ay_Cpu, public Classic_Emu {
 
12
        typedef Ay_Cpu cpu;
 
13
public:
 
14
        // AY file header
 
15
        enum { header_size = 0x14 };
 
16
        struct header_t
 
17
        {
 
18
                byte tag [8];
 
19
                byte vers;
 
20
                byte player;
 
21
                byte unused [2];
 
22
                byte author [2];
 
23
                byte comment [2];
 
24
                byte max_track;
 
25
                byte first_track;
 
26
                byte track_info [2];
 
27
        };
 
28
        
 
29
        static gme_type_t static_type() { return gme_ay_type; }
 
30
public:
 
31
        Ay_Emu();
 
32
        ~Ay_Emu();
 
33
        struct file_t {
 
34
                header_t const* header;
 
35
                byte const* end;
 
36
                byte const* tracks;
 
37
        };
 
38
protected:
 
39
        blargg_err_t track_info_( track_info_t*, int track ) const;
 
40
        blargg_err_t load_mem_( byte const*, long );
 
41
        blargg_err_t start_track_( int );
 
42
        blargg_err_t run_clocks( blip_time_t&, int );
 
43
        void set_tempo_( double );
 
44
        void set_voice( int, Blip_Buffer*, Blip_Buffer*, Blip_Buffer* );
 
45
        void update_eq( blip_eq_t const& );
 
46
private:
 
47
        file_t file;
 
48
        
 
49
        unsigned play_addr;
 
50
        cpu_time_t play_period;
 
51
        cpu_time_t next_play;
 
52
        Blip_Buffer* beeper_output;
 
53
        int beeper_delta;
 
54
        int last_beeper;
 
55
        int apu_addr;
 
56
        int cpc_latch;
 
57
        bool spectrum_mode;
 
58
        bool cpc_mode;
 
59
        
 
60
        // large items
 
61
        struct {
 
62
                byte padding1 [0x100];
 
63
                byte ram [0x10000 + 0x100];
 
64
        } mem;
 
65
        Ay_Apu apu;
 
66
        friend void ay_cpu_out( Ay_Cpu*, cpu_time_t, unsigned addr, int data );
 
67
        void cpu_out_misc( cpu_time_t, unsigned addr, int data );
 
68
};
 
69
 
 
70
#endif