• Please review our updated Terms and Rules here
  • Exhibitor application for VCF West 2022 is now open! If you are interested in exhibiting, please fill out the form here.
  • Here are the results of the VCF East 2022 Post Event Survey: Survey Results

Reserve a 64k page in MS-DOS

Mills32

Experienced Member
Joined
Sep 25, 2018
Messages
98
Location
Spain
I'm very happy with the results I got :).

I just allocated 32K inside a physical page and used 8 bit PCM (8192 and 11025 Hz). Sound quality is good enough, and you can fit around 10-15 small samples for whatever you want :).

This is an imf music player (OPL2) + PCM drums (for very very slow PC's). It was recorded from dosbox, because my PC created very noisy recording from a real Sound Blaster.

test1.mp3
test2.mp3
test3.mp3

PCM samples are much cleaner on the real hardware :).

I included a simple sample player and a music+sample player in the little game engine I'm making Little-Game-Engine-for-VGA
 

juj

New Member
Joined
Jan 25, 2022
Messages
7
I got into looking at this problem recently, and ended up writing some code to a GitHub repository at https://github.com/juj/64kalloc

At least for DOS Borland Turbo C/C++ 3.0 case in small test programs, I feel that I was able to reliably solve the issue for allocating memory that is 64KB page aligned, without wasting much excess memory in the process. Hopefully the scheme proves robust in the wild and the code can help someone else out there.
 
Top