Better HN
topnewbestaskshowjobs
Log inSign up

near

5,473 karma · joined Jan 21, 2012 (14y ago) · 1,003 submissions

Submissions

comment 5y ago · link · parent

The key thing is that I need to be able to suspend 3-5 layers deep into the call frame. The instruction dispatcher calls into an instruction which calls into a bus memory read function which triggers a DMA transfer that then needs to switch to the video processor, and then I need to resume right there inside the DMA transfer function once the video processor has caught up in time. So the extra stack frame for each fiber/thread is essential.

comment 5y ago · link · parent

They're really incredibly useful for writing emulators. You have to simulate 3-8 processors all running in parallel, but doing so with locks and mutexes tens of millions of times a second is excruciatingly slow and painful, so you have to do this in a single thread (unless you're talking about very modern designs that have lower expectations of cycle-based timings.)

Cooperative threads like this let you completely avoid having to develop state machines for each cycle within state machines for each instruction, etc. They let you suspend a thread four levels into the call stack, and then immediately resume at that point once other emulated processors have caught up to it in time. That lets you do fun tricks like only synchronizing components when required, so it can in some instances end up not only far more elegant, but also much faster than state machines, when they're used well.

I wrote a bit more about this and showed some examples here if anyone's interested: https://near.sh/articles/design/cooperative-threading

I also use them for my web server because I like them, but there are probably better ways of doing that.

comment 5y ago · link · parent

Frame-skipping is just a speed hack of skipping rendering every other frame or so, and makes games very unenjoyable to play. It won't help with input lag at all.

comment 5y ago · link · parent

That is true. There are however techniques software emulators can use like run-ahead that can get you lower latency than even the original hardware on a PC: https://near.sh/articles/input/run-ahead

The caveat is that it doesn't always work, and it makes the power requirements even more unbalanced. Some might also see it as a form of cheating to go below the original game's latency. If you want to match the original game's latency precisely, FPGAs are the way to go right now for sure.

comment 5y ago · link · parent

There's both a cost and a speed barrier to it. FPGAs are often used to design, simulate, and test modern circuits at sub-realtime speeds. No amount of FPGAs will get you a PS2 emulator at playable speeds right now, let alone a PS3/Switch emulator. PCs can do that today by taking shortcuts such as dynamic recompilation and idle loop skipping.

comment 5y ago · link · parent

It is, but these cores are almost exclusively not being done that way. Not yet at least. I hope that they will be, that would be really awesome. I paid $1200 last year for the SNES PPUs to be decapped for this purpose, but it's a truly enormous undertaking to map out those chips and then recreate it in Verilog. You're talking thousands of hours of work per chip. If anyone reading this is able to help with that effort, please do let me know, we could really use the help.

comment 5y ago · link · parent

In latency and power usage, yes. In compatibility and accuracy, no. Both are Turing complete, so there's nothing you can do with one that you can't do with the other.

If you take the SNES core, my software emulator has 100% compatibility and no known bugs, and synchronizes all components at the raw clock cycle level. It also mitigates most of the latency concern through a technique known as run-ahead. But it does require more power to do this.

comment 5y ago · link · parent

It is indeed an amazing project, especially its open source nature. It provides some impressive power savings and latency reductions that are very hard to match with general purpose CPUs.

But in most cases, it is emulation, as the lead developer will attest.

https://github.com/MiSTer-devel/Main_MiSTer/wiki/Why-FPGA

"From my point of view, if the FPGA code is based on the circuitry of real hardware (along with the usual tweaks for FPGA compatibility), then it should be called replication. Anything else is emulation, since it uses different kinds of approximation to meet the same objectives. Currently, it's hard to find a core that can truly be called a replica – most cores are based on more-or-less functional recreations rather than true circuit recreation. The most widely used CPU cores – the Z80 (T80) and MC68000 (TG68K) – are pure functional emulations, not replications. So it's okay to call FPGA cores emulators, unless they are proven to be replicas."

But there's nothing wrong with emulation for preservation, until we get to a point where we can wide-scale clone these older chips down to the transistor level through analysis of delayered decap scans. And even then, emulation will be useful for artificial enhancements as well as for understanding how all those transistors actually worked at a higher level.

It's also not a total solution: by taking many more transistors to programmatically simulate just one, it limits the maximum scale and frequency of what it can support. N64/PS1/Saturn has not yet been fully supported and is still theoretical, but likely, to be possible. Going beyond that is not possible at this time.

Software emulation and FPGA devices should be seen as complementary approaches, rather than competitive. The developers of each often work together, and new knowledge is mutually beneficial.

comment 5y ago · link · parent

Same story here. But in my case, Zoloft gave me really bad tinnitus that persisted even after stopping. I switched to Intuniv that got rid of the panic attacks but not the depression or the new tinnitus. Added Lexapro and that reversed the tinnitus and kept all the positive benefits of Zoloft. Brain chemistry is different for everyone, so it's worth trying more than one if the first doesn't work for you. It's truly life-changing when it works. No one should have to live with daily panic attacks.

comment 5y ago · link · parent

> Therefore, the choice of which conversation, which comment, is entirely yours.

It's not that simple though. You're likely to be part of a broader community and simply deciding to leave that community, and all of your friends, over the actions of one person, is not very reasonable. Often times we are forced to be around people we don't particularly like. When that person does something valuable, they get a level of protection from being reprimanded for their bad behavior that isn't afforded to outsiders of the group, so kicking out such people often becomes difficult as well.

