diff options
author | Daniel Serpell <daniel.serpell@gmail.com> | 2020-05-04 23:26:22 -0400 |
---|---|---|
committer | Daniel Serpell <daniel.serpell@gmail.com> | 2020-05-04 23:26:22 -0400 |
commit | abd20079aa006010789405ea37a512ceb0880193 (patch) | |
tree | 552e30dedcbcda9b5940114f93f031b23a6f6bf1 | |
parent | 66dfbb37324b71bb9901cdf087264d941b025acc (diff) | |
download | emu2-abd20079aa006010789405ea37a512ceb0880193.tar.gz |
Makes number of "find-first-areas" configurable.
-rw-r--r-- | src/dos.c | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -488,29 +488,30 @@ static void int21_43(void) // Each DTA (Data Transfer Area) in memory can hold a find-first data // block. We simply encode our pointer in this area and use this struct // to hold the values. +#define NUM_FIND_FIRST_DTA 64 static struct find_first_dta { // List of files to return and pointer to current. struct dos_file_list *find_first_list; struct dos_file_list *find_first_ptr; // Address of DTA in dos memory - 0 is unused unsigned dta_addr; -} find_first_dta[32]; +} find_first_dta[NUM_FIND_FIRST_DTA]; // Search the list an returns the position static struct find_first_dta *get_find_first_dta(void) { int i; - for(i = 0; i < 32; i++) + for(i = 0; i < NUM_FIND_FIRST_DTA; i++) if(find_first_dta[i].dta_addr == dosDTA) break; - if(i == 32) + if(i == NUM_FIND_FIRST_DTA) { - for(i = 0; i < 32; i++) + for(i = 0; i < NUM_FIND_FIRST_DTA; i++) if(!find_first_dta[i].dta_addr) break; - if(i == 32) + if(i == NUM_FIND_FIRST_DTA) { - print_error("Too many find-first DTA areas opened"); + print_error("Too many find-first DTA areas opened\n"); i = 0; } find_first_dta[i].dta_addr = dosDTA; @@ -524,7 +525,7 @@ static struct find_first_dta *get_find_first_dta(void) static void clear_find_first_dta(struct find_first_dta *p) { unsigned x = find_first_dta - p; - if(x >= 32) + if(x >= NUM_FIND_FIRST_DTA) return; p->dta_addr = 0; p->find_first_ptr = 0; |