mirror of
https://codeberg.org/hkzlab/TK2048.git
synced 2026-01-15 02:30:53 +11:00
39 lines
995 B
C
39 lines
995 B
C
#include <stubs.h>
|
|
#include <string.h>
|
|
|
|
#include <calypsi/intrinsics6502.h>
|
|
|
|
#include "monitor_subroutines.h"
|
|
#include "utility.h"
|
|
#include "mem_map.h"
|
|
#include "shared_page.h"
|
|
|
|
// External initialization requirements
|
|
#pragma require __preserve_zp
|
|
#pragma require __data_initialization_needed
|
|
|
|
static shared_page_data *shared_page = (shared_page_data*)SHARED_PAGE;
|
|
|
|
void main(void) {
|
|
uint8_t wait_count = 0x40;
|
|
|
|
// Initialize the register for LFSR
|
|
lfsr_init(0xF00D);
|
|
|
|
// Clear the memory used to pass parameters to the next module
|
|
memset((void*)(shared_page->module_data), 0, MODULE_DATA_SIZE);
|
|
|
|
// TODO: Detect expansion hardware, and choose what to load according to that
|
|
|
|
// Delay a bit
|
|
while(wait_count--) WAIT(0xFF);
|
|
|
|
// Clear the display memory
|
|
memset((void*)DISPLAY_PAGE_2, 0, DISPLAY_PAGE_SIZE);
|
|
memset((void*)DISPLAY_PAGE_1, 0, DISPLAY_PAGE_SIZE);
|
|
|
|
shared_page->master_command = MASTER_COMMAND_NONE;
|
|
shared_page->next_module_idx = 3; // DLOG module is next!
|
|
|
|
return;
|
|
}
|