Xemu [doxygen]  hyppo 0a42be3a057156924bc1b626a687bd6e27349c45 @ Sat 19 Mar 02:15:11 CET 2022
dma65.h
Go to the documentation of this file.
1 /* F018 DMA core emulation for MEGA65
2  Part of the Xemu project. https://github.com/lgblgblgb/xemu
3  Copyright (C)2016-2022 LGB (Gábor Lénárt) <lgblgblgb@gmail.com>
4 
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
18 
19 #ifndef XEMU_MEGA65_DMA_H_INCLUDED
20 #define XEMU_MEGA65_DMA_H_INCLUDED
21 
22 /* Feature bit masks for dma_init(): */
23 
24 #define DMA_FEATURE_DYNMODESET 0x100
25 #define DMA_FEATURE_MODULO 0x200
26 #define DMA_FEATURE_HACK 0x400
27 
28 /* Variables */
29 
30 extern Uint8 dma_status;
31 extern Uint8 dma_registers[16];
32 extern int dma_chip_revision;
33 
34 /* Functions: */
35 
36 extern void dma_write_reg ( int addr, Uint8 data );
37 extern Uint8 dma_read_reg ( int reg );
38 extern void dma_init ( unsigned int revision );
39 extern void dma_init_set_rev ( unsigned int revision, const Uint8 *rom );
40 extern void dma_reset ( void );
41 extern int dma_update ( void );
42 extern int dma_update_multi_steps ( int do_for_cycles );
43 extern int dma_is_in_use ( void );
44 
45 /* Things should be provided by the emulator: */
46 
47 extern Uint8 DMA_SOURCE_IOREADER_FUNC ( int );
48 extern Uint8 DMA_SOURCE_MEMREADER_FUNC ( int );
49 extern Uint8 DMA_TARGET_IOREADER_FUNC ( int );
50 extern Uint8 DMA_TARGET_MEMREADER_FUNC ( int );
51 extern Uint8 DMA_LIST_READER_FUNC ( int );
52 extern void DMA_SOURCE_IOWRITER_FUNC ( int, Uint8 );
53 extern void DMA_SOURCE_MEMWRITER_FUNC ( int, Uint8 );
54 extern void DMA_TARGET_IOWRITER_FUNC ( int, Uint8 );
55 extern void DMA_TARGET_MEMWRITER_FUNC ( int, Uint8 );
56 
57 /* Snapshot related part: */
58 
59 #ifdef XEMU_SNAPSHOT_SUPPORT
60 #include "xemu/emutools_snapshot.h"
61 extern int dma_snapshot_load_state ( const struct xemu_snapshot_definition_st *def, struct xemu_snapshot_block_st *block );
62 extern int dma_snapshot_save_state ( const struct xemu_snapshot_definition_st *def );
63 #endif
64 
65 #endif
DMA_SOURCE_IOWRITER_FUNC
void DMA_SOURCE_IOWRITER_FUNC(int, Uint8)
DMA_SOURCE_MEMREADER_FUNC
Uint8 DMA_SOURCE_MEMREADER_FUNC(int)
DMA_LIST_READER_FUNC
Uint8 DMA_LIST_READER_FUNC(int)
DMA_TARGET_MEMREADER_FUNC
Uint8 DMA_TARGET_MEMREADER_FUNC(int)
addr
int addr
Definition: dma65.c:81
m65-memcontent-generator.data
data
Definition: m65-memcontent-generator.py:119
DMA_TARGET_IOWRITER_FUNC
void DMA_TARGET_IOWRITER_FUNC(int, Uint8)
Uint8
uint8_t Uint8
Definition: fat32.c:51
block
Uint32 block
Definition: fat32.c:156
DMA_TARGET_MEMWRITER_FUNC
void DMA_TARGET_MEMWRITER_FUNC(int, Uint8)
dma_init_set_rev
void dma_init_set_rev(unsigned int revision, Uint8 *rom_ver_signature)
Definition: dma65.c:439
dma_is_in_use
int dma_is_in_use(void)
Definition: dma65.c:303
dma_status
Uint8 dma_status
Definition: dma65.c:51
dma_registers
Uint8 dma_registers[16]
Definition: dma65.c:52
DMA_SOURCE_MEMWRITER_FUNC
void DMA_SOURCE_MEMWRITER_FUNC(int, Uint8)
DMA_SOURCE_IOREADER_FUNC
Uint8 DMA_SOURCE_IOREADER_FUNC(int)
DMA_TARGET_IOREADER_FUNC
Uint8 DMA_TARGET_IOREADER_FUNC(int)
dma_init
void dma_init(unsigned int revision)
Definition: dma65.c:465
dma_chip_revision
int dma_chip_revision
Definition: dma65.c:53
dma_read_reg
Uint8 dma_read_reg(int reg)
Definition: dma65.c:502
dma_update_multi_steps
int dma_update_multi_steps(int do_for_cycles)
Definition: dma65.c:405
emutools_snapshot.h
dma_reset
void dma_reset(void)
Definition: dma65.c:488
dma_write_reg
void dma_write_reg(int addr, Uint8 data)
Definition: dma65.c:175
dma_update
int dma_update(void)
Definition: dma65.c:215