2015-11-16 08:38:05 +00:00
|
|
|
auto PPU::read(uint32 addr) -> uint8 {
|
2016-02-25 10:38:03 +00:00
|
|
|
auto bgcnt = [&]() -> Registers::Background::Control& { return regs.bg[addr.bits(1,2)].control; };
|
|
|
|
auto wf = [&]() -> Registers::WindowFlags& {
|
|
|
|
static uint id[] = {In0, In1, Out, Obj};
|
|
|
|
return regs.windowflags[id[addr.bits(0,1)]];
|
|
|
|
};
|
|
|
|
|
2012-04-01 01:41:15 +00:00
|
|
|
switch(addr) {
|
2012-03-31 08:14:31 +00:00
|
|
|
|
2012-03-31 08:17:36 +00:00
|
|
|
//DISPCNT
|
2016-02-25 10:38:03 +00:00
|
|
|
case 0x0400'0000: return (
|
|
|
|
regs.control.bgmode << 0
|
|
|
|
| regs.control.cgbmode << 3
|
|
|
|
| regs.control.frame << 4
|
|
|
|
| regs.control.hblank << 5
|
|
|
|
| regs.control.objmapping << 6
|
|
|
|
| regs.control.forceblank << 7
|
|
|
|
);
|
|
|
|
case 0x0400'0001: return (
|
|
|
|
regs.control.enable[BG0] << 0
|
|
|
|
| regs.control.enable[BG1] << 1
|
|
|
|
| regs.control.enable[BG2] << 2
|
|
|
|
| regs.control.enable[BG3] << 3
|
|
|
|
| regs.control.enable[OBJ] << 4
|
|
|
|
| regs.control.enablewindow[In0] << 5
|
|
|
|
| regs.control.enablewindow[In1] << 6
|
|
|
|
| regs.control.enablewindow[Obj] << 7
|
|
|
|
);
|
2012-03-31 08:17:36 +00:00
|
|
|
|
|
|
|
//GRSWP
|
Update to v097r17 release.
byuu says:
Changelog:
- ruby: if DirectSoundCreate fails (no sound device present), return
false from init instead of crashing
- nall: improved edge case return values for
(basename,pathname,dirname,...)
- nall: renamed file_system_object class to inode
- nall: varuint_t replaced with VariadicNatural; which contains
.bit,.bits,.byte ala Natural/Integer
- nall: fixed boolean compilation error on Windows
- WS: popa should not restore SP
- GBA: rewrote the CPU/APU cores to use the .bit,.bits functions;
removed registers.cpp from each
Note that the GBA changes are extremely major. This is about five hours
worth of extremely delicate work. Any slight errors could break
emulation in extremely bad ways. Let's hold off on extensive testing
until the next WIP, after I do the same to the PPU.
So far ... endrift's SOUNDCNT_X I/O test is failing, although that code
didn't change, so clearly I messed up SOUNDCNT_H somehow ...
To compile on Windows:
1. change nall/string/platform.hpp line 47 to
return slice(result, 0, 3);
2. change ruby/video.wgl.cpp line 72 to
auto lock(uint32_t*& data, uint& pitch, uint width, uint height) -> bool {
3. add this line to the very top of hiro/windows/header.cpp:
#define boolean FuckYouMicrosoft
2016-02-23 11:08:44 +00:00
|
|
|
case 0x0400'0002: return regs.greenswap;
|
2016-02-25 10:38:03 +00:00
|
|
|
case 0x0400'0003: return 0;
|
2012-03-31 08:17:36 +00:00
|
|
|
|
|
|
|
//DISPSTAT
|
2016-02-25 10:38:03 +00:00
|
|
|
case 0x0400'0004: return (
|
|
|
|
regs.status.vblank << 0
|
|
|
|
| regs.status.hblank << 1
|
|
|
|
| regs.status.vcoincidence << 2
|
|
|
|
| regs.status.irqvblank << 3
|
|
|
|
| regs.status.irqhblank << 4
|
|
|
|
| regs.status.irqvcoincidence << 5
|
|
|
|
);
|
|
|
|
case 0x0400'0005: return (
|
|
|
|
regs.status.vcompare
|
|
|
|
);
|
2012-03-31 08:17:36 +00:00
|
|
|
|
2012-03-31 08:14:31 +00:00
|
|
|
//VCOUNT
|
2016-02-25 10:38:03 +00:00
|
|
|
case 0x0400'0006: return regs.vcounter.byte(0);
|
|
|
|
case 0x0400'0007: return regs.vcounter.byte(1);
|
|
|
|
|
|
|
|
//BG0CNT, BG1CNT, BG2CNT, BG3CNT
|
|
|
|
case 0x0400'0008: case 0x0400'000a: case 0x0400'000c: case 0x0400'000e: return (
|
|
|
|
bgcnt().priority << 0
|
|
|
|
| bgcnt().characterbaseblock << 2
|
|
|
|
| bgcnt().unused << 4
|
|
|
|
| bgcnt().mosaic << 6
|
|
|
|
| bgcnt().colormode << 7
|
|
|
|
);
|
|
|
|
case 0x0400'0009: case 0x0400'000b: case 0x0400'000d: case 0x0400'000f: return (
|
|
|
|
bgcnt().screenbaseblock << 0
|
|
|
|
| bgcnt().affinewrap << 5
|
|
|
|
| bgcnt().screensize << 6
|
|
|
|
);
|
|
|
|
|
|
|
|
//WININ, WINOUT
|
|
|
|
case 0x0400'0048: case 0x0400'0049: case 0x0400'004a: case 0x0400'004b: return (
|
|
|
|
wf().enable[BG0] << 0
|
|
|
|
| wf().enable[BG1] << 1
|
|
|
|
| wf().enable[BG2] << 2
|
|
|
|
| wf().enable[BG3] << 3
|
|
|
|
| wf().enable[OBJ] << 4
|
|
|
|
| wf().enable[SFX] << 4
|
|
|
|
);
|
2012-03-31 08:17:36 +00:00
|
|
|
|
|
|
|
//BLTCNT
|
2016-02-25 10:38:03 +00:00
|
|
|
case 0x0400'0050: return (
|
|
|
|
regs.blend.control.above[BG0] << 0
|
|
|
|
| regs.blend.control.above[BG1] << 1
|
|
|
|
| regs.blend.control.above[BG2] << 2
|
|
|
|
| regs.blend.control.above[BG3] << 3
|
|
|
|
| regs.blend.control.above[OBJ] << 4
|
|
|
|
| regs.blend.control.above[SFX] << 5
|
|
|
|
| regs.blend.control.mode << 6
|
|
|
|
);
|
|
|
|
case 0x0400'0051: return (
|
|
|
|
regs.blend.control.below[BG0] << 0
|
|
|
|
| regs.blend.control.below[BG1] << 1
|
|
|
|
| regs.blend.control.below[BG2] << 2
|
|
|
|
| regs.blend.control.below[BG3] << 3
|
|
|
|
| regs.blend.control.below[OBJ] << 4
|
|
|
|
| regs.blend.control.below[SFX] << 5
|
|
|
|
);
|
2012-03-31 08:14:31 +00:00
|
|
|
|
Update to v095r05 release.
byuu says:
Changelog:
- GBA: lots of emulation improvements
- PPU PRAM is 16-bits wide
- DMA masks &~1/Half, &~3/Word
- VRAM OBJ 8-bit writes are ignored
- OAM 8-bit writes are ignored
- BGnCNT unused bits are writable*
- BG(0,1)CNT can't set the d13
- BLDALPHA is readable (fixes Donkey Kong Country, etc)
- SNES: lots of code cleanups
- sfc/chip => sfc/coprocessor
- UI: save most recent controller selection
GBA test scores: 1552/1552, 37/38, 1020/1260
(* forgot to add the value to the read function, so endrift's I/O tests
for them will fail. Fixed locally.)
Note: SNES is the only system with multiple controller/expansion port
options, and as such is the only one with a "None" option. Because it's
shared by the controller and expansion port, it ends up sorted first in
the list. This means that on your first run, you'll need to go to Super
Famicom->Controller Port 1 and select "Gamepad", otherwise input won't
work.
Also note that changing the expansion port device requires loading a new
cart. Unlike controllers, you aren't meant to hotplug expansion port
devices.
2015-11-12 10:15:03 +00:00
|
|
|
//BLDALPHA
|
Update to v097r17 release.
byuu says:
Changelog:
- ruby: if DirectSoundCreate fails (no sound device present), return
false from init instead of crashing
- nall: improved edge case return values for
(basename,pathname,dirname,...)
- nall: renamed file_system_object class to inode
- nall: varuint_t replaced with VariadicNatural; which contains
.bit,.bits,.byte ala Natural/Integer
- nall: fixed boolean compilation error on Windows
- WS: popa should not restore SP
- GBA: rewrote the CPU/APU cores to use the .bit,.bits functions;
removed registers.cpp from each
Note that the GBA changes are extremely major. This is about five hours
worth of extremely delicate work. Any slight errors could break
emulation in extremely bad ways. Let's hold off on extensive testing
until the next WIP, after I do the same to the PPU.
So far ... endrift's SOUNDCNT_X I/O test is failing, although that code
didn't change, so clearly I messed up SOUNDCNT_H somehow ...
To compile on Windows:
1. change nall/string/platform.hpp line 47 to
return slice(result, 0, 3);
2. change ruby/video.wgl.cpp line 72 to
auto lock(uint32_t*& data, uint& pitch, uint width, uint height) -> bool {
3. add this line to the very top of hiro/windows/header.cpp:
#define boolean FuckYouMicrosoft
2016-02-23 11:08:44 +00:00
|
|
|
case 0x0400'0052: return regs.blend.eva;
|
|
|
|
case 0x0400'0053: return regs.blend.evb;
|
Update to v095r05 release.
byuu says:
Changelog:
- GBA: lots of emulation improvements
- PPU PRAM is 16-bits wide
- DMA masks &~1/Half, &~3/Word
- VRAM OBJ 8-bit writes are ignored
- OAM 8-bit writes are ignored
- BGnCNT unused bits are writable*
- BG(0,1)CNT can't set the d13
- BLDALPHA is readable (fixes Donkey Kong Country, etc)
- SNES: lots of code cleanups
- sfc/chip => sfc/coprocessor
- UI: save most recent controller selection
GBA test scores: 1552/1552, 37/38, 1020/1260
(* forgot to add the value to the read function, so endrift's I/O tests
for them will fail. Fixed locally.)
Note: SNES is the only system with multiple controller/expansion port
options, and as such is the only one with a "None" option. Because it's
shared by the controller and expansion port, it ends up sorted first in
the list. This means that on your first run, you'll need to go to Super
Famicom->Controller Port 1 and select "Gamepad", otherwise input won't
work.
Also note that changing the expansion port device requires loading a new
cart. Unlike controllers, you aren't meant to hotplug expansion port
devices.
2015-11-12 10:15:03 +00:00
|
|
|
|
2015-11-14 00:52:51 +00:00
|
|
|
//BLDY is write-only
|
|
|
|
|
2012-03-31 08:14:31 +00:00
|
|
|
}
|
|
|
|
|
2016-02-25 10:38:03 +00:00
|
|
|
return 0;
|
2012-03-31 08:14:31 +00:00
|
|
|
}
|
|
|
|
|
2016-02-25 10:38:03 +00:00
|
|
|
auto PPU::write(uint32 addr, uint8 data) -> void {
|
|
|
|
auto bgcnt = [&]() -> Registers::Background::Control& { return regs.bg[addr.bits(1,2)].control; };
|
|
|
|
auto bgofs = [&]() -> Registers::Background& { return regs.bg[addr.bits(2,3)]; };
|
|
|
|
auto bg = [&]() -> Registers::Background& { return regs.bg[addr.bits(4,5)]; };
|
|
|
|
auto wf = [&]() -> Registers::WindowFlags& {
|
|
|
|
static uint id[] = {In0, In1, Out, Obj};
|
|
|
|
return regs.windowflags[id[addr.bits(0,1)]];
|
|
|
|
};
|
|
|
|
|
2012-04-01 01:41:15 +00:00
|
|
|
switch(addr) {
|
2012-03-31 08:14:31 +00:00
|
|
|
|
|
|
|
//DISPCNT
|
2016-02-25 10:38:03 +00:00
|
|
|
case 0x0400'0000:
|
|
|
|
regs.control.bgmode = data.bits(0,2);
|
|
|
|
regs.control.cgbmode = data.bit (3);
|
|
|
|
regs.control.frame = data.bit (4);
|
|
|
|
regs.control.hblank = data.bit (5);
|
|
|
|
regs.control.objmapping = data.bit (6);
|
|
|
|
regs.control.forceblank = data.bit (7);
|
|
|
|
return;
|
|
|
|
case 0x0400'0001:
|
|
|
|
regs.control.enable[BG0] = data.bit(0);
|
|
|
|
regs.control.enable[BG1] = data.bit(1);
|
|
|
|
regs.control.enable[BG2] = data.bit(2);
|
|
|
|
regs.control.enable[BG3] = data.bit(3);
|
|
|
|
regs.control.enable[OBJ] = data.bit(4);
|
|
|
|
regs.control.enablewindow[In0] = data.bit(5);
|
|
|
|
regs.control.enablewindow[In1] = data.bit(6);
|
|
|
|
regs.control.enablewindow[Obj] = data.bit(7);
|
|
|
|
return;
|
2012-03-31 08:14:31 +00:00
|
|
|
|
2012-03-31 08:17:36 +00:00
|
|
|
//GRSWP
|
2016-02-25 10:38:03 +00:00
|
|
|
case 0x0400'0002:
|
|
|
|
regs.greenswap = data.bit(0);
|
|
|
|
return;
|
Update to v097r17 release.
byuu says:
Changelog:
- ruby: if DirectSoundCreate fails (no sound device present), return
false from init instead of crashing
- nall: improved edge case return values for
(basename,pathname,dirname,...)
- nall: renamed file_system_object class to inode
- nall: varuint_t replaced with VariadicNatural; which contains
.bit,.bits,.byte ala Natural/Integer
- nall: fixed boolean compilation error on Windows
- WS: popa should not restore SP
- GBA: rewrote the CPU/APU cores to use the .bit,.bits functions;
removed registers.cpp from each
Note that the GBA changes are extremely major. This is about five hours
worth of extremely delicate work. Any slight errors could break
emulation in extremely bad ways. Let's hold off on extensive testing
until the next WIP, after I do the same to the PPU.
So far ... endrift's SOUNDCNT_X I/O test is failing, although that code
didn't change, so clearly I messed up SOUNDCNT_H somehow ...
To compile on Windows:
1. change nall/string/platform.hpp line 47 to
return slice(result, 0, 3);
2. change ruby/video.wgl.cpp line 72 to
auto lock(uint32_t*& data, uint& pitch, uint width, uint height) -> bool {
3. add this line to the very top of hiro/windows/header.cpp:
#define boolean FuckYouMicrosoft
2016-02-23 11:08:44 +00:00
|
|
|
case 0x0400'0003: return;
|
2012-03-31 08:17:36 +00:00
|
|
|
|
|
|
|
//DISPSTAT
|
Update to v097r17 release.
byuu says:
Changelog:
- ruby: if DirectSoundCreate fails (no sound device present), return
false from init instead of crashing
- nall: improved edge case return values for
(basename,pathname,dirname,...)
- nall: renamed file_system_object class to inode
- nall: varuint_t replaced with VariadicNatural; which contains
.bit,.bits,.byte ala Natural/Integer
- nall: fixed boolean compilation error on Windows
- WS: popa should not restore SP
- GBA: rewrote the CPU/APU cores to use the .bit,.bits functions;
removed registers.cpp from each
Note that the GBA changes are extremely major. This is about five hours
worth of extremely delicate work. Any slight errors could break
emulation in extremely bad ways. Let's hold off on extensive testing
until the next WIP, after I do the same to the PPU.
So far ... endrift's SOUNDCNT_X I/O test is failing, although that code
didn't change, so clearly I messed up SOUNDCNT_H somehow ...
To compile on Windows:
1. change nall/string/platform.hpp line 47 to
return slice(result, 0, 3);
2. change ruby/video.wgl.cpp line 72 to
auto lock(uint32_t*& data, uint& pitch, uint width, uint height) -> bool {
3. add this line to the very top of hiro/windows/header.cpp:
#define boolean FuckYouMicrosoft
2016-02-23 11:08:44 +00:00
|
|
|
case 0x0400'0004:
|
2016-02-25 10:38:03 +00:00
|
|
|
regs.status.irqvblank = data.bit(3);
|
|
|
|
regs.status.irqhblank = data.bit(4);
|
|
|
|
regs.status.irqvcoincidence = data.bit(5);
|
2012-03-31 08:17:36 +00:00
|
|
|
return;
|
Update to v097r17 release.
byuu says:
Changelog:
- ruby: if DirectSoundCreate fails (no sound device present), return
false from init instead of crashing
- nall: improved edge case return values for
(basename,pathname,dirname,...)
- nall: renamed file_system_object class to inode
- nall: varuint_t replaced with VariadicNatural; which contains
.bit,.bits,.byte ala Natural/Integer
- nall: fixed boolean compilation error on Windows
- WS: popa should not restore SP
- GBA: rewrote the CPU/APU cores to use the .bit,.bits functions;
removed registers.cpp from each
Note that the GBA changes are extremely major. This is about five hours
worth of extremely delicate work. Any slight errors could break
emulation in extremely bad ways. Let's hold off on extensive testing
until the next WIP, after I do the same to the PPU.
So far ... endrift's SOUNDCNT_X I/O test is failing, although that code
didn't change, so clearly I messed up SOUNDCNT_H somehow ...
To compile on Windows:
1. change nall/string/platform.hpp line 47 to
return slice(result, 0, 3);
2. change ruby/video.wgl.cpp line 72 to
auto lock(uint32_t*& data, uint& pitch, uint width, uint height) -> bool {
3. add this line to the very top of hiro/windows/header.cpp:
#define boolean FuckYouMicrosoft
2016-02-23 11:08:44 +00:00
|
|
|
case 0x0400'0005:
|
2016-02-25 10:38:03 +00:00
|
|
|
regs.status.vcompare = data;
|
2012-03-31 08:17:36 +00:00
|
|
|
return;
|
|
|
|
|
2016-02-25 10:38:03 +00:00
|
|
|
//BG0CNT, BG1CNT, BG2CNT, BG3CNT
|
|
|
|
case 0x0400'0008: case 0x0400'000a: case 0x0400'000c: case 0x0400'000e:
|
|
|
|
bgcnt().priority = data.bits(0,1);
|
|
|
|
bgcnt().characterbaseblock = data.bits(2,3);
|
|
|
|
bgcnt().unused = data.bits(4,5);
|
|
|
|
bgcnt().mosaic = data.bit (6);
|
|
|
|
bgcnt().colormode = data.bit (7);
|
2012-04-09 06:41:27 +00:00
|
|
|
return;
|
2016-02-25 10:38:03 +00:00
|
|
|
case 0x0400'0009: case 0x0400'000b: case 0x0400'000d: case 0x0400'000f:
|
|
|
|
if(addr.bits(1,2) <= 1) data.bit(5) = 0; //clear affine wrap for BG0, BG1
|
|
|
|
bgcnt().screenbaseblock = data.bits(0,4);
|
|
|
|
bgcnt().affinewrap = data.bit (5);
|
|
|
|
bgcnt().screensize = data.bits(6,7);
|
2012-04-09 06:41:27 +00:00
|
|
|
return;
|
2012-03-31 08:17:36 +00:00
|
|
|
|
2016-02-25 10:38:03 +00:00
|
|
|
//BG0HOFS, BG1HOFS, BG2BOFS, BG3HOFS
|
|
|
|
case 0x0400'0010: case 0x0400'0014: case 0x0400'0018: case 0x0400'001c:
|
|
|
|
bgofs().hoffset.bits(0,7) = data;
|
2012-04-09 06:41:27 +00:00
|
|
|
return;
|
2016-02-25 10:38:03 +00:00
|
|
|
case 0x0400'0011: case 0x0400'0015: case 0x0400'0019: case 0x0400'001d:
|
|
|
|
bgofs().hoffset.bit(8) = data.bit(0);
|
2012-04-09 06:41:27 +00:00
|
|
|
return;
|
2012-03-31 08:17:36 +00:00
|
|
|
|
2016-02-25 10:38:03 +00:00
|
|
|
//BG0VOFS, BG1VOFS, BG2VOFS, BG3VOFS
|
|
|
|
case 0x0400'0012: case 0x0400'0016: case 0x0400'001a: case 0x0400'001e:
|
|
|
|
bgofs().voffset.bits(0,7) = data;
|
2012-04-09 06:41:27 +00:00
|
|
|
return;
|
2016-02-25 10:38:03 +00:00
|
|
|
case 0x0400'0013: case 0x0400'0017: case 0x0400'001b: case 0x0400'001f:
|
|
|
|
bgofs().voffset.bit(8) = data.bit(0);
|
2012-04-09 06:41:27 +00:00
|
|
|
return;
|
2012-03-31 08:17:36 +00:00
|
|
|
|
2016-02-25 10:38:03 +00:00
|
|
|
//BG2PA, BG3PA
|
|
|
|
case 0x0400'0020: case 0x0400'0030: bg().pa.byte(0) = data; return;
|
|
|
|
case 0x0400'0021: case 0x0400'0031: bg().pa.byte(1) = data; return;
|
2012-03-31 08:17:36 +00:00
|
|
|
|
2016-02-25 10:38:03 +00:00
|
|
|
//BG2PB, BG3PB
|
|
|
|
case 0x0400'0022: case 0x0400'0032: bg().pb.byte(0) = data; return;
|
|
|
|
case 0x0400'0023: case 0x0400'0033: bg().pb.byte(1) = data; return;
|
2012-03-31 08:17:36 +00:00
|
|
|
|
2016-02-25 10:38:03 +00:00
|
|
|
//BG2PC, BG3PC
|
|
|
|
case 0x0400'0024: case 0x0400'0034: bg().pc.byte(0) = data; return;
|
|
|
|
case 0x0400'0025: case 0x0400'0035: bg().pc.byte(1) = data; return;
|
|
|
|
|
|
|
|
//BG2PD, BG3PD
|
|
|
|
case 0x0400'0026: case 0x0400'0036: bg().pd.byte(0) = data; return;
|
|
|
|
case 0x0400'0027: case 0x0400'0037: bg().pd.byte(1) = data; return;
|
|
|
|
|
|
|
|
//BG2X_L, BG2X_H, BG3X_L, BG3X_H
|
|
|
|
case 0x0400'0028: case 0x0400'0038: bg().x.bits( 0, 7) = data.bits(0,7); bg().lx = bg().x; return;
|
|
|
|
case 0x0400'0029: case 0x0400'0039: bg().x.bits( 8,15) = data.bits(0,7); bg().lx = bg().x; return;
|
|
|
|
case 0x0400'002a: case 0x0400'003a: bg().x.bits(16,23) = data.bits(0,7); bg().lx = bg().x; return;
|
|
|
|
case 0x0400'002b: case 0x0400'003b: bg().x.bits(24,27) = data.bits(0,3); bg().lx = bg().x; return;
|
|
|
|
|
|
|
|
//BG2Y_L, BG2Y_H, BG3Y_L, BG3Y_H
|
|
|
|
case 0x0400'002c: case 0x0400'003c: bg().y.bits( 0, 7) = data.bits(0,7); bg().ly = bg().y; return;
|
|
|
|
case 0x0400'002d: case 0x0400'003d: bg().y.bits( 8,15) = data.bits(0,7); bg().ly = bg().y; return;
|
|
|
|
case 0x0400'002e: case 0x0400'003e: bg().y.bits(16,23) = data.bits(0,7); bg().ly = bg().y; return;
|
|
|
|
case 0x0400'002f: case 0x0400'003f: bg().y.bits(24,27) = data.bits(0,3); bg().ly = bg().y; return;
|
2012-03-31 08:17:36 +00:00
|
|
|
|
|
|
|
//WIN0H
|
2016-02-25 10:38:03 +00:00
|
|
|
case 0x0400'0040: regs.window[0].x2 = data; return;
|
|
|
|
case 0x0400'0041: regs.window[0].x1 = data; return;
|
2012-03-31 08:17:36 +00:00
|
|
|
|
|
|
|
//WIN1H
|
2016-02-25 10:38:03 +00:00
|
|
|
case 0x0400'0042: regs.window[1].x2 = data; return;
|
|
|
|
case 0x0400'0043: regs.window[1].x1 = data; return;
|
2012-03-31 08:17:36 +00:00
|
|
|
|
|
|
|
//WIN0V
|
2016-02-25 10:38:03 +00:00
|
|
|
case 0x0400'0044: regs.window[0].y2 = data; return;
|
|
|
|
case 0x0400'0045: regs.window[0].y1 = data; return;
|
2012-03-31 08:17:36 +00:00
|
|
|
|
|
|
|
//WIN1V
|
2016-02-25 10:38:03 +00:00
|
|
|
case 0x0400'0046: regs.window[1].y2 = data; return;
|
|
|
|
case 0x0400'0047: regs.window[1].y1 = data; return;
|
|
|
|
|
|
|
|
//WININ, WINOUT
|
|
|
|
case 0x0400'0048: case 0x0400'0049: case 0x0400'004a: case 0x0400'004b:
|
|
|
|
wf().enable[BG0] = data.bit(0);
|
|
|
|
wf().enable[BG1] = data.bit(1);
|
|
|
|
wf().enable[BG2] = data.bit(2);
|
|
|
|
wf().enable[BG3] = data.bit(3);
|
|
|
|
wf().enable[OBJ] = data.bit(4);
|
|
|
|
wf().enable[SFX] = data.bit(5);
|
|
|
|
return;
|
2012-03-31 08:17:36 +00:00
|
|
|
|
|
|
|
//MOSAIC
|
Update to v097r17 release.
byuu says:
Changelog:
- ruby: if DirectSoundCreate fails (no sound device present), return
false from init instead of crashing
- nall: improved edge case return values for
(basename,pathname,dirname,...)
- nall: renamed file_system_object class to inode
- nall: varuint_t replaced with VariadicNatural; which contains
.bit,.bits,.byte ala Natural/Integer
- nall: fixed boolean compilation error on Windows
- WS: popa should not restore SP
- GBA: rewrote the CPU/APU cores to use the .bit,.bits functions;
removed registers.cpp from each
Note that the GBA changes are extremely major. This is about five hours
worth of extremely delicate work. Any slight errors could break
emulation in extremely bad ways. Let's hold off on extensive testing
until the next WIP, after I do the same to the PPU.
So far ... endrift's SOUNDCNT_X I/O test is failing, although that code
didn't change, so clearly I messed up SOUNDCNT_H somehow ...
To compile on Windows:
1. change nall/string/platform.hpp line 47 to
return slice(result, 0, 3);
2. change ruby/video.wgl.cpp line 72 to
auto lock(uint32_t*& data, uint& pitch, uint width, uint height) -> bool {
3. add this line to the very top of hiro/windows/header.cpp:
#define boolean FuckYouMicrosoft
2016-02-23 11:08:44 +00:00
|
|
|
case 0x0400'004c:
|
2016-02-25 10:38:03 +00:00
|
|
|
regs.mosaic.bghsize = data.bits(0,3);
|
|
|
|
regs.mosaic.bgvsize = data.bits(4,7);
|
2012-03-31 08:17:36 +00:00
|
|
|
return;
|
Update to v097r17 release.
byuu says:
Changelog:
- ruby: if DirectSoundCreate fails (no sound device present), return
false from init instead of crashing
- nall: improved edge case return values for
(basename,pathname,dirname,...)
- nall: renamed file_system_object class to inode
- nall: varuint_t replaced with VariadicNatural; which contains
.bit,.bits,.byte ala Natural/Integer
- nall: fixed boolean compilation error on Windows
- WS: popa should not restore SP
- GBA: rewrote the CPU/APU cores to use the .bit,.bits functions;
removed registers.cpp from each
Note that the GBA changes are extremely major. This is about five hours
worth of extremely delicate work. Any slight errors could break
emulation in extremely bad ways. Let's hold off on extensive testing
until the next WIP, after I do the same to the PPU.
So far ... endrift's SOUNDCNT_X I/O test is failing, although that code
didn't change, so clearly I messed up SOUNDCNT_H somehow ...
To compile on Windows:
1. change nall/string/platform.hpp line 47 to
return slice(result, 0, 3);
2. change ruby/video.wgl.cpp line 72 to
auto lock(uint32_t*& data, uint& pitch, uint width, uint height) -> bool {
3. add this line to the very top of hiro/windows/header.cpp:
#define boolean FuckYouMicrosoft
2016-02-23 11:08:44 +00:00
|
|
|
case 0x0400'004d:
|
2016-02-25 10:38:03 +00:00
|
|
|
regs.mosaic.objhsize = data.bits(0,3);
|
|
|
|
regs.mosaic.objvsize = data.bits(4,7);
|
2012-03-31 08:17:36 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
//BLDCNT
|
2016-02-25 10:38:03 +00:00
|
|
|
case 0x0400'0050:
|
|
|
|
regs.blend.control.above[BG0] = data.bit (0);
|
|
|
|
regs.blend.control.above[BG1] = data.bit (1);
|
|
|
|
regs.blend.control.above[BG2] = data.bit (2);
|
|
|
|
regs.blend.control.above[BG3] = data.bit (3);
|
|
|
|
regs.blend.control.above[OBJ] = data.bit (4);
|
|
|
|
regs.blend.control.above[SFX] = data.bit (5);
|
|
|
|
regs.blend.control.mode = data.bits(6,7);
|
|
|
|
return;
|
|
|
|
case 0x0400'0051:
|
|
|
|
regs.blend.control.below[BG0] = data.bit(0);
|
|
|
|
regs.blend.control.below[BG1] = data.bit(1);
|
|
|
|
regs.blend.control.below[BG2] = data.bit(2);
|
|
|
|
regs.blend.control.below[BG3] = data.bit(3);
|
|
|
|
regs.blend.control.below[OBJ] = data.bit(4);
|
|
|
|
regs.blend.control.below[SFX] = data.bit(5);
|
|
|
|
return;
|
2012-03-31 08:17:36 +00:00
|
|
|
|
|
|
|
//BLDALPHA
|
2016-02-25 10:38:03 +00:00
|
|
|
case 0x0400'0052: regs.blend.eva = data.bits(0,4); return;
|
|
|
|
case 0x0400'0053: regs.blend.evb = data.bits(0,4); return;
|
2012-03-31 08:17:36 +00:00
|
|
|
|
|
|
|
//BLDY
|
2016-02-25 10:38:03 +00:00
|
|
|
case 0x0400'0054: regs.blend.evy = data.bits(0,4); return;
|
Update to v097r17 release.
byuu says:
Changelog:
- ruby: if DirectSoundCreate fails (no sound device present), return
false from init instead of crashing
- nall: improved edge case return values for
(basename,pathname,dirname,...)
- nall: renamed file_system_object class to inode
- nall: varuint_t replaced with VariadicNatural; which contains
.bit,.bits,.byte ala Natural/Integer
- nall: fixed boolean compilation error on Windows
- WS: popa should not restore SP
- GBA: rewrote the CPU/APU cores to use the .bit,.bits functions;
removed registers.cpp from each
Note that the GBA changes are extremely major. This is about five hours
worth of extremely delicate work. Any slight errors could break
emulation in extremely bad ways. Let's hold off on extensive testing
until the next WIP, after I do the same to the PPU.
So far ... endrift's SOUNDCNT_X I/O test is failing, although that code
didn't change, so clearly I messed up SOUNDCNT_H somehow ...
To compile on Windows:
1. change nall/string/platform.hpp line 47 to
return slice(result, 0, 3);
2. change ruby/video.wgl.cpp line 72 to
auto lock(uint32_t*& data, uint& pitch, uint width, uint height) -> bool {
3. add this line to the very top of hiro/windows/header.cpp:
#define boolean FuckYouMicrosoft
2016-02-23 11:08:44 +00:00
|
|
|
case 0x0400'0055: return;
|
2012-03-31 08:17:36 +00:00
|
|
|
|
2012-03-31 08:14:31 +00:00
|
|
|
}
|
|
|
|
}
|