Skip to content

Commit 852c75c

Browse files
author
tiansongyu
committed
消除所有warning
1 parent 5ef7586 commit 852c75c

23 files changed

+2411
-2504
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright [2021] <tiansongyu>
1+
// Copyright [2020-2021] <tiansongyu>
22
#include "Bus.h"
33

44
Bus::Bus() {

6502/6502Lib/src/public/Mapper.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright [2020-2021] <tiansongyu>
2+
13
#include "Mapper.h"
24

35
Mapper::Mapper(uint8_t prgBanks, uint8_t chrBanks) {

6502/6502Lib/src/public/Mapper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright [2020-2021] <tiansongyu>
2+
13
#pragma once
24
#include <cstdint>
35

6502/6502Lib/src/public/Mapper_000.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright [2021] <tiansongyu>
2+
13
#include "Mapper_000.h"
24

35
Mapper_000::Mapper_000(uint8_t prgBanks, uint8_t chrBanks)

6502/6502Lib/src/public/Mapper_000.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#pragma once
1+
// Copyright [2021] <tiansongyu>
2+
#ifndef _6502_6502LIB_SRC_PUBLIC_MAPPER_000_H_
3+
#define _6502_6502LIB_SRC_PUBLIC_MAPPER_000_H_
24
#include "Mapper.h"
35

46
class Mapper_000 : public Mapper {
@@ -16,3 +18,4 @@ class Mapper_000 : public Mapper {
1618

1719
// No local equipment required
1820
};
21+
#endif // _6502_6502LIB_SRC_PUBLIC_MAPPER_000_H_

6502/6502Lib/src/public/Mapper_001.cpp

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright [2021] <tiansongyu>
2+
13
#include "Mapper_001.h"
24

35
Mapper_001::Mapper_001(uint8_t prgBanks, uint8_t chrBanks)
@@ -99,24 +101,24 @@ bool Mapper_001::cpuMapWrite(uint16_t addr, uint32_t &mapped_addr,
99101
// Sets the switchable PRG ROM bank to the value of A.;
100102
// ;
101103
// A MMC1_SR MMC1_PB
102-
// setPRGBank:;
104+
// setPRGBank:;
103105
// 000edcba 10000 Start with an empty shift register(SR).The 1 is used
104-
// sta $E000;
106+
// sta $E000;
105107
// 000edcba->a1000 to detect when the SR has become full.lsr a;
106108
// > 0000edcb a1000
107-
// sta $E000;
109+
// sta $E000;
108110
// 0000edcb->ba100
109-
// lsr a;
111+
// lsr a;
110112
// > 00000edc ba100
111-
// sta $E000;
113+
// sta $E000;
112114
// 00000edc->cba10
113-
// lsr a;
115+
// lsr a;
114116
// > 000000ed cba10
115-
// sta $E000;
117+
// sta $E000;
116118
// 000000ed->dcba1 Once a 1 is shifted into the last position, the SR is
117-
// full.lsr a; > 0000000e dcba1 sta $E000; 0000000e dcba1->edcba A write
118-
// with the SR full copies D0 and the SR to a bank register; 10000($E000 -
119-
// $FFFF means PRG bank number) and then clears the SR.rts
119+
// full.lsr a; > 0000000e dcba1 sta $E000; 0000000e dcba1->edcba
120+
// A write with the SR full copies D0 and the SR to a bank register;
121+
// 10000($E000 - $FFFF means PRG bank number) and then clears the SR.rts
120122

121123
nLoadRegister >>= 1;
122124
nLoadRegister |= (data & 0x01) << 4;
@@ -126,9 +128,8 @@ bool Mapper_001::cpuMapWrite(uint16_t addr, uint32_t &mapped_addr,
126128
// Get Mapper Target Register, by examining
127129
// bits 13 & 14 of the address
128130
uint8_t nTargetRegister = (addr >> 13) & 0x03;
129-
130-
if (nTargetRegister == 0) // 0x8000 - 0x9FFF
131-
{
131+
// 0x8000 - 0x9FFF
132+
if (nTargetRegister == 0) {
132133
// Set Control Register
133134
nControlRegister = nLoadRegister & 0x1F;
134135

@@ -146,8 +147,7 @@ bool Mapper_001::cpuMapWrite(uint16_t addr, uint32_t &mapped_addr,
146147
mirrormode = HORIZONTAL;
147148
break;
148149
}
149-
} else if (nTargetRegister == 1) // 0xA000 - 0xBFFF
150-
{
150+
} else if (nTargetRegister == 1) { // 0xA000 - 0xBFFF
151151
// Set CHR Bank Lo
152152
if (nControlRegister & 0b10000) {
153153
// 4K CHR Bank at PPU 0x0000
@@ -156,15 +156,13 @@ bool Mapper_001::cpuMapWrite(uint16_t addr, uint32_t &mapped_addr,
156156
// 8K CHR Bank at PPU 0x0000
157157
nCHRBankSelect8 = nLoadRegister & 0x1E;
158158
}
159-
} else if (nTargetRegister == 2) // 0xC000 - 0xDFFF
160-
{
159+
} else if (nTargetRegister == 2) { // 0xC000 - 0xDFFF
161160
// Set CHR Bank Hi
162161
if (nControlRegister & 0b10000) {
163162
// 4K CHR Bank at PPU 0x1000
164163
nCHRBankSelect4Hi = nLoadRegister & 0x1F;
165164
}
166-
} else if (nTargetRegister == 3) // 0xE000 - 0xFFFF
167-
{
165+
} else if (nTargetRegister == 3) { // 0xE000 - 0xFFFF
168166
// Configure PRG Banks
169167
uint8_t nPRGMode = (nControlRegister >> 2) & 0x03;
170168

@@ -250,4 +248,4 @@ void Mapper_001::reset() {
250248
nPRGBankSelect16Hi = nPRGBanks - 1;
251249
}
252250

253-
MIRROR Mapper_001::mirror() { return mirrormode; }
251+
MIRROR Mapper_001::mirror() { return mirrormode; }

6502/6502Lib/src/public/Mapper_001.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#pragma once
1+
// Copyright [2021] <tiansongyu>
2+
#ifndef _6502_6502LIB_SRC_PUBLIC_MAPPER_001_H_
3+
#define _6502_6502LIB_SRC_PUBLIC_MAPPER_001_H_
24
#include <vector>
35

46
#include "Mapper.h"
@@ -37,3 +39,4 @@ class Mapper_001 : public Mapper {
3739

3840
std::vector<uint8_t> vRAMStatic;
3941
};
42+
#endif // _6502_6502LIB_SRC_PUBLIC_MAPPER_001_H_

6502/6502Lib/src/public/Mapper_002.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright [2021] <tiansongyu>
2+
13
#include "Mapper_002.h"
24

35
Mapper_002::Mapper_002(uint8_t prgBanks, uint8_t chrBanks)

6502/6502Lib/src/public/Mapper_002.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright [2021] <tiansongyu>
2+
13
#pragma once
24
#include "Mapper.h"
35

6502/6502Lib/src/public/Mapper_003.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright [2021] <tiansongyu>
2+
13
#include "Mapper_003.h"
24

35
Mapper_003::Mapper_003(uint8_t prgBanks, uint8_t chrBanks)

0 commit comments

Comments
 (0)