1
0
mirror of https://github.com/stid/woz64.git synced 2024-11-26 08:50:11 +00:00
woz64/core/system.asm

98 lines
2.5 KiB
NASM
Raw Normal View History

2020-01-12 08:10:01 +00:00
#importonce
2020-01-19 06:48:59 +00:00
#import "../core/pseudo.asm"
#import "../core/module.asm"
#import "../core/boot.asm"
2020-01-12 08:10:01 +00:00
#import "../libs/memory.asm"
#import "../libs/math.asm"
#import "../libs/print.asm"
2020-01-19 06:48:59 +00:00
#import "../libs/keyboard.asm"
#import "../libs/screen.asm"
2020-01-12 08:10:01 +00:00
#import "../progs/woz_shell.asm"
2020-01-19 06:48:59 +00:00
.filenamespace System
2020-01-12 08:10:01 +00:00
2020-01-19 06:48:59 +00:00
* = * "System Core"
2020-01-12 08:10:01 +00:00
2020-01-13 00:52:10 +00:00
// ========================================================
// ////// METHODS /////////////////////////////////////////
// ========================================================
2020-01-19 06:48:59 +00:00
// --------------------------------------------------------
// start -
// System Start
// --------------------------------------------------------
start: {
// Start Main Program
jsr WozShell.start
// TODO: Program exited here
// We can ask program to set a ram param and let us know
// if exit is due to a sort of error.
rts
// TODO: Can we use Timed Interrupt to execute small system recurring tasks?
}
2020-01-13 00:52:10 +00:00
// --------------------------------------------------------
// init -
// Module Init.
// --------------------------------------------------------
2020-01-12 08:10:01 +00:00
init: {
2020-01-13 01:24:10 +00:00
// Init All Modules
2020-01-19 06:48:59 +00:00
// TODO: How we can make this dynamic?
2020-01-13 01:24:10 +00:00
jsr Memory.init
2020-01-19 06:48:59 +00:00
jsr Screen.init
2020-01-13 01:24:10 +00:00
jsr Print.init
2020-01-19 06:48:59 +00:00
jsr Math.init
2020-01-13 01:24:10 +00:00
jsr Keyboard.init
2020-01-19 06:48:59 +00:00
2020-01-13 01:24:10 +00:00
jsr WozShell.init
rts
2020-01-12 08:10:01 +00:00
}
2020-01-19 06:48:59 +00:00
2020-01-13 00:52:10 +00:00
// --------------------------------------------------------
// toDebug -
// Print debug info.
// --------------------------------------------------------
2020-01-12 08:10:01 +00:00
toDebug: {
2020-01-13 01:24:10 +00:00
// Debug All Modules
2020-01-19 06:48:59 +00:00
jsr Boot.toDebug
2020-01-13 01:24:10 +00:00
ModuleToDebug(module_type, module_name, version)
2020-01-19 06:48:59 +00:00
2020-01-13 07:33:13 +00:00
jsr Pseudo.toDebug
2020-01-13 01:24:10 +00:00
jsr Module.toDebug
2020-01-19 06:48:59 +00:00
jsr Keyboard.toDebug
jsr Math.toDebug
2020-01-13 01:24:10 +00:00
jsr Memory.toDebug
jsr Print.toDebug
2020-01-19 06:48:59 +00:00
jsr Screen.toDebug
2020-01-13 01:24:10 +00:00
jsr WozShell.toDebug
rts
2020-01-12 08:10:01 +00:00
}
2020-01-13 00:52:10 +00:00
// ========================================================
// ////// DATA ////////////////////////////////////////////
// ========================================================
2020-01-12 08:10:01 +00:00
2020-01-19 06:48:59 +00:00
* = * "System Core Data"
2020-01-13 01:24:10 +00:00
module_type: .byte Module.TYPES.CORE
2020-01-19 06:48:59 +00:00
version: .byte 1, 0, 0
2020-01-13 00:52:10 +00:00
.encoding "screencode_mixed"
2020-01-12 08:10:01 +00:00
module_name:
2020-01-19 06:48:59 +00:00
.text "system"
2020-01-13 01:24:10 +00:00
.byte 0
2020-01-13 00:52:10 +00:00
2020-01-12 08:10:01 +00:00
#import "../core/mem_map.asm"