Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SiDi128: rotate module using the second SDRAM by robinsonb5 #899

Merged
merged 4 commits into from
Dec 20, 2024

Conversation

gyurco
Copy link
Collaborator

@gyurco gyurco commented Dec 17, 2024

Credits to Alastair M. Robinson (https://github.com/robinsonb5/) for his rotating scandoubler extension, using the SDRAM as a framebuffer.

Credits to Alastair M. Robinson (https://github.com/robinsonb5/)
for his rotating scandoubler extension, using the SDRAM as a framebuffer.
@gyurco
Copy link
Collaborator Author

gyurco commented Dec 17, 2024

I noticed that some cores use a DIPBASE=8, which is not good, since many options are in the 8-15 range, so I removed them (need new MRAs, too, but AFAIK they're automatically updated).

@jotego
Copy link
Owner

jotego commented Dec 17, 2024

I have to review it but removing the dip base should be ok. That macro comes from the old times when MiST could not handle so many dip switches.

The CPSx cores timing is failing. We need the timing to be clean before merging. 🙏🏼

@jotego
Copy link
Owner

jotego commented Dec 17, 2024

And thank you!!

@gyurco
Copy link
Collaborator Author

gyurco commented Dec 17, 2024

They failed even before, for ages. It can be made clean, with "STANDARD EFFORT", but it slows down the compiling a lot, so we agreed to not apply it some time ago.

@jotego
Copy link
Owner

jotego commented Dec 18, 2024

But the daily compilation works. So I think it is the PR content. If using standard effort works, we could enable that for compilation with the JTFRAME_RELEASE macro set.

@jotego
Copy link
Owner

jotego commented Dec 18, 2024

If my understanding is correct, this uses the second SDRAM chip and does not interfere with the operation of the first SDRAM chip. Is that right?

@@ -4,7 +4,8 @@
{{ if .JTFRAME_OSD_LOAD }} F,rom; {{ end }}
{{ if .JTFRAME_VERTICAL }}
{{ if .JTFRAME_OSD_FLIP }} O1,Flip screen,Off,On; {{ end }}
O2,Rotate controls,Yes,No; {{ end }}
O2,Rotate controls,Yes,No;
{{ if .JTFRAME_SDRAM_ROTATION }} OD,Screen Rotation,No,Yes; {{ end }}{{ end }}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On MiSTer, there is a way to disable the display of this line when the game is not vertical. So a core that handles both vertical and horizontal games only displays it when needed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no feedback to the OSD from the core in the MiST firmware. It won't be hard to do it, just the urge wasn't too strong to implement it.

@@ -71,3 +71,4 @@ CORE_OSD=OKM,Control Type,A.Stick,A.Triggers,A.Wheel;

[sidi128]
JTFRAME_LF_SDRAM_BUFFER
-JTFRAME_SDRAM_ROTATION
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires unsetting it manually on the horizontal games.
Maybe this could work instead:

`ifdef SIDI128
`ifdef JTFRAME_VERTICAL
`define JTFRAME_SDRAM_ROTATION
`endif
`endif

Added to the relevant files.

Another option is to have jtframe add it conditionally for SIDI128+JTFRAME_VERTICAL compilations. This function will need to be modified. I think modifying jtframe is cleaner.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't do any harm on non-vertical games, but I can disable it for them, also.

@jotego
Copy link
Owner

jotego commented Dec 18, 2024

One more question, this only affects the HDMI output, right? The regular VGA output will be kept as it is, isn't it?

@gyurco
Copy link
Collaborator Author

gyurco commented Dec 18, 2024

It rotates the scandoubled output, so HDMI and VGA are rotated. 15kHz video is unchanged.

@gyurco
Copy link
Collaborator Author

gyurco commented Dec 18, 2024

If my understanding is correct, this uses the second SDRAM chip and does not interfere with the operation of the first SDRAM chip. Is that right?

Yes, that's true. The only game which already uses the second SDRAM is Outrun, but rotating is not needed for it.

@gyurco
Copy link
Collaborator Author

gyurco commented Dec 18, 2024

But the daily compilation works. So I think it is the PR content. If using standard effort works, we could enable that for compilation with the JTFRAME_RELEASE macro set.

You meant with JTFRAME_RELEASE?
As with the PR's, they already failed:
#898

@gyurco
Copy link
Collaborator Author

gyurco commented Dec 18, 2024

This one:

{{ if (index .Macros "JTFRAME_RELEASE") -}}^M
set_global_assignment -name OPTIMIZATION_MODE "HIGH PERFORMANCE EFFORT"^M
{{ else -}}^M
set_global_assignment -name CYCLONEII_OPTIMIZATION_TECHNIQUE BALANCED^M
{{ end }}^M

doesn't seem to work:

set_global_assignment -name CYCLONEII_OPTIMIZATION_TECHNIQUE BALANCED^M
.
.
.
set_global_assignment -name VERILOG_MACRO "JTFRAME_RELEASE=1"

@gyurco
Copy link
Collaborator Author

gyurco commented Dec 18, 2024

It works with jtcore -d JTFRAME_RELEASE=1 ..., but not with jtcore -d JTFRAME_RELEASE ...

It makes the timings better, as the flip-flop's reset input can
be used instead of gating the clock/data lines with the reset signal.
@gyurco
Copy link
Collaborator Author

gyurco commented Dec 19, 2024

Added a patch to CPS, which eliminates the worst paths starting from rst_video. Now it builds well with -d JTFRAME_RELEASE=1

@jotego jotego merged commit 2f377f5 into master Dec 20, 2024
199 of 203 checks passed
@jotego
Copy link
Owner

jotego commented Dec 20, 2024

Thank you!
JTFRAME_RELEASE=1 was already set by jtcore --nodbg so we should be good to go

@rp-jt
Copy link
Collaborator

rp-jt commented Dec 20, 2024

Hello @gyurco,
I'm trying to test this, but I don't see any changes when I select "Screen Rotation: Yes" in the SiDi128 menu for the latest compile all.
Is there any further step I should do?

I'm using VGA output with scandoubler

@gyurco
Copy link
Collaborator Author

gyurco commented Dec 20, 2024

Hi,
In which game did you try?
Maybe you have to update the MRAs/ARCs, too, because of the removing of JTFRAME_DIPBASE from some cores.

@gyurco
Copy link
Collaborator Author

gyurco commented Dec 20, 2024

Just took this screenshot from current master from cps2:
cps2-rotate

@jotego
Copy link
Owner

jotego commented Dec 21, 2024

I can confirm it work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

3 participants