mirror of
https://gitlab.com/c3d/db48x.git
synced 2024-09-29 05:36:58 +02:00
Remove debug menu, allocate more memory
Experimentally, we need to leave about 4K free for "other stuff" Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
This commit is contained in:
parent
303ac0ff17
commit
08638f7ef8
2 changed files with 10 additions and 13 deletions
|
@ -604,6 +604,13 @@ void stop_buzzer()
|
|||
{
|
||||
record(dmcp_notyet, "stop_buzzer not implemented");
|
||||
}
|
||||
|
||||
int sys_free_mem()
|
||||
{
|
||||
// On the simulator, we have real memory
|
||||
return 1024 * 1024;
|
||||
}
|
||||
|
||||
void sys_delay(uint32_t ms_delay)
|
||||
{
|
||||
QThread::msleep(ms_delay);
|
||||
|
|
|
@ -157,8 +157,9 @@ void program_init()
|
|||
font_defaults();
|
||||
|
||||
#ifndef DEBUG
|
||||
// Give 64K to the runtime
|
||||
size_t size = 64 * 1024;
|
||||
// Give as much as memory as possible to the runtime
|
||||
// Experimentally, this is the amount of memory we need to leave free
|
||||
size_t size = sys_free_mem() - 8 * 1024;
|
||||
#else
|
||||
// Give 256 bytes to the runtime to stress-test the GC
|
||||
size_t size = 256;
|
||||
|
@ -166,17 +167,6 @@ void program_init()
|
|||
byte *memory = (byte *) malloc(size);
|
||||
runtime::RT.memory(memory, size);
|
||||
|
||||
// Fake test menu
|
||||
cstring labels[input::NUM_MENUS] = {
|
||||
"Short", "A bit long", "Very long", "Super Duper long",
|
||||
"X1", "X2", "A", "B",
|
||||
"C", "D", "E", "F",
|
||||
"Tests", "Benchmark DMCP", "Benchark My Code", "Toggle Font",
|
||||
"Previous Font", "Next Font",
|
||||
};
|
||||
object_p functions[input::NUM_MENUS] = { MenuFont };
|
||||
Input.menus(input::NUM_MENUS, labels, functions);
|
||||
|
||||
// The following is just to link the same set of functions as DM42
|
||||
if (memory == (byte *) program_init)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue