2015-11-21 07:36:48 +00:00
|
|
|
//NEC uPD7720 (not supported)
|
|
|
|
//NEC uPD7725
|
|
|
|
//NEC uPD96050
|
|
|
|
|
2016-02-02 10:51:17 +00:00
|
|
|
#pragma once
|
2012-03-26 10:13:02 +00:00
|
|
|
|
|
|
|
namespace Processor {
|
|
|
|
|
|
|
|
struct uPD96050 {
|
2015-11-21 07:36:48 +00:00
|
|
|
auto power() -> void;
|
|
|
|
auto exec() -> void;
|
|
|
|
auto serialize(serializer&) -> void;
|
|
|
|
|
|
|
|
auto execOP(uint24 opcode) -> void;
|
|
|
|
auto execRT(uint24 opcode) -> void;
|
|
|
|
auto execJP(uint24 opcode) -> void;
|
|
|
|
auto execLD(uint24 opcode) -> void;
|
|
|
|
|
|
|
|
auto readSR() -> uint8;
|
|
|
|
auto writeSR(uint8 data) -> void;
|
|
|
|
|
|
|
|
auto readDR() -> uint8;
|
|
|
|
auto writeDR(uint8 data) -> void;
|
|
|
|
|
|
|
|
auto readDP(uint12 addr) -> uint8;
|
|
|
|
auto writeDP(uint12 addr, uint8 data) -> void;
|
|
|
|
|
|
|
|
auto disassemble(uint14 ip) -> string;
|
|
|
|
|
|
|
|
enum class Revision : uint { uPD7725, uPD96050 } revision;
|
2012-03-26 10:13:02 +00:00
|
|
|
uint24 programROM[16384];
|
|
|
|
uint16 dataROM[2048];
|
|
|
|
uint16 dataRAM[2048];
|
|
|
|
|
2015-11-21 07:36:48 +00:00
|
|
|
//registers.cpp
|
|
|
|
struct Flag {
|
|
|
|
inline operator uint() const;
|
|
|
|
inline auto operator=(uint d) -> uint;
|
2012-03-26 10:13:02 +00:00
|
|
|
|
2015-11-21 07:36:48 +00:00
|
|
|
bool s1, s0, c, z, ov1, ov0;
|
|
|
|
};
|
2012-03-26 10:13:02 +00:00
|
|
|
|
2015-11-21 07:36:48 +00:00
|
|
|
struct Status {
|
|
|
|
inline operator uint() const;
|
|
|
|
inline auto operator=(uint d) -> uint;
|
2012-03-26 10:13:02 +00:00
|
|
|
|
2015-11-21 07:36:48 +00:00
|
|
|
bool rqm, usf1, usf0, drs, dma, drc, soc, sic, ei, p1, p0;
|
|
|
|
};
|
2012-03-26 10:13:02 +00:00
|
|
|
|
2015-11-21 07:36:48 +00:00
|
|
|
struct Regs {
|
2016-02-16 09:27:55 +00:00
|
|
|
uint16 stack[16]; //LIFO
|
Update to v097r17 release.
byuu says:
Changelog:
- ruby: if DirectSoundCreate fails (no sound device present), return
false from init instead of crashing
- nall: improved edge case return values for
(basename,pathname,dirname,...)
- nall: renamed file_system_object class to inode
- nall: varuint_t replaced with VariadicNatural; which contains
.bit,.bits,.byte ala Natural/Integer
- nall: fixed boolean compilation error on Windows
- WS: popa should not restore SP
- GBA: rewrote the CPU/APU cores to use the .bit,.bits functions;
removed registers.cpp from each
Note that the GBA changes are extremely major. This is about five hours
worth of extremely delicate work. Any slight errors could break
emulation in extremely bad ways. Let's hold off on extensive testing
until the next WIP, after I do the same to the PPU.
So far ... endrift's SOUNDCNT_X I/O test is failing, although that code
didn't change, so clearly I messed up SOUNDCNT_H somehow ...
To compile on Windows:
1. change nall/string/platform.hpp line 47 to
return slice(result, 0, 3);
2. change ruby/video.wgl.cpp line 72 to
auto lock(uint32_t*& data, uint& pitch, uint width, uint height) -> bool {
3. add this line to the very top of hiro/windows/header.cpp:
#define boolean FuckYouMicrosoft
2016-02-23 11:08:44 +00:00
|
|
|
VariadicNatural pc; //program counter
|
|
|
|
VariadicNatural rp; //ROM pointer
|
|
|
|
VariadicNatural dp; //data pointer
|
2016-02-16 09:27:55 +00:00
|
|
|
uint4 sp; //stack pointer
|
2015-11-21 07:36:48 +00:00
|
|
|
int16 k;
|
|
|
|
int16 l;
|
|
|
|
int16 m;
|
|
|
|
int16 n;
|
2016-02-16 09:27:55 +00:00
|
|
|
int16 a; //accumulator
|
|
|
|
int16 b; //accumulator
|
2015-11-21 07:36:48 +00:00
|
|
|
Flag flaga;
|
|
|
|
Flag flagb;
|
2016-02-16 09:27:55 +00:00
|
|
|
uint16 tr; //temporary register
|
|
|
|
uint16 trb; //temporary register
|
|
|
|
Status sr; //status register
|
|
|
|
uint16 dr; //data register
|
2015-11-21 07:36:48 +00:00
|
|
|
uint16 si;
|
|
|
|
uint16 so;
|
|
|
|
} regs;
|
2012-03-26 10:13:02 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|