libmsx
C library for MSX
Loading...
Searching...
No Matches
mem_rw.h
Go to the documentation of this file.
1// -*- coding: utf-8-unix -*-
2/*
3 * Copyright (c) 2021-2024 Daishi Mori (mori0091)
4 *
5 * This software is released under the MIT License.\n
6 * See https://github.com/mori0091/libmsx/blob/main/LICENSE
7 *
8 * GitHub libmsx project\n
9 * https://github.com/mori0091/libmsx
10 */
17#ifndef MEM_RW_H_
18#define MEM_RW_H_
19
20#include <stdbool.h>
21#include <stddef.h>
22#include <stdint.h>
23
39bool mem_is_opened(void);
40
48void mem_open(uint8_t * loc);
49
55void mem_close(void);
56
73void mem_dup(uint16_t offset, size_t len);
74
82uint8_t * mem_ptr(void);
83
113bool mem_is_in_free_area(uint8_t * p, size_t len);
114
127void mem_write_chunk(const uint8_t * src, size_t len);
128
140void mem_read_chunk(uint8_t * dst, size_t len);
141
150void mem_write_byte(uint8_t x);
151
159uint8_t mem_read_byte(void);
160
163#endif // MEM_RW_H_
bool mem_is_opened(void)
Tests whether ROM/RAM accessor is opened or not.
uint8_t * mem_ptr(void)
Get current position of ROM/RAM accessor.
void mem_close(void)
Close ROM/RAM accessor.
void mem_read_chunk(uint8_t *dst, size_t len)
Read a chunk from ROM/RAM.
void mem_dup(uint16_t offset, size_t len)
Duplicate a sequence of bytes beginning at the specified offset in the output stream at the current p...
uint8_t mem_read_byte(void)
Read an octet from ROM/RAM.
bool mem_is_in_free_area(uint8_t *p, size_t len)
Tests whether the specified range is in free area.
void mem_open(uint8_t *loc)
Open ROM/RAM accessor.
void mem_write_byte(uint8_t x)
Write an octet to RAM.
void mem_write_chunk(const uint8_t *src, size_t len)
Write a chunk to RAM.