mirror of
https://github.com/MiSTer-devel/Gameboy_MiSTer.git
synced 2026-05-24 03:03:25 +00:00
VIDEO: sprite priority fixed for GBC handed differently (sprite index in oam is used instead of X position)
This commit is contained in:
4
sprite.v
4
sprite.v
@@ -22,6 +22,8 @@
|
||||
module sprite (
|
||||
input clk,
|
||||
input size16,
|
||||
input isGBC,
|
||||
input [7:0] sprite_index,
|
||||
|
||||
input [7:0] v_cnt,
|
||||
input [7:0] h_cnt,
|
||||
@@ -50,7 +52,7 @@ module sprite (
|
||||
|
||||
// x position for priority detection. Invisible sprites are far to the right and
|
||||
// have minimum priority
|
||||
assign x = v_visible?x_pos:8'hff;
|
||||
assign x = v_visible?isGBC?sprite_index:x_pos:8'hff;
|
||||
|
||||
// register used to store pixel data for current line
|
||||
reg [7:0] data0;
|
||||
|
||||
@@ -23,6 +23,7 @@ module sprites (
|
||||
input clk,
|
||||
input clk_reg,
|
||||
input size16,
|
||||
input isGBC,
|
||||
|
||||
// pixel position input which the current pixel is generated for
|
||||
input [7:0] v_cnt,
|
||||
@@ -98,6 +99,9 @@ for(i=0;i<SPRITES;i=i+1) begin : spr
|
||||
sprite sprite (
|
||||
.clk ( clk_reg ),
|
||||
.size16 ( size16 ),
|
||||
.isGBC ( isGBC ),
|
||||
|
||||
.sprite_index ( i ),
|
||||
|
||||
.v_cnt ( v_cnt ),
|
||||
.h_cnt ( h_cnt ),
|
||||
|
||||
Reference in New Issue
Block a user