2015-11-21 07:36:48 +00:00
|
|
|
//Ricoh 6502
|
|
|
|
//* Ricoh 2A03
|
|
|
|
//* Ricoh 2A07
|
|
|
|
|
2016-02-02 10:51:17 +00:00
|
|
|
#pragma once
|
2012-04-28 06:35:51 +00:00
|
|
|
|
|
|
|
namespace Processor {
|
|
|
|
|
2012-04-29 06:16:44 +00:00
|
|
|
struct R6502 {
|
Update to v099r04 release.
byuu says:
Changelog:
- lots of code cleanups to processor/r6502 (the switch.cpp file is only
halfway done ...)
- lots of code cleanups to fc/cpu
- removed fc/input
- implemented fc/controller
hex_usr, you may not like this, but I want to keep the controller port
and expansion port interface separate, like I do with the SNES. I realize
the NES' is used more for controllers, and the SNES' more for hardware
expansions, but ... they're not compatible pinouts and you can't really
connect one to the other.
Right now, I've only implemented the controller portion. I'll have to
get to the peripheral portion later.
Also, the gamepad implementation there now may be wrong. It's based off
the Super Famicom version obviously. I'm not sure if the Famicom has
different behavior with latching $4016 writes, or not. But, it works in
Mega Man II, so it's a start.
Everyone, be sure to remap your controls, and then set port 1 -> gamepad
after loading your first Famicom game with the new WIP.
2016-06-18 06:04:32 +00:00
|
|
|
virtual auto read(uint16 addr) -> uint8 = 0;
|
|
|
|
virtual auto write(uint16 addr, uint8 data) -> void = 0;
|
|
|
|
virtual auto lastCycle() -> void = 0;
|
2015-11-21 07:36:48 +00:00
|
|
|
virtual auto nmi(uint16& vector) -> void = 0;
|
Update to v099r04 release.
byuu says:
Changelog:
- lots of code cleanups to processor/r6502 (the switch.cpp file is only
halfway done ...)
- lots of code cleanups to fc/cpu
- removed fc/input
- implemented fc/controller
hex_usr, you may not like this, but I want to keep the controller port
and expansion port interface separate, like I do with the SNES. I realize
the NES' is used more for controllers, and the SNES' more for hardware
expansions, but ... they're not compatible pinouts and you can't really
connect one to the other.
Right now, I've only implemented the controller portion. I'll have to
get to the peripheral portion later.
Also, the gamepad implementation there now may be wrong. It's based off
the Super Famicom version obviously. I'm not sure if the Famicom has
different behavior with latching $4016 writes, or not. But, it works in
Mega Man II, so it's a start.
Everyone, be sure to remap your controls, and then set port 1 -> gamepad
after loading your first Famicom game with the new WIP.
2016-06-18 06:04:32 +00:00
|
|
|
virtual auto readDebugger(uint16 addr) -> uint8 { return 0u; }
|
2012-04-28 06:35:51 +00:00
|
|
|
|
2015-11-21 07:36:48 +00:00
|
|
|
auto mdr() const -> uint8;
|
|
|
|
auto power() -> void;
|
|
|
|
auto reset() -> void;
|
|
|
|
auto interrupt() -> void;
|
Update to v099r04 release.
byuu says:
Changelog:
- lots of code cleanups to processor/r6502 (the switch.cpp file is only
halfway done ...)
- lots of code cleanups to fc/cpu
- removed fc/input
- implemented fc/controller
hex_usr, you may not like this, but I want to keep the controller port
and expansion port interface separate, like I do with the SNES. I realize
the NES' is used more for controllers, and the SNES' more for hardware
expansions, but ... they're not compatible pinouts and you can't really
connect one to the other.
Right now, I've only implemented the controller portion. I'll have to
get to the peripheral portion later.
Also, the gamepad implementation there now may be wrong. It's based off
the Super Famicom version obviously. I'm not sure if the Famicom has
different behavior with latching $4016 writes, or not. But, it works in
Mega Man II, so it's a start.
Everyone, be sure to remap your controls, and then set port 1 -> gamepad
after loading your first Famicom game with the new WIP.
2016-06-18 06:04:32 +00:00
|
|
|
auto instruction() -> void;
|
2012-04-28 06:35:51 +00:00
|
|
|
|
2015-11-21 07:36:48 +00:00
|
|
|
auto serialize(serializer&) -> void;
|
2012-04-28 06:35:51 +00:00
|
|
|
|
|
|
|
//memory.cpp
|
Update to v099r04 release.
byuu says:
Changelog:
- lots of code cleanups to processor/r6502 (the switch.cpp file is only
halfway done ...)
- lots of code cleanups to fc/cpu
- removed fc/input
- implemented fc/controller
hex_usr, you may not like this, but I want to keep the controller port
and expansion port interface separate, like I do with the SNES. I realize
the NES' is used more for controllers, and the SNES' more for hardware
expansions, but ... they're not compatible pinouts and you can't really
connect one to the other.
Right now, I've only implemented the controller portion. I'll have to
get to the peripheral portion later.
Also, the gamepad implementation there now may be wrong. It's based off
the Super Famicom version obviously. I'm not sure if the Famicom has
different behavior with latching $4016 writes, or not. But, it works in
Mega Man II, so it's a start.
Everyone, be sure to remap your controls, and then set port 1 -> gamepad
after loading your first Famicom game with the new WIP.
2016-06-18 06:04:32 +00:00
|
|
|
auto io() -> uint8;
|
|
|
|
auto readPC() -> uint8;
|
|
|
|
auto readSP() -> uint8;
|
|
|
|
auto readZP(uint8 addr) -> uint8;
|
2012-04-28 06:35:51 +00:00
|
|
|
|
Update to v099r04 release.
byuu says:
Changelog:
- lots of code cleanups to processor/r6502 (the switch.cpp file is only
halfway done ...)
- lots of code cleanups to fc/cpu
- removed fc/input
- implemented fc/controller
hex_usr, you may not like this, but I want to keep the controller port
and expansion port interface separate, like I do with the SNES. I realize
the NES' is used more for controllers, and the SNES' more for hardware
expansions, but ... they're not compatible pinouts and you can't really
connect one to the other.
Right now, I've only implemented the controller portion. I'll have to
get to the peripheral portion later.
Also, the gamepad implementation there now may be wrong. It's based off
the Super Famicom version obviously. I'm not sure if the Famicom has
different behavior with latching $4016 writes, or not. But, it works in
Mega Man II, so it's a start.
Everyone, be sure to remap your controls, and then set port 1 -> gamepad
after loading your first Famicom game with the new WIP.
2016-06-18 06:04:32 +00:00
|
|
|
auto writeSP(uint8 data) -> void;
|
|
|
|
auto writeZP(uint8 addr, uint8 data) -> void;
|
2012-04-28 06:35:51 +00:00
|
|
|
|
Update to v099r04 release.
byuu says:
Changelog:
- lots of code cleanups to processor/r6502 (the switch.cpp file is only
halfway done ...)
- lots of code cleanups to fc/cpu
- removed fc/input
- implemented fc/controller
hex_usr, you may not like this, but I want to keep the controller port
and expansion port interface separate, like I do with the SNES. I realize
the NES' is used more for controllers, and the SNES' more for hardware
expansions, but ... they're not compatible pinouts and you can't really
connect one to the other.
Right now, I've only implemented the controller portion. I'll have to
get to the peripheral portion later.
Also, the gamepad implementation there now may be wrong. It's based off
the Super Famicom version obviously. I'm not sure if the Famicom has
different behavior with latching $4016 writes, or not. But, it works in
Mega Man II, so it's a start.
Everyone, be sure to remap your controls, and then set port 1 -> gamepad
after loading your first Famicom game with the new WIP.
2016-06-18 06:04:32 +00:00
|
|
|
auto ioPage(uint16 x, uint16 y) -> void;
|
|
|
|
auto ioPageAlways(uint16 x, uint16 y) -> void;
|
2012-04-28 06:35:51 +00:00
|
|
|
|
|
|
|
//instructions.cpp
|
2016-06-05 05:03:21 +00:00
|
|
|
using fp = auto (R6502::*)() -> void;
|
Update to v099r04 release.
byuu says:
Changelog:
- lots of code cleanups to processor/r6502 (the switch.cpp file is only
halfway done ...)
- lots of code cleanups to fc/cpu
- removed fc/input
- implemented fc/controller
hex_usr, you may not like this, but I want to keep the controller port
and expansion port interface separate, like I do with the SNES. I realize
the NES' is used more for controllers, and the SNES' more for hardware
expansions, but ... they're not compatible pinouts and you can't really
connect one to the other.
Right now, I've only implemented the controller portion. I'll have to
get to the peripheral portion later.
Also, the gamepad implementation there now may be wrong. It's based off
the Super Famicom version obviously. I'm not sure if the Famicom has
different behavior with latching $4016 writes, or not. But, it works in
Mega Man II, so it's a start.
Everyone, be sure to remap your controls, and then set port 1 -> gamepad
after loading your first Famicom game with the new WIP.
2016-06-18 06:04:32 +00:00
|
|
|
auto fp_asl();
|
|
|
|
auto fp_adc();
|
|
|
|
auto fp_and();
|
|
|
|
auto fp_bit();
|
|
|
|
auto fp_cmp();
|
|
|
|
auto fp_cpx();
|
|
|
|
auto fp_cpy();
|
|
|
|
auto fp_dec();
|
|
|
|
auto fp_eor();
|
|
|
|
auto fp_inc();
|
|
|
|
auto fp_lda();
|
|
|
|
auto fp_ldx();
|
|
|
|
auto fp_ldy();
|
|
|
|
auto fp_lsr();
|
|
|
|
auto fp_ora();
|
|
|
|
auto fp_rla();
|
|
|
|
auto fp_rol();
|
|
|
|
auto fp_ror();
|
|
|
|
auto fp_rra();
|
|
|
|
auto fp_sbc();
|
|
|
|
auto fp_sla();
|
|
|
|
auto fp_sra();
|
|
|
|
|
|
|
|
auto op_branch(bool condition);
|
|
|
|
auto op_clear_flag(uint bit);
|
|
|
|
auto op_decrement(uint8& r);
|
|
|
|
auto op_increment(uint8& r);
|
|
|
|
auto op_pull(uint8& r);
|
|
|
|
auto op_push(uint8& r);
|
|
|
|
auto op_read_absolute(fp);
|
|
|
|
auto op_read_absolute_x(fp);
|
|
|
|
auto op_read_absolute_y(fp);
|
|
|
|
auto op_read_immediate(fp);
|
|
|
|
auto op_read_indirect_zero_page_x(fp);
|
|
|
|
auto op_read_indirect_zero_page_y(fp);
|
|
|
|
auto op_read_zero_page(fp);
|
|
|
|
auto op_read_zero_page_x(fp);
|
|
|
|
auto op_read_zero_page_y(fp);
|
|
|
|
auto op_rmw_absolute(fp);
|
|
|
|
auto op_rmw_absolute_x(fp);
|
|
|
|
auto op_rmw_zero_page(fp);
|
|
|
|
auto op_rmw_zero_page_x(fp);
|
|
|
|
auto op_set_flag(uint bit);
|
|
|
|
auto op_shift(fp);
|
|
|
|
auto op_store_absolute(uint8& r);
|
|
|
|
auto op_store_absolute_x(uint8& r);
|
|
|
|
auto op_store_absolute_y(uint8& r);
|
|
|
|
auto op_store_indirect_zero_page_x(uint8& r);
|
|
|
|
auto op_store_indirect_zero_page_y(uint8& r);
|
|
|
|
auto op_store_zero_page(uint8& r);
|
|
|
|
auto op_store_zero_page_x(uint8& r);
|
|
|
|
auto op_store_zero_page_y(uint8& r);
|
|
|
|
auto op_transfer(uint8& s, uint8& d, bool flag);
|
2015-11-21 07:36:48 +00:00
|
|
|
|
|
|
|
auto op_brk();
|
|
|
|
auto op_jmp_absolute();
|
|
|
|
auto op_jmp_indirect_absolute();
|
|
|
|
auto op_jsr_absolute();
|
|
|
|
auto op_nop();
|
|
|
|
auto op_php();
|
|
|
|
auto op_plp();
|
|
|
|
auto op_rti();
|
|
|
|
auto op_rts();
|
|
|
|
|
Update to v099r04 release.
byuu says:
Changelog:
- lots of code cleanups to processor/r6502 (the switch.cpp file is only
halfway done ...)
- lots of code cleanups to fc/cpu
- removed fc/input
- implemented fc/controller
hex_usr, you may not like this, but I want to keep the controller port
and expansion port interface separate, like I do with the SNES. I realize
the NES' is used more for controllers, and the SNES' more for hardware
expansions, but ... they're not compatible pinouts and you can't really
connect one to the other.
Right now, I've only implemented the controller portion. I'll have to
get to the peripheral portion later.
Also, the gamepad implementation there now may be wrong. It's based off
the Super Famicom version obviously. I'm not sure if the Famicom has
different behavior with latching $4016 writes, or not. But, it works in
Mega Man II, so it's a start.
Everyone, be sure to remap your controls, and then set port 1 -> gamepad
after loading your first Famicom game with the new WIP.
2016-06-18 06:04:32 +00:00
|
|
|
auto op_arr_immediate();
|
|
|
|
auto op_nop_absolute();
|
|
|
|
auto op_nop_absolute_x();
|
|
|
|
auto op_nop_immediate();
|
|
|
|
auto op_nop_implied();
|
|
|
|
auto op_nop_zero_page();
|
|
|
|
auto op_nop_zero_page_x();
|
2012-04-28 06:35:51 +00:00
|
|
|
|
|
|
|
//disassembler.cpp
|
2015-11-21 07:36:48 +00:00
|
|
|
auto disassemble() -> string;
|
|
|
|
|
|
|
|
#include "registers.hpp"
|
2012-04-28 06:35:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|