comment 5y ago · link · parent

Different people follow for different things. Some people like seeing that other stuff. It would be very helpful if Twitter let accounts tag tweets into categories, and let people choose to subscribe or unsubscribe to those. Maintaining multiple Twitter accounts for different content is very tedious. No doubt your point is valid as well, it's easy to get addicted to that platform, and the likes and notification system gamifies that need for validation.

comment 5y ago · link · parent

Oh, it even has a datasheet! Thanks, that's amazing! The missing SEV instruction could have been aliased to SEP #$40. The only thing missing to produce a working replica today (in hardware or software, just for fun of course,) was indeed the XFE designation. The only place it could have gone was in the WDM prefix, but it could have been any byte after that. We would have to outright guess. He couldn't have reused XCE for it without risking perfect backward-compatibility (though of course he may have decided to do that anyway.)

comment 5y ago · link · parent

On a related note, I had always wished we at least got a complete PDF specification for the unreleased 65832, a 32-bit 6502 core. I'd love to implement it just for the novelty, even if nothing used it. http://www.mirkosoft.sk/65832.html

comment 5y ago · link · parent

What would be wrong with blocking the entire /32 if you know the owner of it is using it in such a way?

comment 5y ago · link · parent

> Its good to know you got 1M unique visitors last month, but I don't need to know I got 1,214,551 unique visitors. All analytic packages have problems like this.

The numbers vary depending on the technical prowess of your audience. Probably at least half the visitors to my site would be using ad blockers. If one were to use server-side logging (at the HTTP request level), it would not be blockable, and your numbers would be accurate save for any bot spam inflating it.

comment 5y ago · link · parent

There's a magic point on YouTube at 10 minutes that lets creators insert ads in the middle of their videos, so they all stretch out the content for that purpose. It's very obnoxious.

comment 6y ago · link · parent

You can to varying degrees, yes. There's a barcode scanner, an exercise bike, a baseball bat, and more. I designed higan around a modular tree structure so that you can just create a new derived node for any peripheral, and define whatever API you like, so that we can emulate the protocol. Then it's up to the GUI to figure out how to do something when it sees Node::ExerciseBike, and how to do I/O with its API interface.

One could imagine, for instance, connecting an actual USB barcode reader to emulate the Barcode Battler, or providing a text box to hand-type a barcode number.

I don't see anyone actually bothering to simulate the entire horse betting network complete with virtual bank accounts, but if you're really interested, Raphael Assenat reverse engineered quite a bit of the JRA-PAT system for fun here:

https://www.raphnet.net/divers/retro_challenge_2018_09/index...

It's a pretty good read as well!

comment 6y ago · link · parent

Hi all, thank you for sharing this article here! It is technically a "laymen's" version of https://byuu.org/articles/edge-of-emulation (submitted here earlier), meant for a wider audience, but it does elaborate on some new discoveries such as the digital video output testing mode.

In the off chance anyone is able to help with this, I've set up a Discord channel (#ars) for coordination here: https://discord.gg/Fx7TfKh

Every member of the bsnes-emu project is on said server.

Thanks so much!

comment 6y ago · link · parent

Oh, sorry I forgot I also had user-agent checks in the code, good catch! archive.is checking was based on IP ranges, since they spoof their user agents as Chrome and use proxies. I removed that too now. All that should be left is a noindex tag on the 1,200 individual game pages at byuu.org/preservation (which I'm told is very important for web indexers; they're all auto-generated thin-content pages.) I believe both archive.is and archive.org ignore noindex anyway, and the full databases are on GitHub at icarus/Database. We should be all good now, but let me know if you find any other issues please.

I don't know how long it'll take for archive.org to remove the exclusion. Requesting it originally took a couple weeks. But they have my approval to start indexing it all again in any case.

I've already paid up for the next year of hosting, so the site should hopefully remain online at least that long, but I might not pay for it forever in the possible event I don't return, so if folks want it mirrored in even more places, now is the time.

comment 6y ago · link · parent

Hello,

I removed the archive.is check, and requested the entire site to be crawled, which is now done. The entire site is mirrored here: http://archive.is/byuu.org

I also sent an e-mail to the archive.org staff requesting the exclusion to be removed.

I hope this will satisfy your request, and that you can sympathize with why I chose not to do this until retiring.

comment 6y ago · link · parent

I'll take my leave from HN as well now.

It's truly been an honor! I've always greatly appreciated the links to my articles shared here, and the discussions with everyone on these and other submissions on the site.

I'm hoping to return one day when things settle down a bit in my life. Hopefully when that day comes I'll have some great new things to share. Until then, take care everyone!

comment 6y ago · link · parent

Thank you kindly! The structural design aspects of programming was one of my favorite parts. I may've gone a bit too far in the final releases of higan with the reference-counted tree to describe system states (specifically serializing the tree is quite involved), but I'm still really happy with the result ^-^;

Hopefully a respite from coding in my spare time will help my hands recover a bit.

comment 6y ago · link · parent

Ah, yeah. Lovely bunch there.

> Fwiw I think your fursona is adorable.

Thank you very much ^-^

comment 6y ago · link · parent

Thank you! Been calling them a dracat. Half-dragon, half-cat hybrid. It's a play on having traits and tendencies of both ^-^
12345
34