| 1 |
/* |
| 2 |
* Copyright (C) 2010-2019 Fabio Cavallo (aka FHorse) |
| 3 |
* |
| 4 |
* This program is free software; you can redistribute it and/or modify |
| 5 |
* it under the terms of the GNU General Public License as published by |
| 6 |
* the Free Software Foundation; either version 2 of the License, or |
| 7 |
* (at your option) any later version. |
| 8 |
* |
| 9 |
* This program is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
* GNU General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU General Public License |
| 15 |
* along with this program; if not, write to the Free Software |
| 16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 17 |
*/ |
| 18 |
|
| 19 |
#ifndef MAPPER_MMC5_H_ |
| 20 |
#define MAPPER_MMC5_H_ |
| 21 |
|
| 22 |
#include "apu.h" |
| 23 |
|
| 24 |
struct _mmc5 { |
| 25 |
BYTE prg_mode; |
| 26 |
BYTE chr_mode; |
| 27 |
BYTE ext_mode; |
| 28 |
BYTE nmt_mode[4]; |
| 29 |
BYTE prg_ram_write[2]; |
| 30 |
BYTE prg_bank[4]; |
| 31 |
uint32_t prg_ram_bank[4][2]; |
| 32 |
BYTE chr_last; |
| 33 |
WORD chr_high; |
| 34 |
WORD chr_s[8]; |
| 35 |
WORD chr_b[4]; |
| 36 |
BYTE ext_ram[0x400]; |
| 37 |
BYTE fill_table[0x400]; |
| 38 |
BYTE fill_tile; |
| 39 |
BYTE fill_attr; |
| 40 |
BYTE split; |
| 41 |
BYTE split_st_tile; |
| 42 |
BYTE split_side; |
| 43 |
BYTE split_scrl; |
| 44 |
BYTE split_in_reg; |
| 45 |
BYTE split_x; |
| 46 |
BYTE split_y; |
| 47 |
WORD split_tile; |
| 48 |
uint32_t split_bank; |
| 49 |
BYTE factor[2]; |
| 50 |
WORD product; |
| 51 |
_apuSquare S3, S4; |
| 52 |
struct _mmc5_pcm { |
| 53 |
BYTE enabled; |
| 54 |
BYTE output; |
| 55 |
BYTE amp; |
| 56 |
} pcm; |
| 57 |
int timestamp; |
| 58 |
int lastSample; |
| 59 |
BYTE muted[3]; |
| 60 |
|
| 61 |
blip_buffer_t* bb; |
| 62 |
DivDispatchOscBuffer* oscBuf[5]; |
| 63 |
}; |
| 64 |
|
| 65 |
void map_init_MMC5(struct _mmc5* mmc5); |
| 66 |
void extcl_cpu_wr_mem_MMC5(struct _mmc5* mmc5, int ts, WORD address, BYTE value); |
| 67 |
void extcl_length_clock_MMC5(struct _mmc5* mmc5); |
| 68 |
void extcl_envelope_clock_MMC5(struct _mmc5* mmc5); |
| 69 |
void extcl_apu_tick_MMC5(struct _mmc5* mmc5, int len); |
| 70 |
|
| 71 |
#endif /* MAPPER_MMC5_H_ */ |