summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2014-08-09 13:12:31 +0000
committer Olivier Galibert <galibert@pobox.com>2014-08-09 13:12:31 +0000
commit2c0c401608d97130409fa877b2c4e1ce8308fccf (patch)
treeae636d781ce01626f5c4174008248c285b8406bc /src
parent6ee738c631617455c3be703ef729f8373e760b86 (diff)
duh (nw)
Diffstat (limited to 'src')
-rw-r--r--src/lib/formats/flopimg.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/formats/flopimg.c b/src/lib/formats/flopimg.c
index a1c51d52bad..97c0b6bf704 100644
--- a/src/lib/formats/flopimg.c
+++ b/src/lib/formats/flopimg.c
@@ -964,11 +964,11 @@ void floppy_image::get_maximal_geometry(int &_tracks, int &_heads)
void floppy_image::get_actual_geometry(int &_tracks, int &_heads)
{
- int maxt = tracks*4, maxh = heads-1;
+ int maxt = (tracks-1)*4, maxh = heads-1;
while(maxt >= 0) {
for(int i=0; i<=maxh; i++)
- if(get_track_size(maxt, i))
+ if(track_array[maxt][i].track_size)
goto track_done;
maxt--;
}
@@ -976,7 +976,7 @@ void floppy_image::get_actual_geometry(int &_tracks, int &_heads)
if(maxt >= 0)
while(maxh >= 0) {
for(int i=0; i<=maxt; i++)
- if(get_track_size(i, maxh))
+ if(track_array[i][maxh].track_size)
goto head_done;
maxh--;
}
@@ -988,7 +988,7 @@ void floppy_image::get_actual_geometry(int &_tracks, int &_heads)
int floppy_image::get_resolution() const
{
int mask = 0;
- for(int i=0; i<tracks*4+1; i++)
+ for(int i=0; i<=(tracks-1)*4; i++)
for(int j=0; j<heads; j++)
if(track_array[i][j].track_size)
mask |= 1 << (i & 3);