summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/formats/flopimg.h
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-07-28 00:54:52 -0400
committer AJR <ajrhacker@users.noreply.github.com>2018-07-28 00:54:54 -0400
commitc5a244d32cb0dc5cb7e7608b55b3caed4e9c9efa (patch)
treea579eee7e4e921bfd15fd21bf4a5fa921df64a8d /src/lib/formats/flopimg.h
parent31aaae7491ea4233de75456af178054e650f4344 (diff)
flopimg.h: Add debug asserts to help catch geometry errors (nw)
Diffstat (limited to 'src/lib/formats/flopimg.h')
-rw-r--r--src/lib/formats/flopimg.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/formats/flopimg.h b/src/lib/formats/flopimg.h
index fe6d8ed35dd..b7f4d542db2 100644
--- a/src/lib/formats/flopimg.h
+++ b/src/lib/formats/flopimg.h
@@ -735,7 +735,7 @@ public:
@param head head number
@return a pointer to the data buffer for this track and head
*/
- std::vector<uint32_t> &get_buffer(int track, int head, int subtrack = 0) { return track_array[track*4+subtrack][head].cell_data; }
+ std::vector<uint32_t> &get_buffer(int track, int head, int subtrack = 0) { assert(track < tracks && head < heads); return track_array[track*4+subtrack][head].cell_data; }
//! Sets the write splice position.
//! The "track splice" information indicates where to start writing
@@ -749,9 +749,9 @@ public:
@param head
@param pos the position
*/
- void set_write_splice_position(int track, int head, uint32_t pos, int subtrack = 0) { track_array[track*4+subtrack][head].write_splice = pos; }
+ void set_write_splice_position(int track, int head, uint32_t pos, int subtrack = 0) { assert(track < tracks && head < heads); track_array[track*4+subtrack][head].write_splice = pos; }
//! @return the current write splice position.
- uint32_t get_write_splice_position(int track, int head, int subtrack = 0) const { return track_array[track*4+subtrack][head].write_splice; }
+ uint32_t get_write_splice_position(int track, int head, int subtrack = 0) const { assert(track < tracks && head < heads); return track_array[track*4+subtrack][head].write_splice; }
//! @return the maximal geometry supported by this format.
void get_maximal_geometry(int &tracks, int &heads) const;