muddle/include/portme.h
2024-02-07 18:58:53 -06:00

56 lines
2.2 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 PORTME_H
#define PORTME_H
#include "common.h"
void portAttributeSet(byte attribute);
uint8_t portByteGet(uint32_t address);
void portByteSet(uint32_t address, uint8_t value);
char portCharGet(void);
void portCharGetPos(byte *x, byte *y);
void portCharPrint(char c);
void portCharSetPos(byte x, byte y);
void portColorSet(byte f, byte b);
void portCursorShow(bool s);
void portDie(char *fmt, ...);
uint32_t portFClose(void *stream);
void *portFOpen(char *pathname, char *mode);
uint32_t portFRead(void *ptr, uint32_t size, uint32_t nmemb, void *stream);
uint32_t portFWrite(void *ptr, uint32_t size, uint32_t nmemb, void *stream);
void portFileLister(void);
void portFree(void *ptr);
void *portMalloc(uint32_t size);
uint16_t portRandomGet(int16_t range);
void portScreenClear(void);
void portStoryLoad(char *story, uint32_t *length);
char *portSymbolsGet(void);
uint16_t portWordGet(uint32_t address);
void portWordSet(uint32_t address, uint16_t value);
#endif // PORTME_H