~ubuntu-branches/debian/experimental/mednafen/experimental

« back to all changes in this revision

Viewing changes to src/cdrom/SimpleFIFO.h

  • Committer: Package Import Robot
  • Author(s): Stephen Kitt
  • Date: 2012-01-31 07:21:35 UTC
  • mfrom: (1.2.8)
  • Revision ID: package-import@ubuntu.com-20120131072135-es3dj12y00xcnrsk
Tags: 0.9.19-1
* New upstream WIP version.
* Update copyright information.
* Refresh use-system-tremor.patch and remove psx-big-endian-only.patch.
* Add spelling-fixes.patch based on Lintian's recommendations.
* Build-depend on debhelper 9 or later and remove corresponding Lintian
  override.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 {
17
17
  data.resize(round_up_pow2(the_size));
18
18
  size = the_size;
 
19
  read_pos = 0;
 
20
  write_pos = 0;
 
21
  in_count = 0;
19
22
 }
20
23
 
21
24
 // Destructor
22
 
 ~SimpleFIFO()
 
25
 INLINE ~SimpleFIFO()
23
26
 {
24
27
 
25
28
 }
58
61
  return(ReadUnit(peek));
59
62
 }
60
63
 
61
 
 inline void Write(const T *happy_data, uint32 happy_count)
 
64
 INLINE void Write(const T *happy_data, uint32 happy_count)
62
65
 {
63
66
  assert(CanWrite() >= happy_count);
64
67
 
73
76
  }
74
77
 }
75
78
 
76
 
 void WriteUnit(T wr_data)
 
79
 INLINE void WriteUnit(const T& wr_data)
77
80
 {
78
81
  Write(&wr_data, 1);
79
82
 }
80
83
 
81
 
 void WriteByte(T wr_data)
 
84
 INLINE void WriteByte(const T& wr_data)
82
85
 {
83
86
  assert(sizeof(T) == 1);
84
87
  Write(&wr_data, 1);
85
88
 }
86
89
 
87
90
 
88
 
 void Flush(void)
 
91
 INLINE void Flush(void)
89
92
 {
90
93
  read_pos = 0;
91
94
  write_pos = 0;
97
100
 uint32 size;
98
101
 uint32 read_pos; // Read position
99
102
 uint32 write_pos; // Write position
100
 
 uint32 in_count; // Number of bytes in the FIFO
 
103
 uint32 in_count; // Number of units in the FIFO
101
104
};
102
105
 
103
106