// Original Coco 3 Plus contributions: Copyright (c) 2026 Brian K. Holman. // Original component notices/terms retained; see COPYRIGHT.md and LICENSING.md. // SPDX-License-Identifier: BSD-3-Clause // GI SP0256 public algorithm tables, MAME Joseph Zbiciak/Tim Lindner. // Derived from pinned VCCPlus sp0256.cpp; see LICENSE. No mask ROM. // Generated by scripts/generate_ssc_sp0256_tables.py. // Source SHA256: 970ee4a027f637de820a10f66b119e95aeb366c4242df23de949ce1dccd030a3 function [15:0] sp_control(input [7:0] address); begin case(address) 8'd0: sp_control=16'h8000; 8'd1: sp_control=16'h8008; 8'd2: sp_control=16'h0108; 8'd3: sp_control=16'h0208; 8'd4: sp_control=16'h0308; 8'd5: sp_control=16'h0408; 8'd6: sp_control=16'h0508; 8'd7: sp_control=16'h0608; 8'd8: sp_control=16'h0708; 8'd9: sp_control=16'h0808; 8'd10: sp_control=16'h0908; 8'd11: sp_control=16'h0a08; 8'd12: sp_control=16'h0b08; 8'd13: sp_control=16'h0c08; 8'd14: sp_control=16'h0d08; 8'd15: sp_control=16'h0e08; 8'd16: sp_control=16'h0f08; 8'd17: sp_control=16'h8026; 8'd18: sp_control=16'h0108; 8'd19: sp_control=16'h0834; 8'd20: sp_control=16'h0926; 8'd21: sp_control=16'h0a17; 8'd22: sp_control=16'h0b26; 8'd23: sp_control=16'h0c08; 8'd24: sp_control=16'h0d08; 8'd25: sp_control=16'h8026; 8'd26: sp_control=16'h0108; 8'd27: sp_control=16'h0816; 8'd28: sp_control=16'h0917; 8'd29: sp_control=16'h0a08; 8'd30: sp_control=16'h0b08; 8'd31: sp_control=16'h0c08; 8'd32: sp_control=16'h0d08; 8'd33: sp_control=16'h4000; 8'd34: sp_control=16'h0026; 8'd35: sp_control=16'h2926; 8'd36: sp_control=16'h2b26; 8'd37: sp_control=16'h2d08; 8'd38: sp_control=16'h4000; 8'd39: sp_control=16'h0026; 8'd40: sp_control=16'h2917; 8'd41: sp_control=16'h2b08; 8'd42: sp_control=16'h2d08; 8'd43: sp_control=16'h0000; 8'd44: sp_control=16'h0000; 8'd45: sp_control=16'h1024; 8'd46: sp_control=16'h1105; 8'd47: sp_control=16'h1243; 8'd48: sp_control=16'h1333; 8'd49: sp_control=16'h1443; 8'd50: sp_control=16'h1533; 8'd51: sp_control=16'h1643; 8'd52: sp_control=16'h1733; 8'd53: sp_control=16'h1833; 8'd54: sp_control=16'h1924; 8'd55: sp_control=16'h1a14; 8'd56: sp_control=16'h1b24; 8'd57: sp_control=16'h1c05; 8'd58: sp_control=16'h1d05; 8'd59: sp_control=16'h1024; 8'd60: sp_control=16'h1105; 8'd61: sp_control=16'h1214; 8'd62: sp_control=16'h1324; 8'd63: sp_control=16'h1414; 8'd64: sp_control=16'h1524; 8'd65: sp_control=16'h1614; 8'd66: sp_control=16'h1724; 8'd67: sp_control=16'h1814; 8'd68: sp_control=16'h1915; 8'd69: sp_control=16'h1a05; 8'd70: sp_control=16'h1b05; 8'd71: sp_control=16'h1c05; 8'd72: sp_control=16'h1d05; 8'd73: sp_control=16'h4000; 8'd74: sp_control=16'h0026; 8'd75: sp_control=16'h2335; 8'd76: sp_control=16'h2535; 8'd77: sp_control=16'h2735; 8'd78: sp_control=16'h4000; 8'd79: sp_control=16'h0026; 8'd80: sp_control=16'h2326; 8'd81: sp_control=16'h2526; 8'd82: sp_control=16'h2726; 8'd83: sp_control=16'h8026; 8'd84: sp_control=16'h0108; 8'd85: sp_control=16'h0243; 8'd86: sp_control=16'h0335; 8'd87: sp_control=16'h0443; 8'd88: sp_control=16'h0535; 8'd89: sp_control=16'h0643; 8'd90: sp_control=16'h0735; 8'd91: sp_control=16'h0834; 8'd92: sp_control=16'h0926; 8'd93: sp_control=16'h0a17; 8'd94: sp_control=16'h0b26; 8'd95: sp_control=16'h0e05; 8'd96: sp_control=16'h0f05; 8'd97: sp_control=16'h8026; 8'd98: sp_control=16'h0108; 8'd99: sp_control=16'h0216; 8'd100: sp_control=16'h0326; 8'd101: sp_control=16'h0416; 8'd102: sp_control=16'h0526; 8'd103: sp_control=16'h0616; 8'd104: sp_control=16'h0726; 8'd105: sp_control=16'h0816; 8'd106: sp_control=16'h0917; 8'd107: sp_control=16'h0a08; 8'd108: sp_control=16'h0b08; 8'd109: sp_control=16'h0e05; 8'd110: sp_control=16'h0f05; 8'd111: sp_control=16'h1024; 8'd112: sp_control=16'h1105; 8'd113: sp_control=16'h1833; 8'd114: sp_control=16'h1924; 8'd115: sp_control=16'h1a14; 8'd116: sp_control=16'h1b24; 8'd117: sp_control=16'h1c05; 8'd118: sp_control=16'h1d05; 8'd119: sp_control=16'h1024; 8'd120: sp_control=16'h1105; 8'd121: sp_control=16'h1814; 8'd122: sp_control=16'h1915; 8'd123: sp_control=16'h1a05; 8'd124: sp_control=16'h1b05; 8'd125: sp_control=16'h1c05; 8'd126: sp_control=16'h1d05; 8'd127: sp_control=16'h0026; 8'd128: sp_control=16'h0108; 8'd129: sp_control=16'h8026; 8'd130: sp_control=16'h0108; 8'd131: sp_control=16'h0243; 8'd132: sp_control=16'h0335; 8'd133: sp_control=16'h0443; 8'd134: sp_control=16'h0535; 8'd135: sp_control=16'h0643; 8'd136: sp_control=16'h0735; 8'd137: sp_control=16'h0834; 8'd138: sp_control=16'h0926; 8'd139: sp_control=16'h0a17; 8'd140: sp_control=16'h0b26; 8'd141: sp_control=16'h0c08; 8'd142: sp_control=16'h0d08; 8'd143: sp_control=16'h0e05; 8'd144: sp_control=16'h0f05; 8'd145: sp_control=16'h8026; 8'd146: sp_control=16'h0108; 8'd147: sp_control=16'h0216; 8'd148: sp_control=16'h0326; 8'd149: sp_control=16'h0416; 8'd150: sp_control=16'h0526; 8'd151: sp_control=16'h0616; 8'd152: sp_control=16'h0726; 8'd153: sp_control=16'h0816; 8'd154: sp_control=16'h0917; 8'd155: sp_control=16'h0a08; 8'd156: sp_control=16'h0b08; 8'd157: sp_control=16'h0c08; 8'd158: sp_control=16'h0d08; 8'd159: sp_control=16'h0e05; 8'd160: sp_control=16'h0f05; 8'd161: sp_control=16'h4000; 8'd162: sp_control=16'h0026; 8'd163: sp_control=16'h0108; 8'd164: sp_control=16'h2335; 8'd165: sp_control=16'h2535; 8'd166: sp_control=16'h2735; 8'd167: sp_control=16'h0e05; 8'd168: sp_control=16'h0f05; 8'd169: sp_control=16'h4000; 8'd170: sp_control=16'h0026; 8'd171: sp_control=16'h0108; 8'd172: sp_control=16'h2326; 8'd173: sp_control=16'h2526; 8'd174: sp_control=16'h2726; 8'd175: sp_control=16'h0e05; 8'd176: sp_control=16'h0f05; default: sp_control=16'h0; endcase end endfunction function [7:0] sp_index(input [6:0] address); begin case(address) 7'd0: sp_index=8'hff; 7'd1: sp_index=8'hff; 7'd2: sp_index=8'hff; 7'd3: sp_index=8'hff; 7'd4: sp_index=8'hff; 7'd5: sp_index=8'hff; 7'd6: sp_index=8'hff; 7'd7: sp_index=8'hff; 7'd8: sp_index=8'hff; 7'd9: sp_index=8'hff; 7'd10: sp_index=8'hff; 7'd11: sp_index=8'hff; 7'd12: sp_index=8'hff; 7'd13: sp_index=8'hff; 7'd14: sp_index=8'hff; 7'd15: sp_index=8'hff; 7'd16: sp_index=8'h11; 7'd17: sp_index=8'h16; 7'd18: sp_index=8'h11; 7'd19: sp_index=8'h18; 7'd20: sp_index=8'h19; 7'd21: sp_index=8'h1e; 7'd22: sp_index=8'h19; 7'd23: sp_index=8'h20; 7'd24: sp_index=8'h53; 7'd25: sp_index=8'h5e; 7'd26: sp_index=8'h81; 7'd27: sp_index=8'h8e; 7'd28: sp_index=8'h61; 7'd29: sp_index=8'h6c; 7'd30: sp_index=8'h91; 7'd31: sp_index=8'h9e; 7'd32: sp_index=8'h53; 7'd33: sp_index=8'h60; 7'd34: sp_index=8'h81; 7'd35: sp_index=8'h90; 7'd36: sp_index=8'h61; 7'd37: sp_index=8'h6e; 7'd38: sp_index=8'h91; 7'd39: sp_index=8'ha0; 7'd40: sp_index=8'h49; 7'd41: sp_index=8'h4d; 7'd42: sp_index=8'h4a; 7'd43: sp_index=8'h4d; 7'd44: sp_index=8'h4e; 7'd45: sp_index=8'h52; 7'd46: sp_index=8'h4f; 7'd47: sp_index=8'h52; 7'd48: sp_index=8'h21; 7'd49: sp_index=8'h24; 7'd50: sp_index=8'h22; 7'd51: sp_index=8'h25; 7'd52: sp_index=8'h26; 7'd53: sp_index=8'h29; 7'd54: sp_index=8'h27; 7'd55: sp_index=8'h2a; 7'd56: sp_index=8'h7f; 7'd57: sp_index=8'h80; 7'd58: sp_index=8'h7f; 7'd59: sp_index=8'h80; 7'd60: sp_index=8'h7f; 7'd61: sp_index=8'h80; 7'd62: sp_index=8'h7f; 7'd63: sp_index=8'h80; 7'd64: sp_index=8'h01; 7'd65: sp_index=8'h0e; 7'd66: sp_index=8'h01; 7'd67: sp_index=8'h10; 7'd68: sp_index=8'h01; 7'd69: sp_index=8'h0e; 7'd70: sp_index=8'h01; 7'd71: sp_index=8'h10; 7'd72: sp_index=8'h2d; 7'd73: sp_index=8'h38; 7'd74: sp_index=8'h2d; 7'd75: sp_index=8'h3a; 7'd76: sp_index=8'h3b; 7'd77: sp_index=8'h46; 7'd78: sp_index=8'h3b; 7'd79: sp_index=8'h48; 7'd80: sp_index=8'ha1; 7'd81: sp_index=8'ha6; 7'd82: sp_index=8'ha2; 7'd83: sp_index=8'ha6; 7'd84: sp_index=8'ha9; 7'd85: sp_index=8'hae; 7'd86: sp_index=8'haa; 7'd87: sp_index=8'hae; 7'd88: sp_index=8'h6f; 7'd89: sp_index=8'h74; 7'd90: sp_index=8'h6f; 7'd91: sp_index=8'h76; 7'd92: sp_index=8'h77; 7'd93: sp_index=8'h7c; 7'd94: sp_index=8'h77; 7'd95: sp_index=8'h7e; 7'd96: sp_index=8'ha1; 7'd97: sp_index=8'ha8; 7'd98: sp_index=8'ha2; 7'd99: sp_index=8'ha8; 7'd100: sp_index=8'ha9; 7'd101: sp_index=8'hb0; 7'd102: sp_index=8'haa; 7'd103: sp_index=8'hb0; 7'd104: sp_index=8'hff; 7'd105: sp_index=8'hff; 7'd106: sp_index=8'hff; 7'd107: sp_index=8'hff; 7'd108: sp_index=8'hff; 7'd109: sp_index=8'hff; 7'd110: sp_index=8'hff; 7'd111: sp_index=8'hff; 7'd112: sp_index=8'hff; 7'd113: sp_index=8'hff; 7'd114: sp_index=8'hff; 7'd115: sp_index=8'hff; 7'd116: sp_index=8'hff; 7'd117: sp_index=8'hff; 7'd118: sp_index=8'hff; 7'd119: sp_index=8'hff; 7'd120: sp_index=8'h00; 7'd121: sp_index=8'h00; 7'd122: sp_index=8'h00; 7'd123: sp_index=8'h00; 7'd124: sp_index=8'h00; 7'd125: sp_index=8'h00; 7'd126: sp_index=8'h00; 7'd127: sp_index=8'h00; default: sp_index=8'hff; endcase end endfunction function [8:0] sp_quant(input [6:0] address); begin case(address) 7'd0: sp_quant=9'h000; 7'd1: sp_quant=9'h009; 7'd2: sp_quant=9'h011; 7'd3: sp_quant=9'h019; 7'd4: sp_quant=9'h021; 7'd5: sp_quant=9'h029; 7'd6: sp_quant=9'h031; 7'd7: sp_quant=9'h039; 7'd8: sp_quant=9'h041; 7'd9: sp_quant=9'h049; 7'd10: sp_quant=9'h051; 7'd11: sp_quant=9'h059; 7'd12: sp_quant=9'h061; 7'd13: sp_quant=9'h069; 7'd14: sp_quant=9'h071; 7'd15: sp_quant=9'h079; 7'd16: sp_quant=9'h081; 7'd17: sp_quant=9'h089; 7'd18: sp_quant=9'h091; 7'd19: sp_quant=9'h099; 7'd20: sp_quant=9'h0a1; 7'd21: sp_quant=9'h0a9; 7'd22: sp_quant=9'h0b1; 7'd23: sp_quant=9'h0b9; 7'd24: sp_quant=9'h0c1; 7'd25: sp_quant=9'h0c9; 7'd26: sp_quant=9'h0d1; 7'd27: sp_quant=9'h0d9; 7'd28: sp_quant=9'h0e1; 7'd29: sp_quant=9'h0e9; 7'd30: sp_quant=9'h0f1; 7'd31: sp_quant=9'h0f9; 7'd32: sp_quant=9'h101; 7'd33: sp_quant=9'h109; 7'd34: sp_quant=9'h111; 7'd35: sp_quant=9'h119; 7'd36: sp_quant=9'h121; 7'd37: sp_quant=9'h129; 7'd38: sp_quant=9'h12d; 7'd39: sp_quant=9'h131; 7'd40: sp_quant=9'h135; 7'd41: sp_quant=9'h139; 7'd42: sp_quant=9'h13d; 7'd43: sp_quant=9'h141; 7'd44: sp_quant=9'h145; 7'd45: sp_quant=9'h149; 7'd46: sp_quant=9'h14d; 7'd47: sp_quant=9'h151; 7'd48: sp_quant=9'h155; 7'd49: sp_quant=9'h159; 7'd50: sp_quant=9'h15d; 7'd51: sp_quant=9'h161; 7'd52: sp_quant=9'h165; 7'd53: sp_quant=9'h169; 7'd54: sp_quant=9'h16d; 7'd55: sp_quant=9'h171; 7'd56: sp_quant=9'h175; 7'd57: sp_quant=9'h179; 7'd58: sp_quant=9'h17d; 7'd59: sp_quant=9'h181; 7'd60: sp_quant=9'h185; 7'd61: sp_quant=9'h189; 7'd62: sp_quant=9'h18d; 7'd63: sp_quant=9'h191; 7'd64: sp_quant=9'h195; 7'd65: sp_quant=9'h199; 7'd66: sp_quant=9'h19d; 7'd67: sp_quant=9'h1a1; 7'd68: sp_quant=9'h1a5; 7'd69: sp_quant=9'h1a9; 7'd70: sp_quant=9'h1ab; 7'd71: sp_quant=9'h1ad; 7'd72: sp_quant=9'h1af; 7'd73: sp_quant=9'h1b1; 7'd74: sp_quant=9'h1b3; 7'd75: sp_quant=9'h1b5; 7'd76: sp_quant=9'h1b7; 7'd77: sp_quant=9'h1b9; 7'd78: sp_quant=9'h1bb; 7'd79: sp_quant=9'h1bd; 7'd80: sp_quant=9'h1bf; 7'd81: sp_quant=9'h1c1; 7'd82: sp_quant=9'h1c3; 7'd83: sp_quant=9'h1c5; 7'd84: sp_quant=9'h1c7; 7'd85: sp_quant=9'h1c9; 7'd86: sp_quant=9'h1cb; 7'd87: sp_quant=9'h1cd; 7'd88: sp_quant=9'h1cf; 7'd89: sp_quant=9'h1d1; 7'd90: sp_quant=9'h1d3; 7'd91: sp_quant=9'h1d5; 7'd92: sp_quant=9'h1d7; 7'd93: sp_quant=9'h1d9; 7'd94: sp_quant=9'h1db; 7'd95: sp_quant=9'h1dd; 7'd96: sp_quant=9'h1df; 7'd97: sp_quant=9'h1e1; 7'd98: sp_quant=9'h1e2; 7'd99: sp_quant=9'h1e3; 7'd100: sp_quant=9'h1e4; 7'd101: sp_quant=9'h1e5; 7'd102: sp_quant=9'h1e6; 7'd103: sp_quant=9'h1e7; 7'd104: sp_quant=9'h1e8; 7'd105: sp_quant=9'h1e9; 7'd106: sp_quant=9'h1ea; 7'd107: sp_quant=9'h1eb; 7'd108: sp_quant=9'h1ec; 7'd109: sp_quant=9'h1ed; 7'd110: sp_quant=9'h1ee; 7'd111: sp_quant=9'h1ef; 7'd112: sp_quant=9'h1f0; 7'd113: sp_quant=9'h1f1; 7'd114: sp_quant=9'h1f2; 7'd115: sp_quant=9'h1f3; 7'd116: sp_quant=9'h1f4; 7'd117: sp_quant=9'h1f5; 7'd118: sp_quant=9'h1f6; 7'd119: sp_quant=9'h1f7; 7'd120: sp_quant=9'h1f8; 7'd121: sp_quant=9'h1f9; 7'd122: sp_quant=9'h1fa; 7'd123: sp_quant=9'h1fb; 7'd124: sp_quant=9'h1fc; 7'd125: sp_quant=9'h1fd; 7'd126: sp_quant=9'h1fe; 7'd127: sp_quant=9'h1ff; default: sp_quant=9'h0; endcase end endfunction