mirror of
https://codeberg.org/hkzlab/TK2048.git
synced 2026-01-25 22:30:53 +11:00
Merged dii_refactoring, modularize code for 2.0
This commit is contained in:
parent
5d739383aa
commit
cfc455f1ca
37 changed files with 2101 additions and 249 deletions
39
src/intro_main.c
Normal file
39
src/intro_main.c
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue