Skip to content

Commit

Permalink
Fix the color computation code
Browse files Browse the repository at this point in the history
  • Loading branch information
alanjian85 committed Nov 12, 2023
1 parent 0a47078 commit dc20c96
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/main/scala/graphics/DiffInfo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ object DiffInfo {
diffInfo.dremgj := (if (a == 0) 0 else if (a > 0) dividendgj % a else -dividendgj % a).S
diffInfo.drembj := (if (a == 0) 0 else if (a > 0) dividendbj % a else -dividendbj % a).S

val dividendri = (-dx1 + dy1 * (Tile.size - 1)) * 255
val dividendgi = (-dx2 + dy2 * (Tile.size - 1)) * 255
val dividendbi = (-dx0 + dy0 * (Tile.size - 1)) * 255
val dividendri = (dy1 * (Tile.size - 1) - dx1) * 255
val dividendgi = (dy2 * (Tile.size - 1) - dx2) * 255
val dividendbi = (dy0 * (Tile.size - 1) - dx0) * 255

diffInfo.dquori := (if (a == 0) 0 else dividendri / a).S
diffInfo.dquogi := (if (a == 0) 0 else dividendgi / a).S
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/graphics/Graphics.scala
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ class Graphics extends Module {
g := diffInfos(angle).g
b := diffInfos(angle).b

er := diffInfos(angle).r
eg := diffInfos(angle).g
eb := diffInfos(angle).b
er := diffInfos(angle).er
eg := diffInfos(angle).eg
eb := diffInfos(angle).eb

row := 0.U
}
Expand Down

0 comments on commit dc20c96

Please sign in to comment.