Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
melonDS
Commits
a7e7af4b
Commit
a7e7af4b
authored
Mar 04, 2017
by
StapleButter
Browse files
fix behavior for rotscale BG reference points
parent
5c3b7b5c
Changes
3
Hide whitespace changes
Inline
Side-by-side
GPU2D.cpp
View file @
a7e7af4b
...
...
@@ -26,6 +26,7 @@
//
// * BLDCNT special effects are applied on 18bit colors
// -> layers are converted to 18bit before being composited
// -> 'brightness up' effect does: x = x + (63-x)*factor
// * colors are converted as follows: 18bit = 15bit * 2
// -> white comes out as 62,62,62 and not 63,63,63
// * VRAM/FIFO display modes convert colors the same way
...
...
@@ -76,8 +77,10 @@ void GPU2D::Reset()
memset
(
BGCnt
,
0
,
4
*
2
);
memset
(
BGXPos
,
0
,
4
*
2
);
memset
(
BGYPos
,
0
,
4
*
2
);
memset
(
BGXCenter
,
0
,
2
*
4
);
memset
(
BGYCenter
,
0
,
2
*
4
);
memset
(
BGXRef
,
0
,
2
*
4
);
memset
(
BGYRef
,
0
,
2
*
4
);
memset
(
BGXRefInternal
,
0
,
2
*
4
);
memset
(
BGYRefInternal
,
0
,
2
*
4
);
memset
(
BGRotA
,
0
,
2
*
2
);
memset
(
BGRotB
,
0
,
2
*
2
);
memset
(
BGRotC
,
0
,
2
*
2
);
...
...
@@ -209,20 +212,24 @@ void GPU2D::Write32(u32 addr, u32 val)
case
0x028
:
if
(
val
&
0x08000000
)
val
|=
0xF0000000
;
BGXCenter
[
0
]
=
val
;
BGXRef
[
0
]
=
val
;
if
(
GPU
::
VCount
<
192
)
BGXRefInternal
[
0
]
=
val
;
return
;
case
0x02C
:
if
(
val
&
0x08000000
)
val
|=
0xF0000000
;
BGYCenter
[
0
]
=
val
;
BGYRef
[
0
]
=
val
;
if
(
GPU
::
VCount
<
192
)
BGYRefInternal
[
0
]
=
val
;
return
;
case
0x038
:
if
(
val
&
0x08000000
)
val
|=
0xF0000000
;
BGXCenter
[
1
]
=
val
;
BGXRef
[
1
]
=
val
;
if
(
GPU
::
VCount
<
192
)
BGXRefInternal
[
1
]
=
val
;
return
;
case
0x03C
:
if
(
val
&
0x08000000
)
val
|=
0xF0000000
;
BGYCenter
[
1
]
=
val
;
BGYRef
[
1
]
=
val
;
if
(
GPU
::
VCount
<
192
)
BGYRefInternal
[
1
]
=
val
;
return
;
case
0x064
:
...
...
@@ -366,6 +373,11 @@ void GPU2D::DrawScanline(u32 line)
void
GPU2D
::
VBlank
()
{
BGXRefInternal
[
0
]
=
BGXRef
[
0
];
BGXRefInternal
[
1
]
=
BGXRef
[
1
];
BGYRefInternal
[
0
]
=
BGYRef
[
0
];
BGYRefInternal
[
1
]
=
BGYRef
[
1
];
CaptureCnt
&=
~
(
1
<<
31
);
}
...
...
@@ -973,12 +985,8 @@ void GPU2D::DrawBG_Extended(u32 line, u32* dst, u32 bgnum)
s16
rotC
=
BGRotC
[
bgnum
-
2
];
s16
rotD
=
BGRotD
[
bgnum
-
2
];
s32
rotX
=
BGXCenter
[
bgnum
-
2
];
s32
rotY
=
BGYCenter
[
bgnum
-
2
];
// hax
rotX
+=
line
*
rotB
;
rotY
+=
line
*
rotD
;
s32
rotX
=
BGXRefInternal
[
bgnum
-
2
];
s32
rotY
=
BGYRefInternal
[
bgnum
-
2
];
if
(
bgcnt
&
0x0080
)
{
...
...
@@ -1081,8 +1089,8 @@ void GPU2D::DrawBG_Extended(u32 line, u32* dst, u32 bgnum)
}
}
//
BGX
Ce
nter[bgnum-2] += rotB;
//
BGY
Ce
nter[bgnum-2] += rotD;
BGX
RefI
nter
nal
[
bgnum
-
2
]
+=
rotB
;
BGY
RefI
nter
nal
[
bgnum
-
2
]
+=
rotD
;
}
void
GPU2D
::
InterleaveSprites
(
u32
*
buf
,
u32
prio
,
u32
*
dst
)
...
...
GPU2D.h
View file @
a7e7af4b
...
...
@@ -55,8 +55,10 @@ private:
u16
BGXPos
[
4
];
u16
BGYPos
[
4
];
s32
BGXCenter
[
2
];
s32
BGYCenter
[
2
];
s32
BGXRef
[
2
];
s32
BGYRef
[
2
];
s32
BGXRefInternal
[
2
];
s32
BGYRefInternal
[
2
];
s16
BGRotA
[
2
];
s16
BGRotB
[
2
];
s16
BGRotC
[
2
];
...
...
melonDS.depend
View file @
a7e7af4b
...
...
@@ -10,7 +10,7 @@
1481161027 c:\documents\sources\melonds\types.h
1488
497660
source:c:\documents\sources\melonds\nds.cpp
1488
589906
source:c:\documents\sources\melonds\nds.cpp
<stdio.h>
<string.h>
"NDS.h"
...
...
@@ -87,13 +87,13 @@
"NDS.h"
"SPI.h"
1488
477220
source:c:\documents\sources\melonds\gpu2d.cpp
1488
589055
source:c:\documents\sources\melonds\gpu2d.cpp
<stdio.h>
<string.h>
"NDS.h"
"GPU.h"
1488
47564
0 c:\documents\sources\melonds\gpu2d.h
1488
59021
0 c:\documents\sources\melonds\gpu2d.h
1481040524 c:\documents\sources\melonds\wifi.h
...
...
@@ -109,7 +109,7 @@
1486511075 c:\documents\sources\melonds\fifo.h
"types.h"
1488
497840
source:c:\documents\sources\melonds\dma.cpp
1488
589063
source:c:\documents\sources\melonds\dma.cpp
<stdio.h>
"NDS.h"
"DMA.h"
...
...
@@ -119,7 +119,7 @@
1487305393 c:\documents\sources\melonds\dma.h
"types.h"
1488
496264
source:c:\documents\sources\melonds\gpu.cpp
1488
589923
source:c:\documents\sources\melonds\gpu.cpp
<stdio.h>
<string.h>
"NDS.h"
...
...
@@ -140,7 +140,7 @@
1486506409 c:\documents\sources\melonds\ndscart.h
"types.h"
1488
49
626
4
source:c:\documents\sources\melonds\ndscart.cpp
1488
58
626
5
source:c:\documents\sources\melonds\ndscart.cpp
<stdio.h>
<string.h>
"NDS.h"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment