diff options
author | Javier <dev.git@javispedro.com> | 2022-04-12 22:38:20 +0200 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2022-04-12 22:38:20 +0200 |
commit | a109a1193ca3cf64a29265103075922d2dd9fc1b (patch) | |
tree | cde59f7e29ccca176dd150a51e8caf4613a86d1f /dostsr.h | |
parent | 2b9f509a04acb88d9ac72bce23b28099efdc4878 (diff) | |
download | vbados-a109a1193ca3cf64a29265103075922d2dd9fc1b.tar.gz vbados-a109a1193ca3cf64a29265103075922d2dd9fc1b.zip |
add file date/time listing support, closeall call
Diffstat (limited to 'dostsr.h')
-rw-r--r-- | dostsr.h | 24 |
1 files changed, 11 insertions, 13 deletions
@@ -76,37 +76,35 @@ static __segment allocate_umb(unsigned size) return new_segment; } -static __segment reallocate_to_umb(segment_t __far * cur_seg, unsigned segment_size) +static __segment reallocate_to_umb(segment_t cur_seg, unsigned segment_size) { - segment_t old_psp_segment = *cur_seg - (DOS_PSP_SIZE/16); - segment_t new_psp_segment; + segment_t old_segment_psp = cur_seg - (DOS_PSP_SIZE/16); + segment_t new_segment_psp; deallocate_environment(_psp); // If we are already in UMA, don't bother - if (old_psp_segment >= 0xA000) { + if (old_segment_psp >= 0xA000) { return 0; } - new_psp_segment = allocate_umb(segment_size); + new_segment_psp = allocate_umb(segment_size); - if (new_psp_segment && new_psp_segment >= 0xA000) { - segment_t new_segment = new_psp_segment + (DOS_PSP_SIZE/16); - printf("Moving to upper memory\n"); + if (new_segment_psp && new_segment_psp >= 0xA000) { + segment_t new_segment = new_segment_psp + (DOS_PSP_SIZE/16); // Create a new program instance including PSP at the new_segment - copy_program(new_psp_segment, old_psp_segment, segment_size); + copy_program(new_segment_psp, old_segment_psp, segment_size); // Tell DOS to "switch" to the new program - dos_set_psp(new_psp_segment); + dos_set_psp(new_segment_psp); // Return the new segment return new_segment; } else { - printf("No upper memory available\n"); - if (new_psp_segment) { + if (new_segment_psp) { // In case we got another low-memory segment... - dos_free(new_psp_segment); + dos_free(new_segment_psp); } return 0; |