• Welcome to Talking Time's third iteration! If you would like to register for an account, or have already registered but have not yet been confirmed, please read the following:

    1. The CAPTCHA key's answer is "Percy"
    2. Once you've completed the registration process please email us from the email you used for registration at percyreghelper@gmail.com and include the username you used for registration

    Once you have completed these steps, Moderation Staff will be able to get your account approved.

MiSTer: the thread of cycle accuracy

Sarge

hardcore retro gamin'
If this happens... I mean, wow. That would be insane.

@Phantoon: N64 core when? I mean, it should be doable, right? ;)

(Discussion ball is now rolling.)
 

Phantoon

I cuss you bad
@Phantoon: N64 core when? I mean, it should be doable, right?
If you could power it by me wanting it you'd have had it years ago

Sadly I don't think the MiSTer can do it, so it should show its repentance in the form of Konami arcade games
 

Sarge

hardcore retro gamin'
Yeah, I don't think it'll happen, either.

But I do think Konami arcade games will be coming. I've heard rumblings to that effect, and given some of the games involved (TMNT, The Simpsons, X-Men), it'll probably be sooner than we think.

What I'm really hoping for is the NBA Jam hardware. :)
 

Phantoon

I cuss you bad
Oh yeah, NBA Jam would be flat out incredible. Wouldn't say no to Mortal Kombat II if that could be done, either
 

Sarge

hardcore retro gamin'
I honestly don't think it's out of reach. I don't see anything in that hardware that screams unobtainable, unless the graphics side of the equation is really complex. I don't think the CPU is anything crazy at all - it looks like a TMS34010 @ 6.25 MHz.
 

Falselogic

