Skip to content

Commit 5ef7586

Browse files
author
tiansongyu
committed
fix compile
1 parent d640ad8 commit 5ef7586

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

6502/6502Lib/src/public/Bus.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Bus::~Bus() {}
1010

1111
void Bus::SetSampleFrequency(uint32_t sample_rate) {
1212
// sample_rate是声音采样率,这个采样率决定一个声音数据的发生周期
13-
dAudioTimePerSystemSample = 1.0 / static_cast<double>sample_rate;
13+
dAudioTimePerSystemSample = 1.0 / static_cast<double>(sample_rate);
1414
dAudioTimePerNESClock =
1515
1.0 / 5369318.0; // 1 / ppu的时钟频率 = ppu的时钟周期
1616
}

6502/6502Lib/src/public/Bus.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright [2021] <tiansongyu>
2-
#ifndef 6502_6502LIB_SRC_PUBLIC_BUS_H_
3-
#define 6502_6502LIB_SRC_PUBLIC_BUS_H_
2+
#ifndef __6502_6502LIB_SRC_PUBLIC_BUS_H_
3+
#define __6502_6502LIB_SRC_PUBLIC_BUS_H_
44

55
#include <array>
66
#include <cstdint>
@@ -79,4 +79,4 @@ class Bus {
7979
// 系统clock
8080
bool clock();
8181
};
82-
#endif // 6502_6502LIB_SRC_PUBLIC_BUS_H_
82+
#endif // __6502_6502LIB_SRC_PUBLIC_BUS_H_

6502/6502Lib/src/public/Cartridge.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
// Copyright [2021] <tiansongyu>
2+
#ifndef _6502_6502LIB_SRC_PUBLIC_CARTRIDGE_H_
3+
#define _6502_6502LIB_SRC_PUBLIC_CARTRIDGE_H_
24
#include <cstdint>
35
#include <fstream>
46
#include <memory>
57
#include <string>
68
#include <vector>
79

810
#include "Mapper_000.h"
9-
//待添加不同种类的mapper
11+
// 待添加不同种类的mapper
1012
#include "Mapper_001.h"
1113
#include "Mapper_002.h"
1214
#include "Mapper_003.h"
@@ -15,7 +17,7 @@
1517

1618
class Cartridge {
1719
public:
18-
Cartridge(const std::string &sFileName);
20+
explicit Cartridge(const std::string &sFileName);
1921
~Cartridge();
2022

2123
public:
@@ -49,3 +51,4 @@ class Cartridge {
4951

5052
MIRROR Mirror();
5153
};
54+
#endif // _6502_6502LIB_SRC_PUBLIC_CARTRIDGE_H_

0 commit comments

Comments
 (0)