data/full_repos/permissive/175197601/hdl/deprecated/jtpopeye_mister.sv
'utf-8' codec can't decode byte 0x8b in position 0: invalid start byte
1: b'%Error: data/full_repos/permissive/175197601/hdl/deprecated/jtpopeye_mister.sv:105: Cannot find include file: build_id.v\n`include "build_id.v"  \n         ^~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/175197601/hdl/deprecated,data/full_repos/permissive/175197601/build_id.v\n             data/full_repos/permissive/175197601/hdl/deprecated,data/full_repos/permissive/175197601/build_id.v.v\n             data/full_repos/permissive/175197601/hdl/deprecated,data/full_repos/permissive/175197601/build_id.v.sv\n             build_id.v\n             build_id.v.v\n             build_id.v.sv\n             obj_dir/build_id.v\n             obj_dir/build_id.v.v\n             obj_dir/build_id.v.sv\n%Error: data/full_repos/permissive/175197601/hdl/deprecated/jtpopeye_mister.sv:121: Define or directive not defined: \'`BUILD_DATE\'\n    "V,v",`BUILD_DATE, " http://patreon.com/topapate;"\n          ^~~~~~~~~~~\n%Error: data/full_repos/permissive/175197601/hdl/deprecated/jtpopeye_mister.sv:121: syntax error, unexpected \',\', expecting TYPE-IDENTIFIER\n    "V,v",`BUILD_DATE, " http://patreon.com/topapate;"\n                     ^\n%Error: Exiting due to 3 error(s)\n'
module emu
(

    input         CLK_50M,



    input         RESET,


    inout  [44:0] HPS_BUS,


    output        VGA_CLK,



    output        VGA_CE,

    output  [7:0] VGA_R,
    output  [7:0] VGA_G,
    output  [7:0] VGA_B,
    output        VGA_HS,
    output        VGA_VS,
    output        VGA_DE,
    output  reg   VGA_F1,


    output        HDMI_CLK,



    output        HDMI_CE,

    output  [7:0] HDMI_R,
    output  [7:0] HDMI_G,
    output  [7:0] HDMI_B,
    output        HDMI_HS,
    output        HDMI_VS,
    output        HDMI_DE,
    output  [1:0] HDMI_SL,


    output  [7:0] HDMI_ARX,
    output  [7:0] HDMI_ARY,

    output        LED_USER,




    output  [1:0] LED_POWER,
    output  [1:0] LED_DISK,

    output [15:0] AUDIO_L,
    output [15:0] AUDIO_R,
    output        AUDIO_S,

    output  [1:0] ROTATE,


    output        SDRAM_CLK,
    output        SDRAM_CKE,
    output [12:0] SDRAM_A,
    output  [1:0] SDRAM_BA,
    inout  [15:0] SDRAM_DQ,
    output        SDRAM_DQML,
    output        SDRAM_DQMH,
    output        SDRAM_nCS,
    output        SDRAM_nCAS,
    output        SDRAM_nRAS,
    output        SDRAM_nWE
    `ifdef SIMULATION
    ,output         sim_pxl_cen,
    output          sim_pxl_clk,
    output          sim_vs,
    output          sim_hs
    `endif    
);

`include "build_id.v" 
localparam CONF_STR = {
    "JTPOP;;",
    "O1,Credits,OFF,ON;",
    "-;",
    "F,rom;",
    "O2,Aspect Ratio,Original,Wide;",
    "O35,Scandoubler Fx,None,HQ2x,CRT 25%,CRT 50%,CRT 75%;",
    "OGH,Difficulty,Normal,Easy,Hard,Very hard;",
    "OIJ,Lives,4,3,2,1;",
    "OKL,Bonus,40k,60k,80k,No Bonus;",
    "OM,Sky Skipper,No,Yes;",

    "-;",
    "R0,Reset;",
    "J,Punch,Start 1P,Start 2P,Coin,Pause;",
    "V,v",`BUILD_DATE, " http://patreon.com/topapate;"
};



wire clk_sys;
wire pll_locked;

