System Information and Start Screen Cleanup
This commit is contained in:
parent
887c04a86b
commit
1c4fb6b2b2
13
src/Makefile
13
src/Makefile
|
@ -1,7 +1,7 @@
|
||||||
# VPATH=.:../../module/Calypsi-remote-debug/src
|
# VPATH=.:../../module/Calypsi-remote-debug/src
|
||||||
DEBUGGER=../module/Calypsi-remote-debug/src
|
DEBUGGER=../module/Calypsi-remote-debug/src
|
||||||
|
|
||||||
UNIT := F256
|
UNIT := F256K
|
||||||
MEMORY := RAM
|
MEMORY := RAM
|
||||||
|
|
||||||
# Define OS-dependent variables
|
# Define OS-dependent variables
|
||||||
|
@ -43,6 +43,17 @@ else ifeq ($(UNIT),F256)
|
||||||
SRCS_FOR_UNIT=C256/jumptable.s C256/io_stubs.c C256/extras.s
|
SRCS_FOR_UNIT=C256/jumptable.s C256/io_stubs.c C256/extras.s
|
||||||
CFLAGS_FOR_UNIT=-DMODEL=2 -DCPU=255 --code-model large --data-model large
|
CFLAGS_FOR_UNIT=-DMODEL=2 -DCPU=255 --code-model large --data-model large
|
||||||
|
|
||||||
|
ifeq ($(MEMORY),ROM)
|
||||||
|
LDFLAGS_FOR_UNIT=C256/flash-f256.scm clib-lc-ld.a --rtattr printf=medium
|
||||||
|
else
|
||||||
|
LDFLAGS_FOR_UNIT=C256/ld_lc_f256.scm clib-lc-ld.a --rtattr printf=medium
|
||||||
|
endif
|
||||||
|
else ifeq ($(UNIT),F256K)
|
||||||
|
CPU=w65816
|
||||||
|
C_SRCS_DEBUGGER=$(DEBUGGER)/agent.c $(DEBUGGER)/c256-uart.c $(DEBUGGER)/low_level_WDC65816.s
|
||||||
|
SRCS_FOR_UNIT=C256/jumptable.s C256/io_stubs.c C256/extras.s
|
||||||
|
CFLAGS_FOR_UNIT=-DMODEL=2 -DCPU=255 --code-model large --data-model large
|
||||||
|
|
||||||
ifeq ($(MEMORY),ROM)
|
ifeq ($(MEMORY),ROM)
|
||||||
LDFLAGS_FOR_UNIT=C256/flash-f256.scm clib-lc-ld.a --rtattr printf=medium
|
LDFLAGS_FOR_UNIT=C256/flash-f256.scm clib-lc-ld.a --rtattr printf=medium
|
||||||
else
|
else
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
UNIT := F256
|
UNIT := F256K
|
||||||
|
|
||||||
# Define OS-dependent variables
|
# Define OS-dependent variables
|
||||||
|
|
||||||
|
|
|
@ -230,8 +230,6 @@ SYSTEMCALL void int_enable(unsigned short n) {
|
||||||
/* Find the mask for the interrupt */
|
/* Find the mask for the interrupt */
|
||||||
unsigned short mask = int_mask(n);
|
unsigned short mask = int_mask(n);
|
||||||
|
|
||||||
printf("Enable interrupt %d => group: %d, mask: %d\n", n, group, mask);
|
|
||||||
|
|
||||||
if ((group != 0xff) && (mask != 0xff)) {
|
if ((group != 0xff) && (mask != 0xff)) {
|
||||||
// Only set the mask if the mask and group numbers are valid
|
// Only set the mask if the mask and group numbers are valid
|
||||||
uint8_t new_mask = MASK_GRP0[group] & ~mask;
|
uint8_t new_mask = MASK_GRP0[group] & ~mask;
|
||||||
|
|
|
@ -20,6 +20,7 @@
|
||||||
#include "constants.h"
|
#include "constants.h"
|
||||||
#include "errors.h"
|
#include "errors.h"
|
||||||
#include "dev/block.h"
|
#include "dev/block.h"
|
||||||
|
#include "dev/rtc.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Convert Toolkit Block Device result codes to FatFS result codes
|
* @brief Convert Toolkit Block Device result codes to FatFS result codes
|
||||||
|
|
|
@ -130,6 +130,27 @@ void sys_get_information(p_sys_info info) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#elif MODEL == MODEL_FOENIX_F256 || MODEL == MODEL_FOENIX_F256K || MODEL == MODEL_FOENIX_F256K2
|
||||||
|
machine_id = GABE_SYS_STAT->machine_id;
|
||||||
|
// TODO: be able to remove this line
|
||||||
|
if (machine_id == 0x13) {
|
||||||
|
machine_id = MODEL_FOENIX_F256K;
|
||||||
|
}
|
||||||
|
|
||||||
|
cpu = CPU_WDC65816;
|
||||||
|
clock_speed = SYSCLK_6MHZ;
|
||||||
|
|
||||||
|
info->has_expansion_card = 0;
|
||||||
|
info->has_hard_drive = 0;
|
||||||
|
info->has_ethernet = 0;
|
||||||
|
info->screens = 1;
|
||||||
|
|
||||||
|
info->fpga_model = GABE_VERSION->model;
|
||||||
|
info->fpga_version = GABE_VERSION->version;
|
||||||
|
info->fpga_subver = GABE_VERSION->subversion;
|
||||||
|
|
||||||
|
info->system_ram_size = (uint32_t)512 * (uint32_t)1024 * (uint32_t)1024;
|
||||||
|
|
||||||
#else
|
#else
|
||||||
machine_id = 0xFF;
|
machine_id = 0xFF;
|
||||||
cpu = CPU_M68000;
|
cpu = CPU_M68000;
|
||||||
|
@ -150,6 +171,11 @@ void sys_get_information(p_sys_info info) {
|
||||||
info->cpu = cpu;
|
info->cpu = cpu;
|
||||||
|
|
||||||
switch (clock_speed) {
|
switch (clock_speed) {
|
||||||
|
case SYSCLK_6MHZ:
|
||||||
|
/* 6 MHz */
|
||||||
|
info->cpu_clock_khz = 6000;
|
||||||
|
break;
|
||||||
|
|
||||||
case SYSCLK_14MHZ:
|
case SYSCLK_14MHZ:
|
||||||
/* 14.318 MHz */
|
/* 14.318 MHz */
|
||||||
info->cpu_clock_khz = 14318;
|
info->cpu_clock_khz = 14318;
|
||||||
|
@ -243,6 +269,18 @@ void sys_get_information(p_sys_info info) {
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (info->model) {
|
switch (info->model) {
|
||||||
|
case MODEL_FOENIX_F256:
|
||||||
|
info->model_name = "F256jr";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODEL_FOENIX_F256K:
|
||||||
|
info->model_name = "F256K";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MODEL_FOENIX_F256K2:
|
||||||
|
info->model_name = "F256K2";
|
||||||
|
break;
|
||||||
|
|
||||||
case MODEL_FOENIX_FMX:
|
case MODEL_FOENIX_FMX:
|
||||||
info->model_name = "C256 FMX";
|
info->model_name = "C256 FMX";
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -43,14 +43,15 @@
|
||||||
|
|
||||||
/* Clock speeds */
|
/* Clock speeds */
|
||||||
|
|
||||||
#define SYSCLK_14MHZ 0x00 /* 14.318 MHz */
|
#define SYSCLK_6MHZ 0x00 /* 6 MHz */
|
||||||
#define SYSCLK_20MHZ 0x01 /* 20 MHz */
|
#define SYSCLK_14MHZ 0x01 /* 14.318 MHz */
|
||||||
#define SYSCLK_25MHZ 0x02 /* 25 MHz */
|
#define SYSCLK_20MHZ 0x02 /* 20 MHz */
|
||||||
#define SYSCLK_33MHZ 0x03 /* 33 MHz */
|
#define SYSCLK_25MHZ 0x03 /* 25 MHz */
|
||||||
#define SYSCLK_40MHZ 0x04 /* 40 MHz */
|
#define SYSCLK_33MHZ 0x04 /* 33 MHz */
|
||||||
#define SYSCLK_50MHZ 0x05 /* 50 MHz */
|
#define SYSCLK_40MHZ 0x05 /* 40 MHz */
|
||||||
#define SYSCLK_66MHZ 0x06 /* 66 MHz */
|
#define SYSCLK_50MHZ 0x06 /* 50 MHz */
|
||||||
#define SYSCLK_80MHZ 0x07 /* 88 MHz */
|
#define SYSCLK_66MHZ 0x07 /* 66 MHz */
|
||||||
|
#define SYSCLK_80MHZ 0x08 /* 88 MHz */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Fill out a s_sys_info structure with the information about the current system
|
* Fill out a s_sys_info structure with the information about the current system
|
||||||
|
|
|
@ -136,7 +136,6 @@ void initialize() {
|
||||||
#error Cannot identify screen setup
|
#error Cannot identify screen setup
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
printf("Foenix Toolbox v%d.%02d.%04d starting up...\nHello, F256k!\n", VER_MAJOR, VER_MINOR, VER_BUILD);
|
|
||||||
INFO("Text system initialized.");
|
INFO("Text system initialized.");
|
||||||
|
|
||||||
// // Initialize the bitmap system
|
// // Initialize the bitmap system
|
||||||
|
@ -185,19 +184,6 @@ void initialize() {
|
||||||
rtc_init();
|
rtc_init();
|
||||||
INFO("Real time clock initialized");
|
INFO("Real time clock initialized");
|
||||||
|
|
||||||
t_time time;
|
|
||||||
// time.year = 2024;
|
|
||||||
// time.month = 7;
|
|
||||||
// time.day = 3;
|
|
||||||
// time.hour = 16;
|
|
||||||
// time.minute = 05;
|
|
||||||
// time.second = 0;
|
|
||||||
// rtc_set_time(&time);
|
|
||||||
|
|
||||||
rtc_get_time(&time);
|
|
||||||
printf("%04d-%02d-%02d %02d:%02d\n", time.year, time.month, time.day, time.hour, time.minute);
|
|
||||||
INFO3("%04d-%02d-%02d", time.year, time.month, time.day);
|
|
||||||
|
|
||||||
// target_jiffies = sys_time_jiffies() + 300; /* 5 seconds minimum */
|
// target_jiffies = sys_time_jiffies() + 300; /* 5 seconds minimum */
|
||||||
// DEBUG1("target_jiffies assigned: %d", target_jiffies);
|
// DEBUG1("target_jiffies assigned: %d", target_jiffies);
|
||||||
|
|
||||||
|
@ -442,6 +428,34 @@ void test_kbd() {
|
||||||
printf("\n\n");
|
printf("\n\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void test_sysinfo() {
|
||||||
|
// 8 x 22 region
|
||||||
|
t_rect region;
|
||||||
|
region.size.height = 9;
|
||||||
|
region.size.width = 23;
|
||||||
|
region.origin.x = 80 - region.size.width;
|
||||||
|
region.origin.y = 60 - region.size.height;
|
||||||
|
|
||||||
|
txt_set_region(0, ®ion);
|
||||||
|
|
||||||
|
printf("Foenix Retro Systems\n");
|
||||||
|
printf("Model %s\n", info.model_name);
|
||||||
|
printf("MID %x\n", info.model);
|
||||||
|
printf("CPU %s\n", info.cpu_name);
|
||||||
|
printf("Clock %lu MHz\n", info.cpu_clock_khz / (long)1024);
|
||||||
|
printf("Memory %d MB\n", (int)(info.system_ram_size / ((long)1024 * (long)1024)));
|
||||||
|
printf("FPGA %04X %04X.%04X\n", info.fpga_model, info.fpga_version, info.fpga_subver);
|
||||||
|
printf("Toolbox v%d.%02d.%04d\n", info.mcp_version, info.sub_model, info.mcp_build);
|
||||||
|
|
||||||
|
region.size.width = 0;
|
||||||
|
region.size.height = 0;
|
||||||
|
region.origin.x = 0;
|
||||||
|
region.origin.y = 0;
|
||||||
|
|
||||||
|
txt_set_region(0, ®ion);
|
||||||
|
txt_set_xy(0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char * argv[]) {
|
int main(int argc, char * argv[]) {
|
||||||
short result;
|
short result;
|
||||||
short i;
|
short i;
|
||||||
|
@ -450,14 +464,12 @@ int main(int argc, char * argv[]) {
|
||||||
initialize();
|
initialize();
|
||||||
kbd_init();
|
kbd_init();
|
||||||
|
|
||||||
test_kbd();
|
test_sysinfo();
|
||||||
|
|
||||||
// Attempt to start up the user code
|
// Attempt to start up the user code
|
||||||
// log(LOG_INFO, "Looking for user startup code:");
|
// log(LOG_INFO, "Looking for user startup code:");
|
||||||
// boot_launch();
|
// boot_launch();
|
||||||
|
|
||||||
printf("Done.\n");
|
|
||||||
|
|
||||||
#ifdef _CALYPSI_MCP_DEBUGGER
|
#ifdef _CALYPSI_MCP_DEBUGGER
|
||||||
extern int CalypsiDebugger(void);
|
extern int CalypsiDebugger(void);
|
||||||
CalypsiDebugger(); // This will not return
|
CalypsiDebugger(); // This will not return
|
||||||
|
|
Loading…
Reference in a new issue