#Sega Saturn
1 messages Β· Page 86 of 1
For n64 you can't use the scan_doubler and scaler at the same time. The scaler will override the scan_doubler. Also suggest moving the conversation here in the CRT thread as other's may be of help https://discord.com/channels/647909397477195803/806021143948689438
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)
One message removed from a suspended account.
In a nutshell if you do a side by side comparison of Saturn and ST-V, what are the differences?
you get 0xF0 for which ever port in oreg with nothing connected Ash.
Games on ROM chips vs games on CDs
Whatβs the status of lightgun support? Hoping to play some virtua cop
It's working fully if you use the latest unstable
What I did instead was catch the rising edge of the gun's trigger input. Then, I flashed the screen for a couple of frames in response to that, and then presented that input to the game. So it also resulted in the gun's trigger being delayed by a few frames.
hrm.. tried to get my openfire lightguns to work, but while I can assign trigger etc, the crosshair never moves
Hi guys! Just tried the latest version of the core for STV, I can assign all buttons but 1Player button start never works...
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
ok so for example I can't start Cotton 2...
yeah, that's a known issue.
do those guns use joystick mode? you may have to enable that
should be right next to where you set the controller types
Cotton 2 has a protection IC which prevents the game from actually starting
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
Try setting p1 'xy ctrl' and 'buttons' to mouse maybe @soft goblet
cotton2 is something else. it never even talks to the protection chip.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
Pocket Fighter finished with 4 different characters endings , one more Perfect on the compatibility list.
I have until Friday, so I'm doing my last tests now.
So... what was the issue?
Ok, thanks!
One message removed from a suspended account.
Good deal. Glad you got it sorted.
One message removed from a suspended account.
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...
if ((SmpcRegs->IREG[0] & 0xC0) == 0x40) {
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.
srg may have noted that that part isn't complete. You can get more bytes than the oreg can hold if you use multitaps
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.
Do you have the mister main file for openfire?
And is it active for Saturn?
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.
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?
Reference firmware for the OpenFIRE project, built for the RP2040 microcontroller - TeamOpenFIRE/OpenFIRE-Firmware
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.
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
yeah, I saw it
Yep, I would expect the button mapping should work through the normal MiSTer menu thing.
/ db
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
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.
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
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.
no it's in git
the comments in the issue claim they will eventually PR it, they're just testing it
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.)
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.
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.
Sorry I've had a bad couple weeks, sorry for being rude
I forgot how stressful it is, just doing the PR alone, using the latest core code, and trying to keep it relatively "clean".
you should restore the Off option
it's partly why there are bugs, because real hardware needs a controller unplugged
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.
ah got it
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.
true okey dokey, at least you heard my concerns
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.
every now and then i let the inner cuavas out
lol. np
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
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.
i get it
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.
don't let it get to you, do it for yourself, not for the official recognition
do it to contribute and improve it
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.
At some point, I can't be testing tons of games, as I'd never get anything else done. lol
np, mate. π
i shouldn't ahve taken it out on you
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.
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
otherwise github gets weird and will desync
Yep. I'm still learning. π
I didn't even know about the Sync button on the site, until now.
or rather it was called something else and it woudln't always sync right, now it's better
there's also a command line client you can use to invoke the sync
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.
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.
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
Making sure sega is repeated a lot in memory?
Is that the patented nintendo game boy protection?
So far, in MAME, I've only seen the game check that first part of the pattern, before the title screen.
βThey embedded our name in their code! That is copyright infringement!β
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.
I've heard many games have chiptunes on the ST-V vice the Saturns CD music. Might be true, might be false, might be better, might be worse.
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.
hmm, patched the TST R1,R1 to TST #$0, R0 and that didn't fix it
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.
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.
I thought the same thing, suppose either works
port 1 / player 1 makes more sense
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.
is this where we find out on top of the protection this game also suffers from the same bug as cotton2?
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),
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.
This has been merged! Thanks!
Master SH2 seems to be reading in the stuff just fine.
Hard to debug what's wrong.
Build with fixed "Shinobi X" and "In The Hunt": #unstable-nightlies message
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.
using the mister like a real syntheziser is a good thing
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.
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
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.
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
@untold cloud how much space do we have left now (fpga)? π
Probably more space than is left in my brain these days.
rest , get some sleep π
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.
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
The Radiant Silvergun fix hasn't been merged yet: https://github.com/MiSTer-devel/Main_MiSTer/pull/960
Although other PRs have been getting merged since then: https://github.com/MiSTer-devel/Main_MiSTer/pulls?q=is%3Apr+is%3Aclosed
i posted main with fix some time ago
Yep, but it should get merged some time!
perhaps there will still be some change , who knows
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
MUSter? MidSter?
MTer
Saturn finally has a int-scaling and 5x mode for HDMI! that rules
this core has just come such a long way
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
I still wanted to add composite blend , but I do not know if it is necessary
it would be nice
maybe horizontal crop
there are plenty of games that utilize it for shadows
Saturn really does look best on composite for certain games
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
at least we have actual composite now if we want
i hadnβt actually looked to see if pal-composite was added
but actually my Philips crt doesn't like the composite signal from this core specifically; have to use a different crt
I think someone tested it
actually I already added composite blend , but I need to see how it works
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
If only it was possible to have an adaptive blending feature that specifically blends the dithering from the VDP1.
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
learned something new with these photos
Whatβs the MiSTer like? π
Didnβt know there was a major hardware revision
Yeah, but this would be more similar to how PS1 emus create pretty advanced data structures on the side to implement perspective correct textures and higher precision triangle coordinates.
maybe not tho? maybe itβs a different level of complexity.
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.
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
Lightgun support is excellent, getting pixel-perfect aim in vcop2
Now I only have my lack of skill to blame for my poor performance π€
whatβs your gun of choice?
Not sure about arcade games, but wouldnβt analog trigger support also help with some Namco racing games by adding βemulationβ for the NeGCon
yes, i guess if Robert was willing to dive back into the psx core
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
Requires a change in main though π
it's not like main isn't open source
Didn't analogue trigger support get added to Main recently?
people change it all the time
I wasnβt saying it was necessarily a blocker, just that it may have wider impacts
i dont think its been added yet or else this entire conversation is redundant π
Maybe I am misremembering, I can't see it now I search news
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
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
I have retroshooter guns, pretty happy with them overall
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.
i love seeing all the people come through enjoying the LG support
Speaking of light gun, I assume house of the Dead 1 and 2 would be a bit of a stretch for Mister
HOTD1 is a saturn game
2 is Dreamcast I think?
The arcade versions specifically
the arcade version of it is too much though afaik, its model2. HOTD2 is dreamcast/naomi so well out
Ah drat. That would immediately be my light gun trigger
That's true. I played with that in the past. If you know what you're doing you can also disable the white flashing
IIRC I got it working on the pi4 but Iβm not sure if it was full speed
arit!
ah yeah
I'd love Model 2, but it'd be a big project
that 50 MHz graphics hardware could be uh, a little rough
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
Model 2 π€©π€©π€©π€©. Sega Rally !!!!!! Daytona USA!!!
Thankfully, our Dear Friend Rally is very well realized on Saturn. And Daytona's on there too, sort of
But Model 2 Sega Rally is 60fps!
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
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?
core mapping?
Core mapping wants directional inputs before mapping buttons
or can you make a custom reflex profile
Iβll look into that, thanks
iirc it only needs right, not all the directional inputs, so: it's a hack and you sacrifice a button, but you can use B (or whatever front button you don't normally use) as right so that it can map
whatβs up with these weird artifacts in the options menu of battle garegga?
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
Maybe a timing of VRAM access slots on VDP2.
could be
Battle Garegga is really sensible to timings on RAM access slots.
We had to fix it like... 3-4 times aloready.
it;s very minor issue π
And maybe only visible on yoko (standard) video mode.
So is this what that response in my issue thread is about?
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.
Sorry, I'm not quite with you - which Lightgun specifically are you having trouble with?
Oh, the PR thing.
OpenFire, yep?
Specifically talking about https://github.com/TeamOpenFIRE/OpenFIRE-Firmware/issues/28#issuecomment-2635369730
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.
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.
No problem at all.
is the ping only needed to set that mode that changes how the gamepad buttons map in the gun?
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.
Well, it's not using gamepad output by default. The ping is to make it switch to gamepad output.
On PC, mouse+keyboard is the standard, so that is what the OF firmware defaults to.
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.
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?
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?
Well, again, it's not the expected mode on PC, so... no. Switching to that mode is done via serial codes, usually sent by some feedback distributor program a'la MAMEHOOKER.
I get that a Mouse might not be the "best" way for a lightgun to talk to something, as the mouse uses relative positioning.
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.
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
hmm, wickerwaka just added support for those retroshooter guns in mouse mode and added 'QUIRK_LIGHTGUN_MOUSE
In this case, it's searching for both:
- 0xF143 vendor ID
- Product string starts with "OpenFIRE", which is burned into all guns regardless of the custom product name appended.
although hmm maybe those were EV_ABS not REL
Joystick XY is nice since you never have to worry about any relative/absolute shenanigans - but you also only get 8 bits of precision
Well this would've existed after I got my grubby mitts on a Mister and made the patch π
I was mainly looking at what G4IR was doing as a basis.
8 bits? But we use more than that. I set our gamepad descriptor to output each axis as 16 bit (which is stretched from the internal mapping of 0-32767)
I think that quirk might only have been for allowing mouse buttons to be mapped normally
AFAIK, on the FPGA side of MiSTer, it only uses 8-bit (signed) values for X/Y.
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.
At least for joystick XY.
Then again, most of the cores are fairly low-res, so the precision thing maybe isn't overly critical.
IIRC, the MiSTer lightgun calibration UI shows 0-32767. That's mainly what I was talking about, aha
Ahh, OK.
I'm sure it probably gets scaled down in the cores to 8 bits
But that's what the frontend gun UI showed
Sega Saturn for MiSTer. Contribute to MiSTer-devel/Saturn_MiSTer development by creating an account on GitHub.
// analog -127..+127, Y: [15:8], X: [7:0]
That's the main method the HPS (ARM) uses to talk to the FPGA side, via the hps_io module.
The calibration UI is showing the Linux USB values - which then get truncated
ah yep, that's a signed 8 bit int
This I kinda figured, yeah
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.
AFAIK the mister lightgun cali is required for it to even work, isn't it? That's what I experienced in my testing.
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.
Checking out the ST-V support and other Saturn updated. https://twitch.tv/owlnonymous
Thanks, Mr Owl.
I won't lie I was disappointed that the Saturn core supported guns, but only through SNAC and not USB guns. But that seems to have changed recently, yes?
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.
Retroshooter guns do use absolute position if thatβs what that means
(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.
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
Was already done.
See, perfectly clean code. π
yea are those the correct limits for that device?
it probably is... just wondering if the of actually listed specs
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
oh lol
Gonna watch a bit of Mr Owl's live stream.
Good to have you on here, @topaz tartan , btw.
(^^;
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
Sent a PR to Main, hopefully it should be implem'd soon.
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
For virtual lightgun testing, it just needs the unstable core or it also needs mister main?
Going to test it wht a guncon1.
nah, just the latest core in nightlies
i mean, if your main is pre 2020 give it a quick update_all by all means
It's not that old π
I'm still getting the hang of C tbh
π
Good to know after submitting code for public scrutiny, I guess
But I appreciate the tips.
eh, you can revise PRs, no big deal.
also have you seen the rest of input.cpp? You're doing fiiiiine
Havenβt played through good olβ Bulk Slash in a while β¦ and this time I used my new Saturn SNAC adapter that arrived today!
heads up, the saturn controllers are 5v logic, the mister snac port is 3.3v unless your saturn adapter has the resistor ladder built in it could slowly damage one part or both
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)
Do you know if the SNAX adapter has the resistor ladder
I donβt know what a resistance ladder is. Is it this middleman thing between the MiSTer and the SNAC adapter?
iβm not sure, but with how bespoke it is designed iβd be surprised if it isnβt integrated
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
hereβs one of them as an example
it sits in between
Yeah it kinda looks like that but green. It came with my MiSTer.
OK will do. (The only other SNAC I have is the SNES one the MiSTer came with)
Mine is smaller, though
This is a resistance ladder, though, right?
yup
thatβs perfect, just much more neatly arranged
OK cool. (I have no idea what Iβm looking at with circuits. I lay out newspaper pages.)
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
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.
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
Do you notice much difference using snac compared to a wired USB controller?
So far I've been happy with my m30s
Good god get an extension cable
But then how would they snap their level shifter in half
I tell people this in every video
Oh, that OpenFIRE lightgun support was merged: #unstable-nightlies message
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
Real question is how you map the buttons for snes. AB XY or BC YZ
Is there a tutorial on how to setup STV on the Saturn core?
Did anyone test the DOA change? Did it help the slowdown in either ram config?
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
Yes it's two different things
No slowdown and no longer crashes on latest dual RAM unstable.
Thanks!
ahh ok
M30 BC -> SNES BA
M30 YZ -> SNES YX
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
I'll do this when I use the SNES core, neat!
Yeah, I do similar with the NES core
i started doing this trying to figure out the best way to get both Super Mario World's running jump (Y+B) and running spinjump (X+A) both comfortable to reach on the M30, and ended up using that layout for basically everything on SNES, i can't go back now!
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).
I noticed a ton of slowdown on the second to last fight against Kasumi with dual ram.
Little bit of Saturn news lately: https://www.segasaturnshiro.com/2025/02/05/saturn-news-roundup-megami-tensei-author-loves-mr-bones-pseudosaturn-progress-yaba-sanshiro-fix/
Pat on life support after hearing this
unrelated and massively off-topic have you ever seen the Star Trek arcade game from β82
I ... don't think so?
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?
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.
Haha the voice https://youtu.be/5bh35Dqum4Y?si=pZ6NRbHX0OYdCjYu&t=104
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...
predates Worf and yet sounds like him
That's pretty cool. Reminds me of the Star Wars arcade game with vector graphics, which I've actually played at a barcade
ABCY or bust!
May be character specific? I finished the game with Jann Lee with no slowdowns or crashes on the latest dual RAM unstable.
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.
For me also without slowdowns, Kasumi
you're welcomeeeeeeeeeeeee
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.
f10 on the core yet?
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
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.
sound like a Main fix?
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
whatβs the likely explanation for the problem?
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.
Perhaps, I was playing as Kasumi too. But it really struggled on that stage, all others were fine.
Might require the main being updated to fix the problem.
Virtua Cop itself isn't mis-calibrated, is it? (and/or can you just compensate with the game's built-in calibration?)
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
You shoot offscreen to begin calibration; then, the next time you shoot the screen, that becomes the center
(I think?)
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
hmm
maybe the shot position is scaled correctly for the width but not the crosshair position?
It sounds like it's off by a constant amount
OF is joystick based on mister right
Yep
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?
all the way on both sides
yeah so its scaled correctly but just offset left, did you say its not the case in other cores?
Just to be clear, the virtual crosshair is offset, not the actual aim.. Let me check some other core just to be sure
yeah that makes sense
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
that about confirms it yeah
Interesting.. in VC2, the offset is totally different. Is the F10 calibration stored by core or by game?
by-core
is that a different resolution? if you open the osd and go left it'll tell you there
huh
thats really surprising
maybe its the games themselves trying to apply some default config
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
just after you return to the games start screen
Might be an idiot, can't get the cart type set to STV in the OSD :/
Didn't have the newest nightly, sigh π€£
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.
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
np at all.
the gun was just a guncon 2 alternate
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.
but i did just use the button assigned to B to reload
So not like a CRT lightgun, ofc.
that felt and worked really well good btw
Ahh, OK, so Auto-reload works OK so far?
it did!
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.
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
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.
now, gun4ir worked perfectly
Calibration between the Crosshair position and a "real" USB Lightgun might actually be slightly off.
Shooting offscreen to reload with my guncon 3 was working.
Auto-Reload in the core, is basically always mapped to Button B. So whatever you map to Button B, on the OSD menu.
makes sense
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.
The old βcover the barrel with your handβ trick
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.
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
Shooting holes through your hand like Vermont swiss cheese!
i will make some recordings later tonight to show my results on a tube tv
I can see why code PRs are hard now, because I forgot you then feel obliged to do "support", and fix future issues. lol
The trick only works once! Since...you know...the hole.
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
Really wish we could get a progressive scan mode like PS1 and N64 for interlaced games.
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.
The whole weave and bob thing is basically a pick your poison solution.
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.
and youβve got half a percent of the de10βs logic gates left to work with so iβd say itβs SoL
we're coming for adaptive scanlines next!
my recommendation, MiSTer into a scart splitter, one output into a crt the other into a device that can do adaptive deinterlace
No way I'd know how to do Motion Adaptive deinterlacing, so you'd have to hit up Mike Chi, or somebody. lol
I suspect that might not fit
Almost certainly not.
We donβt make garbage Swiss
The old Intel/altera VIP scaler, did support deinterlacing, IIRC.
But yeah, that would be even more painful.
one time I went to see how the ossc pro does it and they just use the altera IP for motion adaptive
I mean...it's from Vermont! 
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.
have you got a usb lightgun too?
the one you got iirc was a combo Saturn/ps1 wasnβt it?
No USB gun yet.
I should probably buy one soon.
Saving for a trip to Thailand, though, so I've been watching the pennies.
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
pft, you got my gun4ir working on the big screen. you more than earned it.
just cover the postage if you want
I'd happy to pay towards the lg as well.
very kind of you, iβll dm after work and have confirmed full functionality with you
That would be awesome, thanks.
Even the GC2 is quite expensive on eBay, though.
Please let me pay a bit towards it, plus postage.
i got them when they were cheap
In in the UK, btw, in a place that I'm sure is twinned with Mordor.
yup
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.
np π«‘
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
Yep, have to hit Start first, then aim at the bullseye.
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.
Is the build in unstable the one we are testing lightguns on or another build in chan?
Latest unstable.
Any lg in main should work now?
USB lightguns like guncon 3 work.
Hmmm ill see if blamcons work on it
That's the only one I've tested anyway.
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
We do, and they are
Now that you mention it, and having thought about it for a few minutes, you're right. lol
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
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 π
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
https://github.com/MiSTer-devel/Saturn_MiSTer/issues/344#issuecomment-2630597058 - this bug is related to the implementation of the gradation calculation function
You've been debugging it?
Seems logic as we need a gradation of the fog on that scene.
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
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 π€£
π
srg320 is a big brain π
I can't wait to see where the error was.
hey sorry i missed this when i was testing, i should of been a bit more thorough, i nearly always play with crosshairs off and the line-of-sight was great
Have nothing to contribute but ty to all you guys testing, you are doing god's work here. π
So the Saturn core is basically finished now, right? π
right π
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 π
This might be a godsend for some of the Super Metroid's inputs, have to try that
But yeah I just double whatever I feel like for autofires
hey guys, so guncon3 works now?
virtua cop, house of the dead?
no one does lightgun games like sega and namco did, bless them
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?