pll pll(
    .refclk     ( CLK_50M    ),
    .rst        ( 1'b0       ),
    .locked     ( pll_locked ),
    .outclk_0   ( clk_sys    )
);



wire [31:0] status;
wire  [1:0] buttons;

wire        ioctl_wr;
wire [21:0] ioctl_addr;
wire  [7:0] ioctl_data;

wire [10:0] ps2_key;
wire [15:0] joy_0, joy_1;

wire        forced_scandoubler;
wire        downloading;
wire        rst, rst_n;

assign LED_DISK  = 2'b0;
assign LED_POWER = 2'b0;

wire HDMI_interlaced = 1'b1;

wire [9:0] game_joy1, game_joy2;
wire [1:0] game_start, game_coin;

wire [2:0] red, green;
wire [1:0] blue;

wire [3:0] game_r = { red, red[2] };
wire [3:0] game_g = { green, green[2] };
wire [3:0] game_b = { blue, blue };

wire       HS, VS;
wire [3:0] gfx_en;




jtframe_mister #(
    .CONF_STR      ( CONF_STR       ),
    .THREE_BUTTONS ( 1'b0           ))
u_frame(
    .clk_sys        ( clk_sys        ),
    .clk_rom        ( clk_sys        ),
    .clk_vga        ( clk_sys        ),
    .pll_locked     ( pll_locked     ),

    .status         ( status         ),
    .HPS_BUS        ( HPS_BUS        ),
    .buttons        ( buttons        ),

    .game_r         ( game_r         ),
    .game_g         ( game_g         ),
    .game_b         ( game_b         ),
    .LHBL           ( LHBL_dly       ),
    .LVBL           ( LVBL_dly       ),
    .hs             ( HS             ),
    .vs             ( VS             ),
    .pxl_cen        ( pxl_cen        ),
    .pxl2_cen       ( pxl2_cen       ),

    .SDRAM_CLK      ( SDRAM_CLK      ),
    .SDRAM_DQ       ( SDRAM_DQ       ),
    .SDRAM_A        ( SDRAM_A        ),
    .SDRAM_DQML     ( SDRAM_DQML     ),
    .SDRAM_DQMH     ( SDRAM_DQMH     ),
    .SDRAM_nWE      ( SDRAM_nWE      ),
    .SDRAM_nCAS     ( SDRAM_nCAS     ),
    .SDRAM_nRAS     ( SDRAM_nRAS     ),
    .SDRAM_nCS      ( SDRAM_nCS      ),
    .SDRAM_BA       ( SDRAM_BA       ),
    .SDRAM_CKE      ( SDRAM_CKE      ),

    .ioctl_addr     ( ioctl_addr     ),
    .ioctl_data     ( ioctl_data     ),
    .ioctl_wr       ( ioctl_wr       ),
    .prog_addr      ( 22'd0          ),
    .prog_data      ( 8'd0           ),
    .prog_mask      ( 2'b11          ),
    .prog_we        ( 1'b1           ),
    .prog_rd        ( 1'b0           ),
    .downloading    ( downloading    ),
    .dwnld_busy     ( downloading    ),

    .loop_rst       ( 1'b0           ),
    .sdram_addr     ( 22'd0          ),
    .sdram_req      ( 1'b0           ),
    .sdram_ack      (                ),
    .data_read      (                ),
    .data_rdy       (                ),
    .refresh_en     ( 1'b0           ),

    .rst            ( rst            ),
    .rst_n          ( rst_n          ),
    .game_rst       ( game_rst       ),
    .game_rst_n     ( game_rst_n     ),

    .rst_req        ( rst_req        ),

    .game_joystick1 ( game_joy1      ),
    .game_joystick2 ( game_joy2      ),
    .game_coin      ( game_coin      ),
    .game_start     ( game_start     ),
    .game_service   (                ),
    .LED            ( LED_USER       ),

    .enable_fm      ( enable_fm      ),
    .enable_psg     ( enable_psg     ),
    .dip_test       ( dip_test       ),
    .dip_pause      ( dip_pause      ),
    .dip_flip       ( dip_flip       ),
    .dip_fxlevel    (                ),

    .rotate         ( ROTATE         ),

    .hdmi_r         ( HDMI_R         ),
    .hdmi_g         ( HDMI_G         ),
    .hdmi_b         ( HDMI_B         ),
    .hdmi_hs        ( HDMI_HS        ),
    .hdmi_vs        ( HDMI_VS        ),
    .hdmi_clk       ( HDMI_CLK       ),
    .hdmi_cen       ( HDMI_CE        ),
    .hdmi_de        ( HDMI_DE        ),
    .hdmi_sl        ( HDMI_SL        ),
    .hdmi_arx       ( HDMI_ARX       ),
    .hdmi_ary       ( HDMI_ARY       ),

    .scan2x_r       ( VGA_R          ),
    .scan2x_g       ( VGA_G          ),
    .scan2x_b       ( VGA_B          ),
    .scan2x_hs      ( VGA_HS         ),
    .scan2x_vs      ( VGA_VS         ),
    .scan2x_clk     ( VGA_CLK        ),
    .scan2x_cen     ( VGA_CE         ),
    .scan2x_de      ( VGA_DE         ),

    .gfx_en         ( gfx_en         )
);

wire game_service = 1'b0;

assign ROTATE = 2'b00;
`ifdef SIMULATION
assign sim_pxl_clk = clk_sys;
assign sim_pxl_cen = pxl_cen;
`endif

jtpopeye_game u_game(
    .rst_n          ( rst_n            ),
    .clk            ( clk_sys          ),
    .pxl_cen        ( pxl_cen          ),
    .pxl2_cen       ( pxl2_cen         ),

    .red            ( red              ),
    .green          ( green            ),
    .blue           ( blue             ),
    .HB             ( HB               ),
    .VB             ( VB               ),
    .HS             ( HS               ),
    .VS             ( VS               ),
    .SY_n           (                  ),
    .INITEO         ( INITEO           ),

    .start_button   ( game_start       ),
    .coin_input     ( game_coin[0]     ),
    .joystick1      ( game_joy1[4:0]   ),
    .joystick2      ( game_joy2[4:0]   ),
    .service        ( game_service     ),


    .uart_rx        ( 1'b0             ),
    .uart_tx        (                  ),


    .downloading    ( downloading      ),
    .ioctl_addr     ( ioctl_addr       ),
    .ioctl_data     ( ioctl_data       ),
    .ioctl_wr       ( ioctl_wr         ),


    .dip_pause      ( dip_pause        ),
    .status         ( status           ),

    .snd            ( AUDIO_L[15:6]    ),
    .sample         (),

    .gfx_en ( {gfx_en[3], gfx_en[1:0]} )
);

assign AUDIO_L[5:0] = 6'd0;
assign AUDIO_R = AUDIO_L;
assign AUDIO_S = 0;

endmodule
module emu
(

    input         CLK_50M,



    input         RESET,


    inout  [44:0] HPS_BUS,


    output        VGA_CLK,



    output        VGA_CE,

    output  [7:0] VGA_R,
    output  [7:0] VGA_G,
    output  [7:0] VGA_B,
    output        VGA_HS,
    output        VGA_VS,
    output        VGA_DE,
    output  reg   VGA_F1,


    output        HDMI_CLK,



    output        HDMI_CE,

    output  [7:0] HDMI_R,
    output  [7:0] HDMI_G,
    output  [7:0] HDMI_B,
    output        HDMI_HS,
    output        HDMI_VS,
    output        HDMI_DE,
    output  [1:0] HDMI_SL,


    output  [7:0] HDMI_ARX,
    output  [7:0] HDMI_ARY,

    output        LED_USER,




    output  [1:0] LED_POWER,
    output  [1:0] LED_DISK,

    output [15:0] AUDIO_L,
    output [15:0] AUDIO_R,
    output        AUDIO_S,

    output  [1:0] ROTATE,


    output        SDRAM_CLK,
    output        SDRAM_CKE,
    output [12:0] SDRAM_A,
    output  [1:0] SDRAM_BA,
    inout  [15:0] SDRAM_DQ,
    output        SDRAM_DQML,
    output        SDRAM_DQMH,
    output        SDRAM_nCS,
    output        SDRAM_nCAS,
    output        SDRAM_nRAS,
    output        SDRAM_nWE
    `ifdef SIMULATION
    ,output         sim_pxl_cen,
    output          sim_pxl_clk,
    output          sim_vs,
    output          sim_hs
    `endif    
);


`include "build_id.v" 
localparam CONF_STR = {
    "JTPOP;;",
    "O1,Credits,OFF,ON;",
    "-;",
    "F,rom;",
    "O2,Aspect Ratio,Original,Wide;",
    "O35,Scandoubler Fx,None,HQ2x,CRT 25%,CRT 50%,CRT 75%;",
    "OGH,Difficulty,Normal,Easy,Hard,Very hard;",
    "OIJ,Lives,4,3,2,1;",
    "OKL,Bonus,40k,60k,80k,No Bonus;",
    "OM,Sky Skipper,No,Yes;",

    "-;",
    "R0,Reset;",
    "J,Punch,Start 1P,Start 2P,Coin,Pause;",
    "V,v",`BUILD_DATE, " http://patreon.com/topapate;"
};



wire clk_sys;
wire pll_locked;

pll pll(
    .refclk     ( CLK_50M    ),
    .rst        ( 1'b0       ),
    .locked     ( pll_locked ),
    .outclk_0   ( clk_sys    )
);



wire [31:0] status;
wire  [1:0] buttons;

wire        ioctl_wr;
wire [21:0] ioctl_addr;
wire  [7:0] ioctl_data;

wire [10:0] ps2_key;
wire [15:0] joy_0, joy_1;

wire        forced_scandoubler;
wire        downloading;
wire        rst, rst_n;

assign LED_DISK  = 2'b0;
assign LED_POWER = 2'b0;

wire HDMI_interlaced = 1'b1;

wire [9:0] game_joy1, game_joy2;
wire [1:0] game_start, game_coin;

wire [2:0] red, green;
wire [1:0] blue;

wire [3:0] game_r = { red, red[2] };
wire [3:0] game_g = { green, green[2] };
wire [3:0] game_b = { blue, blue };

wire       HS, VS;
wire [3:0] gfx_en;




jtframe_mister #(
    .CONF_STR      ( CONF_STR       ),
    .THREE_BUTTONS ( 1'b0           ))
u_frame(
    .clk_sys        ( clk_sys        ),
    .clk_rom        ( clk_sys        ),
    .clk_vga        ( clk_sys        ),
    .pll_locked     ( pll_locked     ),

    .status         ( status         ),
    .HPS_BUS        ( HPS_BUS        ),
    .buttons        ( buttons        ),

    .game_r         ( game_r         ),
    .game_g         ( game_g         ),
    .game_b         ( game_b         ),
    .LHBL           ( LHBL_dly       ),
    .LVBL           ( LVBL_dly       ),
    .hs             ( HS             ),
    .vs             ( VS             ),
    .pxl_cen        ( pxl_cen        ),
    .pxl2_cen       ( pxl2_cen       ),

    .SDRAM_CLK      ( SDRAM_CLK      ),
    .SDRAM_DQ       ( SDRAM_DQ       ),
    .SDRAM_A        ( SDRAM_A        ),
    .SDRAM_DQML     ( SDRAM_DQML     ),
    .SDRAM_DQMH     ( SDRAM_DQMH     ),
    .SDRAM_nWE      ( SDRAM_nWE      ),
    .SDRAM_nCAS     ( SDRAM_nCAS     ),
    .SDRAM_nRAS     ( SDRAM_nRAS     ),
    .SDRAM_nCS      ( SDRAM_nCS      ),
    .SDRAM_BA       ( SDRAM_BA       ),
    .SDRAM_CKE      ( SDRAM_CKE      ),

    .ioctl_addr     ( ioctl_addr     ),
    .ioctl_data     ( ioctl_data     ),
    .ioctl_wr       ( ioctl_wr       ),
    .prog_addr      ( 22'd0          ),
    .prog_data      ( 8'd0           ),
    .prog_mask      ( 2'b11          ),
    .prog_we        ( 1'b1           ),
    .prog_rd        ( 1'b0           ),
    .downloading    ( downloading    ),
    .dwnld_busy     ( downloading    ),

    .loop_rst       ( 1'b0           ),
    .sdram_addr     ( 22'd0          ),
    .sdram_req      ( 1'b0           ),
    .sdram_ack      (                ),
    .data_read      (                ),
    .data_rdy       (                ),
    .refresh_en     ( 1'b0           ),

    .rst            ( rst            ),
    .rst_n          ( rst_n          ),
    .game_rst       ( game_rst       ),
    .game_rst_n     ( game_rst_n     ),

    .rst_req        ( rst_req        ),

    .game_joystick1 ( game_joy1      ),
    .game_joystick2 ( game_joy2      ),
    .game_coin      ( game_coin      ),
    .game_start     ( game_start     ),
    .game_service   (                ),
    .LED            ( LED_USER       ),

    .enable_fm      ( enable_fm      ),
    .enable_psg     ( enable_psg     ),
    .dip_test       ( dip_test       ),
    .dip_pause      ( dip_pause      ),
    .dip_flip       ( dip_flip       ),
    .dip_fxlevel    (                ),

    .rotate         ( ROTATE         ),

    .hdmi_r         ( HDMI_R         ),
    .hdmi_g         ( HDMI_G         ),
    .hdmi_b         ( HDMI_B         ),
    .hdmi_hs        ( HDMI_HS        ),
    .hdmi_vs        ( HDMI_VS        ),
    .hdmi_clk       ( HDMI_CLK       ),
    .hdmi_cen       ( HDMI_CE        ),
    .hdmi_de        ( HDMI_DE        ),
    .hdmi_sl        ( HDMI_SL        ),
    .hdmi_arx       ( HDMI_ARX       ),
    .hdmi_ary       ( HDMI_ARY       ),

    .scan2x_r       ( VGA_R          ),
    .scan2x_g       ( VGA_G          ),
    .scan2x_b       ( VGA_B          ),
    .scan2x_hs      ( VGA_HS         ),
    .scan2x_vs      ( VGA_VS         ),
    .scan2x_clk     ( VGA_CLK        ),
    .scan2x_cen     ( VGA_CE         ),
    .scan2x_de      ( VGA_DE         ),

    .gfx_en         ( gfx_en         )
);

wire game_service = 1'b0;

assign ROTATE = 2'b00;
`ifdef SIMULATION
assign sim_pxl_clk = clk_sys;
assign sim_pxl_cen = pxl_cen;
`endif

jtpopeye_game u_game(
    .rst_n          ( rst_n            ),
    .clk            ( clk_sys          ),
    .pxl_cen        ( pxl_cen          ),
    .pxl2_cen       ( pxl2_cen         ),

    .red            ( red              ),
    .green          ( green            ),
    .blue           ( blue             ),
    .HB             ( HB               ),
    .VB             ( VB               ),
    .HS             ( HS               ),
    .VS             ( VS               ),
    .SY_n           (                  ),
    .INITEO         ( INITEO           ),

    .start_button   ( game_start       ),
    .coin_input     ( game_coin[0]     ),
    .joystick1      ( game_joy1[4:0]   ),
    .joystick2      ( game_joy2[4:0]   ),
    .service        ( game_service     ),


    .uart_rx        ( 1'b0             ),
    .uart_tx        (                  ),


    .downloading    ( downloading      ),
    .ioctl_addr     ( ioctl_addr       ),
    .ioctl_data     ( ioctl_data       ),
    .ioctl_wr       ( ioctl_wr         ),


    .dip_pause      ( dip_pause        ),
    .status         ( status           ),

    .snd            ( AUDIO_L[15:6]    ),
    .sample         (),

    .gfx_en ( {gfx_en[3], gfx_en[1:0]} )
);

assign AUDIO_L[5:0] = 6'd0;
assign AUDIO_R = AUDIO_L;
assign AUDIO_S = 0;

endmodule