Пример #1
0
//
// JERRY byte access (read)
//
uint8_t JERRYReadByte(uint32_t offset, uint32_t who/*=UNKNOWN*/)
{
   if ((offset >= DSP_CONTROL_RAM_BASE) && (offset < DSP_CONTROL_RAM_BASE+0x20))
      return DSPReadByte(offset, who);
   else if ((offset >= DSP_WORK_RAM_BASE) && (offset < DSP_WORK_RAM_BASE+0x2000))
      return DSPReadByte(offset, who);
   // LRXD/RRXD/SSTAT $F1A148/4C/50 (really 16-bit registers...)
   else if (offset >= 0xF1A148 && offset <= 0xF1A153)
      return DACReadByte(offset, who);
   //	F10036          R     xxxxxxxx xxxxxxxx   JPIT1 - timer 1 pre-scaler
   //	F10038          R     xxxxxxxx xxxxxxxx   JPIT2 - timer 1 divider
   //	F1003A          R     xxxxxxxx xxxxxxxx   JPIT3 - timer 2 pre-scaler
   //	F1003C          R     xxxxxxxx xxxxxxxx   JPIT4 - timer 2 divider
   else if ((offset >= 0xF10036) && (offset <= 0xF1003D))
   {
      /* Unhandled timer read (BYTE) */
   }
   else if (offset >= 0xF14000 && offset <= 0xF14003)
   {
      uint16_t value = JoystickReadWord(offset & 0xFE);

      if (offset & 0x01)
         value &= 0xFF;
      else
         value >>= 8;

      // This is wrong, should only have the lowest bit from $F14001
      return value | EepromReadByte(offset);
   }
Пример #2
0
//
// JERRY byte access (read)
//
uint8_t JERRYReadByte(uint32_t offset, uint32_t who/*=UNKNOWN*/)
{
#ifdef JERRY_DEBUG
	WriteLog("JERRY: Reading byte at %06X\n", offset);
#endif
	if ((offset >= DSP_CONTROL_RAM_BASE) && (offset < DSP_CONTROL_RAM_BASE+0x20))
		return DSPReadByte(offset, who);
	else if ((offset >= DSP_WORK_RAM_BASE) && (offset < DSP_WORK_RAM_BASE+0x2000))
		return DSPReadByte(offset, who);
	// LRXD/RRXD/SSTAT $F1A148/4C/50 (really 16-bit registers...)
	else if (offset >= 0xF1A148 && offset <= 0xF1A153)
		return DACReadByte(offset, who);
//	F10036          R     xxxxxxxx xxxxxxxx   JPIT1 - timer 1 pre-scaler
//	F10038          R     xxxxxxxx xxxxxxxx   JPIT2 - timer 1 divider
//	F1003A          R     xxxxxxxx xxxxxxxx   JPIT3 - timer 2 pre-scaler
//	F1003C          R     xxxxxxxx xxxxxxxx   JPIT4 - timer 2 divider
//This is WRONG!
//	else if (offset >= 0xF10000 && offset <= 0xF10007)
//This is still wrong. What needs to be returned here are the values being counted down
//in the jerry_timer_n_counter variables... !!! FIX !!! [DONE]

//This is probably the problem with the new timer code... This is invalid
//under the new system... !!! FIX !!!
	else if ((offset >= 0xF10036) && (offset <= 0xF1003D))
	{
WriteLog("JERRY: Unhandled timer read (BYTE) at %08X...\n", offset);
	}
//	else if (offset >= 0xF10010 && offset <= 0xF10015)
//		return clock_byte_read(offset);
//	else if (offset >= 0xF17C00 && offset <= 0xF17C01)
//		return anajoy_byte_read(offset);
	else if (offset >= 0xF14000 && offset <= 0xF14003)
//		return JoystickReadByte(offset) | EepromReadByte(offset);
	{
		uint16_t value = JoystickReadWord(offset & 0xFE);

		if (offset & 0x01)
			value &= 0xFF;
		else
			value >>= 8;

		// This is wrong, should only have the lowest bit from $F14001
		return value | EepromReadByte(offset);
	}