libmsx
C library for MSX
Loading...
Searching...
No Matches
vmem.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 */
21#pragma once
22
23#ifndef VMEM_H
24#define VMEM_H
25
26#include <stdint.h>
27#include <stddef.h>
28
29#include "io.h"
30
31// ---- VRAM access
42typedef uint32_t vmemptr_t;
43
56
69
83inline uint8_t vmem_get(void) {
84 return vdp_port0;
85}
86
100inline void vmem_set(uint8_t val) {
101 vdp_port0 = val;
102}
103
121void vmem_read(vmemptr_t src, void* dst, uint16_t len);
122
140void vmem_write(vmemptr_t dst, void* src, uint16_t len);
141
157void vmem_memset(vmemptr_t dst, uint8_t val, uint16_t len);
158
161#endif
void vmem_read(vmemptr_t src, void *dst, uint16_t len)
MSX Read a series of bytes from VRAM.
void vmem_write(vmemptr_t dst, void *src, uint16_t len)
MSX Write a series of bytes to VRAM.
void vmem_set_write_address(vmemptr_t loc)
MSX Set VRAM address for sequential writing of VRAM.
void vmem_set(uint8_t val)
MSX Write 1 byte to VRAM.
Definition vmem.h:100
void vmem_set_read_address(vmemptr_t loc)
MSX Set VRAM address for sequential reading of VRAM.
uint8_t vmem_get(void)
MSX Read 1 byte from VRAM.
Definition vmem.h:83
uint32_t vmemptr_t
Type for VRAM address.
Definition vmem.h:42
void vmem_memset(vmemptr_t dst, uint8_t val, uint16_t len)
MSX Fill a series of bytes in VRAM with the specified value.
Definition of I/O ports.
static volatile __sfr vdp_port0
Definition io.h:24