#Sega Saturn

1 messages Β· Page 86 of 1

sweet vale
#

One message removed from a suspended account.

#

One message removed from a suspended account.

untold cloud
#

We've reached Peak MiSTer.

#

Won't fit, with the CD stuff and SignalTap enabled.

upper dust
untold cloud
#

Will just work on the Radiant thing for a while, then do a PR for the SNAC and Joypad Off thing later.

#

You mean by modifying the core, to extend the white screen for more frames? Or some other method?

Could be interesting to try methods which just make the Gamma really high, for those frames.

Detecting the white frame in the first place will be interesting, as it would have to do the detection within the first bunch of lines.

#

Else, there would be no way to premptively mess with the frame that's currently being drawn / output.

#

Detecting say the first handful of lines at the top of the screen having all-white pixels would be easy enough.

#

And the option would only be enabled for light gun games anyway.

#

Then again, repeating the white frame probably won't work for too many games.

#

As most will be latching the X/Y value for only the ONE white frame.

#

(for anyone else reading this, we're talking about real Lightguns on a CRT, btw. lol)

sweet vale
#

One message removed from a suspended account.

lament fox
#

In a nutshell if you do a side by side comparison of Saturn and ST-V, what are the differences?

inner token
#

you get 0xF0 for which ever port in oreg with nothing connected Ash.

rich violet
#

Games on ROM chips vs games on CDs

glass rain
#

What’s the status of lightgun support? Hoping to play some virtua cop

rich violet
#

It's working fully if you use the latest unstable

clear condor
soft goblet
#

hrm.. tried to get my openfire lightguns to work, but while I can assign trigger etc, the crosshair never moves

inner escarp
#

Hi guys! Just tried the latest version of the core for STV, I can assign all buttons but 1Player button start never works...

warped saddle
#

there are a number of games you can't start

#

at least one due to protection that isn't implemented but a few others might just be a bug

inner escarp
#

ok so for example I can't start Cotton 2...

warped saddle
#

yeah, that's a known issue.

thorn pagoda
#

should be right next to where you set the controller types

naive whale
#

some games have protection ICs that will corrupt the game

#

others wont even allow boot

#

it kind of does things all across the board in a diff way

kind bough
#

Try setting p1 'xy ctrl' and 'buttons' to mouse maybe @soft goblet

warped saddle
#

cotton2 is something else. it never even talks to the protection chip.

sweet vale
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

ripe valley
#

Pocket Fighter finished with 4 different characters endings , one more Perfect on the compatibility list.

celest lake
#

Zet you are terrible at not doing saturn testing

#

❀️

ripe valley
#

I have until Friday, so I'm doing my last tests now.

high bramble
sweet vale
high bramble
#

Good deal. Glad you got it sorted.

sweet vale
untold cloud
#

I think Mr Bacon forgot, that it was him who showed me the probably solution for games like Cotton 2 / BM. lol

#

I can't be 100% that it's the same cause, but...

#

Every ST-V game has it's own built-in Test menu, which is different to the normal BIOS Service / Factory Test menu.

#

I did a few tweaks to the SMPC a few weeks ago, to try to get the Start button working in Cotton.

#

Based on the patches in that git issue.

#

I didn't get the game to react to Start, but I did manage to get the cursor to move around in the game's Test menu.

#

So I think it's close, but needs more work.

#

Looking at the MAME code as well, it's hard to figure out what's going on.

#
            //else if (SmpcRegs->IREG[0] & 0x80) {
            else if ((SmpcRegs->IREG[0] & 0x80)^(oldVal& 0x80)) {
#

That was the first "fix" in the Yabause emulator, but I think it's a kludge.

#

ie. it's based on toggling the bit, each time that part of the SMPC is accessed.

#

(which would be a bit of an obvious issue, if the flag doesn't toggle the same way, every time a new game is loaded.)

#

That's part of the INTBACK continue/break request stuff.

#

INTBACK is basically the way the SMPC can automatically grab values from a controller etc., into the OREG mem.

#

Rather than the SH2 doing direct IO reads/writes to read a controller. (which is what it does for the LightGun).

#

That code was later changed, to mask the IREG value with 0xC0, on both line 885 and 894, and remove the MSB bit toggle...

coarse tokenBOT
#
if ((SmpcRegs->IREG[0] & 0xC0) == 0x40) {
untold cloud
#

The original SMPC on Saturn/ST-V, used a small MCU core in the chip.

#

The Srg320 core uses pure Verilog instead, to handle the commands etc.

#
            if (!RW_N && RW_N_OLD && !CS_N) begin
                case ({A,1'b1})
                    7'h01: begin 
                        {CONT,BREAK} <= DI[7:6];
                        IREG[0] <= DI;
                    end
#

That's the Write handling for the INTBACK command, AFAIK.

#

It doesn't need to do the masking of the upper two bits (0xC0), as it directly grabs the two bits from the incoming byte.

#

IIRC, the Continue and Break bits, are to do with when the INTBACK command is reading data into the OREG table.

#

The SH2 can either choose to send a Break, if it has enough of the data it needs. The SMPC will stop reading any more bytes.

#

Or it can read one chunk, then send a Continue, to let the SMPC read more data.

#

(I think this is for when there is a lot of data, the SMPC can't fit all of it at once into the OREG table.)

#

The actual INTBACK command code is 0x10.

#

(VBLANK IN and VBLANK OUT, are talking about when the display enters the Vertical Blanking area, and when it exits that, and starts displaying the active lines.)

#

INTBACK can be used to grab SMPC "Status Data", or "Peripheral (controller)" data.

#

Depending on how you set the bits for the command parameter, I guess.

#

INTBACK writes the response to the OREG table, which is just a bunch of Bytes that the SH2 can read later.

#

It also updates the SR - Status Register.

#

If the bit in the SR says there is remaining Peripheral data, I think that's when the Continue flag can be used, to tell the SMPC to read the rest of the data.

#

ie. Write the INTBACK command. First interrupt, read the SR. Read the OREGs for the first part of the data.

#

If the "Remaining data" flag in the SR is set, write the Continue flag, second interrupt, read the rest of the data.

#

(and if enough data has been read, the SH2 code can choose to send a Break, to cancel the INTBACK)

#

Oh yeah, and it's the params you write to the IREGs, that determine which type of status or data the INTBACK command reads.

#

I can't remember exactly what I tweaked in the core before, to try to get Cotton working.

#

I'll have to look back on the DMs with Mr Bacon.

inner token
#

srg may have noted that that part isn't complete. You can get more bytes than the oreg can hold if you use multitaps

untold cloud
#

Oh, interesting.

#

So maybe it doesn't properly "pause" when there is more data.

#

And / or doesn't update the SR to say there is remaining data.

#

So games like Cotton cause it to overrun the OREGs, or something like that.

#

Can't find the old chat atm. I don't know if it was maybe on the Dreamcast channel.

#

Yep, it's all here...

#

Emu code...

#
            if ((SmpcRegs->IREG[0] & 0xC0) == 0x40) {        // BREAK.
            else if ((SmpcRegs->IREG[0] & 0xC0) == 0x80) {   // CONTINUE.
#

Uses an else-if, so a Break flag will block the reading of the Continue flag.

#

One of the tweaks I tried in the core...

#
if (DI[6]) BREAK <= 1'b1;
else if (DI[7]) CONT <= 1'b1;
#

Which apparently got the Service button to work, in the game's own Test menu.

#

(BIOS Service menu - EACH GAME TEST thing)

#

But still no Start in the game. I'm convinced it's related, though.

#

This is a totally separate issue to the Protection IC thing in Radiant Silvergun, imo.

#

One of the tweaks I did, caused the game (Cotton 2 or BM) to crash, as soon as I hit the Start button. lol

#

Seems I gave up on that thing after a couple of days.

#

But the last tweak I tried, is apparently what got the cursor to move around, in the game's Test menu...

#
if (DI[7:6]==2'b10 || DI[7:6]==2'b01) {CONT,BREAK} <= DI[7:6];    // Only allow write, if only one bit is set.
#

So yeah, giving up again. lol

#

As for Radiant - I got the first part of the spoofing stuff "working".

#

But not the second part.

#

I still don't know if I'm supposed to be incrementing stuff for every rising edge of CS_N, when the SH2 is doing the Reads.

full cedar
#

And is it active for Saturn?

untold cloud
#

Sheesh. Some of those lightguns look a bit painful to get running. lol

#

I thought the majority of USB lightguns (wired, or wireless receiver) just emulated a Mouse, or analog joystick.

warped saddle
#

eh, I don't think that one is that bad

#

their changes are just adding the quirk in main and a little function to tell their gun to go into 'mister mode' which I think is just a gamepad mode?

untold cloud
#

Not sure, but if it the XY movement doesn't work as an emulated Mouse or Joystick originally, I don't know what would cause that?

#

If the patch to Main is small, will they be doing a PR for that, so it can be merged with the main branch?

#

Oh, it's kind of in a zip atm.

warped saddle
#

I assume at some point

#

I think they dont' even need to really do all that button mapping

#

I bet whatever they are emiting in the 'normal' mode could just be mapped in the gamepad db and work

untold cloud
warped saddle
#

yeah, I saw it

untold cloud
#

Yep, I would expect the button mapping should work through the normal MiSTer menu thing.

#

/ db

warped saddle
#

yeah, I wonder what wasn't working that made them do that. I wonder how good the gun is otherwise. a good open source gun might be worth it

untold cloud
#

OK, so it's kind of reformatting the HID stuff / Linux device stuff.

#

I really think they could do a PR for that, and Sorg would have no trouble merging it.

#

'cos if that pre-compiled MiSTer gets too old, it could break other stuff, if replacing a newer file.

warped saddle
#

although the 'user configurable pid' will make it difficult to just add a global db entry

#

but, that's what gamecontrollerdb_user.txt is for I guess

untold cloud
#

I might have to do a PR for that patch. lol

#

But since they didn't use the git system for it, I'll have to do a diff against the latest main MiSTer code.

#

Or, just do the fork anyway, then overwrite the files with theirs, and let github show me the diffs.

#

Hoping it's only a few files changed, for the OF patch.

warped saddle
#

no it's in git

#

the comments in the issue claim they will eventually PR it, they're just testing it

untold cloud
#

OK, np.

#

I mean, generally, if it works, it works. hehe

#

ie. if MiSTer recognizes the Lgun, and the tracking is good, it's probably fine.

#

To be fair, most people are probably far more cautious than I am. lol

#

Some would say that I should have done more testing with games, before doing the Lightgun PR. Oh well.

#

Sort of a bit further with Radiant. But I don't know if I'm supposed to increment after every CS_N pulse.

#

ie. whether that's the SH2 expecting to read a whole 32-bit Word on each pulse.

#

Or only reading the upper and lower 16-bits.

#

Still no Start button, though.

#

The pattern seems to be repeating correctly at the end.

#

So yeah, I probably need to increment on each CS_N pulse.

#

Now I'm wondering if the ST-V cart pinout is the same as Saturn.

#

Probably not.

#

Oh.

#
Radiant Silvergun...

Writing   00 to 4FFFFF1
Writing 0800 to 4fffff8
Writing 0010 to 4fffffA
Writing 7777 to 4fffffC
Writing   01 to 4FFFFF1

All subsequent reads from 4FFFFFC...

00000000 (x4)
10101010 (x4)
20202020 (x4)
30303030 (x4)
40404040 (x4)
50505050 (x4)
60606060 (x4)
70707070 (x4)
80808080 (x4)
90909090 (x4)
A0A0A0A0 (x4)
B0B0B0B0 (x4)
C0C0C0C0 (x4)
D0D0D0D0 (x4)
E0E0E0E0 (x4)
F0F0F0F0 (x4)

Repeats reading this chunk, many times...
00010203
04050607
08090A0B
0C0D0E0F

And then Writes 00 to 4fffff1
#

The last pattern only reads each Word once, then moves to the next.

#

I was waiting for two CS_N pulses for each.

#

Recompiling... sigh

#

There must be a better way to debug this stuff.

#

One way that Kevtris uses, is to add a small MCU core.

#

Then he hooks into it via serial, and can quickly reprogram it to do what he needs.

#

I mean, I could also have looked to see if Radiant can be patched, but that would take even longer. lol

#

(but if it could, it would be possible to just detect the ROM during loading, and patch it on-the-fly. Like some other cores do for certain games.)

open swan
# untold cloud Some would say that I should have done more testing with games, before doing the...

you need to slow down and think more carefully about what you are doing. you removed the Off option for joy1_type and joy2_type completely. there was probably a good reason for that being there. there was no reason to remove it and replace it with "Virt LGun". you should have also just called it "Lightgun" since "Virt LGun" is confusing. Also make sure to doublecheck your line endings before submitting a PR, it makes it harder to check the diff and eventually the git blame for people reviewing this stuff down the road. also don't mess with files in the sys folder, those are typically supposed to just be updated from the template repo when a framework update is done. if it's customized in there you can't as easily do framework updates and it makes it harder to collaborate.

#

slow down and double and triple check your work because the unstable builds for very popular cores are something that thousands of people eagerly test.

untold cloud
#

I'm fully aware of how many people use the unstable builds. I do think very carefully about the PRs.

But also aware that a lot of the initial code for stuff doesn't always work for all games at first.

#

And gradually gets improved over time.

#

I called it "Virt LGun" for a good reason - I didn't want the string to take up too much space on the menu, and not leave enough room for displaying the options.

#

The only thing I had to add to sys_top.v, was this...

#
`define MISTER_DISABLE_ALSA 1
#

I think defines like that used to be in the actual project settings, but that doesn't seem to be always used now, depending on the core.

#

And, to be completely honest with you - you could have been a bit more polite in your reply.

#

I did give thought to removing the Off option, too.

#

I meant to ask about it, and whether it might affect certain games.

#

But forgot to ask, in the midst of trying to do the PR in the first place.

open swan
#

Sorry I've had a bad couple weeks, sorry for being rude

untold cloud
#

I forgot how stressful it is, just doing the PR alone, using the latest core code, and trying to keep it relatively "clean".

open swan
#

you should restore the Off option

#

it's partly why there are bugs, because real hardware needs a controller unplugged

untold cloud
#

I did, but now working on the Radiant thing, so I couldn't re-enable the CD stuff at the same time, to do the PR.

open swan
#

ah got it

untold cloud
#

But I could git clone to a separate folder, then do it that way.

#

Also - can't just call it "Lightgun", as that could confuse people who want to use a real Lightgun via SNAC.

open swan
#

true okey dokey, at least you heard my concerns

untold cloud
#

The concensus seemed to be, to call it a "Virtual" lightgun, vs anything else.

#

I know you mean well, it just came across a bit demanding. lol

#

Or, to be fully honest again - it came across as if you've been talking to other people who have had criticisms.

open swan
#

every now and then i let the inner cuavas out

untold cloud
#

lol. np

open swan
#

it's more like i took out on you how i have been feeling about a person i know in real life lately

#

my bad

untold cloud
#

I admit, I am a bit sensitive about the PR thing specifically, as I didn' t have the best experience when I did the very first ones, years ago.

open swan
#

i get it

untold cloud
#

When I did Gameport Joystick support for ao486, Sorg did tidy up the code, etc., and tweaked the calibration.

#

But then, like with Adaptive Blur, all I got was "Based on an idea by ElectronAsh" in the release.

#

Instead of just a plain-and-simple "By ElectronAsh".

#

I didn't think that was too much to ask, at the time, when it was 95% my code.

#

So that honestly put me off even wanting to do "official" PRs after that point.

#

Previous stuff I'd done, just went via Sorg directly.

open swan
#

don't let it get to you, do it for yourself, not for the official recognition

#

do it to contribute and improve it

untold cloud
#

I do try to think carefully, and keep the code changes fairly minimal.

And went through at least 15 recompiles, to get the Lightgun stuff seemingly working OK.

open swan
#

sorry for the tone

#

i'm just in a really bad mood

untold cloud
#

At some point, I can't be testing tons of games, as I'd never get anything else done. lol

#

np, mate. πŸ˜‰

open swan
#

i shouldn't ahve taken it out on you

untold cloud
#

Nah. You're usually quite upbeat, so I know there was no malice there.

#

Doing the PR for the Off thing now.

#

Had to Sync the new changes to main, with the fork.

#

Then git clone, do the tweaks, commit, push.

#

Then I'll do the PR.

#

I didn't think of doing it that way last night, as I was too stuck into trying the Radiant patch.

open swan
#

my typical procedure is to sync up the repo first, clone to my pc, make a new branch, commit the changes for that specific issue into that branch, submit pr from that branch

#

that way i can always easily sync the main/master in my fork whenever i make a change later

open swan
#

otherwise github gets weird and will desync

untold cloud
#

Yep. I'm still learning. πŸ˜‰

#

I didn't even know about the Sync button on the site, until now.

open swan
#

yeah they added it recently

#

it's very useful

untold cloud
#

I often wondered how it would "pull" the changes normally.

#

Oh, OK.

open swan
#

or rather it was called something else and it woudln't always sync right, now it's better

warped saddle
#

there's also a command line client you can use to invoke the sync

untold cloud
#

Not quite there.

#

I think it switches to the last pattern too soon.

#

A lot of this is due to the whole off-by-one thing, which I've always had trouble with.

#

The game does a BT (Branch if True) there.

#

And jumps back, if the pattern matches.

trim nimbus
#

Yeah, for being a common workflow, it is surprising how long it took GitHub to make some of the fork -> parent and parent -> fork stuff in the ui.

untold cloud
#

Compares R0 to R5, which is the counter.

#

Counts up to 0x200, incrementing 4 at a time.

#

Ooh.

#

It's comparing to a table in memory.

#

I really should have just checked that before.

#

Might be able to just zero that out. lol

trim nimbus
#

Making sure sega is repeated a lot in memory?

#

Is that the patented nintendo game boy protection?

untold cloud
#

So far, in MAME, I've only seen the game check that first part of the pattern, before the title screen.

trim nimbus
#

β€œThey embedded our name in their code! That is copyright infringement!”

untold cloud
#

But yes, it looks possible that it does other checks later on, for the SEGA string stuff.

#

lol

#

Yeah.

#

oic, an R1 holds the addr it's reading from.

#

ie. the Protection IC.

#

At 0x24fffffc.

#

Which is actually at offset 0x4fffffc, but the SH2 uses some of the upper address bits to denote whether it's a cached read or not.

#

I think.

#

0x4000000 is the offset for the second half (upper 32MB) of the Cart ROM space.

#

Game actually starts off with the SEGASEGA stuff there.

#

Even before the game itself runs, so I think the BIOS might be doing that, or possible the MAME code?

#

So that's not the source of the protection pattern, but where it's storing it, after reading from the Prot IC.

#

I just had a peek in the dev-talk channel.

#

I think if I started posting in there, it would annoy even more people. lol

#

Here's where the game does the actual comparison against the values read from the Prot IC.

#

Surely can't be that simple?

#

When the game starts, memory gets cleared with the SEGASEGA stuff, but that could either be the BIOS does that as standard, or MAME does.

#

So can probably ignore that.

#

But, for the Protection IC check, it looks like if there is a mismatch, it will write a value >0 to 0x600EDBC.

#

Then it reads that value shortly after. If it's zero, then the check was a match.

#

Might be able to just force zero there at all times, and get into the game.

#

But then shouldn't really do that, in case the game uses that address for other stuff later on.

#

I wrote a 0x33 to that first byte, just before it reads it.

#

The game (in MAME) reacted to Start, but then kinda froze. lol

#

I don't know what that tells us, so I'll just carry on with the spoofing test.

#

The code which does the actual read from 0x600EDBC, and expects to see 0x00 in the first (MSB) byte.

#

So it should take the next BT (Branch if True), if the protection passed.

green pebble
untold cloud
#

PR done, for the Joypad OFF thing.

#

For "Shinobi X" and "In The Hunt", etc.

#

I did check to see if it would affect anything else, and it all looks fine.

#

Basically, when no known joypad type is selected (known to the HPS2PAD module), it just does a default assign instead

#

Want to keep the "Virt LGun" name for now.

#

On second thoughts.

#

Owww.

#

Can't delete a PR. 😦

#

Not the end of the World.

#

Will also change it to say Pad 1 Type: and Pad 2 Type: maybe?

#

Another PR for later...

#

It doesn't currently grey-out the Lightgun options when SNAC is enabled on a port.

#

I do like the idea of keeping the SNAC option at the top of the page.

#

So it makes it obvious that it should be the first thing to check, if a user has issues with the controls.

warped saddle
#

hmm, patched the TST R1,R1 to TST #$0, R0 and that didn't fix it

untold cloud
#

Yeah, it looks a bit more involved than I thought.

#

If the pattern looks correct on the next compile, but still doesn't work, I'll try incrementing on each CS_N pulse.

#

Just not sure why it would be doing pairs of pulses for each read, unless it was reading the upper and lower 16-bits at a time.

#

I think that's right - you can see it doing the Write to mem at offset 0x1EC after reading each (32-bit) WORD.

#

No, that's still wrong. lol

#

Why is everything on this core so tricky.

#
00000000 (x4)
10101010 (x4)
20202020 (x4)
30303030 (x4)
40404040 (x4)
50505050 (x4)
60606060 (x4)
70707070 (x4)
80808080 (x4)
90909090 (x4)
A0A0A0A0 (x4)
B0B0B0B0 (x4)
C0C0C0C0 (x4)
D0D0D0D0 (x4)
E0E0E0E0 (x4)
F0F0F0F0 (x4)

Repeats reading this chunk, many times...
00010203
04050607
08090A0B
0C0D0E0F
#

It needs to allow for EIGHT CS_N pulses, per word, for the first pattern.

#

Then only TWO CS_N pulses for the last pattern, which just repeats.

untold cloud
#

Reading one word per two CS_N pulses now, which I reckon should be correct.

#

But the next part is still wrong. Jeez.

#

SO annoying. lol

#

This Saturn core stuff, has taken years off my life.

#

Fingers crossed. This next compile feels like the one. lol

#

SNAC now correctly greys out all of the port stuff if it's enabled (either Port).

#

And the Lightgun options (for each port) are greyed out, unless the Virt LightGun is actually selected, OR if SNAC on that port is On.

#

I think that could be good for many other cores, to cut down on the confusion.

#

Any reason to rename it to say "Port 1" / "Port 2", instead of "Pad" ?

#

'cos the controller type isn't always a Pad. It can be Digital Pad, Wheel, Mouse, etc.

kind bough
#

I thought the same thing, suppose either works
port 1 / player 1 makes more sense

untold cloud
#

No Radiant Silvergun today.

#

The second pattern looks correct now, but it won't Start.

#

It's possible the data needs to be byteswapped, but I don't think so.

#

Looks like it's just not shoving the data into the core, when the SH2 does the Write to RAM.

warped saddle
#

is this where we find out on top of the protection this game also suffers from the same bug as cotton2?

untold cloud
#

Possibly.

#

But I think not, it's just not quite working yet.

#
assign MSHDI     = CDO;

assign CDO      = !MSHCS3_N || !DRAMCE_N || !ROMCE_N || !SRAMCE_N ? MEM_DI :
                  !STVIO_CS_N || !STVPROT_CS_N                    ? MEM_DI :
                  !SMPCCE_N                                       ? {4{SMPC_DO}} :
#
assign MEM_DI     = !RAMH_CS_N ?    sdr2_do : !STVIO_CS_N ? {24'hFFFFFF,STVIO_DO} : !STVPROT_CS_N ? STV_PROT_DO : raml_do;
#

Data gets shoved into MEM_DI, whenever STVPROT_CS_N is Low.

#

And the CS decoding seems be OK, aside from it being pulsed twice per each 32-bit Word read.

#

CDO gets assigned to MSHDI, which is the direct input into the Master SH2.

#

(Slave SH2 requests access to the same bus, via the Master SH2)

#

The STVIO and STVPRO CS stuff could be put on the same line as the other MEM_DI stuff, but it's just for clarity.

#

Could be something to do with the cache.

#

Like I'd need to bypass the cache, or something.

#

Or, I should have taken a closer look at this...

#
`ifdef MISTER_DUAL_SDRAM
    assign MEM_DI     = !RAMH_CS_N ?    sdr2_do : !STVIO_CS_N ? {24'hFFFFFF,STVIO_DO} : !STVPROT_CS_N ? STV_PROT_DO : raml_do;
    assign MEM_WAIT_N = !RAMH_CS_N ? ~sdr2_busy : !STVIO_CS_N ? 1'b1 : ~raml_busy;
`else
    assign MEM_DI     = !RAMH_CS_N ?    ramh_do : !STVIO_CS_N ? {24'hFFFFFF,STVIO_DO} : !STVPROT_CS_N ? STV_PROT_DO : raml_do;
    assign MEM_WAIT_N = !RAMH_CS_N ? ~ramh_busy : !STVIO_CS_N ? 1'b1 : ~raml_busy;
`endif
#

For STVIO, it forces MEM_WAIT_N high.

#

I'm not doing that for STVPROT. Oops.

#

Aaand... so we compile again.

#

I have a feeling that's not the main problem, but we shall see.

#
assign MSHWAIT_N = CWAIT_N & (MEM_WAIT_N | (MSHCS3_N & DRAMCE_N & ROMCE_N & SRAMCE_N));

// On the Master SH2 input...
        .WAIT_N(MSHWAIT_N),
untold cloud
#

You can set a define in the SH2 Regfile, to have it output the CPU Regs for debugging.

#

Gonna try that, and add a few regs to SignalTap, so I can see exactly what the CPU is reading.

untold cloud
#

Master SH2 seems to be reading in the stuff just fine.

#

Hard to debug what's wrong.

untold cloud
#

Looks like the correct pattern at the end now, too.

#

Giving up for today.

rich violet
#

Build with fixed "Shinobi X" and "In The Hunt": #unstable-nightlies message

untold cloud
#

LOL

#

Thanks for the name spell-out. πŸ˜›

#

I kept seeing the emotes disappear, and wondered what was going on.

#

Might have to take a break some MiSTer stuffs soon.

#

And maybe have a look at getting some of this running on FPGA...

#

I mean, kind of "MiSTer", but not really. lol

#

'cos...

#

The JV-1080 uses an SH1 CPU.

#

And the Saturn core... uses an SH1 CPU, for the CD interface stuff.

#

And it's in Verilog, which means it's less evil.

#

I did quite a bit of work on reversing the Expansion card ROM format of the JV years ago.

#

But since then, people have written C code and Python scripts, to extract the samples, and even add new ones.

#

Kitrinx and NewRisingSun did the SC55 ROM extraction and SoundFont project a while ago.

#

And nukeykt did the Nuked-SC55 synth engine as well, which was based on die shots of the actual synth ASIC.

#

The JV-80 / JV-880 (rack version) are essentially an SC-55 with different ROMs.

#

The JV-1080 uses the newer "XP" version of the chip, but pretty much the same basis.

#

So yeah, I think we'll start to see far more use of FPGAs soon, to do (digital) synth recreations.

#

Probably quite off-topic now, but yeah.

lone mural
#

using the mister like a real syntheziser is a good thing

untold cloud
#

I know mt32-pi and VSTs exist... but I still want mah FPGA version.

#

I wrote a Wavetable synth in Verilog some years ago, without using a CPU core.

#

And it was easily one of the most fun projects I've ever done.

#

The demos sound quite crusty, as I used the SC-55 style sample set, taken from AmigaDOOM.

#

The samples were only 8-bit, and originally only 11.025 KHz, or something.

#

Plus, the Flash on the DE1 board is only 4MB.

#

Only just enough logic on the Cyc II, to fit 32 Voices.

velvet vine
#

I don't mean to continue the offtopic discussion (much) but I was wondering about digital synth/effect recreations on FPGA. That's really interesting ElectronAsh. I hope it takes off in future

untold cloud
#

Yep, I definitely think it's going to be quite a big deal soon.

#

I saw that the MAME team started adding some classic Romplers a few years back.

#

And then I found out it was relatively straightforward to enable MIDI input on MAME, so I had a quick play with the Ensoniq ESQ-1.

#

I just asked nukeykt on TwitterX about the LA32 and JV-1080 stuff. I think we could get something done there.

#

The first step for me, is getting the JV-1080 SH1 code running under Verilator sim.

#

I "found" the SH1 ROM online.

velvet vine
#

that's so cool. there's potential there for a mister-like platform for music gear heads

#

I've now followed nukeykt on X, the demos posted there are great

mortal mist
#

@untold cloud how much space do we have left now (fpga)? πŸ˜„

untold cloud
mortal mist
#

rest , get some sleep πŸ™‚

untold cloud
#

I have Nuked-SC55 set up alongside Imgui on the other PC.

#

So it can view the memory in realtime, etc.

#

I'll put it on github soon.

#

Can't remember exactly what I was doing it for. lol

#

nukeykt is also a user on here, which is good.

#

#software-emulation message

#

Should probably find a channel to continue the synth discussion.

#

Probably best in the #midi channel. I'll start posting on there later.

#

I bet "The MIDI Channel" is already taken on YouTube. Quite a good name.

velvet vine
#

I saw that Nuked-SC55 post, sounds great. I'm super interested in following what you're both doing so wherever you are posting about it I will keep my eye on

rich violet
mortal mist
#

i posted main with fix some time ago

rich violet
#

Yep, but it should get merged some time!

mortal mist
#

perhaps there will still be some change , who knows

rich violet
#

Maybe

#

I'll wait for a month after the PR was opened, and if it's still open with no change, I'll comment to ask on there, just in case it simply got overlooked

dense sundial
#

MTer

pastel basalt
#

Saturn finally has a int-scaling and 5x mode for HDMI! that rules

#

this core has just come such a long way

wise brook
#

it’s filled with features, only 4 reported graphical issues, no reported sound issues, only one feature needs to be added by Sorg (analog triggers)

#

it’s one of the best damn cores on the platform

#

so much love and work went into this it’s almost unfathomable to me

#

and now for one tenth the cost of buying Panzer Dragoon Saga you can experience the whole library with crystal clear digital output or better-than-stock analog video/audio

mortal mist
mortal mist
#

maybe horizontal crop

pastel basalt
#

there are plenty of games that utilize it for shadows

#

Saturn really does look best on composite for certain games

wise brook
#

adaptive blend would have been incredible, but i dare say to make a saturn version of that would require a lot of work and more fpga resources

thorn pagoda
#

at least we have actual composite now if we want

pastel basalt
#

yeah it's true

#

I just plug in to the crt if I want composite lol

wise brook
#

i hadn’t actually looked to see if pal-composite was added

pastel basalt
#

but actually my Philips crt doesn't like the composite signal from this core specifically; have to use a different crt

wise brook
#

but i also don’t have an adapter

#

is the passive one all that’s needed now?

pastel basalt
mortal mist
#

actually I already added composite blend , but I need to see how it works

wise brook
#

i was doing a little guncon 2 testing on crt with the core

#

hadn’t quite got it dialed in when my baby needed my attention

#

this thrustmaster ppk is shockingly good

#

my tv brightness isn’t even cranked up at all and it landed every shot

#

my main use for virtual lightguns is gun4ir but i feel i owe it to electron ash to do more testing

#

i hadn’t got it to shoot off-screen successfully, which you’d think would be the unwanted default when the gun failed to read it’s location

#

but i hadn’t f10 calibrated the core because i needed an all-white background to properly set it

ancient surge
#

If only it was possible to have an adaptive blending feature that specifically blends the dithering from the VDP1.

wise brook
#

it would be like making a gpu revision to the saturn

#

like if dither patterns were fed to the vdp, it would have to know to render them differently and have them color mix with the next layer?

#

it’s not completely unheard of tho because the real ps1 had a revised gpu that did a similar thing

#

found it

#

the gpu revision

naive whale
hearty marten
#

What’s the MiSTer like? πŸ˜…

visual grove
#

Didn’t know there was a major hardware revision

ancient fractal
wise brook
ancient fractal
#

This would certainly not be as complex a task though. But anything requiring more bandwidth is probably off the table for the Saturn core on DE10-nano

#

I don't keep up with emulators really, is this something Saturn emus do? It doesn't sound that hard to do really. Make an extra bit for the VDP1 framebuffers that stores if mesh transparency was enabled for the pixel, do the actual drawing without dithering, and then have VDP2 blend if the extra bit is set.

wise brook
#

you never know, had the Saturn dominated, there may have been a β€œ1chip” style revised saturn architecture which could have done that

i’d love to hear from an old hardware developer on the possibility

glass rain
#

Lightgun support is excellent, getting pixel-perfect aim in vcop2

#

Now I only have my lack of skill to blame for my poor performance 🀠

wise brook
#

asked in general but heard nothing back

wise brook
trim nimbus
#

Not sure about arcade games, but wouldn’t analog trigger support also help with some Namco racing games by adding β€œemulation” for the NeGCon

wise brook
#

yes, i guess if Robert was willing to dive back into the psx core

thorn pagoda
#

the psx core negcon support is actually by another dev

#

i'm totally blanking on who, maybe sonik or nolbin

#

and yeah analog trigger support would make that even better than it already is

#

ao486 could also benefit

hearty marten
#

Requires a change in main though πŸ˜”

thorn pagoda
#

it's not like main isn't open source

hallow fossil
#

Didn't analogue trigger support get added to Main recently?

thorn pagoda
#

people change it all the time

hearty marten
#

I wasn’t saying it was necessarily a blocker, just that it may have wider impacts

thorn pagoda
#

i dont think its been added yet or else this entire conversation is redundant πŸ˜„

hallow fossil
#

Maybe I am misremembering, I can't see it now I search news

thorn pagoda
#

communicating additional axis (2 more ontop of the 4 we already have) might be a bit tricky. and there's mapping/ui questions

#

its a chunk of work for sure but its not impossible

primal vigil
#

Could we get that joypad off option in other cores like the SNES? There are many situations where game options change when joypads are connected or disconnected

thorn pagoda
#

PSX already has it for sure

#

i think quite a few cores do don't they?

glass rain
primal vigil
#

I don't know any others off the top of my head. It's rare but there is the occasional game like Super Mario World that disables pass and play when a second controller is plugged in.

thorn pagoda
#

i love seeing all the people come through enjoying the LG support

primal vigil
#

Speaking of light gun, I assume house of the Dead 1 and 2 would be a bit of a stretch for Mister

thorn pagoda
#

HOTD1 is a saturn game

glass rain
#

2 is Dreamcast I think?

primal vigil
#

The arcade versions specifically

thorn pagoda
#

the arcade version of it is too much though afaik, its model2. HOTD2 is dreamcast/naomi so well out

primal vigil
#

Ah drat. That would immediately be my light gun trigger

thorn pagoda
#

good news is you can emulate them on fairly modest pc's now

#

like a rpi5

primal vigil
#

That's true. I played with that in the past. If you know what you're doing you can also disable the white flashing

glass rain
#

IIRC I got it working on the pi4 but I’m not sure if it was full speed

thorn pagoda
#

ah yeah

clear condor
#

I'd love Model 2, but it'd be a big project

#

that 50 MHz graphics hardware could be uh, a little rough

wise brook
#

model 1 probably not much better

#

they’re all a smorgasbord of silicon

#

heck i’ll be over the moon for the rest of the 2d sega arcade hardware

sacred goblet
clear condor
#

Thankfully, our Dear Friend Rally is very well realized on Saturn. And Daytona's on there too, sort of

pearl harbor
#

But Model 2 Sega Rally is 60fps!

undone oyster
#

finally got around to testing the lightgun stuff in the core and it works really well, hopefully Ash can fix the Scud issue with the resolution switch

woeful quarry
#

I tried out the newest unstable with a GC1 and Reflex Adapt, it works but the trigger is acting as Start and the A and B buttons on the side are acting as the trigger, is there any way to change that?

woeful quarry
#

Core mapping wants directional inputs before mapping buttons

wise brook
#

or can you make a custom reflex profile

woeful quarry
#

I’ll look into that, thanks

clear condor
tall radish
#

what’s up with these weird artifacts in the options menu of battle garegga?

mortal mist
#

this happens sometimes, exiting and re-entering should take care of it, it does not always occur.

#

when I tried to fix a few things I also noticed this, I thought , I was the one who messed something up, but this has appeared before.

#

it's vdp2 sprite bug

#

i added it , maybe it's an easy fix

ripe valley
#

Maybe a timing of VRAM access slots on VDP2.

mortal mist
#

could be

ripe valley
#

Battle Garegga is really sensible to timings on RAM access slots.

#

We had to fix it like... 3-4 times aloready.

mortal mist
#

it;s very minor issue πŸ™‚

ripe valley
#

And maybe only visible on yoko (standard) video mode.

topaz tartan
#

I don't normally use Discord and I certainly wouldn't have expected this convo in a Saturn subthread either.

#

Either way, yes I have full intentions of submitting a PR to MiSTer Main for the patch, but because the way I pinged the guns is kinda sorta a bit of a hack (as in just resolving the path for the serial device I needed to send the commands to auto-set guns into gamepad/mister mode) I wanted to be sure it worked on other Misters setups than just my own.
But since all guns use the same vendor ID (and most importantly, said VID isn't registered by anything else), it shouldn't be an issue. I've also had a lot of... shit to deal with lately, so I didn't exactly have the headspace to keep an eye on my volunteer work.

untold cloud
#

Sorry, I'm not quite with you - which Lightgun specifically are you having trouble with?

#

Oh, the PR thing.

#

OpenFire, yep?

topaz tartan
untold cloud
#

Ahh, OK.

#

Sorry if I came across a bit rough, when talking about the PR yesterday.

I was just surprised it wasn't submitted yet, as it looked like a clean patch to main MiSTer, so I don't think it would cause issues with existing code.

topaz tartan
#

Self-esteem issues prevents me from seeing anything I work on as clean so, ah, sorry! I really wanted to make sure it worked for users first before submitting it.

untold cloud
#

No problem at all.

warped saddle
#

is the ping only needed to set that mode that changes how the gamepad buttons map in the gun?

untold cloud
#

In contrast to my version of "I did about 20 compiles to get it this far... other games can be fixed later" approach. lol

#

As an example, I had an idea that at least one Saturn lightgun game uses interlaced mode, so I knew I'd likely have to sort that soon.

topaz tartan
#

It's the same switch that a PC user would send to the gun to have it automatically switch to using its gamepad output device.

warped saddle
#

oh, I thought from looking at the firmware changes it was a gamepad mode that was somehow different

#

the guns have no way to manually switch the mode?

untold cloud
#

What specifically was the issue with OF on MiSTer?

Does the HID descriptor not emulate a Mouse+keyb by default (on MiSTer), or is it more involved than that?

topaz tartan
untold cloud
#

I get that a Mouse might not be the "best" way for a lightgun to talk to something, as the mouse uses relative positioning.

topaz tartan
# untold cloud What specifically was the issue with OF on MiSTer? Does the HID descriptor not ...

Well, the device needs to be whitelisted as a gun to even get the MiSTer gun cali UI, that's step one.
And it defaults to mouse+kb, and I wanted the experience to be as seamless as possible without having to pre-setup to a mister-friendly mode on a PC, hence the added code to ping the gun to turn to gamepad output mode instead.
Far as I know, I'm not aware of any USB lightguns that talks to Mister using the mouse.

#

And everything I've seen from my own testing, mice get seen as relative output, even if the gun itself uses and outputs ABS coords.

untold cloud
#

oic, yeah. So main MiSTer won't even see it properly, unless it knows the VID/PID.

#

Joystick XY likely is a better mode for LGs.

#

Although I've yet to actually test that myself. lol

warped saddle
#

hmm, wickerwaka just added support for those retroshooter guns in mouse mode and added 'QUIRK_LIGHTGUN_MOUSE

topaz tartan
warped saddle
#

although hmm maybe those were EV_ABS not REL

clear condor
#

Joystick XY is nice since you never have to worry about any relative/absolute shenanigans - but you also only get 8 bits of precision

topaz tartan
#

I was mainly looking at what G4IR was doing as a basis.

topaz tartan
warped saddle
#

I think that quirk might only have been for allowing mouse buttons to be mapped normally

untold cloud
#

AFAIK, on the FPGA side of MiSTer, it only uses 8-bit (signed) values for X/Y.

topaz tartan
#

Well either way, I figured, gamepad output was the established standard here, so I'll just use that and make it as seamless as I can.

untold cloud
#

At least for joystick XY.

#

Then again, most of the cores are fairly low-res, so the precision thing maybe isn't overly critical.

topaz tartan
untold cloud
#

Ahh, OK.

topaz tartan
#

I'm sure it probably gets scaled down in the cores to 8 bits

#

But that's what the frontend gun UI showed

untold cloud
coarse tokenBOT
#
// analog -127..+127, Y: [15:8], X: [7:0]
untold cloud
#

That's the main method the HPS (ARM) uses to talk to the FPGA side, via the hps_io module.

clear condor
#

The calibration UI is showing the Linux USB values - which then get truncated

topaz tartan
#

ah yep, that's a signed 8 bit int

topaz tartan
untold cloud
#

But yeah, if the menu core displays 16-bit values, then best to go with that, on the HID side of things.

#

Or I guess 15-bit? lol

#

tbh, I've... never used the MiSTer lightgun calibration thing.

#

I probably should. It's on the todo list.

topaz tartan
#

AFAIK the mister lightgun cali is required for it to even work, isn't it? That's what I experienced in my testing.

untold cloud
#

I also bought the cheapo Saturn Lightgun the other day, and the extension cable arrived, I will try to test that soon.

But ofc that's an oldskool CRT lightgun, which will work via SNAC. So not really related to the USB stuff.

prime hare
untold cloud
#

Thanks, Mr Owl.

topaz tartan
untold cloud
#

Yep, I spent about the past week, trying to figure it out. Eventually got it (mostly) working. lol

#

By taking the Lightgun module from the MD core, which I believe was largely written by ShaneLynch.

#

Originally, I tried shoving the XY values directly into the latch register in VDP2.

#

But it wasn't too bad in the end, to get it to recognize an LG, directly on the Joyport.

#

Well, via the HPS2PAD module.

#

It was just that whole weird Joypad ID that confused me for a long time.

glass rain
untold cloud
#

(ie. LG joyport bits [3:2] tied High. Which ends up being read as two nibbles, which then ends up with an ID of 0xA.)

#

Then I had to figure out the mapping from the 8-bit (converted to unsigned) XY values to the 320-wide and 352-wide modes of the Saturn.

#

I will try to test the few Interlaced games soon. Hopefully it's not too painful to get working.

green basin
#

the hid descriptor needs to be in input.cpp for any light guns that are not coming up as light guns... different guns have diff x/y limits

#

i don't see anything in there for the OpenFire stuff but maybe i missed it

untold cloud
#

See, perfectly clean code. πŸ˜‰

green basin
#

yea are those the correct limits for that device?

#

it probably is... just wondering if the of actually listed specs

topaz tartan
#

And that's the older initial commit oops, got tweaked in the comm after that.

#

I would hope they are correct, I made the damn thing lol

green basin
#

oh lol

topaz tartan
untold cloud
#

Gonna watch a bit of Mr Owl's live stream.

#

Good to have you on here, @topaz tartan , btw.

topaz tartan
#

Not sure how helpful I'll be in the long run, lol

#

I'm still getting the hang of C tbh, all of the FPGA stuff just goes whooosh

topaz tartan
#

Sent a PR to Main, hopefully it should be implem'd soon.

warped saddle
#

my only suggestion would be not to use system() to just echo a few bytes to a file. just fopen and write it directly

#

also feels like something that could just happen via a udev rule but Sorg is likely to "Linux guys are coming" me over that type of suggestion, lol

noble escarp
#

For virtual lightgun testing, it just needs the unstable core or it also needs mister main?
Going to test it wht a guncon1.

wise brook
#

nah, just the latest core in nightlies

#

i mean, if your main is pre 2020 give it a quick update_all by all means

noble escarp
#

It's not that old πŸ˜‚

topaz tartan
#

Good to know after submitting code for public scrutiny, I guess

#

But I appreciate the tips.

warped saddle
#

eh, you can revise PRs, no big deal.

#

also have you seen the rest of input.cpp? You're doing fiiiiine

winter phoenix
#

Haven’t played through good ol’ Bulk Slash in a while … and this time I used my new Saturn SNAC adapter that arrived today!

wise brook
topaz tartan
# warped saddle eh, you can revise PRs, no big deal.

Just revised and tested it again to make sure it works, so thanks πŸ˜‰
And now my desk is a minor cable nightmare rn since I don't usually have my mister at my desktop (and it's the only place where my emitters are mounted atm)

short shore
winter phoenix
wise brook
winter phoenix
#

BTW I’m trying out untranslated Rabbit and the music sounds fine, so it was the patch that was screwing things up … Saturn core stays winning, sorry for the false alarm last week

wise brook
#

here’s one of them as an example

#

it sits in between

winter phoenix
#

Yeah it kinda looks like that but green. It came with my MiSTer.

wise brook
#

so use that with your saturn adapter

#

and Mega Drive too

#

as both ran on 5v

winter phoenix
#

OK will do. (The only other SNAC I have is the SNES one the MiSTer came with)

#

Mine is smaller, though

wise brook
#

that’s way more desirable

#

less bulky, shame it’s not got a nice case

winter phoenix
#

This is a resistance ladder, though, right?

wise brook
#

yup

#

that’s perfect, just much more neatly arranged

winter phoenix
#

OK cool. (I have no idea what I’m looking at with circuits. I lay out newspaper pages.)

wise brook
#

you’re all good my dude

#

i love what you do for the scene

#

if in the near future, you want to upgrade to an even more tidy solution

#

this is an all-in-one

#

it does the voltage correction in a neat little package

supple vine
#

I would be worried to have so much stuff hanging directly on my user port, because of mechanical strain. I would put a short extension cord (1 ft), just to be safe.

winter phoenix
#

that's why I put a little block of wood under it to support it... I didn't like how it was just hanging there

rich violet
#

Do you notice much difference using snac compared to a wired USB controller?

#

So far I've been happy with my m30s

glass rain
#

But then how would they snap their level shifter in half

naive whale
rich violet
#

Oh, that OpenFIRE lightgun support was merged: #unstable-nightlies message

dense sundial
#

Don't fuss with voltages, get M30

#

It's perfect as a Saturn pad and then some

#

I love playing SNES games on it way more than the kosher method

glass rain
#

Real question is how you map the buttons for snes. AB XY or BC YZ

tawny compass
#

Is there a tutorial on how to setup STV on the Saturn core?

mortal mist
celest lake
#

Did anyone test the DOA change? Did it help the slowdown in either ram config?

mortal mist
#

What change ?

#

For slowdown use fast timing option

rich violet
#

The fix for the crashes?

#

I don't think it was related to slowdown at all

#

Something to do with divide by 0 in the CPU implementation, I think

mortal mist
#

Yes it's two different things

tawny compass
tawny compass
celest lake
#

ahh ok

cunning citrus
wise brook
#

i actually double map the a and x to the leftmost and rightmost buttons

#

sometimes it feels natural to use b/c, sometimes b/a and this means i can just go with what makes the game feel best

cunning citrus
#

I'll do this when I use the SNES core, neat!

glass rain
#

Yeah, I do similar with the NES core

minor cipher
cunning citrus
#

Ill look into double mapping SNES Y to M30 A. Because some games uses Y to attack, so I can use the M30 A button instead of changing the game button settings. (we are derailing a little bit here, sorry).

floral saddle
winter phoenix
wise brook
#

Pat on life support after hearing this

winter phoenix
#

I know haha

#

Gonna be fun to get his reaction to this on the show this Friday

wise brook
#

unrelated and massively off-topic have you ever seen the Star Trek arcade game from β€˜82

winter phoenix
#

I ... don't think so?

wise brook
#

i’d never heard of it, it’s got some gorgeous vector graphics

#

one went up for sale in Illinois

#

like, when’s the last time you discover a sega game exists that you’ve never heard of?

south light
#

It's a great experience with an interesting control scheme. They have one at the Pinball Hall of Fame in Vegas. Got to play it year before last.

rich violet
#

A 3D Vector (Wireframe) shooting 'em up game with computerized speech synthesis. The player finds himself the Captain of the Starship Enterprise, his mission being to rid the universe of a number of threats to the United Federation of Planets.
In order to destroy enemies the player may use either of two weapons : Phasers (the Fire button) or Pho...

β–Ά Play video
wise brook
#

predates Worf and yet sounds like him

winter phoenix
#

That's pretty cool. Reminds me of the Star Wars arcade game with vector graphics, which I've actually played at a barcade

tawny compass
next bronze
#

I have seen the vector Star Trek arcade when I was younger. I have played a few ports of it, though none have that voice.

mortal mist
soft goblet
#

OF works great in VC from what I can tell, except the Crosshair is off by a good bit.. i.e. if I aim over the iron sights of the gun, the shot lines up, but the crosshair is an inch to the right of where I aimed and where the shot landed.

soft goblet
#

F10 does nothing for me during gameplay.. it DOES work in i.e. the PSX emu

#

...okay. I just plugged the keyboard into the first USB port instead of port 4 and F10 did work.. lemme try again

#

nope.. the crosshair remains offset

#

in the screenshot, I aimed with the crosshair and fired, and the shot landed where it shows the impact, not where the green crosshair was

ripe valley
#

We're getting crazy with srg320.
Time Gal fails on Fenrir and SAROO, but works on some software emulators with the same copy.

#

Same for Ninja Hayate.

#

Some levels won't load on the core and these ODEs.

wise brook
#

sound like a Main fix?

topaz tartan
#

I'd assume the crosshair being off thing is an aspect of the software/core. I do know that the crosshair overlay on the PSX core seemed to line up in a basic Point Blank test

wise brook
ancient surge
#

I'm guessing due to the nature of those games, they're constantly streaming data from the disc, and there is a bug related to the core that is causing a snag.

floral saddle
ancient surge
#

Might require the main being updated to fix the problem.

clear condor
soft goblet
#

How's the calibration supposed to work in VC? It seems to make zero difference whether I shoot for the crosshair or the actual bullseye and then exit and accept the setting

clear condor
#

You shoot offscreen to begin calibration; then, the next time you shoot the screen, that becomes the center

#

(I think?)

soft goblet
#

Well, in that case it is properly calibrated (and works pretty well in gameplay, too), but the crosshair remains offset by an inch or so to the right. I turned it off now cause it's just distracting

thorn pagoda
#

hmm

#

maybe the shot position is scaled correctly for the width but not the crosshair position?

clear condor
#

It sounds like it's off by a constant amount

thorn pagoda
#

OF is joystick based on mister right

soft goblet
#

Yep

thorn pagoda
#

maybe it needs some constant offset applied to account for h-blank?

#

can you get the crosshair all the way to the right side of the screen?

soft goblet
#

all the way on both sides

thorn pagoda
#

yeah so its scaled correctly but just offset left, did you say its not the case in other cores?

soft goblet
#

Just to be clear, the virtual crosshair is offset, not the actual aim.. Let me check some other core just to be sure

thorn pagoda
#

yeah that makes sense

soft goblet
#

Point Blank on PSX core is pretty much spot on (give or take a few pixels around the center of the ingame crosshair vs. the virtual crosshair, seems to be some smoothing going on)

#

Bit hard to see since both have similar colors

thorn pagoda
#

that about confirms it yeah

soft goblet
#

Interesting.. in VC2, the offset is totally different. Is the F10 calibration stored by core or by game?

thorn pagoda
#

by-core

#

is that a different resolution? if you open the osd and go left it'll tell you there

soft goblet
thorn pagoda
#

huh

#

thats really surprising

#

maybe its the games themselves trying to apply some default config

glass rain
#

You have to f10 calibrate the core once (don’t forget to save settings) and then also calibrate per game

#

I guess if you have auto save turned on, it’ll save the game calibration when you open the osd, but I’m not sure

wise brook
unkempt thistle
#

Might be an idiot, can't get the cart type set to STV in the OSD :/

#

Didn't have the newest nightly, sigh 🀣

untold cloud
#

OK, trying to catch up...

#

@wise brook When you said before that you couldn't get the gun to shoot "offscreen", do you mean it never works at all?

If you have the Crosshair enabled, the crosshair should completely disappear, once you aim to the very edges of the screen (top, bottom, left, or right).

#

That's when it does the offscreen thing, where it tells the Saturn core that there is no longer "light" detected.

#

And I mean the last few pixels on each side, should be the zone where it detects offscreen, basically.

wise brook
#

the thrustmaster iirc, even after calibration never shot offscreen.

but i am at β€œwork” right now and won’t be able to test for 7 hours

untold cloud
#

np at all.

wise brook
#

the gun was just a guncon 2 alternate

untold cloud
#

Trying to think how else a USB Lightgun might signal to the core that it's not detecting light.

#

I don't know if they even could. lol

#

'cos most will be using IR emitters, etc, to detect the gun aim.

wise brook
#

but i did just use the button assigned to B to reload

untold cloud
#

So not like a CRT lightgun, ofc.

wise brook
#

that felt and worked really well good btw

untold cloud
#

Ahh, OK, so Auto-reload works OK so far?

wise brook
#

it did!

untold cloud
#

Auto-Reload basically just forces the "Light" signal to Off, then triggers Button A (Trigger) for you.

#

So should be fairly reliable, unless certain games are doing polling, and it's a bit too fast.

#

As for the Crosshairs being off-aim from where the gun is (for some people) - the crosshairs in theory are exactly where the Saturn core will "think" the aim is pointed, as far as the XY coords latched into VDP2.

#

But I could be wrong there somewhere, as it also had a delay option when used on the MD.

#

The delay is meant to keep the Light sensor signal High for a bit longer, to more closely mimic a typical gun.

wise brook
#

oh! i don’t think i had auto reload turned on with the gun, it did have a setting for that but i don’t think it was engaged

untold cloud
#

The thing is, once I calibrated it in Virtua Cop's "Gun Adjust" menu, the Crosshair aiming was fine.

#

But obviously I was only testing with a USB mouse, so that would make sense.

wise brook
#

now, gun4ir worked perfectly

untold cloud
#

Calibration between the Crosshair position and a "real" USB Lightgun might actually be slightly off.

pearl harbor
#

Shooting offscreen to reload with my guncon 3 was working.

wise brook
#

as expect

#

but the usb guns on a crt might not work as expected

untold cloud
#

Auto-Reload in the core, is basically always mapped to Button B. So whatever you map to Button B, on the OSD menu.

wise brook
#

makes sense

untold cloud
#

I would imagine the majority of USB light guns will allow the cursor to go all the way to min (0), or all the way to max, when pointed offscreen.

#

That's the only way the core (currently) knows the gun is offscreen.

naive whale
untold cloud
#

And logically, the only way most USB Lightgun systems (with IR emitters, or Wiimote/DFrobot style camera) would be able to detect an offscreen event.

wise brook
#

with a Namco guncon 2, you can set the B button to the bottom of the β€œmagazine” and slap that to reload which feels legit

pearl harbor
wise brook
#

i will make some recordings later tonight to show my results on a tube tv

untold cloud
#

I can see why code PRs are hard now, because I forgot you then feel obliged to do "support", and fix future issues. lol

pearl harbor
#

The trick only works once! Since...you know...the hole.

untold cloud
#

As an example, I do want to fix the Lightgun thing for interlaced games, but not sure when I'll get chance.

#

I spent the last two nights, messing with the SH1 core from Saturn, trying to get some Roland synth code to run on the sim.

#

But that was a big FAIL (so far), so here I am. lol

pearl harbor
#

Really wish we could get a progressive scan mode like PS1 and N64 for interlaced games.

untold cloud
#

Erm, I'm not exactly sure how Interlaced works on the Saturn.

#

But if it is genuinely displaying the odd and even lines as separate "fields", then it would likely need to be deinterlaced somehow.

pearl harbor
#

The whole weave and bob thing is basically a pick your poison solution.

untold cloud
#

ie. it's probably not as simple as it just using a Framebuffer, as it generates a lot of stuff on-the-fly, in the VDPs.

wise brook
#

and you’ve got half a percent of the de10’s logic gates left to work with so i’d say it’s SoL

untold cloud
#

A bit more logic, now that ALSA is disabled.

#

But not much.

warped saddle
#

we're coming for adaptive scanlines next!

wise brook
#

my recommendation, MiSTer into a scart splitter, one output into a crt the other into a device that can do adaptive deinterlace

untold cloud
#

No way I'd know how to do Motion Adaptive deinterlacing, so you'd have to hit up Mike Chi, or somebody. lol

warped saddle
#

I suspect that might not fit

untold cloud
#

Almost certainly not.

naive whale
untold cloud
#

The old Intel/altera VIP scaler, did support deinterlacing, IIRC.

#

But yeah, that would be even more painful.

warped saddle
#

one time I went to see how the ossc pro does it and they just use the altera IP for motion adaptive

pearl harbor
untold cloud
#

Plus, it requires the "patch" for Quartus, to compile with the VIP scaler.

#

From Arakon's post...

#

That's strange, because I could understand it if the bullet hole was "after" the crosshair.

#

Unless it's so far delayed, it's ending up on the next scanline, but not quite reaching the crosshair again. lol

#

Brain already hurts, thinking about the relative positions of stuff, and the cause-and-effect nature of it.

#

The Crosshair should always represent the XY coords latched into VDP2, though.

#
        if(~&sensor_time) sensor_time <= sensor_time + 1'd1;
        
        if(sensor_pend) begin
            if (sensor_time >= SENSOR_DELAY) begin
                SENSOR <= (!reload_pend && !reload && !offscreen);
                sensor_pend <= 1'b0;
                sensor_time <= 8'd0;
            end
        end
        // Keep sensor active for a bit to mimic real light gun behavior.
        // Required for games that poll instead of using interrupts.
        else if(sensor_time > 64) SENSOR <= 1'b0;    // Could probably reduce this for Saturn.
    end                                                        // But some games could actually use polling? EA
#
wire [7:0] gun_p1_sensor_delay = 8'd2;
#

The sensor_time > 64 thing, should be for how long it holds the SENSOR signal High, after the scanline has hit the aiming point.

#

If that makes sense.

#

So that would be holding it High for 64 pixels, apparently.

#

That whole chunk of logic in the lightgun.sv module, works on CE_PIX, which is essentially the pixel clock.

#

So the count for things like sensor_time are also done as "pixels".

#

Code is a bit back-to-front...

#
    if(HDE && VDE && (x == hcnt) && (y <= vcnt) && (y > vcnt - 8)) begin
        sensor_pend <= 1'b1;
        sensor_time <= 8'd0;
    end
#

That's what triggers the sensor_pend count-up, but that piece of code is placed after the other stuff above.

#

(I just personally like to try to place code where stuff happens in-sequence, if I can)

#

This is a very Sorg way of doing things. lol...

#
if(~&sensor_time)
#

Even the lack of space after the IF statement.

#

That's doing a bitwise AND, of all the bits in sensor_time.

#

But then inverting it, with the ~ (bitwise NOT).

#

I can't even figure out what the means rn.

#

Would be more human-readable to do the count-up within this block...

#
        if(sensor_pend) begin
            if (sensor_time >= SENSOR_DELAY) begin
                SENSOR <= (!reload_pend && !reload && !offscreen);
                sensor_pend <= 1'b0;
                sensor_time <= 8'd0;
            end
            else sensor_time <= sensor_time + 1'd1;
        end
#

As soon as sensor_time reaches SENSOR_DELAY (the fixed compile-time value), it clears sensor_pend anyway.

#

Then that whole block no longer gets evaluated, due to the IF at the start.

#

In summary: I don't yet know why the crosshair would be so far off from the aim. lol

#

But, I did notice it was slightly off for me, too, when using the USB mouse to test.

#

Until I did the Gun Adjust thing in VC.

#

So maybe it is a bit off to begin with. And needs a tweak, to make it closer, without having to do calib every time.

#
            x  <= lg_x;
            y  <= lg_y;
            xm <= lg_x - cross_sz;
            xp <= lg_x + cross_sz;
            ym <= lg_y - cross_sz;
            yp <= lg_y + cross_sz;
#
    draw <= (((SIZE[1] || ($signed(hcnt) >= $signed(xm) && hcnt <= xp)) && y == vcnt) || 
             ((SIZE[1] || ($signed(vcnt) >= $signed(ym) && vcnt <= yp)) && x == hcnt))
#

Crosshair drawing stuff. ^

#

lg_x and lg_y are the raw X/Y values from the USB lightgun. ie. from the Mouse XY or Joystick analog XY.

#

xm and xp will be when it draws the horiz line through the aim point.

#

And obv the same for ym and yp.

#

So x and y should be dead-center of the aiming point, basically.

#

The SIZE[1] OR thing, is how it draws the lines across the whole screen, IIRC.

#

Yeah, that makes it ignore the whole middle chunk of logic, so then it's only looking at the match of y==vcnt and x==hcnt.

#

Oh yeah, SENSOR_DELAY does actually delay the ON time of the Sensor very slightly.

#
            if (sensor_time >= SENSOR_DELAY) begin
                SENSOR <= (!reload_pend && !reload && !offscreen);
                sensor_pend <= 1'b0;
                sensor_time <= 8'd0;
            end
#

ie. only when sensor_time reaches SENSOR_DELAY, but that's only set to 2 atm.

#

Which would be literally only two pixels away.

#

The Sensor OFF time, is hard-coded a 64 atm.

#

That seems like a long time, so could be reduced.

#

To help debug that, the Sensor signal could be overlaid on-screen, to see how far the timing extends, after the crosshair.

#

Maybe we really should have a dev thread for this stuff.

#

OK, so...

#

The F10 option on the main menu core, would be to calibrate your physical aim, to where the crosshair XY should be.

#

So the crosshair should then line-up with the gun.

#

Yeah, I don't know why it would be so far-off in the core.

#

Unless...

#
.HDE(HBL_N),    // Blanking signals are Active-Low. So should act as "DE" (Data Enable) signals when High!
.VDE(VBL_N),    // ie. No need to invert here.
.CE_PIX(DCLK),
.HRES(HRES),    // input [1:0]   [1]:0-normal,1-hi-res; [0]:0-320p,1-352p
.VRES(VRES),    // input [1:0]   0-224,1-240,2-256
#

The blanking stuff should be correct, or it would never work properly.

#

(in non-inversion of the blanking signals, I mean.)

#

So those are acting as the DE (Data Enable) signals, to denote when there are active (visible) pixels being displayed by the core / displayed on-screen.

#

But...

#

If say HBL_N goes High, shortly before the first active pixel of the line, that would throw off the crosshair vs core HV calibration.

#

This is going to be a nightmare, isn't it. lol

#

It looked fine to me on SignalFlap, so I think something else is going on, with certain lightguns and certain games.

#

For one thing, a lot of USB lightguns will be using a higher precision for the XY values.

#

vs what the core itself uses, which is only 8-bit signed, atm.

#

If main MiSTer is doing the correct thing, it will just be ditching the LSB bits of the incoming XY values, and only using the upper 8 bits to send to the core.

#

I'll have a closer look at this soon, and start doing more testing. I'll also try out the old-people CRT lightgun I just bought.

wise brook
#

have you got a usb lightgun too?

#

the one you got iirc was a combo Saturn/ps1 wasn’t it?

untold cloud
#

No USB gun yet.

#

I should probably buy one soon.

#

Saving for a trip to Thailand, though, so I've been watching the pennies.

wise brook
#

if you want, i literally have 1 more than i need

#

i’ve got 2 guncon1 and 3 guncon2

untold cloud
#

That's very generous of you, but I'd feel bad taking that.

#

I didn't want to presume that you'd give it away for free, ofc. lol

wise brook
#

pft, you got my gun4ir working on the big screen. you more than earned it.

just cover the postage if you want

untold cloud
#

I'd happy to pay towards the lg as well.

wise brook
#

very kind of you, i’ll dm after work and have confirmed full functionality with you

untold cloud
#

That would be awesome, thanks.

#

Even the GC2 is quite expensive on eBay, though.

#

Please let me pay a bit towards it, plus postage.

wise brook
#

i got them when they were cheap

untold cloud
#

In in the UK, btw, in a place that I'm sure is twinned with Mordor.

wise brook
#

yup

untold cloud
#

Same weather as Mordor, and same general atmosphere. Keir Starmer is the big glowing eye thing.

#

I could get sent to prison, just for saying that, these days. lol

#

Sir Keir Stalin, we call him.

#

Anyway, thanks. lol

#

Not sure how long I'll be awake tonight, but I will catch up with you soon.

wise brook
#

np 🫑

kind bough
#

The f10 calibration is between the gun and the OSD crosshair
I needed to calibrate in-game otherwise the shot was off from the OSD crosshair. Most were off by a fair bit initially, was good after that
Think its press start on the calibration screen to calibrate using the next shot, otherwise its just 'testing'

#

for VirtuaCop 1 that is

untold cloud
#

Yep, have to hit Start first, then aim at the bullseye.

pearl harbor
#

I did actually just notice that there's still a slight invisible wall on the right side of the screen. I only didn't notice at first because I usually aim to the left or up to reload. When I tested reloading down or right, only right wasn't working. So I turned the OSD crosshair back on, and yeah it doesn't quite reach the right side of the screen. It isn't nearly what it was like in that early lightgun build when it was a solid 10% of the screen. This time it's only like a few pixels, but it's enough to not allow for right side reload. I recalibrated the gun through the OSD, but that didn't change anything, so it seems to be something outside of calibration that's causing it.

green basin
#

Is the build in unstable the one we are testing lightguns on or another build in chan?

pearl harbor
#

Latest unstable.

green basin
#

Any lg in main should work now?

pearl harbor
#

USB lightguns like guncon 3 work.

green basin
#

Hmmm ill see if blamcons work on it

pearl harbor
#

That's the only one I've tested anyway.

fallow oracle
#

oh we got lightguns now?

#

I have a couple guncon 3s and if two guns are allowed at once I might need to play HotD soon

clear condor
#

We do, and they are

untold cloud
#

I think I know what that is.

#

It's because I was using a USB mouse for testing.

#

But a mouse uses relative movements, so it essentially has an infinite range. Sort of.

#

(within the limits of the X/Y values fed to the core, that is.)

#

I didn't test analog joystick input yet.

#

And the 0-255 values from the Joystick are scaled to fit the screen, for the 320-wide and 352-wide resolutions.

#

But it's probably not able to check for offscreen, because the maximum X value can't go any higher.

#

So it needs a tweak, to check more implicitly for the offscreen thing.

#
wire [8:0] screen_width = HRES[0] ? 352 : 320;
#

For Mouse X...

#
            else if(new_x >= screen_width-1) lg_x <= screen_width-1;    // If Mouse X >= screen_width, limit (lg_x) to the screen width.
            else lg_x <= new_x[8:0];
#

The mouse X value (new_x) is actually 11 bits, so can extend to a huge value of 2047.

#

That logic above just limits that to screen_width-1.

#

(else, it knows it's below that, so just assigns the value from some bits of new_x.)

#

This is the check for "offscreen"...

#
// Check if the target is off the edge of the screen. (Left, or Right, or Top, or Bottom).
// Have to do screen_width-2, because of the 352-wide (0-351) res mapping only goes to 349 max.
offscreen <= !lg_x[8:1] || lg_x >= (screen_width-2) || !lg_y[7:1] || lg_y >= (vtotal-1'd1);
#

The !lg_x[8:1] thing, ditches the LSB bit, so it ignores the very first pixel on the left side (which is what we want).

#

Similar for Y.

#

But for lg_x, I'm checking whether it's >= (screen_width-2).

#

Which works OK for the Mouse, because it's X value can always go higher than that.

#

But for joystick (analog) XY...

#
if (HRES[0]) lg_x <= j_x + (j_x >> 2) + (j_x >> 3);    // Map 0-255 to 352-wide res. (actually 0-349, but close enough)
else lg_x <= j_x + (j_x >> 2);                                // Map 0-255 to 320-wide res. (actually 0-318, but close enough)
#

The mapping only reaches 0-349, when the horiz res is 352 (0-351).

#

I probably need to check for screen_width-3, in fact.

#

screen_width-2 would be 350. Oops. lol

#

Yeah, that'll be it.

#

The crosshair can't ever go beyond 349 when using joystick X input.

#

So maybe even screen_width-4.

#

Yeah. I reckon it needs to check for lg_x >= 348.

#

It still means the crosshair won't quite reach the last couple of pixels on the right, but it was the cleanest way to do the mapping.

#

Without using a divider, because the core was so crammed already.

#

ie...

#
lg_x <= j_x + (j_x >> 2) + (j_x >> 3);    // Map 0-255 to 352-wide res.
#

j_x >> 2, is the same as doing j_x / 4.

#

And j_x >> 3, is the same as j_x / 8.

#

The max j_x can (originally) go to, is 255.

#

So that would be 255 + 63 + 31 = 349 max lg_x value.

#

I will try to test this very soon, and do a PR for it, in the next few days.

#

Then look at the games that use interlaced.

#

VDP2 does some translation there, when it latches the light gun H/V counters, at the exact time the Sensor (EXLAT_N) input from the lightgun goes Low (asserted).

#
            EXLAT_N_OLD <= EXLAT_N;
            if (!EXLAT_N && EXLAT_N_OLD && REGS.EXTEN.EXLTEN) begin    //EXTEN
                REGS.HCNT.HCT = {H_CNT,DOTCLK_DIV[1]};
                REGS.VCNT.VCT = LSMD == 2'b11 ? {VCT,~ODD} : {1'b0,VCT};
                REGS.TVSTAT.EXLTFG <= 1;
            end
#

(!EXLAT_N && EXLAT_N_OLD), just checks for the falling edge of EXLAT_N.

#

So that's almost pixel-accurate along the current line.

#

H_CNT doesn't seem to need a tweak for interlaced, as it would be the same horizontal res anyway (likely 320 or 352).

#

But it checks LSMD for Interlaced mode, then it shifts VCT (vertical counter) left by one bit.

#

Then uses the "ODD" field indicator (inverted) as the LSB bit.

#

Interlaced mode would in theory give twice the usual number of vertical lines, but drawn as two separate fields.

#

So yeah, I probably need to do the vertical scaling differently, in the Lightgun module.

#

Another stream-of-consciousness post, but hey, a handful of people might be interested in the detail. lol

kind bough
#

Im likely misunderstanding, but just in case: for me in interlaced mode the tracking still seemed OK on the vertical axis, but horizontal range was compressed to the left 1/2 of the screen

#

its funny, I dont think ive ever tried to reload off the right of the screen, always use top or left πŸ™‚

clear condor
#

The number of lines drawn is the same whether using 240p or 480i, so that makes sense. I'm not particular with whether, when the Saturn does 480i, it also doubles the horizontal resolution. I'm guessing it does, which would explain why the horizontal range is squished into the left half

mortal mist
rich violet
#

You've been debugging it?

ripe valley
mortal mist
#

I made a build yesterday that works ok , but unfortunately I don't have enough knowledge to make Bomberman work too

#

I only know for sure , that there is an error there

mortal mist
#

Ok , srg320 confirmed that there was an error there. He fixed it , good thing I don't have to stare at the code anymore because it hurts my head 🀣

ripe valley
#

😏

mortal mist
#

srg320 is a big brain πŸ™‚

mortal mist
#

I can't wait to see where the error was.

thorn pagoda
tacit viper
#

Have nothing to contribute but ty to all you guys testing, you are doing god's work here. πŸ™‚

hearty marten
#

So the Saturn core is basically finished now, right? πŸ˜…

mortal mist
#

right πŸ™‚

hearty marten
#

Looking through the issues it seems like the vast majority can be either closed or are feature requests

#

Or srg’s already fixed them πŸ˜„

#

Possibly time for another release soon 😎

dense sundial
#

But yeah I just double whatever I feel like for autofires

random shard
#

hey guys, so guncon3 works now?

#

virtua cop, house of the dead?

#

no one does lightgun games like sega and namco did, bless them

winter phoenix
#

So if I wanted to use an original Saturn lightgun with the MiSTer, I’d still have to hook it up to a CRT, is that correct?