public static WriteHandlerPtr spunchout_prot_w = new WriteHandlerPtr() { public void handler(int offset, int data)
        {
	
		switch ( offset ) {
			case 0x00:
				if ( prot_mode_sel == 0x0a ) {
					cpu_writemem16(0xd012, data);
					return;
				}
	
				if ( prot_mode_sel == 0x0b || prot_mode_sel == 0x23 ) {
					cpu_writemem16(0xd7c1, data);
					return;
				}
	
				prot_mem[offset] = data;
				return;
			//break;
	
			case 0x02:
				if ( prot_mode_sel == 0x09 ) { /* PC = 0x20f7, 0x22d7 */
					prot_mem[offset] = data;
					return;
				}
			break;
	
			case 0x03:
				if ( prot_mode_sel == 0x09 ) { /* PC = 0x1e4c */
					prot_mem[offset] = data;
					return;
				}
			break;
	
			case 0x05:
				prot_mem[offset] = data;
				return;
	
			case 0x06:
				if ( prot_mode_sel == 0x09 ) { /* PC = 0x2287 */
					prot_mem[offset] = data;
					return;
				}
			break;
	
			case 0x0b:
				prot_mem[offset] = data;
				return;
	
			case 0x0d: /* PC = all over the code */
				prot_mode_sel = data;
				return;
			case 0x0f:
				prot_mem[offset] = data;
				return;
		}
	
		if ( errorlog!=null )
			fprintf( errorlog, "Wrote to unknown protection? port %02x ( %02x )\n", offset, data );
	
		prot_mem[offset] = data;
	}}