MEM: improve error conditions

(cherry picked from commit 38db1520f53b0684a00584f7c17147e2418bd3a1)
GFX: implement PAL mode

(cherry picked from commit a9926dafb87b58e8323124ea6eb107ee84d640a8)

Conflicts:
	vdp.cpp
	vdp.h
Fix unused register
Use vblank() function correctly in status register
MEM: add min/max macros

(cherry picked from commit f1c406bd950bbc06b90e3d79459aeb360e9cf737)

Conflicts:
	mem.h
MEM: fix gamegenie code support

(cherry picked from commit 088469b31df80228b8b1f57c6bb4e58a00c79ead)
GFX: shadow/highlight also affects backdrop (streetracer)

(cherry picked from commit a6f70f2d7878e618e2a62ceda19bddfae9e8b566)

Conflicts:
	gfx.cpp
CARTIDGE: initialize backup ram correctly

(cherry picked from commit b031a09680c0f23a056862eb424364d49f24be01)
GFX: fix window calculation in mode h32

(cherry picked from commit 50941116e874f6596ffacf81334d46731b432ebc)
M68K: use 32-bit predecrement memory access also for movem.l

(cherry picked from commit 5233485227b376eb5e52a3649a0a143254b50861)
VDP/GFX: implement internal SAT cache (fix Castlevania Blodlines level 6-2)

(cherry picked from commit 239bebd3a00ee7a964a52c43a309dec7e7b0af50)

Conflicts:
	vdp.cpp
Apply GG codes after 100 frames (to bypass checksums)

(cherry picked from commit 7d38a2fbfb0601ba07fc051b304a271860ecd390)
VDP: change hcounter to more closely use table numbers (and fix a bug in the process)

(cherry picked from commit d57a280642c6fb32b51b35c12bb74437bcd66d53)
GFX: like VDP, use bit 0 in reg12 for selecting H32 vs H40

(cherry picked from commit f43f6bb6f8bb6b1c0f4ff5c191d9c90f6afef94b)