Changeset c5b6c90 in buchla-emu for emu/mkdisk.c


Ignore:
Timestamp:
07/31/2017 05:01:38 PM (7 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
1489228
Parents:
1efc42c
git-author:
Thomas Lopatic <thomas@…> (07/31/2017 05:01:32 PM)
git-committer:
Thomas Lopatic <thomas@…> (07/31/2017 05:01:38 PM)
Message:

Successfully loaded midas.abs from disk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • emu/mkdisk.c

    r1efc42c rc5b6c90  
    3030#define N_CYL 80
    3131#define N_SID 2
    32 #define N_SEC 18
     32#define N_SEC 9
    3333#define SZ_SEC 512
    3434
    35 #define N_SEC_CLU 1
     35#define N_SEC_CLU 2
     36#define SZ_CLU (SZ_SEC * N_SEC_CLU)
    3637
    3738#define N_BOOT_SEC 1
    38 #define N_FAT_SEC 9
    39 #define N_ROOT_SEC 14
     39#define N_FAT_SEC 3
     40#define N_ROOT_SEC 7
    4041
    4142#define N_FAT 2
     
    142143        off = put_sec_16(0, off, N_CYL * N_SID * N_SEC);
    143144
    144         // media descriptor (floppy disk, 1.44M)
    145         off = put_sec_8(0, off, 0xf0);
     145        // media descriptor (floppy disk, 720k)
     146        off = put_sec_8(0, off, 0xf9);
    146147
    147148        // sectors per FAT (9 * 512 / 3 * 2 = 3072)
     
    165166        int32_t ent = 0;
    166167
    167         ent = put_fat_12(sec, ent, 0xff0);
     168        ent = put_fat_12(sec, ent, 0xff9);
    168169        ent = put_fat_12(sec, ent, 0xfff);
    169170
    170         int32_t n_sec = (sz_midas + SZ_SEC - 1) / SZ_SEC;
    171 
    172         for (int32_t i = 0; i < n_sec - 1; ++i) {
     171        int32_t n_clu = (sz_midas + SZ_CLU - 1) / SZ_CLU;
     172
     173        for (int32_t i = 0; i < n_clu - 1; ++i) {
    173174                ent = put_fat_12(sec, ent, ent + 1);
    174175        }
Note: See TracChangeset for help on using the changeset viewer.