protected void writeHWReg(Size size, int addr, int value) {
		int reg = addr - 0x2000;
		
		if(mmap[reg] == null) {
			mmap[reg] = new UnimplementedHardwareRegister();
			Log.err(String.format("Write Memory Mapped register 0x%04x not implemented.", addr));
			if (Settings.get(Settings.MEM_THROW_INVALID_ADDR).equals("true"))
				throw new RuntimeException(String.format("Write Memory Mapped register 0x%04x not implemented.", addr));
		}
		
		if (size == Size.SHORT) {
			if(mmap[reg+1] == null) {
				mmap[reg+1] = new UnimplementedHardwareRegister();
				Log.err(String.format("Write Memory Mapped register 0x%04x not implemented.", addr+1));
				if (Settings.get(Settings.MEM_THROW_INVALID_ADDR).equals("true"))
					throw new RuntimeException(String.format("Write Memory Mapped register 0x%04x not implemented.", addr+1));
			}

			/*
			 * Low goes first unless you want games to look like they're being 
			 * played through Kanye's shutter shades.
			 */
			mmap[reg].setValue(value & 0x00FF);
			mmap[reg+1].setValue((value & 0xFF00) >> 8);
		} else {
			mmap[reg].setValue(value);
		}
	}