f256/f256lib/f_kernel.c
2024-03-27 19:54:24 -05:00

142 lines
3.1 KiB
C

/*
* Copyright (c) 2024 Scott Duensing, scott@kangaroopunch.com
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef WITHOUT_KERNEL
#ifndef F256LIB_AMALGAMATED_BUILD
#include "f_kernel.h"
#endif
kernelEventT kernelEventData; // Allocate some RAM to hold event data.
kernelArgsT *kernelArgs; // Create an alias for the kernel args.
char kernelError;
byte kernelGetPending(void) {
return -kernelArgs->events.pending;
}
void kernelReset(void) {
// Plop this into the zero page where the kernel can find it.
kernelArgs = (kernelArgsT *)0x00f0;
// Tell the kernel where our event buffer lives.
kernelArgs->events.event = &kernelEventData;
}
/*
case EVENT(GAME):
// Joystick
break;
case EVENT(key.PRESSED):
// Keyboard
break;
case EVENT(key.RELEASED):
// Keyboard
break;
case EVENT(mouse.CLICKS):
// Mouse
break;
case EVENT(mouse.DELTA):
// Mouse
break;
case EVENT(block.NAME):
// Block
break;
case EVENT(block.SIZE):
// Block
break;
case EVENT(block.DATA):
// Block
break;
case EVENT(block.WROTE):
// Block
break;
case EVENT(block.FORMATTED):
// Block
break;
case EVENT(block.ERROR):
// Block
break;
case EVENT(file.NOT_FOUND):
// File
break;
case EVENT(file.OPENED):
// File
break;
case EVENT(file.DATA):
// File
break;
case EVENT(file.WROTE):
// File
break;
case EVENT(file.EOF):
// File
break;
case EVENT(file.CLOSED):
// File
break;
case EVENT(file.RENAMED):
// File
break;
case EVENT(file.DELETED):
// File
break;
case EVENT(file.ERROR):
// File
break;
case EVENT(directory.OPENED):
// Directory
break;
case EVENT(directory.VOLUME):
// Directory
break;
case EVENT(directory.FILE):
// Directory
break;
case EVENT(directory.FREE):
// Directory
break;
case EVENT(directory.EOF):
// Directory
break;
case EVENT(directory.CLOSED):
// Directory
break;
case EVENT(directory.ERROR):
// Directory
break;
// ***TODO*** Network
*/
#endif