Also use named initializers for null core
[lsnes.git] / bsnes-patches / v087 / 0005-Add-needed-support-for-detecting-true-polls-as-oppos.patch
blobd66c227fbbb572c968d2b832c90cc81803f189f3
1 From f22d7a2b57d57959ac947465323870a8772d15ad Mon Sep 17 00:00:00 2001
2 From: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
3 Date: Mon, 24 Sep 2012 21:46:09 +0300
4 Subject: [PATCH] Add needed support for detecting true polls as opposed to
5 just autopolling
7 ---
8 snes/cpu/cpu.hpp | 1 +
9 snes/cpu/mmio/mmio.cpp | 18 ++++++++++--------
10 2 files changed, 11 insertions(+), 8 deletions(-)
12 diff --git a/snes/cpu/cpu.hpp b/snes/cpu/cpu.hpp
13 index 5eb963e..f6466cc 100755
14 --- a/snes/cpu/cpu.hpp
15 +++ b/snes/cpu/cpu.hpp
16 @@ -25,6 +25,7 @@ struct CPU : public Processor, public CPUcore, public PPUcounter {
17 CPU();
18 ~CPU();
20 + bool controller_flag;
21 privileged:
22 #include "dma/dma.hpp"
23 #include "memory/memory.hpp"
24 diff --git a/snes/cpu/mmio/mmio.cpp b/snes/cpu/mmio/mmio.cpp
25 index 8b6aaa6..c5ee930 100755
26 --- a/snes/cpu/mmio/mmio.cpp
27 +++ b/snes/cpu/mmio/mmio.cpp
28 @@ -42,6 +42,7 @@ void CPU::mmio_w4016(uint8 data) {
29 //1-0 = Joypad serial data
30 uint8 CPU::mmio_r4016() {
31 uint8 r = regs.mdr & 0xfc;
32 + controller_flag = true;
33 r |= input.port1->data();
34 return r;
36 @@ -52,6 +53,7 @@ uint8 CPU::mmio_r4016() {
37 //1-0 = Joypad serial data
38 uint8 CPU::mmio_r4017() {
39 uint8 r = (regs.mdr & 0xe0) | 0x1c;
40 + controller_flag = true;
41 r |= input.port2->data();
42 return r;
44 @@ -204,14 +206,14 @@ uint8 CPU::mmio_r4217() {
45 return status.rdmpy >> 8;
48 -uint8 CPU::mmio_r4218() { return status.joy1 >> 0; } //JOY1L
49 -uint8 CPU::mmio_r4219() { return status.joy1 >> 8; } //JOY1H
50 -uint8 CPU::mmio_r421a() { return status.joy2 >> 0; } //JOY2L
51 -uint8 CPU::mmio_r421b() { return status.joy2 >> 8; } //JOY2H
52 -uint8 CPU::mmio_r421c() { return status.joy3 >> 0; } //JOY3L
53 -uint8 CPU::mmio_r421d() { return status.joy3 >> 8; } //JOY3H
54 -uint8 CPU::mmio_r421e() { return status.joy4 >> 0; } //JOY4L
55 -uint8 CPU::mmio_r421f() { return status.joy4 >> 8; } //JOY4H
56 +uint8 CPU::mmio_r4218() { controller_flag = true; return status.joy1 >> 0; } //JOY1L
57 +uint8 CPU::mmio_r4219() { controller_flag = true; return status.joy1 >> 8; } //JOY1H
58 +uint8 CPU::mmio_r421a() { controller_flag = true; return status.joy2 >> 0; } //JOY2L
59 +uint8 CPU::mmio_r421b() { controller_flag = true; return status.joy2 >> 8; } //JOY2H
60 +uint8 CPU::mmio_r421c() { controller_flag = true; return status.joy3 >> 0; } //JOY3L
61 +uint8 CPU::mmio_r421d() { controller_flag = true; return status.joy3 >> 8; } //JOY3H
62 +uint8 CPU::mmio_r421e() { controller_flag = true; return status.joy4 >> 0; } //JOY4L
63 +uint8 CPU::mmio_r421f() { controller_flag = true; return status.joy4 >> 8; } //JOY4H
65 //DMAPx
66 uint8 CPU::mmio_r43x0(uint8 i) {
67 --
68 1.7.10.4