data/full_repos/permissive/217518118/rtl/ninjakun_video.v
1: b'%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:34: Cannot find include file: rtl/defs.v\n`include "rtl/defs.v" \n         ^~~~~~~~~~~~\n        ... Looked in:\n             data/full_repos/permissive/217518118/rtl,data/full_repos/permissive/217518118/rtl/defs.v\n             data/full_repos/permissive/217518118/rtl,data/full_repos/permissive/217518118/rtl/defs.v.v\n             data/full_repos/permissive/217518118/rtl,data/full_repos/permissive/217518118/rtl/defs.v.sv\n             rtl/defs.v\n             rtl/defs.v.v\n             rtl/defs.v.sv\n             obj_dir/rtl/defs.v\n             obj_dir/rtl/defs.v.v\n             obj_dir/rtl/defs.v.sv\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:64: Define or directive not defined: \'`HW_PKUNWAR\'\nwire FGOPQ = HWTYPE != `HW_PKUNWAR & (FGOUT[3:0]!=0);\n                       ^~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:65: Define or directive not defined: \'`HW_PKUNWAR\'\nwire FGPPQ = HWTYPE != `HW_PKUNWAR & FGOPQ & (~FGPRI);\n                       ^~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:83: Define or directive not defined: \'`HW_PKUNWAR\'\n VCLKx4, VCLK, RESET, (HWTYPE == `HW_PKUNWAR || HWTYPE == `HW_RAIDERS5),\n                                 ^~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:83: syntax error, unexpected ||, expecting TYPE-IDENTIFIER\n VCLKx4, VCLK, RESET, (HWTYPE == `HW_PKUNWAR || HWTYPE == `HW_RAIDERS5),\n                                             ^~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:83: Define or directive not defined: \'`HW_RAIDERS5\'\n VCLKx4, VCLK, RESET, (HWTYPE == `HW_PKUNWAR || HWTYPE == `HW_RAIDERS5),\n                                                          ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:131: Define or directive not defined: \'`HW_RAIDERS5\'\nwire  [9:0] CHRNO = (HWTYPE == `HW_RAIDERS5 || HWTYPE == `HW_NOVA2001) ? {2\'b00, FGVDT[7:0]} : {1\'b0,FGVDT[13],FGVDT[7:0]};\n                               ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:131: syntax error, unexpected ||, expecting TYPE-IDENTIFIER\nwire  [9:0] CHRNO = (HWTYPE == `HW_RAIDERS5 || HWTYPE == `HW_NOVA2001) ? {2\'b00, FGVDT[7:0]} : {1\'b0,FGVDT[13],FGVDT[7:0]};\n                                            ^~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:131: Define or directive not defined: \'`HW_NOVA2001\'\nwire  [9:0] CHRNO = (HWTYPE == `HW_RAIDERS5 || HWTYPE == `HW_NOVA2001) ? {2\'b00, FGVDT[7:0]} : {1\'b0,FGVDT[13],FGVDT[7:0]};\n                                                         ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:138: Define or directive not defined: \'`HW_RAIDERS5\'\n  0: begin OUT <= CDT[7:4]  ; PAL   <= HWTYPE == `HW_RAIDERS5 ? {1\'b0, FGVDT[15:12]} : FGVDT[12:8]; end\n                                                 ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:138: syntax error, unexpected \'?\', expecting TYPE-IDENTIFIER\n  0: begin OUT <= CDT[7:4]  ; PAL   <= HWTYPE == `HW_RAIDERS5 ? {1\'b0, FGVDT[15:12]} : FGVDT[12:8]; end\n                                                              ^\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:149: Define or directive not defined: \'`HW_NOVA2001\'\nassign FGOUT = HWTYPE == `HW_NOVA2001 ? (OUT == 4\'h1 ? PAL : { PAL[4], OUT }) : { PAL[4], 1\'b0, PAL[3:0], OUT };\n                         ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:149: syntax error, unexpected \'?\', expecting TYPE-IDENTIFIER\nassign FGOUT = HWTYPE == `HW_NOVA2001 ? (OUT == 4\'h1 ? PAL : { PAL[4], OUT }) : { PAL[4], 1\'b0, PAL[3:0], OUT };\n                                      ^\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:175: Define or directive not defined: \'`HW_NOVA2001\'\nwire  [8:0] POSH  = PH+BGSCX+((HWTYPE == `HW_NOVA2001 || HWTYPE == `HW_PKUNWAR) ? 9\'d9 : 9\'d2)  ;\n                                         ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:175: syntax error, unexpected ||, expecting TYPE-IDENTIFIER\nwire  [8:0] POSH  = PH+BGSCX+((HWTYPE == `HW_NOVA2001 || HWTYPE == `HW_PKUNWAR) ? 9\'d9 : 9\'d2)  ;\n                                                      ^~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:175: Define or directive not defined: \'`HW_PKUNWAR\'\nwire  [8:0] POSH  = PH+BGSCX+((HWTYPE == `HW_NOVA2001 || HWTYPE == `HW_PKUNWAR) ? 9\'d9 : 9\'d2)  ;\n                                                                   ^~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:178: Define or directive not defined: \'`HW_RAIDERS5\'\nwire  [10:0] CHRNO = HWTYPE == `HW_RAIDERS5 ? {2\'b10, BGVDT[8:0]} : \n                               ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:178: syntax error, unexpected \'?\', expecting TYPE-IDENTIFIER\nwire  [10:0] CHRNO = HWTYPE == `HW_RAIDERS5 ? {2\'b10, BGVDT[8:0]} : \n                                            ^\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:179: Define or directive not defined: \'`HW_NOVA2001\'\n                     HWTYPE == `HW_NOVA2001 ? {3\'b110, BGVDT[7:0]}:\n                               ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:180: Define or directive not defined: \'`HW_PKUNWAR\'\n      HWTYPE == `HW_PKUNWAR  ? BGVDT[10:0]:\n                ^~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:189: Define or directive not defined: \'`HW_RAIDERS5\'\n        PAL   <= (HWTYPE == `HW_RAIDERS5 || HWTYPE == `HW_PKUNWAR) ? BGVDT[15:12] : BGVDT[11:8];\n                            ^~~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:189: syntax error, unexpected ||, expecting TYPE-IDENTIFIER\n        PAL   <= (HWTYPE == `HW_RAIDERS5 || HWTYPE == `HW_PKUNWAR) ? BGVDT[15:12] : BGVDT[11:8];\n                                         ^~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:189: Define or directive not defined: \'`HW_PKUNWAR\'\n        PAL   <= (HWTYPE == `HW_RAIDERS5 || HWTYPE == `HW_PKUNWAR) ? BGVDT[15:12] : BGVDT[11:8];\n                                                      ^~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:190: Define or directive not defined: \'`HW_PKUNWAR\'\n        BGPRI <= HWTYPE == `HW_PKUNWAR && BGVDT[11];\n                           ^~~~~~~~~~~\n%Error: data/full_repos/permissive/217518118/rtl/ninjakun_video.v:190: syntax error, unexpected &&, expecting TYPE-IDENTIFIER\n        BGPRI <= HWTYPE == `HW_PKUNWAR && BGVDT[11];\n                                       ^~\n%Error: Exiting due to 25 error(s)\n'
module NINJAKUN_VIDEO
(
	input				RESET,
	input				VCLKx4,
	input				VCLK,
	
	input   [8:0]		PH,
	input   [8:0]		PV,

	output  [8:0]		PALAD,

	output  [9:0]		FGVAD,
	input  [15:0]		FGVDT,

	output  [9:0]		BGVAD,
	input  [15:0]		BGVDT,
	input   [7:0]		BGSCX,
	input   [7:0]		BGSCY,

	output [10:0]		SPAAD,
	input   [7:0]		SPADT,

	output				VBLK,
	input				DBGPD,

	input				ROMCL,
	input  [16:0]		ROMAD,
	input   [7:0]		ROMDT,
	input				ROMEN,
	input   [1:0]       HWTYPE
);
`include "rtl/defs.v"

assign VBLK = (PV>=193);


wire		SPCFT = 1'b1;
wire [13:0]	SPCAD;
wire [31:0]	SPCDT;

wire [12:0]	FGCAD;
wire [31:0]	FGCDT;

wire [13:0] BGCAD;
wire [31:0] BGCDT;

NJFGROM sprom(~VCLKx4, SPCAD, SPCDT, ROMCL, ROMAD, ROMDT, ROMEN);
NJFGROM fgrom(  ~VCLK, FGCAD, FGCDT, ROMCL, ROMAD, ROMDT, ROMEN);
NJBGROM bgrom(  ~VCLK, BGCAD, BGCDT, ROMCL, ROMAD, ROMDT, ROMEN);


wire	   FGPRI;
wire [8:0] FGOUT;
NINJAKUN_FG fg(
	VCLK, HWTYPE,
	PH, PV,
	FGVAD, FGVDT,
	FGCAD, FGCDT,
  {FGPRI, FGOUT}
);

wire FGOPQ = HWTYPE != `HW_PKUNWAR & (FGOUT[3:0]!=0);
wire FGPPQ = HWTYPE != `HW_PKUNWAR & FGOPQ & (~FGPRI);


wire [8:0] BGOUT, BGPRI;

NINJAKUN_BG bg(
	VCLK, HWTYPE,
	PH, PV,
	BGSCX, BGSCY,
	BGVAD, BGVDT,
	BGCAD, BGCDT,
	BGOUT, BGPRI
);


wire [8:0] SPOUT;

NINJAKUN_SP sp(
	VCLKx4, VCLK, RESET, (HWTYPE == `HW_PKUNWAR || HWTYPE == `HW_RAIDERS5),
	PH, PV,
	SPAAD, SPADT,
	SPCAD, SPCDT, SPCFT,
	SPOUT
);
	
wire SPOPQ = (SPOUT[3:0]!=0);


wire [8:0] PDOUT = (PV[7]|PV[8]) ? 0 : {PV[6:2],PH[7:4]};

wire BGFRC = BGPRI && BGOUT[3:0] != 0;


DSEL4_9B cmix( 
	.PALAD(PALAD),
	.DBGPD(DBGPD),
	.PDOUT(PDOUT), .BGFRC(BGFRC),
	.FGPPQ(FGPPQ), .FGOUT(FGOUT),
    .SPOPQ(SPOPQ), .SPOUT(SPOUT),
	.FGOPQ(FGOPQ), 
	.BGOUT(BGOUT)
);

endmodule
module NINJAKUN_VIDEO
(
	input				RESET,
	input				VCLKx4,
	input				VCLK,
	
	input   [8:0]		PH,
	input   [8:0]		PV,

	output  [8:0]		PALAD,

	output  [9:0]		FGVAD,
	input  [15:0]		FGVDT,

	output  [9:0]		BGVAD,
	input  [15:0]		BGVDT,
	input   [7:0]		BGSCX,
	input   [7:0]		BGSCY,

	output [10:0]		SPAAD,
	input   [7:0]		SPADT,

	output				VBLK,
	input				DBGPD,

	input				ROMCL,
	input  [16:0]		ROMAD,
	input   [7:0]		ROMDT,
	input				ROMEN,
	input   [1:0]       HWTYPE
);

`include "rtl/defs.v"

