MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / DEV9read8

Function DEV9read8

pcsx2/DEV9/DEV9.cpp:857–895  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

855}
856
857u8 DEV9read8(u32 addr)
858{
859 if (!EmuConfig.DEV9.EthEnable && !EmuConfig.DEV9.HddEnable)
860 return 0;
861
862 if (addr >= ATA_DEV9_HDD_BASE && addr < ATA_DEV9_HDD_END)
863 {
864 return dev9.ata->Read(addr, 8);
865 }
866 // Note, ATA regs within range of addresses used by Speed
867 if (addr >= SPD_REGBASE && addr < SMAP_REGBASE)
868 {
869 // speed
870 return SpeedRead(addr, 8);
871 }
872 if (addr >= SMAP_REGBASE && addr < FLASH_REGBASE)
873 {
874 // smap
875 return smap_read8(addr);
876 }
877 if ((addr >= FLASH_REGBASE) && (addr < (FLASH_REGBASE + FLASH_REGSIZE)))
878 {
879 return static_cast<u8>(FLASHread32(addr, 1));
880 }
881
882 u8 hard = 0;
883 switch (addr)
884 {
885 case DEV9_R_REV:
886 hard = 0x32; // expansion bay
887 //DevCon.WriteLn("DEV9: DEV9_R_REV 8bit read %x", hard);
888 return hard;
889
890 default:
891 hard = dev9Ru8(addr);
892 Console.Error("DEV9: Unknown 8bit read at address %lx value %x", addr, hard);
893 return hard;
894 }
895}
896
897u16 DEV9read16(u32 addr)
898{

Callers 3

iopMemRead8Function · 0.85
_ext_memRead8Function · 0.85
iopHwRead8_Page1Function · 0.85

Calls 5

SpeedReadFunction · 0.85
smap_read8Function · 0.85
FLASHread32Function · 0.85
ReadMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected