-
Notifications
You must be signed in to change notification settings - Fork 100
Expand file tree
/
Copy pathsfc_mapper_helper.h
More file actions
28 lines (24 loc) · 872 Bytes
/
sfc_mapper_helper.h
File metadata and controls
28 lines (24 loc) · 872 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#pragma once
// License: MIT http://opensource.org/licenses/MIT
// Author: dustpg mailto:dustpg@gmail.com
#include "sfc_famicom.h"
/// <summary>
/// 实用函数-StepFC: 载入8k PRG-ROM
/// </summary>
/// <param name="famicom">The famicom.</param>
/// <param name="des">The DES.</param>
/// <param name="src">The source.</param>
static inline void sfc_load_prgrom_8k(
sfc_famicom_t* famicom, int des, int src) {
famicom->prg_banks[4 + des] = famicom->rom_info.data_prgrom + 8 * 1024 * src;
}
/// <summary>
/// 实用函数-StepFC: 载入1k CHR-ROM
/// </summary>
/// <param name="famicom">The famicom.</param>
/// <param name="des">The DES.</param>
/// <param name="src">The source.</param>
static inline void sfc_load_chrrom_1k(
sfc_famicom_t* famicom, int des, int src) {
famicom->ppu.banks[des] = famicom->rom_info.data_chrrom + 1024 * src;
}