assign VBLK = (PV>=193);


wire		SPCFT = 1'b1;
wire [13:0]	SPCAD;
wire [31:0]	SPCDT;

wire [12:0]	FGCAD;
wire [31:0]	FGCDT;

wire [13:0] BGCAD;
wire [31:0] BGCDT;

NJFGROM sprom(~VCLKx4, SPCAD, SPCDT, ROMCL, ROMAD, ROMDT, ROMEN);
NJFGROM fgrom(  ~VCLK, FGCAD, FGCDT, ROMCL, ROMAD, ROMDT, ROMEN);
NJBGROM bgrom(  ~VCLK, BGCAD, BGCDT, ROMCL, ROMAD, ROMDT, ROMEN);


wire	   FGPRI;
wire [8:0] FGOUT;
NINJAKUN_FG fg(
	VCLK, HWTYPE,
	PH, PV,
	FGVAD, FGVDT,
	FGCAD, FGCDT,
  {FGPRI, FGOUT}
);

wire FGOPQ = HWTYPE != `HW_PKUNWAR & (FGOUT[3:0]!=0);
wire FGPPQ = HWTYPE != `HW_PKUNWAR & FGOPQ & (~FGPRI);


wire [8:0] BGOUT, BGPRI;

NINJAKUN_BG bg(
	VCLK, HWTYPE,
	PH, PV,
	BGSCX, BGSCY,
	BGVAD, BGVDT,
	BGCAD, BGCDT,
	BGOUT, BGPRI
);


wire [8:0] SPOUT;

NINJAKUN_SP sp(
	VCLKx4, VCLK, RESET, (HWTYPE == `HW_PKUNWAR || HWTYPE == `HW_RAIDERS5),
	PH, PV,
	SPAAD, SPADT,
	SPCAD, SPCDT, SPCFT,
	SPOUT
);
	
wire SPOPQ = (SPOUT[3:0]!=0);


wire [8:0] PDOUT = (PV[7]|PV[8]) ? 0 : {PV[6:2],PH[7:4]};

wire BGFRC = BGPRI && BGOUT[3:0] != 0;


DSEL4_9B cmix( 
	.PALAD(PALAD),
	.DBGPD(DBGPD),
	.PDOUT(PDOUT), .BGFRC(BGFRC),
	.FGPPQ(FGPPQ), .FGOUT(FGOUT),
    .SPOPQ(SPOPQ), .SPOUT(SPOUT),
	.FGOPQ(FGOPQ), 
	.BGOUT(BGOUT)
);

endmodule