Lapsed Threadcromancer
(they/them)
While watching @MCBanjoMike play Kaizo Mario the other night he started describing his MISTER set up to me and pretty much sold me on getting one. Especially considering how CORES are continually expanding and we might very soon have the 32-bit systems on these things. (Even if we don't it seems worth it.) So, where do I start? Are there some good guides on what hardware and software I need?

Thank you!
 

ShakeWell

Slam Master
(he, etc.)
While watching @MCBanjoMike play Kaizo Mario the other night he started describing his MISTER set up to me and pretty much sold me on getting one. Especially considering how CORES are continually expanding and we might very soon have the 32-bit systems on these things. (Even if we don't it seems worth it.) So, where do I start? Are there some good guides on what hardware and software I need?

Thank you!

Here's an old video I made when I first set mine up:


But the only software you need to start is the main MiSTer program from github. Once you have that, you can fire up the DE-10 and it will just go right into the MiSTer frontend. From there, you can run the update scripts to get all the cores, and then you just need ROM packs for the consoles (some of which can be added with ancillary scripts). It's pretty easy, easier than a RetroPi.
 

Sarge

hardcore retro gamin'
Yeah, it was shockingly easy to get set up. I used the SD card prep tool so the partitions were set up right, then used the offline updater-pc script to grab all the cores if you don't hook it up for network access.
 

John

(he/him)
I like it because it reminds me of the early days of emulation, like when emulators like ZSNES had big updates like "Supports transparency layers, so you can get through the Mist Cave in FFIV" or "SuperFX now works at 3FPS". Every time I run the update script some new arcade game/console/computer is added, and I don't even have to search through shady Must Delete After 24 Hours rom sites.
 

MCBanjoMike

Sudden chomper
(He/him)
So False, in terms of hardware, there are only a few essential components. You need the DE-10 itself and you'll almost certainly want a RAM expansion*. 32MB of RAM will run most cores, but some (particularly later Neo Geo games and some CPS2) require more. A USB hub is also necessary, because the DE-10 only has one USB port and it's a micro USB, of all things. Makerspot makes a $7 USB hub that works great, a lot of us have one. I would also recommend getting a heatsink and fan, just to be safe. Oh, and you'll need a micro SD card. With multiple CD-based cores that function and a few more on the horizon, I would recommend getting a pretty big one! You can also use network storage, but I don't know how to do that.

As for optional components: a USB board probably isn't necessary to begin with unless you want to plug a lot of wireless dongles in. I use a wireless keyboard and a bluetooth adapter for a controller and it works just fine with the Makerspot USB hub. You might need the USB expansion board if you want to use wifi, however. If you get one, you might also need to buy a stronger power supply.

The IO board is a super fun toy but is only necessary if you want to use analog and digital output at the same time. I have one and I love it, but if you're only going to play on an HDTV then it doesn't offer a lot of advantages.

A case is great if you have kids or pets, or if you plan on moving your MiSTer around a lot. Otherwise you probably don't need one.

As for where to get stuff, I would say that MisterAddons (AKA PorkChopExpress) is the most well-known guy in North America for this stuff. He has good products and is easy to reach if you have any questions. You might even be able to get a discount if you find a referral code, but I can't figure out where mine went.

Welcome to the club!


*Sadly, there have been a couple of issues with RAM designs and there's no guarantee that the one you get will work with everything in the future, but I think the boards from the reputable sellers will at least work properly with all the cores that exist today. Just know that you may one day need to replace your RAM if future cores require more memory speed than what the current models can support.
 

Phantoon

I cuss you bad
I would also add that some cores (the Genesis and GBA cores when I was starting out) work with just the DE10 Nano board so you can phase the other boards in as required.

I found this link helpful setting mine up.
 

John

(he/him)
I like the USB add-on board that's the same dimensions as the DE-10, because it fits nice with the case I got from MisterAddons. I think he's sold out of the PCB style case that I have, and I think is sold out of the new passively cooled aluminum ones he's made. You may have to go with a 3d printed one from someone else, or just run it naked.
 

Sarge

hardcore retro gamin'
I'm conflicted on whether I'd want a passive cooling solution or not. The fan noise honestly doesn't bother me much, and I like the idea of as much cooling as I can get with the more demanding cores.
 
I have a literal bag of heatsinks and thermal tape squares, I will send anyone on this forum one for just the cost of sending it. Get at me.

Speaking of... in the process of upgrading my setup and moving it into a passively cooled case I now have the following spare parts. All but the USB hub were purchased from MisterAddons:
  • A 32 MB Ram Module (I upgraded to 128 MB)
  • A bottom and top PCB plate. The top plate has a fan, and I have the associated heatsink. Here's what I'm talking about from MisterAddon's shop (here and here). (I upgraded to the passively cooled case and added the IO board)
  • The aforementioned Makerspot USB OTG hub. (I added the USB Board)
I'll knock a bit off any of the going prices on MisterAddons since these are 'used' if anyone is interested.
 

Yimothy

Red Plane
(he/him)
I am (foolishly) trying to figure out how I might go about implementing automatic horizontal integer scaling. Verilog and system verilog are really opaque languages, at least to a non-programmer like me. Somewhere in the code is the part that does vertical integer scaling, but I haven’t found it yet. I’ve got a couple of ideas about how I might go about doing horizontal, but I feel I should at least take a look at how the existing vertical option works before I re-invent the wheel. Especially since my badly reinvented wheel is likely to wind up an octagon rather than a circle.
 

Sarge

hardcore retro gamin'
Good luck! I haven't messed with Verilog/VHDL in a long, long time, so I'd probably be out of my depth at this point. :(
 

Yimothy

Red Plane
(he/him)
I found the vertical scaling code by looking at the change log of mister.ini to see when vertical integer scaling was added. Now I just have to figure out how it works and how to replicate it. I’ve also found a spot elsewhere in the code where I think the aspect ratio is implemented, so I may end up tweaking that. I think if I divide the output resolution it decides on by the input resolution it will give me the multiple by which it’s been scaled truncated to an integer (verilog division apparently always rounds down to integer), then I can multiply that number by the input again and set the result as the output. If that works, I’ll add a menu option for high/low scaling, which would add one to the multiple when set to high, and if I figure out how a parameter in mister.ini to turn integer horizontal scaling on or off. Alternatively I could do that in the on-screen display menu of the core, I guess.

I think this would require changes to files in the sys directory, which sorgelig doesn’t seem too keen on, so not sure if it would be accepted if it works. An alternate method would be to modify the size of the borders to match the custom aspect ratio, which I think I could do in just the individual core files rather than the shared ones, but that would be a lot more complicated and pretty hacky.

edit: the other thing about this is that if I succeed it’ll render my previous change to the SMS core redundant, except for people who really care about the image being accurately slightly to the right when horizontal scrolling is on.
 

Yimothy

Red Plane
(he/him)
trying to figure out how I might go about implementing automatic horizontal integer scaling

By cripes I think I've got it!

8EkxgrF.jpg


Here we see the MiSTer running set to custom aspect ratios of 8:5 and 9:5. Note that the width is exactly the same in either case (it's actually a bit hard to tell because I haven't included the whole TV in the shot, but take my word for it. Or compare the size of the OSD to the size of the image).

IvFMa0b.jpg


Here we see the MiSTer running set to full screen. Note that there is blank space at the edges of the screen.

What's going on here is that I've modified the scaler to round the horizontal scaling down to the nearest integer multiple. After a long long time staring at code with no idea what it all meant, I eventually changed three lines in the scaler to make this happen. There's no way this will be accepted into the main version of MiSTer as is, but it's proof of concept at least. How it works is pretty simple: in the scaler there are input and output parameters. I changed the line that defines the width of the output image to be:

Code:
o_hsize <= ((hmax-hmin + 1)/(i_hmax + 1))*(i_hmax + 1);

Or, to make that more legible:

output horizontal size = ((requested output size) / (input size)) * input size

The reason this works is that division ignores remainders. So, with my custom aspect ratio set to 9:5, the requested horizontal output size is 1728 pixels (the vertical resolution with integer scaling at 1080p is 960, five times the core's vertical resolution. 1728 is 9/5 times that). The input size is 256. 1728/256 = 6.75, but the remainder is ignored so the result returned is 6. Multiply that by the input size again and we get an actual output size of 1536.

One flaw in this calculation is that if the requested output size is smaller than the input size you get a result of 0. I thought this might break things, but on testing it got me a screen that was as wide as the OSD, so I guess there's some protection there.

I had to change another couple of lines to keep the image centred, and then it was off to the compiler. Success! I found it pretty difficult to figure out how to implement this, but the actual method of getting an integer scale by dividing and remultiplying by the input resolution was very easy to work out, which makes me think a real programmer could easily have done this ages ago. Which makes me think that it's not already in the MiSTer because the devs don't want it rather than because they haven't put the work in to make it happen. So maybe I'm wasting my time.

Anyway, next step is to give the user control over this. I'm not sure if it's better to put it in mister.ini or the core OSD. Either way I'd have to figure out how to transmit the information to the scaler, but that should be doable. I'd figure on having three settings: off, low, or high. Off would be no horizontal integer adjustment, low would take the current aspect ratio and scale to the nearest integer below it (as in the build I have now), and high would do the same but scale to the nearest integer above:

output horizontal size = ((requested output size) / (input size) + 1) * input size

I guess it would also be good form to include some checks that I wasn't multiplying the input by zero, and that I wasn't scaling up to above the total horizontal resolution (which I think the scaler already does, but it fixes it by scaling to the total resolution, whereas I'd want to scale it to the largest integer multiple that fit). Neither of those should be too hard (he says, not having done the work yet). An alternative approach would be to set a direct multiplication option: 1x, 2x, 3x, 4x and so on, but I think tying it in to the aspect ratio makes more sense for now, especially for cores with multiple resolutions so their image size doesn't fluctuate wildly with resolution changes.
 

Yimothy

Red Plane
(he/him)
I think I have my integer horizontal scale build all worked out - I've added a menu option and I think I've transmitted it to the scaler so that integer scaling can be set to off, rounding down from the aspect ratio, and rounding up. Unfortunately in my test build I forgot to uncomment the line which sets the image width when integer scaling is turned off, so all I got was a black screen. For some reason the OSD froze when I tried to go into the A/V options section to turn it on (I can't see how my changes would have caused that, but it's very possible they did). I've uncommented it in the source code, but I don't have time to run another compile right now, so it'll have to wait for later. Darn.
 

Yimothy

Red Plane
(he/him)
This is cross-posted from the MiSTer forums. I got horizontal integer scaling working:

There's been a fair bit of talk lately about using custom aspect ratios with vscale_mode 1 to get integer scaling both horizontally and vertically. This works, but it's a bit of a nuisance. I've had a fiddle with the SMS core and implemented automatic horizontal integer scaling as an OSD option which can be set to round the scaling multiple to the nearest integer either above or below what the selected aspect ratio would produce with non-integer scaling. I'm not a programmer and what little I know of verilog, system verilog, and vhdl I learned trying to figure this out (and my previous modification of the SMS core), so it probably could have been done more cleanly, but my implementation seems to work, at least in my limited tests (via HDMI in video modes 0 and 8).

I changed the menu a little in SMS.sv, and the rest of the changes all took place in sys_top.v and ascal.vhd. Both of those files are in the sys section of the code, so changing them is maybe a no-no and this won't get accepted into the official core, but it also means that if my changes (maybe cleaned up a bit) are accepted into the framework then adding this feature to other cores should just require adding an item to the OSD menu.

I've made a branch to my fork of the SMS core here with this change implemented. The .rbf build is under releases as SMSHoriMenu.rbf. Anyone interested, please download it, try it out, see if I've broken anything, and let me know. Thanks.

I'll explain what I did and how. The target for this explanation is me a week ago, i.e. someone with very little idea how this stuff works. People who already know can probably skip over it. The short version is that I added code in the scaler which divides the horizontal output resolution by the horizontal input resolution. The result of that is rounded down to an integer, which I then multiply the input resolution by to get the new, integer scaled, output resolution.

In more detail, here's my code, starting with changes to SMS.sv:

Code:
45      output [1:0] HORIZ_INT,    // horizontal integer scaling setting
 
149     assign HORIZ_INT = status [31:30];

183     "P1OUV,Intgr Hori Scale,Off,Narrow,Wide;",

This is the menu option and its transmission to sys_top.v. This seriously confused me for a while, but I'll talk about the mistakes I made trying to get this to work after I finish talking about how it works. Anyway, line 183 here adds an option to the Audio/Video menu of the SMS core for "Intgr Hori Scale" with options off, narrow, and wide. Changing this option changes status bits 30 and 31. Line 149 assigns the values of those bits to HORIZ_INT, and line 45 passes that information to the module (in sys_top.v) which calls this module.

In sys_top.v:

Code:
320     wire[1:0]  horiz_int;

694     .hint      (horiz_int),

1471    .HORIZ_INT(horiz_int),

Line 320 here declares a two bit wire named horiz_int. Line 1471 is in the part of the file that calls the module (emu) I changed in SMS.sv, and takes the HORIZ_INT value from there and sets horiz_int to it. Line 320 is in the part of the file that calls the scaler (ascal.vhd), and passes that value through to "hint" in there. Maybe I should have been more consistent with my names, dunno. Or at least gone with h_int rather than hint.

In ascal.vhd:

Code:
214    hint    : IN std_logic_vector(1 DOWNTO 0);

1716      o_hdisp  <=hdisp; -- <ASYNC> ?
1717      IF hint(1 DOWNTO 0)="00" THEN            -- Horizontal integer scaling off
1718           o_hmin   <=hmin; -- <ASYNC> ?
1719           o_hmax   <=hmax; -- <ASYNC> ?
1720           o_hsize  <=o_hmax - o_hmin + 1;
1721      ELSE                                     --Horizontal integer scaling on
1722           IF hint(1 DOWNTO 0)="01" THEN       --Narrow (round upscaling multiple down)
1723               o_hsize <= ((hmax-hmin + 1)/(i_hmax + 1))*(i_hmax + 1);
1724           ELSE                                --Wide (round upscaling multiple up)
1725               IF ((hmax-hmin + 1)/(i_hmax + 1) +1)*(i_hmax + 1) < o_hdisp THEN
1726                    o_hsize <= ((hmax-hmin + 1)/(i_hmax + 1) +1)*(i_hmax + 1);
1727               ELSE                            --switch to narrow if image wider than total display
1728                    o_hsize <= ((hmax-hmin + 1)/(i_hmax + 1))*(i_hmax + 1);
1729               END IF;
1730           END IF;
1731           IF o_hsize = 0 THEN                 -- No integer scaling if output smaller than input
1732                o_hsize <= hmax - hmin + 1;
1733           END IF; 
1734           o_hmin <= (o_hdisp - o_hsize) / 2;
1735           o_hmax <= o_hmin + o_hsize -1;
1736      END IF;

Alright, this is the meat of it. Line 214 accepts the info from the OSD menu - does the user want horizontal integer scaling? Then 1716 through 1736 do the actual work. There are a whole lot of variables here, some of which are set by the inputs to the core, and some of which are derived from the inputs. Anything starting with o_h relates to output, and anything starting with i_h relates to input. The h is for horizontal, there's more code I didn't change that relates to vertical scaling. When sys_top.v calls the scaler module it requests an output resolution, but doesn't specify the input resolution. The scaler figures out the input resolution from the video source. hdisp, hmax and hmin are some of the output parameters requested by sys_top. hdisp is the total displayed horizontal resolution, including black areas at the edge of the screen. hmin is where the picture starts within that, and hmax is where the picture ends.

Line 1717 checks if hint has the value 00, which would indicate horizontal integer scaling is set to off. If so, it uses the normal output values as if I hadn't changed anything.

1722 checks if hint is 01, which would reflect the menu being set to Narrow integer scaling. 1723 sets the output horizontal size to integer scaling:

Code:
o_hsize <= ((hmax-hmin + 1)/(i_hmax + 1))*(i_hmax + 1);

hmax-hmin + 1 is the output size for the specified aspect ratio with whatever vertical scaling is going on. These values come from sys_top, where they are derived from the aspect ratio setting. I didn't change any of that. +1 is because the numbers start from zero. For example, if I had full screen scaling on in video_mode 8, hmin would be 0, and hmax would be 1919, and the width 1920.

i_hmax + 1 is the size of the horizontal input. i_hmin will always be 0 (I think), so there's no need to subtract it to get the width, but again I need to add one.

Dividing the horizontal output by the horizontal input gives me the horizontal multiplier. Because these are integers, the result ignores the remainder, so 6.782 becomes 6, 4.2 becomes 4, and so on. That result is then multiplied by the input horizontal resolution to get the new horizontal output size. Simple!

Line 1724's ELSE covers the third menu option. If horizontal integer scaling is on and not set to narrow, the only other option is wide. The formula here is the same as for the narrow scaling, but I add one to the initial division result so that 6.782 becomes 7 and 4.2 becomes 5 and so on. This is slightly complicated by the possibility that the result will be wider than the screen, which I think resulted in no picture in one of my test builds, so I've put in a check so that if the result is too wide it'll revert to narrow scaling, which should never exceed the screen width (I think). It probably would have been more efficient to declare a variable, set the result of the wide calculation to it, and then check that variable against the display size and use it to set the output size rather than do the same calculation twice on subsequent lines, but as I mentioned I'm not a programmer.

Lines 1731 through 1733 are intended to protect against an output resolution which is narrower than the input screwing up the results. Dividing a smaller output by a larger input would give a result below 1 which would be rounded down to zero, resulting in an o_hsize of 0. I'm not sure if this part of the code is actually working, though. The output horizontal resolution seems to bottom out at the width of the OSD. Further evaluation required.

Lines 1734 and 1735 set where the image starts and stops on the screen. To get it centred, you want to halve the difference between the size of the image and the total display size, and start drawing there. Then add the total width to that value to get the stopping point. I had to subtract one from that value because the width is a number that starts from one, but the position starts from zero. I think that's why. In reality, I did it because turning integer scaling on without subtracting one here added an extra column of pixels to the right side of the image that shouldn't have been there.

And that's it! It's pretty simple, and probably could have been done more cleanly, but it's working. Aside from maybe the fringe case with an output narrower than the input. I don't think you can do an integer downscale, so I want it to revert to normal scaling in that situation, but I'm not sure my IF statement is working. Maybe I need to put the zero in quotes or something? I'll take another look later, but if anyone who actually knows what they're doing could tell me that'd be appreciated.

Some mistakes I made along the way:

Lots of leaving out semicolons in the code. Good thing the compiler picks up on this.

I screwed up the OSD menu option initially. The menu would freeze when I selected the A/V tab, but the game would continue running in the background. This really had me stumped for a while - I thought at first maybe I was setting bits of the status string that were already claimed by other options, so I changed to some different ones. Eventually I figured out that I'd used too many characters. Initially it was "Horizontal Integer Scaling,Off,Narrow,Wide". The menu is I think 27 characters wide, one of which is a colon to separate the title and the options. My title was using all of that by itself. Once I abbreviated it a bit the freezing stopped. And it turned out that the bits of the status string I'd changed to were assigned already so I had to change them back to where I'd had them originally.

At first nothing was happening when I changed the menu option. Initially I had my check for the output being narrower than the input in line 1717, so it was IF horizontal scaling is off OR the output is narrower than the input THEN don't do integer scaling. I forget what exactly I was using to determine if the output was narrower than the input but whatever it was was always returning a positive value so integer scaling was never used.

Line 1725, which checks if the output is going to be wider than the screen, wasn't initially there. Instead, if wide scaling was selected I would calculate o_hsize and then compare that to the display size and recalculate using narrow scaling if it was too wide. I don't really get why (maybe a delay in the value of o_hsize being set so the comparison would be to the wrong value), but this was producing a really strange picture - part of the right side of the image would be cut off and there would be what looked like vertical scanlines, and sometimes the whole image would shimmer. Adding the calculation to the IF statement before setting the value seems to have fixed that.

My first test build didn't include menu options, it just set the core to always do the narrow integer scaling. I had the non-integer scaling commented out. When I first added the menu option, I forgot to uncomment it. The result was a blank screen (but I could hear the game's title screen music). This was before I figured out that my too-long menu option was crashing the menu, so I'd get a blank screen and then bring up the OSD to try to change the settings and the OSD would crash. Very dispiriting.


Anyways, I hope there's some interest in this. The MiSTer template says "Basically it's prohibited to change any files in this folder (sys)", so I'm not sure if I've broken the rules here. I think a lot of people are interested in having horizontal integer scaling, and I think this could be added to other cores without too much difficulty once the kinks are ironed out of my code. If you're interested, please download my build and see how it works for you. Let me know what's wrong with it.
 

Yimothy

Red Plane
(he/him)
And for a fourth post in a row from me, the binary for the SMS core with my previous changes has been released! Nice!
 

Yimothy

Red Plane
(he/him)
I've made a bit of a clean-up of the code, and tried it out on mega drive. Seems to work. Here's the new version:

Code:
      VARIABLE h_int_multiple : natural RANGE 0 TO 255;

First, I've added a variable to the Scalaire process in ascal.vhd. This holds the multiplier for integer scaling. I wasn't sure what the smallest output resolution of a mister core was, or the largest resolution of a mister display, so I made the maximum multiplier way higher than I think it could ever need to be. If you're running a core with less than ten pixel horizontal resolution then this might not work. Otherwise it should be ok.

Code:
      h_int_multiple := (hmax-hmin+1)/(i_hmax+1);

      IF h_int(1 DOWNTO 0)="00" OR (h_int_multiple=0 AND h_int(1 DOWNTO 0) = "01") THEN            -- Horizontal integer scaling off
           o_hmin   <=hmin; -- <ASYNC> ?
           o_hmax   <=hmax; -- <ASYNC> ?
           o_hsize  <=o_hmax - o_hmin + 1;
      ELSE                                                          -- Horizontal integer scaling on
           IF h_int(1 DOWNTO 0)="01" OR (h_int_multiple+1)*(i_hmax+1) > o_hdisp THEN    -- Narrow (round upscaling multiple down)
               o_hsize <= h_int_multiple*(i_hmax + 1);
           ELSE                                                     -- Wide (round upscaling multiple up)
               o_hsize <= (h_int_multiple +1)*(i_hmax + 1);
           END IF;
           o_hmin <= (o_hdisp - o_hsize) / 2;
           o_hmax <= o_hmin + o_hsize -1;
      END IF;

And here's the meat of it again. It's a bit simpler, I think. I start by setting the horizontal multiplier by dividing the planned output resolution by the input resolution. This way I can just plug h_int_multiple in where it's needed rather than redoing the calculation like in my first attempt. I'll step through the rest of it:

Code:
IF h_int(1 DOWNTO 0)="00" OR (h_int_multiple=0 AND h_int(1 DOWNTO 0) = "01") THEN
    o_hmin   <=hmin; -- <ASYNC> ?
    o_hmax   <=hmax; -- <ASYNC> ?
    o_hsize  <=o_hmax - o_hmin + 1;

I check if integer scaling is turned off. If not, then the output is set to what was requested. I also do a check that we're not asking for an integer downscale (which I'm pretty sure is impossible). If the narrow setting is on and the multiplier is zero (indicating a downscale), then it acts as if horizontal integer scaling is turned off.

Code:
IF h_int(1 DOWNTO 0)="01" OR (h_int_multiple+1)*(i_hmax+1) > o_hdisp THEN
    o_hsize <= h_int_multiple*(i_hmax + 1);

Then I check if we're set to narrow (h_int=01), or if wide upscaling will exceed the display width. In either case, I want to do narrow upscaling (i.e., multiplier rounded down).

Code:
ELSE                                                     -- Wide (round upscaling multiple up)
     o_hsize <= (h_int_multiple +1)*(i_hmax + 1);
END IF;

Otherwise, we do wide upscaling - multiplier rounded up. This is the same as the narrow scaling, but I add one to the multiplier before applying it.

Code:
o_hmin <= (o_hdisp - o_hsize) / 2;
o_hmax <= o_hmin + o_hsize -1;

Then we set the image position. I figure out how much blank space there is (total display side - scaled image side), and divide it by two. By using that figure as the starting point of the image, half of the blank space winds up on the left and half on the right. Then add the image size to that to get where the image finishes. I have to subtract one because o_hmax's lowest value is zero, not one, so the one hundredth pixel from the left, for example, would be described as 99 rather than 100.

I've made a fork for the template and pull requested it. I've also forked the Genesis core, including an rbf of my latest version of that. Haven't put a pull request there, not sure if I should.

Anyways, I've done what I can. Hopefully it gets approved.
 

Yimothy

Red Plane
(he/him)
My MiSTer is pretty noisy, I think because I've put it in a wooden box and the fan is resonating. So I bought one of those fancy noctua fans. I was kind of thinking I'd probably wasted my money on a ridiculous extravagance (and that's still true of the MiSTer as a whole), but today I got it plugged up and mounted in the box. When I turned it on I wondered for a minute if the fan wasn't working, then I realised it was just a lot less noisy. Still a plenty audible fan once I'd adjusted my expectations, but much more subtle.

In a way I was lucky to have my old noisy fan first - when I got my USB board the fan speed started fluctuating. After a bit of fiddling I figured out that the power supply splitter cable that came with it was faulty and replaced it. If I'd had the quiet fan, I might not have noticed and could still be randomly undersupplying my MiSTer.

In other news, I think I'm going to give up on my horizontal integer scaling implementation. My pull request was rejected because it was slowing down the scaler. I don't think it was an actual problem in the genesis core where I'd implemented it, but the framework has to think of all cores and it could cause problems in some of them. I tried a few things that I thought might make it more efficient, but they mostly made it worse. Sorgelig suggested implementing it in individual cores, so I might give that a shot. Someone on the mister forum suggested doing it in the main mister's C code, which makes a lot of sense to me but would require me to figure out how all that works.

For the moment I'm going to plug my version of the scaler into various cores and do builds of the current versions with integer scaling added, maybe put them on a github repository as a one-off for anyone who wants them.
 
Top