2016-08-19 14:11:26 +00:00
|
|
|
auto Z80::instruction() -> void {
|
Update to v101r29 release.
byuu says:
Changelog:
- SMS: background VDP clips partial tiles on the left (math may not be
right ... it's hard to reason about)
- SMS: fix background VDP scroll locks
- SMS: fix VDP sprite coordinates
- SMS: paint black after the end of the visible display
- todo: shouldn't be a brute force at the end of the main VDP
loop, should happen in each rendering unit
- higan: removed emulator/debugger.hpp
- higan: removed privileged: access specifier
- SFC: removed debugger hooks
- todo: remove sfc/debugger.hpp
- Z80: fixed disassembly of (fd,dd) cb (displacement) (opcode)
instructions
- Z80: fix to prevent interrupts from firing between ix/iy prefixes
and opcodes
- todo: this is a rather hacky fix that could, if exploited, crash
the stack frame
- Z80: fix BIT flags
- Z80: fix ADD hl,reg flags
- Z80: fix CPD, CPI flags
- Z80: fix IND, INI flags
- Z80: fix INDR, INIT loop flag check
- Z80: fix OUTD, OUTI flags
- Z80: fix OTDR, OTIR loop flag check
2017-01-09 21:27:13 +00:00
|
|
|
//todo: return instruction() could cause stack crash from recursion
|
|
|
|
//but this is needed to prevent IRQs from firing between prefixes and opcodes
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
auto code = opcode();
|
Update to v101r29 release.
byuu says:
Changelog:
- SMS: background VDP clips partial tiles on the left (math may not be
right ... it's hard to reason about)
- SMS: fix background VDP scroll locks
- SMS: fix VDP sprite coordinates
- SMS: paint black after the end of the visible display
- todo: shouldn't be a brute force at the end of the main VDP
loop, should happen in each rendering unit
- higan: removed emulator/debugger.hpp
- higan: removed privileged: access specifier
- SFC: removed debugger hooks
- todo: remove sfc/debugger.hpp
- Z80: fixed disassembly of (fd,dd) cb (displacement) (opcode)
instructions
- Z80: fix to prevent interrupts from firing between ix/iy prefixes
and opcodes
- todo: this is a rather hacky fix that could, if exploited, crash
the stack frame
- Z80: fix BIT flags
- Z80: fix ADD hl,reg flags
- Z80: fix CPD, CPI flags
- Z80: fix IND, INI flags
- Z80: fix INDR, INIT loop flag check
- Z80: fix OUTD, OUTI flags
- Z80: fix OTDR, OTIR loop flag check
2017-01-09 21:27:13 +00:00
|
|
|
if(code == 0xdd) { r.hlp = &r.ix; return instruction(); }
|
|
|
|
if(code == 0xfd) { r.hlp = &r.iy; return instruction(); }
|
2016-12-26 12:09:56 +00:00
|
|
|
|
|
|
|
if(r.ei) {
|
|
|
|
r.ei = 0;
|
|
|
|
r.iff1 = 1;
|
|
|
|
r.iff2 = 1;
|
|
|
|
}
|
|
|
|
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
if(code == 0xcb && r.hlp != &r.hl) {
|
|
|
|
uint16 addr = HL + (int8)operand();
|
|
|
|
wait(1);
|
|
|
|
instructionCBd(addr, opcode());
|
|
|
|
} else if(code == 0xcb) {
|
|
|
|
instructionCB(opcode());
|
|
|
|
} else if(code == 0xed) {
|
|
|
|
instructionED(opcode());
|
|
|
|
} else {
|
|
|
|
instruction(code);
|
|
|
|
}
|
|
|
|
|
2016-09-06 13:53:14 +00:00
|
|
|
r.hlp = &r.hl;
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#define op(id, name, ...) case id: return instruction##name(__VA_ARGS__);
|
|
|
|
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
auto Z80::instruction(uint8 code) -> void {
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
switch(code) {
|
2016-08-19 14:11:26 +00:00
|
|
|
op(0x00, NOP)
|
2016-09-04 13:51:27 +00:00
|
|
|
op(0x01, LD_rr_nn, BC)
|
2016-09-06 13:53:14 +00:00
|
|
|
op(0x02, LD_irr_a, BC)
|
|
|
|
op(0x03, INC_rr, BC)
|
|
|
|
op(0x04, INC_r, B)
|
|
|
|
op(0x05, DEC_r, B)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0x06, LD_r_n, B)
|
2016-09-06 13:53:14 +00:00
|
|
|
op(0x07, RLCA)
|
|
|
|
op(0x08, EX_rr_rr, AF, AF_)
|
2016-11-01 11:42:25 +00:00
|
|
|
op(0x09, ADD_hl_rr, BC)
|
2016-09-06 13:53:14 +00:00
|
|
|
op(0x0a, LD_a_irr, BC)
|
|
|
|
op(0x0b, DEC_rr, BC)
|
|
|
|
op(0x0c, INC_r, C)
|
|
|
|
op(0x0d, DEC_r, C)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0x0e, LD_r_n, C)
|
2016-09-06 13:53:14 +00:00
|
|
|
op(0x0f, RRCA)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0x10, DJNZ_e)
|
2016-09-04 13:51:27 +00:00
|
|
|
op(0x11, LD_rr_nn, DE)
|
2016-09-06 13:53:14 +00:00
|
|
|
op(0x12, LD_irr_a, DE)
|
|
|
|
op(0x13, INC_rr, DE)
|
|
|
|
op(0x14, INC_r, D)
|
|
|
|
op(0x15, DEC_r, D)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0x16, LD_r_n, D)
|
2016-09-06 13:53:14 +00:00
|
|
|
op(0x17, RLA)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0x18, JR_c_e, 1)
|
2016-11-01 11:42:25 +00:00
|
|
|
op(0x19, ADD_hl_rr, DE)
|
2016-09-06 13:53:14 +00:00
|
|
|
op(0x1a, LD_a_irr, DE)
|
|
|
|
op(0x1b, DEC_rr, DE)
|
|
|
|
op(0x1c, INC_r, E)
|
|
|
|
op(0x1d, DEC_r, E)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0x1e, LD_r_n, E)
|
2016-09-06 13:53:14 +00:00
|
|
|
op(0x1f, RRA)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0x20, JR_c_e, ZF == 0)
|
2016-09-04 13:51:27 +00:00
|
|
|
op(0x21, LD_rr_nn, HL)
|
2016-09-06 13:53:14 +00:00
|
|
|
op(0x22, LD_inn_rr, HL)
|
|
|
|
op(0x23, INC_rr, HL)
|
|
|
|
op(0x24, INC_r, H)
|
|
|
|
op(0x25, DEC_r, H)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0x26, LD_r_n, H)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0x27, DAA)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0x28, JR_c_e, ZF == 1)
|
2016-11-01 11:42:25 +00:00
|
|
|
op(0x29, ADD_hl_rr, HL)
|
2016-09-06 13:53:14 +00:00
|
|
|
op(0x2a, LD_rr_inn, HL)
|
|
|
|
op(0x2b, DEC_rr, HL)
|
|
|
|
op(0x2c, INC_r, L)
|
|
|
|
op(0x2d, DEC_r, L)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0x2e, LD_r_n, L)
|
2016-09-06 13:53:14 +00:00
|
|
|
op(0x2f, CPL)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0x30, JR_c_e, CF == 0)
|
2016-09-04 13:51:27 +00:00
|
|
|
op(0x31, LD_rr_nn, SP)
|
|
|
|
op(0x32, LD_inn_a)
|
2016-09-06 13:53:14 +00:00
|
|
|
op(0x33, INC_rr, SP)
|
|
|
|
op(0x34, INC_irr, HL)
|
|
|
|
op(0x35, DEC_irr, HL)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0x36, LD_irr_n, HL)
|
2016-09-06 13:53:14 +00:00
|
|
|
op(0x37, SCF)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0x38, JR_c_e, CF == 1)
|
2016-11-01 11:42:25 +00:00
|
|
|
op(0x39, ADD_hl_rr, SP)
|
2016-09-06 13:53:14 +00:00
|
|
|
op(0x3a, LD_a_inn)
|
|
|
|
op(0x3b, DEC_rr, SP)
|
|
|
|
op(0x3c, INC_r, A)
|
|
|
|
op(0x3d, DEC_r, A)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0x3e, LD_r_n, A)
|
2016-09-06 13:53:14 +00:00
|
|
|
op(0x3f, CCF)
|
2016-09-06 00:09:33 +00:00
|
|
|
op(0x40, LD_r_r, B, B)
|
|
|
|
op(0x41, LD_r_r, B, C)
|
|
|
|
op(0x42, LD_r_r, B, D)
|
|
|
|
op(0x43, LD_r_r, B, E)
|
|
|
|
op(0x44, LD_r_r, B, H)
|
|
|
|
op(0x45, LD_r_r, B, L)
|
|
|
|
op(0x46, LD_r_irr, B, HL)
|
|
|
|
op(0x47, LD_r_r, B, A)
|
|
|
|
op(0x48, LD_r_r, C, B)
|
|
|
|
op(0x49, LD_r_r, C, C)
|
|
|
|
op(0x4a, LD_r_r, C, D)
|
|
|
|
op(0x4b, LD_r_r, C, E)
|
|
|
|
op(0x4c, LD_r_r, C, H)
|
|
|
|
op(0x4d, LD_r_r, C, L)
|
|
|
|
op(0x4e, LD_r_irr, C, HL)
|
|
|
|
op(0x4f, LD_r_r, C, A)
|
|
|
|
op(0x50, LD_r_r, D, B)
|
|
|
|
op(0x51, LD_r_r, D, C)
|
|
|
|
op(0x52, LD_r_r, D, D)
|
|
|
|
op(0x53, LD_r_r, D, E)
|
|
|
|
op(0x54, LD_r_r, D, H)
|
|
|
|
op(0x55, LD_r_r, D, L)
|
|
|
|
op(0x56, LD_r_irr, D, HL)
|
|
|
|
op(0x57, LD_r_r, D, A)
|
|
|
|
op(0x58, LD_r_r, E, B)
|
|
|
|
op(0x59, LD_r_r, E, C)
|
|
|
|
op(0x5a, LD_r_r, E, D)
|
|
|
|
op(0x5b, LD_r_r, E, E)
|
|
|
|
op(0x5c, LD_r_r, E, H)
|
|
|
|
op(0x5d, LD_r_r, E, L)
|
|
|
|
op(0x5e, LD_r_irr, E, HL)
|
|
|
|
op(0x5f, LD_r_r, E, A)
|
|
|
|
op(0x60, LD_r_r, H, B)
|
|
|
|
op(0x61, LD_r_r, H, C)
|
|
|
|
op(0x62, LD_r_r, H, D)
|
|
|
|
op(0x63, LD_r_r, H, E)
|
|
|
|
op(0x64, LD_r_r, H, H)
|
|
|
|
op(0x65, LD_r_r, H, L)
|
2016-09-06 13:53:14 +00:00
|
|
|
op(0x66, LD_r_irr, _H, HL)
|
2016-09-06 00:09:33 +00:00
|
|
|
op(0x67, LD_r_r, H, A)
|
|
|
|
op(0x68, LD_r_r, L, B)
|
|
|
|
op(0x69, LD_r_r, L, C)
|
|
|
|
op(0x6a, LD_r_r, L, D)
|
|
|
|
op(0x6b, LD_r_r, L, E)
|
|
|
|
op(0x6c, LD_r_r, L, H)
|
|
|
|
op(0x6d, LD_r_r, L, L)
|
2016-09-06 13:53:14 +00:00
|
|
|
op(0x6e, LD_r_irr, _L, HL)
|
2016-09-06 00:09:33 +00:00
|
|
|
op(0x6f, LD_r_r, L, A)
|
2016-09-04 13:51:27 +00:00
|
|
|
op(0x70, LD_irr_r, HL, B)
|
|
|
|
op(0x71, LD_irr_r, HL, C)
|
|
|
|
op(0x72, LD_irr_r, HL, D)
|
|
|
|
op(0x73, LD_irr_r, HL, E)
|
2016-09-06 13:53:14 +00:00
|
|
|
op(0x74, LD_irr_r, HL, _H)
|
|
|
|
op(0x75, LD_irr_r, HL, _L)
|
2016-09-06 00:09:33 +00:00
|
|
|
op(0x76, HALT)
|
2016-09-04 13:51:27 +00:00
|
|
|
op(0x77, LD_irr_r, HL, A)
|
2016-09-06 00:09:33 +00:00
|
|
|
op(0x78, LD_r_r, A, B)
|
|
|
|
op(0x79, LD_r_r, A, C)
|
|
|
|
op(0x7a, LD_r_r, A, D)
|
|
|
|
op(0x7b, LD_r_r, A, E)
|
|
|
|
op(0x7c, LD_r_r, A, H)
|
|
|
|
op(0x7d, LD_r_r, A, L)
|
|
|
|
op(0x7e, LD_r_irr, A, HL)
|
|
|
|
op(0x7f, LD_r_r, A, A)
|
|
|
|
op(0x80, ADD_a_r, B)
|
|
|
|
op(0x81, ADD_a_r, C)
|
|
|
|
op(0x82, ADD_a_r, D)
|
|
|
|
op(0x83, ADD_a_r, E)
|
|
|
|
op(0x84, ADD_a_r, H)
|
|
|
|
op(0x85, ADD_a_r, L)
|
|
|
|
op(0x86, ADD_a_irr, HL)
|
|
|
|
op(0x87, ADD_a_r, A)
|
|
|
|
op(0x88, ADC_a_r, B)
|
|
|
|
op(0x89, ADC_a_r, C)
|
|
|
|
op(0x8a, ADC_a_r, D)
|
|
|
|
op(0x8b, ADC_a_r, E)
|
|
|
|
op(0x8c, ADC_a_r, H)
|
|
|
|
op(0x8d, ADC_a_r, L)
|
|
|
|
op(0x8e, ADC_a_irr, HL)
|
|
|
|
op(0x8f, ADC_a_r, A)
|
|
|
|
op(0x90, SUB_a_r, B)
|
|
|
|
op(0x91, SUB_a_r, C)
|
|
|
|
op(0x92, SUB_a_r, D)
|
|
|
|
op(0x93, SUB_a_r, E)
|
|
|
|
op(0x94, SUB_a_r, H)
|
|
|
|
op(0x95, SUB_a_r, L)
|
|
|
|
op(0x96, SUB_a_irr, HL)
|
|
|
|
op(0x97, SUB_a_r, A)
|
|
|
|
op(0x98, SBC_a_r, B)
|
|
|
|
op(0x99, SBC_a_r, C)
|
|
|
|
op(0x9a, SBC_a_r, D)
|
|
|
|
op(0x9b, SBC_a_r, E)
|
|
|
|
op(0x9c, SBC_a_r, H)
|
|
|
|
op(0x9d, SBC_a_r, L)
|
|
|
|
op(0x9e, SBC_a_irr, HL)
|
|
|
|
op(0x9f, SBC_a_r, A)
|
|
|
|
op(0xa0, AND_a_r, B)
|
|
|
|
op(0xa1, AND_a_r, C)
|
|
|
|
op(0xa2, AND_a_r, D)
|
|
|
|
op(0xa3, AND_a_r, E)
|
|
|
|
op(0xa4, AND_a_r, H)
|
|
|
|
op(0xa5, AND_a_r, L)
|
|
|
|
op(0xa6, AND_a_irr, HL)
|
|
|
|
op(0xa7, AND_a_r, A)
|
|
|
|
op(0xa8, XOR_a_r, B)
|
|
|
|
op(0xa9, XOR_a_r, C)
|
|
|
|
op(0xaa, XOR_a_r, D)
|
|
|
|
op(0xab, XOR_a_r, E)
|
|
|
|
op(0xac, XOR_a_r, H)
|
|
|
|
op(0xad, XOR_a_r, L)
|
|
|
|
op(0xae, XOR_a_irr, HL)
|
|
|
|
op(0xaf, XOR_a_r, A)
|
|
|
|
op(0xb0, OR_a_r, B)
|
|
|
|
op(0xb1, OR_a_r, C)
|
|
|
|
op(0xb2, OR_a_r, D)
|
|
|
|
op(0xb3, OR_a_r, E)
|
|
|
|
op(0xb4, OR_a_r, H)
|
|
|
|
op(0xb5, OR_a_r, L)
|
|
|
|
op(0xb6, OR_a_irr, HL)
|
|
|
|
op(0xb7, OR_a_r, A)
|
|
|
|
op(0xb8, CP_a_r, B)
|
|
|
|
op(0xb9, CP_a_r, C)
|
|
|
|
op(0xba, CP_a_r, D)
|
|
|
|
op(0xbb, CP_a_r, E)
|
|
|
|
op(0xbc, CP_a_r, H)
|
|
|
|
op(0xbd, CP_a_r, L)
|
|
|
|
op(0xbe, CP_a_irr, HL)
|
|
|
|
op(0xbf, CP_a_r, A)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0xc0, RET_c, ZF == 0)
|
|
|
|
op(0xc1, POP_rr, BC)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0xc2, JP_c_nn, ZF == 0)
|
|
|
|
op(0xc3, JP_c_nn, 1)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0xc4, CALL_c_nn, ZF == 0)
|
|
|
|
op(0xc5, PUSH_rr, BC)
|
|
|
|
op(0xc6, ADD_a_n)
|
|
|
|
op(0xc7, RST_o, 0)
|
|
|
|
op(0xc8, RET_c, ZF == 1)
|
|
|
|
op(0xc9, RET)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0xca, JP_c_nn, ZF == 1)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
//op(0xcb, cb:)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0xcc, CALL_c_nn, ZF == 1)
|
|
|
|
op(0xcd, CALL_nn)
|
|
|
|
op(0xce, ADC_a_n)
|
|
|
|
op(0xcf, RST_o, 1)
|
|
|
|
op(0xd0, RET_c, CF == 0)
|
|
|
|
op(0xd1, POP_rr, DE)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0xd2, JP_c_nn, CF == 0)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0xd3, OUT_n_a)
|
|
|
|
op(0xd4, CALL_c_nn, CF == 0)
|
|
|
|
op(0xd5, PUSH_rr, DE)
|
|
|
|
op(0xd6, SUB_a_n)
|
|
|
|
op(0xd7, RST_o, 2)
|
|
|
|
op(0xd8, RET_c, CF == 1)
|
|
|
|
op(0xd9, EXX)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0xda, JP_c_nn, CF == 1)
|
2016-08-27 04:48:21 +00:00
|
|
|
op(0xdb, IN_a_in)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0xdc, CALL_c_nn, CF == 1)
|
|
|
|
//op(0xdd, ix:)
|
|
|
|
op(0xde, SBC_a_n)
|
|
|
|
op(0xdf, RST_o, 3)
|
|
|
|
op(0xe0, RET_c, PF == 0)
|
|
|
|
op(0xe1, POP_rr, HL)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0xe2, JP_c_nn, PF == 0)
|
Update to v101r30 release.
byuu says:
Changelog:
- SMS: added cartridge ROM/RAM mirroring (fixes Alex Kidd)
- SMS: fixed 8x16 sprite mode (fixes Wonder Boy, Ys graphics)
- Z80: emulated "ex (sp),hl" instruction
- Z80: fixed INx NF (should be set instead of cleared)
- Z80: fixed loop condition check for CPxR, INxR, LDxR, OTxR (fixes
walking in Wonder Boy)
- SFC: removed Debugger and sfc/debugger.hpp
- icarus: connected MS, GG, MD importing to the scan dialog
- PCE: added emulation skeleton to higan and icarus
At this point, Master System games are fairly highly compatible, sans
audio. Game Gear games are running, but I need to crop the resolution
and support the higher color palette that they can utilize. It's really
something else the way they handled the resolution shrink on that thing.
The last change is obviously going to be the biggest news.
I'm very well aware it's not an ideal time to start on a new emulation
core, with the MS and MD cores only just now coming to life with no
audio support.
But, for whatever reason, my heart's really set on working on the PC
Engine. I wanted to write the final higan skeleton core, and get things
ready so that whenever I'm in the mood to work on the PCE, I can do so.
The skeleton is far and away the most tedious and obnoxious part of the
emulator development, because it's basically all just lots of
boilerplate templated code, lots of new files to create, etc.
I really don't know how things are going to proceed ... but I can say
with 99.9% certainty that this will be the final brand new core ever
added to higan -- at least one written by me, that is. This was
basically the last system from my childhood that I ever cared about.
It's the last 2D system with games that I really enjoy playing. No other
system is worth dividing my efforts and reducing the quality and amount
of time to work on the systems I have.
In the future, there will be potential for FDS, Mega CD and PCE-CD
support. But those will all be add-ons, and they'll all be really
difficult and challenge the entire design of higan's UI (it's entirely
cartridge-driven at this time.) None of them will be entirely new cores
like this one.
2017-01-11 20:27:30 +00:00
|
|
|
op(0xe3, EX_irr_rr, SP, HL)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0xe4, CALL_c_nn, PF == 0)
|
|
|
|
op(0xe5, PUSH_rr, HL)
|
|
|
|
op(0xe6, AND_a_n)
|
|
|
|
op(0xe7, RST_o, 4)
|
|
|
|
op(0xe8, RET_c, PF == 1)
|
|
|
|
op(0xe9, JP_rr, HL)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0xea, JP_c_nn, PF == 1)
|
2016-09-06 13:53:14 +00:00
|
|
|
op(0xeb, EX_rr_rr, DE, _HL)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0xec, CALL_c_nn, PF == 1)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
//op(0xed, ed:)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0xee, XOR_a_n)
|
|
|
|
op(0xef, RST_o, 5)
|
|
|
|
op(0xf0, RET_c, SF == 0)
|
|
|
|
op(0xf1, POP_rr, AF)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0xf2, JP_c_nn, SF == 0)
|
2016-08-19 14:11:26 +00:00
|
|
|
op(0xf3, DI)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0xf4, CALL_c_nn, SF == 0)
|
|
|
|
op(0xf5, PUSH_rr, AF)
|
|
|
|
op(0xf6, OR_a_n)
|
|
|
|
op(0xf7, RST_o, 6)
|
|
|
|
op(0xf8, RET_c, SF == 1)
|
|
|
|
op(0xf9, LD_sp_rr, HL)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0xfa, JP_c_nn, SF == 1)
|
|
|
|
op(0xfb, EI)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0xfc, CALL_c_nn, SF == 1)
|
|
|
|
//op(0xfd, iy:)
|
2016-09-06 00:09:33 +00:00
|
|
|
op(0xfe, CP_a_n)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0xff, RST_o, 7)
|
2016-08-19 14:11:26 +00:00
|
|
|
}
|
2016-08-27 04:48:21 +00:00
|
|
|
}
|
|
|
|
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
auto Z80::instructionCB(uint8 code) -> void {
|
|
|
|
switch(code) {
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x00, RLC_r, B)
|
|
|
|
op(0x01, RLC_r, C)
|
|
|
|
op(0x02, RLC_r, D)
|
|
|
|
op(0x03, RLC_r, E)
|
|
|
|
op(0x04, RLC_r, H)
|
|
|
|
op(0x05, RLC_r, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0x06, RLC_irr, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x07, RLC_r, A)
|
|
|
|
op(0x08, RRC_r, B)
|
|
|
|
op(0x09, RRC_r, C)
|
|
|
|
op(0x0a, RRC_r, D)
|
|
|
|
op(0x0b, RRC_r, E)
|
|
|
|
op(0x0c, RRC_r, H)
|
|
|
|
op(0x0d, RRC_r, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0x0e, RRC_irr, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x0f, RRC_r, A)
|
|
|
|
op(0x10, RL_r, B)
|
|
|
|
op(0x11, RL_r, C)
|
|
|
|
op(0x12, RL_r, D)
|
|
|
|
op(0x13, RL_r, E)
|
|
|
|
op(0x14, RL_r, H)
|
|
|
|
op(0x15, RL_r, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0x16, RL_irr, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x17, RL_r, A)
|
|
|
|
op(0x18, RR_r, B)
|
|
|
|
op(0x19, RR_r, C)
|
|
|
|
op(0x1a, RR_r, D)
|
|
|
|
op(0x1b, RR_r, E)
|
|
|
|
op(0x1c, RR_r, H)
|
|
|
|
op(0x1d, RR_r, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0x1e, RR_irr, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x1f, RR_r, A)
|
|
|
|
op(0x20, SLA_r, B)
|
|
|
|
op(0x21, SLA_r, C)
|
|
|
|
op(0x22, SLA_r, D)
|
|
|
|
op(0x23, SLA_r, E)
|
|
|
|
op(0x24, SLA_r, H)
|
|
|
|
op(0x25, SLA_r, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0x26, SLA_irr, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x27, SLA_r, A)
|
|
|
|
op(0x28, SRA_r, B)
|
|
|
|
op(0x29, SRA_r, C)
|
|
|
|
op(0x2a, SRA_r, D)
|
|
|
|
op(0x2b, SRA_r, E)
|
|
|
|
op(0x2c, SRA_r, H)
|
|
|
|
op(0x2d, SRA_r, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0x2e, SRA_irr, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x2f, SRA_r, A)
|
|
|
|
op(0x30, SLL_r, B)
|
|
|
|
op(0x31, SLL_r, C)
|
|
|
|
op(0x32, SLL_r, D)
|
|
|
|
op(0x33, SLL_r, E)
|
|
|
|
op(0x34, SLL_r, H)
|
|
|
|
op(0x35, SLL_r, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0x36, SLL_irr, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x37, SLL_r, A)
|
|
|
|
op(0x38, SRL_r, B)
|
|
|
|
op(0x39, SRL_r, C)
|
|
|
|
op(0x3a, SRL_r, D)
|
|
|
|
op(0x3b, SRL_r, E)
|
|
|
|
op(0x3c, SRL_r, H)
|
|
|
|
op(0x3d, SRL_r, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0x3e, SRL_irr, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x3f, SRL_r, A)
|
|
|
|
op(0x40, BIT_o_r, 0, B)
|
|
|
|
op(0x41, BIT_o_r, 0, C)
|
|
|
|
op(0x42, BIT_o_r, 0, D)
|
|
|
|
op(0x43, BIT_o_r, 0, E)
|
|
|
|
op(0x44, BIT_o_r, 0, H)
|
|
|
|
op(0x45, BIT_o_r, 0, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0x46, BIT_o_irr, 0, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x47, BIT_o_r, 0, A)
|
|
|
|
op(0x48, BIT_o_r, 1, B)
|
|
|
|
op(0x49, BIT_o_r, 1, C)
|
|
|
|
op(0x4a, BIT_o_r, 1, D)
|
|
|
|
op(0x4b, BIT_o_r, 1, E)
|
|
|
|
op(0x4c, BIT_o_r, 1, H)
|
|
|
|
op(0x4d, BIT_o_r, 1, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0x4e, BIT_o_irr, 1, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x4f, BIT_o_r, 1, A)
|
|
|
|
op(0x50, BIT_o_r, 2, B)
|
|
|
|
op(0x51, BIT_o_r, 2, C)
|
|
|
|
op(0x52, BIT_o_r, 2, D)
|
|
|
|
op(0x53, BIT_o_r, 2, E)
|
|
|
|
op(0x54, BIT_o_r, 2, H)
|
|
|
|
op(0x55, BIT_o_r, 2, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0x56, BIT_o_irr, 2, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x57, BIT_o_r, 2, A)
|
|
|
|
op(0x58, BIT_o_r, 3, B)
|
|
|
|
op(0x59, BIT_o_r, 3, C)
|
|
|
|
op(0x5a, BIT_o_r, 3, D)
|
|
|
|
op(0x5b, BIT_o_r, 3, E)
|
|
|
|
op(0x5c, BIT_o_r, 3, H)
|
|
|
|
op(0x5d, BIT_o_r, 3, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0x5e, BIT_o_irr, 3, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x5f, BIT_o_r, 3, A)
|
|
|
|
op(0x60, BIT_o_r, 4, B)
|
|
|
|
op(0x61, BIT_o_r, 4, C)
|
|
|
|
op(0x62, BIT_o_r, 4, D)
|
|
|
|
op(0x63, BIT_o_r, 4, E)
|
|
|
|
op(0x64, BIT_o_r, 4, H)
|
|
|
|
op(0x65, BIT_o_r, 4, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0x66, BIT_o_irr, 4, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x67, BIT_o_r, 4, A)
|
|
|
|
op(0x68, BIT_o_r, 5, B)
|
|
|
|
op(0x69, BIT_o_r, 5, C)
|
|
|
|
op(0x6a, BIT_o_r, 5, D)
|
|
|
|
op(0x6b, BIT_o_r, 5, E)
|
|
|
|
op(0x6c, BIT_o_r, 5, H)
|
|
|
|
op(0x6d, BIT_o_r, 5, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0x6e, BIT_o_irr, 5, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x6f, BIT_o_r, 5, A)
|
|
|
|
op(0x70, BIT_o_r, 6, B)
|
|
|
|
op(0x71, BIT_o_r, 6, C)
|
|
|
|
op(0x72, BIT_o_r, 6, D)
|
|
|
|
op(0x73, BIT_o_r, 6, E)
|
|
|
|
op(0x74, BIT_o_r, 6, H)
|
|
|
|
op(0x75, BIT_o_r, 6, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0x76, BIT_o_irr, 6, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x77, BIT_o_r, 6, A)
|
|
|
|
op(0x78, BIT_o_r, 7, B)
|
|
|
|
op(0x79, BIT_o_r, 7, C)
|
|
|
|
op(0x7a, BIT_o_r, 7, D)
|
|
|
|
op(0x7b, BIT_o_r, 7, E)
|
|
|
|
op(0x7c, BIT_o_r, 7, H)
|
|
|
|
op(0x7d, BIT_o_r, 7, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0x7e, BIT_o_irr, 7, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x7f, BIT_o_r, 7, A)
|
|
|
|
op(0x80, RES_o_r, 0, B)
|
|
|
|
op(0x81, RES_o_r, 0, C)
|
|
|
|
op(0x82, RES_o_r, 0, D)
|
|
|
|
op(0x83, RES_o_r, 0, E)
|
|
|
|
op(0x84, RES_o_r, 0, H)
|
|
|
|
op(0x85, RES_o_r, 0, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0x86, RES_o_irr, 0, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x87, RES_o_r, 0, A)
|
|
|
|
op(0x88, RES_o_r, 1, B)
|
|
|
|
op(0x89, RES_o_r, 1, C)
|
|
|
|
op(0x8a, RES_o_r, 1, D)
|
|
|
|
op(0x8b, RES_o_r, 1, E)
|
|
|
|
op(0x8c, RES_o_r, 1, H)
|
|
|
|
op(0x8d, RES_o_r, 1, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0x8e, RES_o_irr, 1, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x8f, RES_o_r, 1, A)
|
|
|
|
op(0x90, RES_o_r, 2, B)
|
|
|
|
op(0x91, RES_o_r, 2, C)
|
|
|
|
op(0x92, RES_o_r, 2, D)
|
|
|
|
op(0x93, RES_o_r, 2, E)
|
|
|
|
op(0x94, RES_o_r, 2, H)
|
|
|
|
op(0x95, RES_o_r, 2, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0x96, RES_o_irr, 2, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x97, RES_o_r, 2, A)
|
|
|
|
op(0x98, RES_o_r, 3, B)
|
|
|
|
op(0x99, RES_o_r, 3, C)
|
|
|
|
op(0x9a, RES_o_r, 3, D)
|
|
|
|
op(0x9b, RES_o_r, 3, E)
|
|
|
|
op(0x9c, RES_o_r, 3, H)
|
|
|
|
op(0x9d, RES_o_r, 3, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0x9e, RES_o_irr, 3, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0x9f, RES_o_r, 3, A)
|
|
|
|
op(0xa0, RES_o_r, 4, B)
|
|
|
|
op(0xa1, RES_o_r, 4, C)
|
|
|
|
op(0xa2, RES_o_r, 4, D)
|
|
|
|
op(0xa3, RES_o_r, 4, E)
|
|
|
|
op(0xa4, RES_o_r, 4, H)
|
|
|
|
op(0xa5, RES_o_r, 4, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0xa6, RES_o_irr, 4, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0xa7, RES_o_r, 4, A)
|
|
|
|
op(0xa8, RES_o_r, 5, B)
|
|
|
|
op(0xa9, RES_o_r, 5, C)
|
|
|
|
op(0xaa, RES_o_r, 5, D)
|
|
|
|
op(0xab, RES_o_r, 5, E)
|
|
|
|
op(0xac, RES_o_r, 5, H)
|
|
|
|
op(0xad, RES_o_r, 5, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0xae, RES_o_irr, 5, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0xaf, RES_o_r, 5, A)
|
|
|
|
op(0xb0, RES_o_r, 6, B)
|
|
|
|
op(0xb1, RES_o_r, 6, C)
|
|
|
|
op(0xb2, RES_o_r, 6, D)
|
|
|
|
op(0xb3, RES_o_r, 6, E)
|
|
|
|
op(0xb4, RES_o_r, 6, H)
|
|
|
|
op(0xb5, RES_o_r, 6, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0xb6, RES_o_irr, 6, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0xb7, RES_o_r, 6, A)
|
|
|
|
op(0xb8, RES_o_r, 7, B)
|
|
|
|
op(0xb9, RES_o_r, 7, C)
|
|
|
|
op(0xba, RES_o_r, 7, D)
|
|
|
|
op(0xbb, RES_o_r, 7, E)
|
|
|
|
op(0xbc, RES_o_r, 7, H)
|
|
|
|
op(0xbd, RES_o_r, 7, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0xbe, RES_o_irr, 7, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0xbf, RES_o_r, 7, A)
|
|
|
|
op(0xc0, SET_o_r, 0, B)
|
|
|
|
op(0xc1, SET_o_r, 0, C)
|
|
|
|
op(0xc2, SET_o_r, 0, D)
|
|
|
|
op(0xc3, SET_o_r, 0, E)
|
|
|
|
op(0xc4, SET_o_r, 0, H)
|
|
|
|
op(0xc5, SET_o_r, 0, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0xc6, SET_o_irr, 0, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0xc7, SET_o_r, 0, A)
|
|
|
|
op(0xc8, SET_o_r, 1, B)
|
|
|
|
op(0xc9, SET_o_r, 1, C)
|
|
|
|
op(0xca, SET_o_r, 1, D)
|
|
|
|
op(0xcb, SET_o_r, 1, E)
|
|
|
|
op(0xcc, SET_o_r, 1, H)
|
|
|
|
op(0xcd, SET_o_r, 1, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0xce, SET_o_irr, 1, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0xcf, SET_o_r, 1, A)
|
|
|
|
op(0xd0, SET_o_r, 2, B)
|
|
|
|
op(0xd1, SET_o_r, 2, C)
|
|
|
|
op(0xd2, SET_o_r, 2, D)
|
|
|
|
op(0xd3, SET_o_r, 2, E)
|
|
|
|
op(0xd4, SET_o_r, 2, H)
|
|
|
|
op(0xd5, SET_o_r, 2, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0xd6, SET_o_irr, 2, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0xd7, SET_o_r, 2, A)
|
|
|
|
op(0xd8, SET_o_r, 3, B)
|
|
|
|
op(0xd9, SET_o_r, 3, C)
|
|
|
|
op(0xda, SET_o_r, 3, D)
|
|
|
|
op(0xdb, SET_o_r, 3, E)
|
|
|
|
op(0xdc, SET_o_r, 3, H)
|
|
|
|
op(0xdd, SET_o_r, 3, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0xde, SET_o_irr, 3, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0xdf, SET_o_r, 3, A)
|
|
|
|
op(0xe0, SET_o_r, 4, B)
|
|
|
|
op(0xe1, SET_o_r, 4, C)
|
|
|
|
op(0xe2, SET_o_r, 4, D)
|
|
|
|
op(0xe3, SET_o_r, 4, E)
|
|
|
|
op(0xe4, SET_o_r, 4, H)
|
|
|
|
op(0xe5, SET_o_r, 4, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0xe6, SET_o_irr, 4, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0xe7, SET_o_r, 4, A)
|
|
|
|
op(0xe8, SET_o_r, 5, B)
|
|
|
|
op(0xe9, SET_o_r, 5, C)
|
|
|
|
op(0xea, SET_o_r, 5, D)
|
|
|
|
op(0xeb, SET_o_r, 5, E)
|
|
|
|
op(0xec, SET_o_r, 5, H)
|
|
|
|
op(0xed, SET_o_r, 5, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0xee, SET_o_irr, 5, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0xef, SET_o_r, 5, A)
|
|
|
|
op(0xf0, SET_o_r, 6, B)
|
|
|
|
op(0xf1, SET_o_r, 6, C)
|
|
|
|
op(0xf2, SET_o_r, 6, D)
|
|
|
|
op(0xf3, SET_o_r, 6, E)
|
|
|
|
op(0xf4, SET_o_r, 6, H)
|
|
|
|
op(0xf5, SET_o_r, 6, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0xf6, SET_o_irr, 6, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0xf7, SET_o_r, 6, A)
|
|
|
|
op(0xf8, SET_o_r, 7, B)
|
|
|
|
op(0xf9, SET_o_r, 7, C)
|
|
|
|
op(0xfa, SET_o_r, 7, D)
|
|
|
|
op(0xfb, SET_o_r, 7, E)
|
|
|
|
op(0xfc, SET_o_r, 7, H)
|
|
|
|
op(0xfd, SET_o_r, 7, L)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
op(0xfe, SET_o_irr, 7, _HL)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0xff, SET_o_r, 7, A)
|
2016-08-27 04:48:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
auto Z80::instructionCBd(uint16 addr, uint8 code) -> void {
|
|
|
|
uint8 _;
|
|
|
|
|
|
|
|
switch(code) {
|
|
|
|
op(0x00, RLC_irr_r, addr, B)
|
|
|
|
op(0x01, RLC_irr_r, addr, C)
|
|
|
|
op(0x02, RLC_irr_r, addr, D)
|
|
|
|
op(0x03, RLC_irr_r, addr, E)
|
|
|
|
op(0x04, RLC_irr_r, addr, H)
|
|
|
|
op(0x05, RLC_irr_r, addr, L)
|
|
|
|
op(0x06, RLC_irr_r, addr, _)
|
|
|
|
op(0x07, RLC_irr_r, addr, A)
|
|
|
|
op(0x08, RRC_irr_r, addr, B)
|
|
|
|
op(0x09, RRC_irr_r, addr, C)
|
|
|
|
op(0x0a, RRC_irr_r, addr, D)
|
|
|
|
op(0x0b, RRC_irr_r, addr, E)
|
|
|
|
op(0x0c, RRC_irr_r, addr, H)
|
|
|
|
op(0x0d, RRC_irr_r, addr, L)
|
|
|
|
op(0x0e, RRC_irr_r, addr, _)
|
|
|
|
op(0x0f, RRC_irr_r, addr, A)
|
Update to v101r28 release.
byuu says:
Changelog:
- SMS: emulated the remaining 240 instructions in the (0xfd, 0xdd)
0xcb (displacement) (opcode) set
- 1/8th of these were "legal" instructions, and apparently games
use them a lot
- SMS: emulated the standard gamepad controllers
- reset button not emulated yet
The reset button is tricky. In every other case, reset is a hardware
thing that instantly reboots the entire machine.
But on the SMS, it's more like a gamepad button that's attached to the
front of the device. When you press it, it fires off a reset vector
interrupt and the gamepad polling routine lets you query the status of
the button.
Just having a reset option in the "Master System" hardware menu is not
sufficient to fully emulate the behavior. Even more annoying is that the
Game Gear doesn't have such a button, yet the core information structs
aren't flexible enough for the Master System to have it, and the Game
Gear to not have it, in the main menu. But that doesn't matter anyway,
since it won't work having it in the menu for the Master System.
So as a result, I'm going to have to have a new "input device" called
"Hardware" that has the "Reset" button listed under there. And for the
sake of consistency, I'm not sure if we should treat the other systems
the same way or not :/
2017-01-08 20:55:02 +00:00
|
|
|
op(0x10, RL_irr_r, addr, B)
|
|
|
|
op(0x11, RL_irr_r, addr, C)
|
|
|
|
op(0x12, RL_irr_r, addr, D)
|
|
|
|
op(0x13, RL_irr_r, addr, E)
|
|
|
|
op(0x14, RL_irr_r, addr, H)
|
|
|
|
op(0x15, RL_irr_r, addr, L)
|
|
|
|
op(0x16, RL_irr_r, addr, _)
|
|
|
|
op(0x17, RL_irr_r, addr, A)
|
|
|
|
op(0x18, RR_irr_r, addr, B)
|
|
|
|
op(0x19, RR_irr_r, addr, C)
|
|
|
|
op(0x1a, RR_irr_r, addr, D)
|
|
|
|
op(0x1b, RR_irr_r, addr, E)
|
|
|
|
op(0x1c, RR_irr_r, addr, H)
|
|
|
|
op(0x1d, RR_irr_r, addr, L)
|
|
|
|
op(0x1e, RR_irr_r, addr, _)
|
|
|
|
op(0x1f, RR_irr_r, addr, A)
|
|
|
|
op(0x20, SLA_irr_r, addr, B)
|
|
|
|
op(0x21, SLA_irr_r, addr, C)
|
|
|
|
op(0x22, SLA_irr_r, addr, D)
|
|
|
|
op(0x23, SLA_irr_r, addr, E)
|
|
|
|
op(0x24, SLA_irr_r, addr, H)
|
|
|
|
op(0x25, SLA_irr_r, addr, L)
|
|
|
|
op(0x26, SLA_irr_r, addr, _)
|
|
|
|
op(0x27, SLA_irr_r, addr, A)
|
|
|
|
op(0x28, SRA_irr_r, addr, B)
|
|
|
|
op(0x29, SRA_irr_r, addr, C)
|
|
|
|
op(0x2a, SRA_irr_r, addr, D)
|
|
|
|
op(0x2b, SRA_irr_r, addr, E)
|
|
|
|
op(0x2c, SRA_irr_r, addr, H)
|
|
|
|
op(0x2d, SRA_irr_r, addr, L)
|
|
|
|
op(0x2e, SRA_irr_r, addr, _)
|
|
|
|
op(0x2f, SRA_irr_r, addr, A)
|
|
|
|
op(0x30, SLL_irr_r, addr, B)
|
|
|
|
op(0x31, SLL_irr_r, addr, C)
|
|
|
|
op(0x32, SLL_irr_r, addr, D)
|
|
|
|
op(0x33, SLL_irr_r, addr, E)
|
|
|
|
op(0x34, SLL_irr_r, addr, H)
|
|
|
|
op(0x35, SLL_irr_r, addr, L)
|
|
|
|
op(0x36, SLL_irr_r, addr, _)
|
|
|
|
op(0x37, SLL_irr_r, addr, A)
|
|
|
|
op(0x38, SRL_irr_r, addr, B)
|
|
|
|
op(0x39, SRL_irr_r, addr, C)
|
|
|
|
op(0x3a, SRL_irr_r, addr, D)
|
|
|
|
op(0x3b, SRL_irr_r, addr, E)
|
|
|
|
op(0x3c, SRL_irr_r, addr, H)
|
|
|
|
op(0x3d, SRL_irr_r, addr, L)
|
|
|
|
op(0x3e, SRL_irr_r, addr, _)
|
|
|
|
op(0x3f, SRL_irr_r, addr, A)
|
|
|
|
op(0x40, BIT_o_irr_r, 0, addr, B)
|
|
|
|
op(0x41, BIT_o_irr_r, 0, addr, C)
|
|
|
|
op(0x42, BIT_o_irr_r, 0, addr, D)
|
|
|
|
op(0x43, BIT_o_irr_r, 0, addr, E)
|
|
|
|
op(0x44, BIT_o_irr_r, 0, addr, H)
|
|
|
|
op(0x45, BIT_o_irr_r, 0, addr, L)
|
|
|
|
op(0x46, BIT_o_irr_r, 0, addr, _)
|
|
|
|
op(0x47, BIT_o_irr_r, 0, addr, A)
|
|
|
|
op(0x48, BIT_o_irr_r, 1, addr, B)
|
|
|
|
op(0x49, BIT_o_irr_r, 1, addr, C)
|
|
|
|
op(0x4a, BIT_o_irr_r, 1, addr, D)
|
|
|
|
op(0x4b, BIT_o_irr_r, 1, addr, E)
|
|
|
|
op(0x4c, BIT_o_irr_r, 1, addr, H)
|
|
|
|
op(0x4d, BIT_o_irr_r, 1, addr, L)
|
|
|
|
op(0x4e, BIT_o_irr_r, 1, addr, _)
|
|
|
|
op(0x4f, BIT_o_irr_r, 1, addr, A)
|
|
|
|
op(0x50, BIT_o_irr_r, 2, addr, B)
|
|
|
|
op(0x51, BIT_o_irr_r, 2, addr, C)
|
|
|
|
op(0x52, BIT_o_irr_r, 2, addr, D)
|
|
|
|
op(0x53, BIT_o_irr_r, 2, addr, E)
|
|
|
|
op(0x54, BIT_o_irr_r, 2, addr, H)
|
|
|
|
op(0x55, BIT_o_irr_r, 2, addr, L)
|
|
|
|
op(0x56, BIT_o_irr_r, 2, addr, _)
|
|
|
|
op(0x57, BIT_o_irr_r, 2, addr, A)
|
|
|
|
op(0x58, BIT_o_irr_r, 3, addr, B)
|
|
|
|
op(0x59, BIT_o_irr_r, 3, addr, C)
|
|
|
|
op(0x5a, BIT_o_irr_r, 3, addr, D)
|
|
|
|
op(0x5b, BIT_o_irr_r, 3, addr, E)
|
|
|
|
op(0x5c, BIT_o_irr_r, 3, addr, H)
|
|
|
|
op(0x5d, BIT_o_irr_r, 3, addr, L)
|
|
|
|
op(0x5e, BIT_o_irr_r, 3, addr, _)
|
|
|
|
op(0x5f, BIT_o_irr_r, 3, addr, A)
|
|
|
|
op(0x60, BIT_o_irr_r, 4, addr, B)
|
|
|
|
op(0x61, BIT_o_irr_r, 4, addr, C)
|
|
|
|
op(0x62, BIT_o_irr_r, 4, addr, D)
|
|
|
|
op(0x63, BIT_o_irr_r, 4, addr, E)
|
|
|
|
op(0x64, BIT_o_irr_r, 4, addr, H)
|
|
|
|
op(0x65, BIT_o_irr_r, 4, addr, L)
|
|
|
|
op(0x66, BIT_o_irr_r, 4, addr, _)
|
|
|
|
op(0x67, BIT_o_irr_r, 4, addr, A)
|
|
|
|
op(0x68, BIT_o_irr_r, 5, addr, B)
|
|
|
|
op(0x69, BIT_o_irr_r, 5, addr, C)
|
|
|
|
op(0x6a, BIT_o_irr_r, 5, addr, D)
|
|
|
|
op(0x6b, BIT_o_irr_r, 5, addr, E)
|
|
|
|
op(0x6c, BIT_o_irr_r, 5, addr, H)
|
|
|
|
op(0x6d, BIT_o_irr_r, 5, addr, L)
|
|
|
|
op(0x6e, BIT_o_irr_r, 5, addr, _)
|
|
|
|
op(0x6f, BIT_o_irr_r, 5, addr, A)
|
|
|
|
op(0x70, BIT_o_irr_r, 6, addr, B)
|
|
|
|
op(0x71, BIT_o_irr_r, 6, addr, C)
|
|
|
|
op(0x72, BIT_o_irr_r, 6, addr, D)
|
|
|
|
op(0x73, BIT_o_irr_r, 6, addr, E)
|
|
|
|
op(0x74, BIT_o_irr_r, 6, addr, H)
|
|
|
|
op(0x75, BIT_o_irr_r, 6, addr, L)
|
|
|
|
op(0x76, BIT_o_irr_r, 6, addr, _)
|
|
|
|
op(0x77, BIT_o_irr_r, 6, addr, A)
|
|
|
|
op(0x78, BIT_o_irr_r, 7, addr, B)
|
|
|
|
op(0x79, BIT_o_irr_r, 7, addr, C)
|
|
|
|
op(0x7a, BIT_o_irr_r, 7, addr, D)
|
|
|
|
op(0x7b, BIT_o_irr_r, 7, addr, E)
|
|
|
|
op(0x7c, BIT_o_irr_r, 7, addr, H)
|
|
|
|
op(0x7d, BIT_o_irr_r, 7, addr, L)
|
|
|
|
op(0x7e, BIT_o_irr_r, 7, addr, _)
|
|
|
|
op(0x7f, BIT_o_irr_r, 7, addr, A)
|
|
|
|
op(0x80, RES_o_irr_r, 0, addr, B)
|
|
|
|
op(0x81, RES_o_irr_r, 0, addr, C)
|
|
|
|
op(0x82, RES_o_irr_r, 0, addr, D)
|
|
|
|
op(0x83, RES_o_irr_r, 0, addr, E)
|
|
|
|
op(0x84, RES_o_irr_r, 0, addr, H)
|
|
|
|
op(0x85, RES_o_irr_r, 0, addr, L)
|
|
|
|
op(0x86, RES_o_irr_r, 0, addr, _)
|
|
|
|
op(0x87, RES_o_irr_r, 0, addr, A)
|
|
|
|
op(0x88, RES_o_irr_r, 1, addr, B)
|
|
|
|
op(0x89, RES_o_irr_r, 1, addr, C)
|
|
|
|
op(0x8a, RES_o_irr_r, 1, addr, D)
|
|
|
|
op(0x8b, RES_o_irr_r, 1, addr, E)
|
|
|
|
op(0x8c, RES_o_irr_r, 1, addr, H)
|
|
|
|
op(0x8d, RES_o_irr_r, 1, addr, L)
|
|
|
|
op(0x8e, RES_o_irr_r, 1, addr, _)
|
|
|
|
op(0x8f, RES_o_irr_r, 1, addr, A)
|
|
|
|
op(0x90, RES_o_irr_r, 2, addr, B)
|
|
|
|
op(0x91, RES_o_irr_r, 2, addr, C)
|
|
|
|
op(0x92, RES_o_irr_r, 2, addr, D)
|
|
|
|
op(0x93, RES_o_irr_r, 2, addr, E)
|
|
|
|
op(0x94, RES_o_irr_r, 2, addr, H)
|
|
|
|
op(0x95, RES_o_irr_r, 2, addr, L)
|
|
|
|
op(0x96, RES_o_irr_r, 2, addr, _)
|
|
|
|
op(0x97, RES_o_irr_r, 2, addr, A)
|
|
|
|
op(0x98, RES_o_irr_r, 3, addr, B)
|
|
|
|
op(0x99, RES_o_irr_r, 3, addr, C)
|
|
|
|
op(0x9a, RES_o_irr_r, 3, addr, D)
|
|
|
|
op(0x9b, RES_o_irr_r, 3, addr, E)
|
|
|
|
op(0x9c, RES_o_irr_r, 3, addr, H)
|
|
|
|
op(0x9d, RES_o_irr_r, 3, addr, L)
|
|
|
|
op(0x9e, RES_o_irr_r, 3, addr, _)
|
|
|
|
op(0x9f, RES_o_irr_r, 3, addr, A)
|
|
|
|
op(0xa0, RES_o_irr_r, 4, addr, B)
|
|
|
|
op(0xa1, RES_o_irr_r, 4, addr, C)
|
|
|
|
op(0xa2, RES_o_irr_r, 4, addr, D)
|
|
|
|
op(0xa3, RES_o_irr_r, 4, addr, E)
|
|
|
|
op(0xa4, RES_o_irr_r, 4, addr, H)
|
|
|
|
op(0xa5, RES_o_irr_r, 4, addr, L)
|
|
|
|
op(0xa6, RES_o_irr_r, 4, addr, _)
|
|
|
|
op(0xa7, RES_o_irr_r, 4, addr, A)
|
|
|
|
op(0xa8, RES_o_irr_r, 5, addr, B)
|
|
|
|
op(0xa9, RES_o_irr_r, 5, addr, C)
|
|
|
|
op(0xaa, RES_o_irr_r, 5, addr, D)
|
|
|
|
op(0xab, RES_o_irr_r, 5, addr, E)
|
|
|
|
op(0xac, RES_o_irr_r, 5, addr, H)
|
|
|
|
op(0xad, RES_o_irr_r, 5, addr, L)
|
|
|
|
op(0xae, RES_o_irr_r, 5, addr, _)
|
|
|
|
op(0xaf, RES_o_irr_r, 5, addr, A)
|
|
|
|
op(0xb0, RES_o_irr_r, 6, addr, B)
|
|
|
|
op(0xb1, RES_o_irr_r, 6, addr, C)
|
|
|
|
op(0xb2, RES_o_irr_r, 6, addr, D)
|
|
|
|
op(0xb3, RES_o_irr_r, 6, addr, E)
|
|
|
|
op(0xb4, RES_o_irr_r, 6, addr, H)
|
|
|
|
op(0xb5, RES_o_irr_r, 6, addr, L)
|
|
|
|
op(0xb6, RES_o_irr_r, 6, addr, _)
|
|
|
|
op(0xb7, RES_o_irr_r, 6, addr, A)
|
|
|
|
op(0xb8, RES_o_irr_r, 7, addr, B)
|
|
|
|
op(0xb9, RES_o_irr_r, 7, addr, C)
|
|
|
|
op(0xba, RES_o_irr_r, 7, addr, D)
|
|
|
|
op(0xbb, RES_o_irr_r, 7, addr, E)
|
|
|
|
op(0xbc, RES_o_irr_r, 7, addr, H)
|
|
|
|
op(0xbd, RES_o_irr_r, 7, addr, L)
|
|
|
|
op(0xbe, RES_o_irr_r, 7, addr, _)
|
|
|
|
op(0xbf, RES_o_irr_r, 7, addr, A)
|
|
|
|
op(0xc0, SET_o_irr_r, 0, addr, B)
|
|
|
|
op(0xc1, SET_o_irr_r, 0, addr, C)
|
|
|
|
op(0xc2, SET_o_irr_r, 0, addr, D)
|
|
|
|
op(0xc3, SET_o_irr_r, 0, addr, E)
|
|
|
|
op(0xc4, SET_o_irr_r, 0, addr, H)
|
|
|
|
op(0xc5, SET_o_irr_r, 0, addr, L)
|
|
|
|
op(0xc6, SET_o_irr_r, 0, addr, _)
|
|
|
|
op(0xc7, SET_o_irr_r, 0, addr, A)
|
|
|
|
op(0xc8, SET_o_irr_r, 1, addr, B)
|
|
|
|
op(0xc9, SET_o_irr_r, 1, addr, C)
|
|
|
|
op(0xca, SET_o_irr_r, 1, addr, D)
|
|
|
|
op(0xcb, SET_o_irr_r, 1, addr, E)
|
|
|
|
op(0xcc, SET_o_irr_r, 1, addr, H)
|
|
|
|
op(0xcd, SET_o_irr_r, 1, addr, L)
|
|
|
|
op(0xce, SET_o_irr_r, 1, addr, _)
|
|
|
|
op(0xcf, SET_o_irr_r, 1, addr, A)
|
|
|
|
op(0xd0, SET_o_irr_r, 2, addr, B)
|
|
|
|
op(0xd1, SET_o_irr_r, 2, addr, C)
|
|
|
|
op(0xd2, SET_o_irr_r, 2, addr, D)
|
|
|
|
op(0xd3, SET_o_irr_r, 2, addr, E)
|
|
|
|
op(0xd4, SET_o_irr_r, 2, addr, H)
|
|
|
|
op(0xd5, SET_o_irr_r, 2, addr, L)
|
|
|
|
op(0xd6, SET_o_irr_r, 2, addr, _)
|
|
|
|
op(0xd7, SET_o_irr_r, 2, addr, A)
|
|
|
|
op(0xd8, SET_o_irr_r, 3, addr, B)
|
|
|
|
op(0xd9, SET_o_irr_r, 3, addr, C)
|
|
|
|
op(0xda, SET_o_irr_r, 3, addr, D)
|
|
|
|
op(0xdb, SET_o_irr_r, 3, addr, E)
|
|
|
|
op(0xdc, SET_o_irr_r, 3, addr, H)
|
|
|
|
op(0xdd, SET_o_irr_r, 3, addr, L)
|
|
|
|
op(0xde, SET_o_irr_r, 3, addr, _)
|
|
|
|
op(0xdf, SET_o_irr_r, 3, addr, A)
|
|
|
|
op(0xe0, SET_o_irr_r, 4, addr, B)
|
|
|
|
op(0xe1, SET_o_irr_r, 4, addr, C)
|
|
|
|
op(0xe2, SET_o_irr_r, 4, addr, D)
|
|
|
|
op(0xe3, SET_o_irr_r, 4, addr, E)
|
|
|
|
op(0xe4, SET_o_irr_r, 4, addr, H)
|
|
|
|
op(0xe5, SET_o_irr_r, 4, addr, L)
|
|
|
|
op(0xe6, SET_o_irr_r, 4, addr, _)
|
|
|
|
op(0xe7, SET_o_irr_r, 4, addr, A)
|
|
|
|
op(0xe8, SET_o_irr_r, 5, addr, B)
|
|
|
|
op(0xe9, SET_o_irr_r, 5, addr, C)
|
|
|
|
op(0xea, SET_o_irr_r, 5, addr, D)
|
|
|
|
op(0xeb, SET_o_irr_r, 5, addr, E)
|
|
|
|
op(0xec, SET_o_irr_r, 5, addr, H)
|
|
|
|
op(0xed, SET_o_irr_r, 5, addr, L)
|
|
|
|
op(0xee, SET_o_irr_r, 5, addr, _)
|
|
|
|
op(0xef, SET_o_irr_r, 5, addr, A)
|
|
|
|
op(0xf0, SET_o_irr_r, 6, addr, B)
|
|
|
|
op(0xf1, SET_o_irr_r, 6, addr, C)
|
|
|
|
op(0xf2, SET_o_irr_r, 6, addr, D)
|
|
|
|
op(0xf3, SET_o_irr_r, 6, addr, E)
|
|
|
|
op(0xf4, SET_o_irr_r, 6, addr, H)
|
|
|
|
op(0xf5, SET_o_irr_r, 6, addr, L)
|
|
|
|
op(0xf6, SET_o_irr_r, 6, addr, _)
|
|
|
|
op(0xf7, SET_o_irr_r, 6, addr, A)
|
|
|
|
op(0xf8, SET_o_irr_r, 7, addr, B)
|
|
|
|
op(0xf9, SET_o_irr_r, 7, addr, C)
|
|
|
|
op(0xfa, SET_o_irr_r, 7, addr, D)
|
|
|
|
op(0xfb, SET_o_irr_r, 7, addr, E)
|
|
|
|
op(0xfc, SET_o_irr_r, 7, addr, H)
|
|
|
|
op(0xfd, SET_o_irr_r, 7, addr, L)
|
|
|
|
op(0xfe, SET_o_irr_r, 7, addr, _)
|
|
|
|
op(0xff, SET_o_irr_r, 7, addr, A)
|
Update to v101r27 release.
byuu says:
Changelog:
- SMS: emulated the generic Sega memory mapper (none of the more
limited forms of it yet)
- (missing ROM shift, ROM write enable emulation -- no commercial
games use either, though)
- SMS: bus I/O returns 0xff instead of 0x00 so games don't think every
key is being pressed at once
- (this is a hack until I implement proper controller pad reading)
- SMS: very limited protection against reading/writing past the end of
ROM/RAM (todo: should mirror)
- SMS: VDP background HSCROLL subtracts, rather than adds, to the
offset (unlike VSCROLL)
- SMS: VDP VSCROLL is 9-bit, modulates voffset+vscroll to 224 in
192-line mode (32x28 tilemap)
- SMS: VDP tiledata for backgrounds and sprites use `7-(x&7)` rather
than `(x&7)`
- SMS: fix output color to be 6-bit rather than 5-bit
- SMS: left clip uses register `#7`, not palette color `#7`
- (todo: do we want `color[reg7]` or `color[16 + reg7]`?)
- SMS: refined handling of 0xcb, 0xed prefixes in the Z80 core and its
disassembler
- SMS: emulated (0xfd, 0xdd) 0xcb opcodes 0x00-0x0f (still missing
0x10-0xff)
- SMS: fixed 0xcb 0b-----110 opcodes to use direct HL and never allow
(IX,IY)+d
- SMS: fixed major logic bug in (IX,IY)+d displacement
- (was using `read(x)` instead of `operand()` for the displacement
byte fetch before)
- icarus: fake there always being 32KiB of RAM in all SMS cartridges
for the time being
- (not sure how to detect this stuff yet; although I've read it's
not even really possible `>_>`)
TODO: remove processor/z80/dissassembler.cpp code block at line 396 (as it's unnecessary.)
Lots of commercial games are starting to show trashed graphical output now.
2017-01-06 08:11:38 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
auto Z80::instructionED(uint8 code) -> void {
|
|
|
|
switch(code) {
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0x40, IN_r_ic, B)
|
|
|
|
op(0x41, OUT_ic_r, B)
|
2016-11-01 11:42:25 +00:00
|
|
|
op(0x42, SBC_hl_rr, BC)
|
|
|
|
op(0x43, LD_inn_rr, BC)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0x44, NEG)
|
|
|
|
op(0x45, RETN)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0x46, IM_o, 0)
|
2016-11-01 11:42:25 +00:00
|
|
|
op(0x47, LD_r_r1, I, A)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0x48, IN_r_ic, C)
|
|
|
|
op(0x49, OUT_ic_r, C)
|
2016-11-01 11:42:25 +00:00
|
|
|
op(0x4a, ADC_hl_rr, BC)
|
|
|
|
op(0x4b, LD_rr_inn, BC)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0x4c, NEG)
|
|
|
|
op(0x4d, RETI)
|
|
|
|
op(0x4e, IM_o, 0)
|
2016-11-01 11:42:25 +00:00
|
|
|
op(0x4f, LD_r_r1, R, A)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0x50, IN_r_ic, D)
|
|
|
|
op(0x51, OUT_ic_r, D)
|
2016-11-01 11:42:25 +00:00
|
|
|
op(0x52, SBC_hl_rr, DE)
|
|
|
|
op(0x53, LD_inn_rr, DE)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0x54, NEG)
|
|
|
|
op(0x55, RETN)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0x56, IM_o, 1)
|
2016-11-01 11:42:25 +00:00
|
|
|
op(0x57, LD_r_r1, A, I)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0x58, IN_r_ic, E)
|
|
|
|
op(0x59, OUT_ic_r, E)
|
2016-11-01 11:42:25 +00:00
|
|
|
op(0x5a, ADC_hl_rr, DE)
|
|
|
|
op(0x5b, LD_rr_inn, DE)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0x5c, NEG)
|
|
|
|
op(0x5d, RETI)
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
op(0x5e, IM_o, 2)
|
2016-11-01 11:42:25 +00:00
|
|
|
op(0x5f, LD_r_r1, A, R)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0x60, IN_r_ic, H)
|
|
|
|
op(0x61, OUT_ic_r, H)
|
2016-11-01 11:42:25 +00:00
|
|
|
op(0x62, SBC_hl_rr, HL)
|
|
|
|
op(0x63, LD_inn_rr, HL)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0x64, NEG)
|
|
|
|
op(0x65, RETN)
|
|
|
|
op(0x66, IM_o, 0)
|
2016-11-01 11:42:25 +00:00
|
|
|
op(0x67, RRD)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0x68, IN_r_ic, L)
|
|
|
|
op(0x69, OUT_ic_r, L)
|
2016-11-01 11:42:25 +00:00
|
|
|
op(0x6a, ADC_hl_rr, HL)
|
|
|
|
op(0x6b, LD_rr_inn, HL)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0x6c, NEG)
|
|
|
|
op(0x6d, RETI)
|
|
|
|
op(0x6e, IM_o, 0)
|
2016-11-01 11:42:25 +00:00
|
|
|
op(0x6f, RLD)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0x70, IN_r_ic, F)
|
|
|
|
op(0x71, OUT_ic_r, F)
|
2016-11-01 11:42:25 +00:00
|
|
|
op(0x72, SBC_hl_rr, SP)
|
|
|
|
op(0x73, LD_inn_rr, SP)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0x74, NEG)
|
|
|
|
op(0x75, RETN)
|
|
|
|
op(0x76, IM_o, 1)
|
2016-11-01 11:42:25 +00:00
|
|
|
op(0x77, NOP)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0x78, IN_r_ic, A)
|
|
|
|
op(0x79, OUT_ic_r, A)
|
2016-11-01 11:42:25 +00:00
|
|
|
op(0x7a, ADC_hl_rr, SP)
|
|
|
|
op(0x7b, LD_rr_inn, SP)
|
2016-10-31 21:10:33 +00:00
|
|
|
op(0x7c, NEG)
|
|
|
|
op(0x7d, RETI)
|
|
|
|
op(0x7e, IM_o, 2)
|
2016-11-01 11:42:25 +00:00
|
|
|
op(0x7f, NOP)
|
2016-10-29 00:33:30 +00:00
|
|
|
op(0xa0, LDI)
|
|
|
|
op(0xa1, CPI)
|
|
|
|
op(0xa2, INI)
|
|
|
|
op(0xa3, OUTI)
|
|
|
|
op(0xa8, LDD)
|
|
|
|
op(0xa9, CPD)
|
|
|
|
op(0xaa, IND)
|
|
|
|
op(0xab, OUTD)
|
|
|
|
op(0xb0, LDIR)
|
|
|
|
op(0xb1, CPIR)
|
|
|
|
op(0xb2, INIR)
|
|
|
|
op(0xb3, OTIR)
|
|
|
|
op(0xb8, LDDR)
|
|
|
|
op(0xb9, CPDR)
|
|
|
|
op(0xba, INDR)
|
|
|
|
op(0xbb, OTDR)
|
2016-08-27 04:48:21 +00:00
|
|
|
}
|
Update to v101r14 release.
byuu says:
Changelog:
- rewrote the Z80 core to properly handle 0xDD (IX0 and 0xFD (IY)
prefixes
- added Processor::Z80::Bus as a new type of abstraction
- all of the instructions implemented have their proper T-cycle counts
now
- added nall/certificates for my public keys
The goal of `Processor::Z80::Bus` is to simulate the opcode fetches being
2-read + 2-wait states; operand+regular reads/writes being 3-read. For
now, this puts the cycle counts inside the CPU core. At the moment, I
can't think of any CPU core where this wouldn't be appropriate. But it's
certainly possible that such a case exists. So this may not be the
perfect solution.
The reason for having it be a subclass of Processor::Z80 instead of
virtual functions for the MasterSystem::CPU core to define is due to
naming conflicts. I wanted the core to say `in(addr)` and have it take
the four clocks. But I also wanted a version of the function that didn't
consume time when called. One way to do that would be for the core to
call `Z80::in(addr)`, which then calls the regular `in(addr)` that goes to
`MasterSystem::CPU::in(addr)`. But I don't want to put the `Z80::`
prefix on all of the opcodes. Very easy to forget it, and then end up not
consuming any time. Another is to use uglier names in the
`MasterSystem::CPU` core, like `read_`, `write_`, `in_`, `out_`, etc. But,
yuck.
So ... yeah, this is an experiment. We'll see how it goes.
2016-09-03 11:26:04 +00:00
|
|
|
|
2016-11-01 11:42:25 +00:00
|
|
|
//undefined instructions are NOP
|
2016-08-19 14:11:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#undef op
|