Better HN
topnewbestaskshowjobs
Log inSign up

ulfalizer2

16 karma · joined May 1, 2015 (11y ago) · 8 submissions

Jack of all trades with a bent towards lower-level programming and *nix.

I'm currently looking for a job.

GitHub: https://github.com/ulfalizer

LinkedIn: https://www.linkedin.com/in/magnussonulf

Stack Overflow: http://stackoverflow.com/users/4577158/ulfalizer

Submissions

comment 11y ago · link · parent

The rewinding is done by saving the current state once per frame into a ring buffer by the way. During rewinding, states are popped off the end of the buffer frame by frame, with each individual frame still running "forwards".

To reverse audio, it is added from near the end of the frame's audio buffer towards the beginning, which is possible as long as you know the exact length of the frame (so that you end up at the beginning of the audio buffer when the frame finishes). The frame length varies slightly for technical reasons (it even does on the real thing), so the final length is saved as each frame finishes so that it can be recalled later if the frame is rewound.

I guess an alternative approach would be to always start from the very end of the audio buffer and just processing and sending the samples starting from whatever offset you end up at when the frame finishes. The resampling and low/high-pass library I'm using (blip_buf) doesn't support that out of the box though. (It takes a list of timestamps where the waveform changes, which is handy for the algorithm it's using.)

Feel free to ask question. I could answer general NES questions too. :)

2.

Show HN: Rewinding NES emulator that also reverses sound(youtube.com ↗)

4 points · by ulfalizer2 · 11y ago · 1 comment

comment 11y ago · link · parent

(Disclaimer: I've never actually tried to read CMOS circuits, and I'm still far from an analog electronics expert. The tutorial itself has been vetted by people who worked on the simulators though -- thanks to Lidnariq, Quietust, and BigEd!)

The basic logic elements tend to be more involved in CMOS, which makes use of symmetrical pairs of transistors with different doping. (Roughly, the doping determines whether a high or a low voltage "closes" the transistor.) Compare the implementation of a NOT gate for NMOS and CMOS here for example (where 'a' is the input): http://en.wikipedia.org/wiki/Inverter_%28logic_gate%29.

To get an idea of one problem with NMOS that CMOS solves, consider the inverter example when the input is high. In that case, you get a continuous current from the power source to ground, meaning you're drawing power (and generating heat) even in the steady (static) state. CMOS on the other hand is designed to only draw power while the circuit is switching. Studying the circuit on the wiki article might give some rough idea of how that works.

comment 11y ago · link · parent

Note that it uses examples from the APU (audio circuitry) and PPU (graphics processor) in the NES. This is probably a good thing, as those circuits are much less dense and so easier to read directly compared to the 6502 circuitry. The particular examples aren't hugely important, and the principles are exactly the same.

Skimming it might give a glimpse of what's going on inside old chips (and newer ones too to some degree, though CMOS is more complicated than NMOS), which I thought some people might find interesting. :)

I wrote this a few years ago, and I can see a few things that could be clarified now. Feel free to ask questions.

5.

Show HN: A tutorial on reading circuits in Visual 6502(wiki.nesdev.com ↗)

10 points · by ulfalizer2 · 11y ago · 3 comments

6.

Show HN: NES emulator with a real-time rewind feature that also reverses audio(github.com ↗)

4 points · by ulfalizer2 · 11y ago · discuss

comment 11y ago · link · parent

Location: Lund, Sweden

Remote: Yes -- preferred.

Willing to relocate: Possibly, to English-speaking countries or within Sweden.

Technologies: C, C++, Python, Bash, Make, Linux/POSIX system programming, emulation, and other stuff that I could probably refresh relatively quickly.

Résumé/CV: https://dl.dropboxusercontent.com/u/20047039/cv.pdf

LinkedIn: https://www.linkedin.com/in/magnussonulf

Portfolio/various stuff:

Three videos from an NES emulator I've been working on. (Sorry for being terrible at these games. :P)

- https://www.youtube.com/watch?v=qCQkYrQo9fI (Demonstration of rewinding.)

- https://www.youtube.com/watch?v=96kg-lclQvM (The "High Hopes" demo.)

- https://www.youtube.com/watch?v=M89c5u4kmrY (Longer gameplay video from Bucky O'Hare.)

Source code for emulator: https://github.com/ulfalizer/nesalizer

My Stack Overflow profile: http://stackoverflow.com/users/4577158/ulfalizer

My "practice" repository, which should give an idea of my coding style without having to wade through a ton of code: https://github.com/ulfalizer/practice

A tutorial on interpreting circuits in Visual 6502 (a JavaScript-based circuit simulator): http://wiki.nesdev.com/w/index.php/Visual_circuit_tutorial

A page on detailed interrupt behavior for the 6502 CPU: http://wiki.nesdev.com/w/index.php/CPU_interrupts

A diagram that outlines the timing of operations performed by the NES's graphics chip during frame rendering (that won't make any sense without some prior knowledge of how NES graphics work :): http://wiki.nesdev.com/w/images/d/d1/Ntsc_timing.png

(I've made lots of other contributions to the NesDev wiki.)

An interpreter for the Linux kernel's configuration language (Kconfig), used in Buildroot and U-Boot: https://github.com/ulfalizer/Kconfiglib

A work-in-progress (hence the silly placeholder description) IRC bot I put together to experiment with various Linux-specific APIs (epoll, timerfd, signalfd, and others -- it also has a ring buffer that uses virtual memory tricks): https://github.com/ulfalizer/botniklas

My old Master's Thesis where I put together a fast-booting Linux system (which won the "Best Master's Thesis" award that year): http://liu.diva-portal.org/smash/get/diva2:473038/FULLTEXT01 (Some details bother me a bit now that I know more. :)

My configuration files (for Bash scripting and the like): https://github.com/ulfalizer/Configuration-files

I'll take a fun project and careful coworkers over a huge salary, so don't hesitate to contact me even if you have a smaller project. Working for a smaller company would be fun to try. :)

Email: moc.liamg[ta]rezilaflu in reverse.

I also often hang out on IRC (EFnet, QuakeNet, and Freenode) as Ulfalizer.