cores: AVR_IOPORT_DECLARE

convert port sructure declarations to macro AVR_IOPORT_DECLARE.

	modified:   simavr/cores/sim_90usb162.c
	modified:   simavr/cores/sim_mega128.c
	modified:   simavr/cores/sim_mega1280.c
	modified:   simavr/cores/sim_mega1281.c
	modified:   simavr/cores/sim_mega128rfa1.c
	modified:   simavr/cores/sim_mega128rfr2.c
	modified:   simavr/cores/sim_mega169.c
	modified:   simavr/cores/sim_mega2560.c
	modified:   simavr/cores/sim_megax.h
	modified:   simavr/cores/sim_tiny2313.c
	modified:   simavr/sim/avr_ioport.h
cores: add spi declaration

convert spi structure definitions to AVR_SPI_DECLARE

	modified:   simavr/cores/sim_90usb162.c
	modified:   simavr/cores/sim_mega128.c
	modified:   simavr/cores/sim_mega1280.c
	modified:   simavr/cores/sim_mega1281.c
	modified:   simavr/cores/sim_mega128rfr2.c
	modified:   simavr/cores/sim_mega169.c
	modified:   simavr/cores/sim_mega2560.c
	modified:   simavr/cores/sim_megax.h
	modified:   simavr/cores/sim_megax4.h
	modified:   simavr/cores/sim_megax8.h
	modified:   simavr/cores/sim_megaxm1.h
	modified:   simavr/sim/avr_spi.h
Merge pull request #99 from bsekisser/bsekisser-cores-ioport-declare

cores: AVR_IOPORT_DECLARE
Merge pull request #100 from bsekisser/bsekisser-cores-spi-declare

cores: add spi declaration
modify handling of interrupt state

Interrupt state edge detection and wait states combined into multi
	function variable.  Enabling the removal of edge detection
	code in the run loop and determining simplifying need to
	service interrupts by placing the burden on code directly
	influencing the interrupt handling state.

This also removes functionally duplicate code clause for BSET/BCLR.

modified:   simavr/sim/sim_avr.c
	edge detection code removed from both run loops...  non
	gdb loop does precheck of interrupt state, while not
	necessary potentially saves a few cycles.
	remove duplicate code BSET/BCLR.

modified:   simavr/sim/sim_avr.h
	uint8_t i_shadow changed to int8_t interrupt_state.

modified:   simavr/sim/sim_core.c
	changes to interrupt state are trapped and sent to be
		handled by avr_sreg_set_s_i().
	multi-cycle loop simplified to check avr->interrupt_state.

modified:   simavr/sim/sim_core.h
	static inline avr_sreg_set_s_i() - handles changes to global
		interrupt state and ensures wait states if I
		flag changes from 0 -> 1.  superfluous 1 -> 1
		states are ignored should they occur. and
		disabling interrupts clears avr->interrupt_state.
		interrupt state changes from SET_SREG_FROM directed to
		avr_sreg_set_s_i();

modified:   simavr/sim/sim_interrupts.c
	avr_interrupt_reset()
		interrupt_state cleared during reset.
	avr_raise_intrrupt()
		check interrupts enabled and no pending
		interrupt_state before marking pending interrupt state.
	avr_service_interrupts()
		servicing code changed to tick pending wait state then
		mark for any pending interrupts or set to zero
		if none waiting.
		on interrupt, direct interrupt state change to
		avr_sreg_set_s_i();

modified:   simavr/sim/sim_interrupts.h
	remove pending_wait.

modified:   tests/tests.c
	interrupt edge dectection code removed from test run loop.
fix coding style errors

	modified:   simavr/sim/sim_core.c
	modified:   simavr/sim/sim_core.h
another coding style error fix, grep missed this one.

	modified:   simavr/sim/sim_avr.c
update interrupt_state to take 2 cycles after enable.

	modified:   simavr/sim/sim_core.h
core: undo code removal.

	modified:   sim_core.c
change sreg handling with interrupts...

	modified:   sim_core.c
		changed usage of avr_sreg_s_i_set to avr_sreg_set

	modified:   sim_core.h
		added .. avr_sreg_set
		avr_sreg_set_s_i merged in to avr_sreg_set

	modified:   sim_interrupts.c
		changed usage of avr_sreg_s_i_set to avr_sreg_set