Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
It's probably a great choice! And now I might pick it next time I make a lil something.

Adbot
ADBOT LOVES YOU

Impotence
Nov 8, 2010
Lipstick Apathy
I feel like I'd enjoy scheme significantly more if my first exposure to it wasn't having to write an interpreter for it in python in my first intro-to-cs class as homework.

Sirocco
Jan 27, 2009

HEY DIARY! HA HA HA!
Been working on a wee program in Python 3 for improving my Scrabble game. The program generates an alphagram with the same probabilities of an English tileset (including blanks) and lets you know if there are any seven-letter words you can make or any eight-letter words you could make with an extra letter.



This screen shows that with the letters AEISTTU, there is one seven-letter word and four possible eight-letter words.



The possibilities reveal themselves when you guess them correctly or if you can't get it and click the buttons. The letters in curly brackets are the extra letter. With blank tiles there can be multiple letters in these brackets.



You can also type your own alphagram directly in with the Choose This Alphagram button.

I've got it set up for the SOWPODS dictionary but it would be trivial to set it up so you could choose a different one. I'm very pleased with how fast it is as well, it can analyse most racks in less than half a second.

The answers in the last screen are FOUMARTS, FORMULAS, and AUSFORMS

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
bonus points if i can drag the letters around to rearrange them like i would in a real scrabble game

Athas
Aug 6, 2007

fuck that joker
I have been working on a clone of a Falling Sand game - I call it Diving Beet. It uses cellular automata to simulate pseudo-physics of particles (gravity, water+fire=smoke, plant+water=plant, lava melts metal, etc). Have a webm animation. The model runs entirely on the GPU (it is written in a parallel functional language) and so is quite fast. The frontend is in Python, and most of the time is actually spent blitting to the screen, it seems. The video is a bit choppy near the end - I think that is due to the recorder not being able to keep up, as it was perfectly smooth in person.

Sirocco
Jan 27, 2009

HEY DIARY! HA HA HA!

Suspicious Dish posted:

bonus points if i can drag the letters around to rearrange them like i would in a real scrabble game

Hmm, maybe. The point of the program is to become used to and remember the alphagrams themselves so I'd want that to always be there while you're rearranging. I could maybe have some moveable tiles below the alphagram, but I'll have to think about whether it's worth it to me or not.



Fixed a bug with user-chosen alphagrams not picking up seven-letter words properly unless the user actually typed it as an alphagram. Fixed now, in my last post it should have picked up that SAFORUM and AUSFORM are a match.

Also added scrollbars for racks with lots of hits and a little message that tells you whether your guess is right, wrong, or already revealed.

skimothy milkerson
Nov 19, 2006

Suspicious Dish posted:

bonus points if i can drag the letters around to rearrange them like i would in a real scrabble game

Do this anyways, for :science:

Sirocco
Jan 27, 2009

HEY DIARY! HA HA HA!
Had some time off today so I went ahead and added a little tile rack you can play about with while trying to find words. Very straightforward click, drag, and drop.



Blank tiles can be clicked to make the letter on it advance once through the alphabet. When it gets to the end it goes back to the question mark and you can, if whimsy takes you, begin the cycle anew. You can right-click the tile to go back the way.



Here I have discovered the word TEASING by rearranging the tiles and adjusting the blank tiles.

Sirocco
Jan 27, 2009

HEY DIARY! HA HA HA!


Added some more functionality so you can see your progress with a score counter. Makes it more of a game than a tool which is nice. You can also tick the checkbutton if you want to ensure that the alphagram will always have a solution.



The score counter changes from red to green the more words you find (clicking the buttons to reveal them doesn't improve your score) which was a fun little extra thing to do.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Amiga time! We have a scrolling background (which doesn't wrap yet so it just jumps back to the starting position) with a blitter object now... but one of the graphics planes isn't being set correctly so the bob's colors get messed with. Also the bob shakes for some reason?

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.




That's cool as gently caress and you're doing gods work making VMs safer

hendersa
Sep 17, 2006

Munkeymon posted:

That's cool as gently caress and you're doing gods work making VMs safer
Thanks! :hfive: The test shown running in the screenshot within my original post ended up discovering CVE-2016-8910. You'd be surprised how many people have to get involved when you find a CVE bug. The people on the QEMU security list are all very nice.

Since I'm here, I might as well throw some screenshots up, right? I promise, there are screens in most of them.

So, there are a few projects floating around that cram a Raspberry Pi into an old NES cartridge to make a console in a cartridge. USB ports for the controllers are exposed at the bottom of the cartridge where the original cart contacts would have been located. I've long thought that I could cram a BeagleBone Black into a much smaller space: an SNES cartridge. Since I finally have a little breathing room to work on it, I have been consolidating various code bits I've written into the main BES codebase. I figured that I can have native SNES gamepad interfacing via the PRUs, an RTC for carts with an internal battery-backed RTC, a pause button, and a screen to replace the label on the cart to show what is currently running.

First, the design. Pin multiplexing planning and allocation for access to both SPI and I2C:



Next, planning and doing the prototype wiring (Adafruit has really expanded their Fritzing libraries!):



Then, preparing the kernel device tree for the pin muxing scheme:



OK! Now we're ready to write some software! My primary concern was the TFT LCD display, since that was the only piece I didn't have code for. Adafruit provides some Arduino code for driving it via SPI, so that was good enough for me to rewrite and optimize it. For my work, it is a combination of the Linux spidev driver and GPIOs, as I have to send a SPI message, toggle a GPIO, send another message, etc. I found out I could also increase the size of the internal spidev buffer with the "spidev.bufsiz" kernel option to push larger blocks of data across the SPI connection in a single message. I ended up increasing the size enough to push 48 lines of data to the TFT in each SPI message (SPI is configured for 48 MHz, mode 0, 8 bits per word).

A simple TFT test pattern with my interfacing code:



I was able to do all of the usual "all-white", "all-black" full-screen fills, too, so I know that I can hit all of the pixels without a problem.

I'm continuing to drag all of these various pieces of code into a single codebase. I'm also probably only a few days away from when I start the physical construction (hacking up old carts to add in holes for the ports...). My local used game stores have piles and piles of Super Scope 6 SNES carts sitting there for $2.99 each...

hendersa fucked around with this message at 18:01 on Dec 9, 2016

Cory Parsnipson
Nov 15, 2015
Haha that's awesome. I'd like to see pictures when you mount the pcb and screen on the cartridge too!

Also when you inevitably hit up the game shop to buy cartridges in bulk and the cashier asks what you are going to do with all of them, I like to request that you give him a startled 1000 yard stare and then mumble like crazy to yourself while avoiding further eye contact until you leave the store. Thanks in advance.

hendersa
Sep 17, 2006

Cory Parsnipson posted:

Haha that's awesome. I'd like to see pictures when you mount the pcb and screen on the cartridge too!

I'll probably set up my camera and record some of it as I work on it. I clean and repair a lot of SNES carts, so I've been meaning to record some of that as well. The time-lapse on my GoPro is awesome for recording this kind of building/prototyping work: https://www.youtube.com/watch?v=WmHq9iZGQJY

quote:

Also when you inevitably hit up the game shop to buy cartridges in bulk and the cashier asks what you are going to do with all of them, I like to request that you give him a startled 1000 yard stare and then mumble like crazy to yourself while avoiding further eye contact until you leave the store. Thanks in advance.
Have you ever been into a used game store where they sell vintage console games and accessories? That kind of customer behavior wouldn't even register with the guys behind the counter. Those poor souls have seen it all. They seem to be genuinely happy to see me when I wander in, since I just say hello with a quick wave, I don't try to corner them to talk about old video games, and I actually buy things while being pleasant about it.

Almost every time I visit one of these stores, there is some goofy-looking sucker leaning on the counter and asking the sales guy if he's ever played some old game or another. The sales guy just says "uh-huh" while he continues to dismantle, clean, and reassemble PS2 controllers while not making eye contact with the customer talking his ear off. The other side of the coin are the wacky recluses that wander the aisles, don't make eye contact with anyone, and mutter to themselves. Good times!

At least they know how to appeal to their (very awkward) target audience. Here is an actual commercial from one of our local stores: https://www.youtube.com/watch?v=nCMzljW4mBg

Cory Parsnipson
Nov 15, 2015
Good point... I hadn't considered thaf, nevermind then!

Cool stream though. I'll have to check it out after work.

Sirocco
Jan 27, 2009

HEY DIARY! HA HA HA!
I've been enjoying your posts for a long time, hendersa, always really fascinating stuff. Think I've got you beat, though.



Does your software have a button for randomly shuffling the tile rack? Or revealing all solutions so you don't have to click through them individually?



Didn't think so. Boom. :cool:

Sirocco fucked around with this message at 00:38 on Dec 15, 2016

hendersa
Sep 17, 2006

Sirocco posted:

I've been enjoying your posts for a long time, hendersa, always really fascinating stuff. Think I've got you beat, though.

Does your software have a button for randomly shuffling the tile rack? Or revealing all solutions so you don't have to click through them individually?

Didn't think so. Boom. :cool:

I can safely say that none of my work contains a button for randomly shuffling a tile rack. I... guess I'll need to work on addressing that in the future? :eng99:

In the meantime, I'll leave that kind of work in the hands of the pros!

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

hendersa posted:

Hey all! I've been super busy finishing up that pesky PhD I've been working on, so my work in the last year has been less about the BeagleBone Black and more about "novel research". However, it turns out that the research is pretty darn useful. Check this out:



So, virtualized guest systems running under QEMU can use the host kernel's KVM to accelerate the execution of guest CPU instructions. Any other hardware devices exposed to the guest (NICs, block devices, audio cards, etc.) are virtual hardware (emulated in software) that are part of the QEMU binary. The guest makes uses a guest kernel interface (a file in the guest's devfs filesystem) (a) to have the guest kernel make a port-mapped IO (PMIO) or memory-mapped IO (MMIO) read/write to guest memory to interact with the control registers of the virtual hardware. This read/write is forwarded to KVM (b), which is then forwarded back from KVM to the virtual device in QEMU (c). The virtual device handles the read/write activity and then forwards a response back (d, e, f).

Unfortunately, these virtual devices can be buggy. They can have thousands of lines of code, and the guest can make malicious reads/writes to virtual device control registers to attack them. As part of my research, I developed a way to test virtual devices within the context of a running QEMU without a guest environment being present:



I use fuzz testing to shove semi-random reads/writes into the control registers of virtual hardware. To do this, I record normal register activity, mutate it, and then play it back. There are a LOT of details involved in this (PCI BAR configuration, skipping read/writes that initial the device to a known-good state, etc.) that had to get sorted out to make it work. I selectively instrument QEMU to track branch coverage during testing so that I know exactly which branches are of interest and whether they have been exercised by a test case:



(The line number is the line where the switch statement starts, and each entry is an instrumented branch that represents a case within the switch. Each branch is one of those little red or green dots in the fuzzer image.)

The best part is that I developed a test case minimizer that takes test cases that trigger bugs and boils them down to the bare minimum number of register reads/writes to trigger each bug. The minimizer then produces C source code implementing the minimum number of reads/writes needed that trigger each bug. As an example, I boot a Linux guest and record all of the reads/writes to a NIC during boot. That's BIOS initialization of the card (PCI enumeration and BAR configuration), guest OS kernel initialization of the card (device driver), and any user space stuff using the card (bringing eth0 up). That is something like 500 reads/writes. When fuzzing, I discover a test case that triggers a bug with about 800 reads/writes. I run that test case through the minimizer, and it turns out to be a particular sequence of only four writes that triggers the bug. I spit out the test case reproduction C code and send it off to the QEMU maintainers for their analysis.

The US Air Force Research Lab was kind enough to lend me some cloud computing resources of theirs, so I ran roughly 2.28 billion test cases over about 900 days of computing time. I found virtual device bugs. Lots of them. I even found a bug in QEMU's x86 BIOS! Some were CVE "I have to report this to the QEMU/Red Hat/Linux kernel security teams before I can even file a bug report in public" bugs. They were that bad. I'd give you all more details on this, but the results were so surprising that I wrote a paper on it and submitted it to a security conference. Since it is still under submission, I can only give a high-level explanation of it.

I think the most amazing thing about this is that I convinced a university to give me a PhD in electrical and computer engineering for a dissertation on emulation. So, to all of those people that said I was wasting my time playing around with video game emulators: suck it.

:science:

I've been so busy with my dissertation defense that I haven't been keeping up with my BeagleBone emails. I have something like 1200 unanswered mails right now. :gonk:

Late post. But you are awesome. Sorry I don't have more to add, just always insanely impressed by the super clever poo poo you're doing.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

uhhhh

I can draw a 320x200 sliding window of a big tilemap? (Except tiles $10 and above are missing!)

Fergus Mac Roich
Nov 5, 2008

Soiled Meat

Luigi Thirty posted:

uhhhh

I can draw a 320x200 sliding window of a big tilemap? (Except tiles $10 and above are missing!)



I've been following your posts in YOSPOS, this project is extremely dope. Are you making River Raid?

Luigi Thirty
Apr 30, 2006

Emergency confection port.

I don't know what I'm making yet. It's just a vertical scrolling engine for the Amiga 500 so far, but making a River Raid clone wouldn't be a bad goal for my first Amiga project.

Shalinor
Jun 10, 2002

Can I buy you a rootbeer?

Luigi Thirty posted:

I don't know what I'm making yet. It's just a vertical scrolling engine for the Amiga 500 so far, but making a River Raid clone wouldn't be a bad goal for my first Amiga project.
That you got smooth scrolling of tiles working would have already been a significant feat, way back when. That was always one of the first culling-the-men-from-the-boys sorts of moments. Are you doing the trick where you're technically drawing an extra row of tiles that gets "clipped" by your rasterizer, and just offsetting your tile grid by whatever amount is necessary for the smooth scroll at the moment?

EDIT: VV Oh, daaaaamn. We never had cool stuff like that over in PC land. Well, not until SVGA anyways, and that was a whole nightmare in and of itself.

Shalinor fucked around with this message at 18:55 on Dec 16, 2016

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Shalinor posted:

That you got smooth scrolling of tiles working would have already been a significant feat, way back when. That was always one of the first culling-the-men-from-the-boys sorts of moments. Are you doing the trick where you're technically drawing an extra row of tiles that gets "clipped" by your rasterizer, and just offsetting your tile grid by whatever amount is necessary for the smooth scroll at the moment?

The background is 320x480 in memory. I'm using the Amiga's video processor to scroll a 320x208 (20x13 tile) window across it, drawing two new tiles above and below the screen each frame for cheap and scanline smooth scrolling with almost no CPU time required - just write tiles into memory and update the coprocessor with the new memory offset the window starts at and it handles everything else.

hendersa
Sep 17, 2006

The Wizard of Poz posted:

Late post. But you are awesome. Sorry I don't have more to add, just always insanely impressed by the super clever poo poo you're doing.
Thanks! Would you like to see some more? Of course you do!




Getting closer to being finished with this thing! This is just a hacked-up cart that I knocked some holes in with pliers, a drill, and an exacto knife, so the cuts are kind of wobbly. The BeagleBone Black is also just a smidge too big for the cart, so the cart's plastic is a little torqued around here and there. Everything still fits inside, though, so I consider that to be a win. I'm in the process of putting together the internal wiring harness. The software is mostly complete at this point, and I hope to do another software release soon.

Edit: Wiring harness testing!


hendersa fucked around with this message at 00:53 on Dec 19, 2016

hendersa
Sep 17, 2006

Believe it or not, the darn thing works. Go figure.

https://www.youtube.com/watch?v=ES3bdXXaJH4

I'm going to get some documentation written, release this thing, and then go sleep through Christmas.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

Luigi Thirty posted:

uhhhh

I can draw a 320x200 sliding window of a big tilemap? (Except tiles $10 and above are missing!)



This is really cool man, nice work!

hendersa posted:

Thanks! Would you like to see some more? Of course you do!




Getting closer to being finished with this thing! This is just a hacked-up cart that I knocked some holes in with pliers, a drill, and an exacto knife, so the cuts are kind of wobbly. The BeagleBone Black is also just a smidge too big for the cart, so the cart's plastic is a little torqued around here and there. Everything still fits inside, though, so I consider that to be a win. I'm in the process of putting together the internal wiring harness. The software is mostly complete at this point, and I hope to do another software release soon.

Edit: Wiring harness testing!




Is... is that a game system inside of a SNES cartridge???

hendersa
Sep 17, 2006

The Wizard of Poz posted:

Is... is that a game system inside of a SNES cartridge???

It's four of them. Seriously! Audio/video goes out to your TV via an HDMI connector on the side. The LCD on the cart is only there for system status info.

Edit: It plays SNES, NES, Gameboy Color, and GBA games. If you plug the cart into your network, you can use a web interface to upload ROMs and configure how their entries look in the front-end GUI.

hendersa fucked around with this message at 06:02 on Dec 21, 2016

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

hendersa posted:

It's four of them. Seriously! Audio/video goes out to your TV via an HDMI connector on the side. The LCD on the cart is only there for system status info.

That's incredibly cool!

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Shalinor posted:

EDIT: VV Oh, daaaaamn. We never had cool stuff like that over in PC land. Well, not until SVGA anyways, and that was a whole nightmare in and of itself.

Here's a small update with some more cool stuff that would be really difficult on a VGA PC: I added a status bar!



That's two separate display windows on the screen: the main 320x208 16-color game window and a 320x16 2-color status bar I can print text to with a printf wrapper. Just have to reset some pointers once per frame and all the display is handled by the coprocessor. I can even get a neat little LCD effect by changing the background color to dark blue and the foreground color to light blue. Coming up next is the fun part, loading art assets from .IFF files :gonk:

Unfortunately, I'm a programmer and not an artist...

Luigi Thirty fucked around with this message at 06:19 on Dec 21, 2016

Rocko Bonaparte
Mar 12, 2002

Every day is Friday!
I have always wanted to have a Super NES Super for Christmas.

hendersa
Sep 17, 2006

Rocko Bonaparte posted:

I have always wanted to have a Super NES Super for Christmas.

Well... now you can! I just released version 0.8 of BES, which includes all of the cartridge console interfacing code. It's a Christmas miracle... the last release was in March of 2015!



After my sixth hour of writing manual documentation, I just gave up and said to hell with it and wrote "beyond this, if you want more info, just mail me". I'm sure that I'll be regretting that when I get even more mail. I didn't even bother to proofread the manual. I'll do that later after I've gotten some rest. For now, it is now out of the door and in the wild. May God have mercy on our souls.

On the bright side, I did get that Christmas present that I've been wanting for the past few years:



Dr. hendersa! :science:

Cory Parsnipson
Nov 15, 2015

hendersa posted:

On the bright side, I did get that Christmas present that I've been wanting for the past few years:



Dr. hendersa! :science:

Fukken sweet. Now I wanna a PhD diploma too! But I don't want to work on groundbreaking research for 4-6+ years with little pay. That's too much work for me. :(

Avenging Dentist
Oct 1, 2005

oh my god is that a circular saw that does not go in my mouth aaaaagh

hendersa posted:

On the bright side, I did get that Christmas present that I've been wanting for the past few years:



Dr. hendersa! :science:

Now just one more decade of occasional nightmares that you didn't actually graduate and you'll be home free! (I still get the odd nightmare that I never actually graduated high school.)

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



hendersa posted:

Dr. hendersa! :science:

1: mods, pls!

2: congrats man!

Nova69
Jul 12, 2012



Using elliptic curve cryptography and DES on a smartcard for encryption/decryption.

Doing it with JavaCard, over the last few months of working on it I'm getting the impression that no one has really used it for like a decade, there's Sun branding everywhere, and the syntax itself is a restricted subset of Java 5.

No integer types, which is creating that casting nightmare.

Still nicer than writing in assembly I guess though...

Nova69 fucked around with this message at 01:58 on Dec 27, 2016

Sirocco
Jan 27, 2009

HEY DIARY! HA HA HA!

Congratulations, man! You should start posting in your project.log thread again (or make a new one) so we can keep better track of your progress.



In other news, I've studied some maths regarding probability to add a little label onto the generator. I hope I've got my maths right! I've also added keyboard shortcuts (you can hit the return key to guess a word).

Sirocco fucked around with this message at 18:26 on Dec 28, 2016

Ghost of Reagan Past
Oct 7, 2003

rock and roll fun

Nothing much to see here, just booting into a Rust kernel with a VGA driver and the ability to write to the screen :snoop:

Ghost of Reagan Past fucked around with this message at 02:58 on Dec 29, 2016

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Still no real gameplay here while I'm working on hardware graphics routines but you can crash into walls now. That's something. I also replaced the hardcoded tilemap with one loaded from an IFF image so I don't need to recompile to play with background tiles.

Luigi Thirty fucked around with this message at 03:35 on Dec 29, 2016

clockwork automaton
May 2, 2007

You've probably never heard of them.

Fun Shoe

Ghost of Reagan Past posted:


Nothing much to see here, just booting into a Rust kernel with a VGA driver and the ability to write to the screen :snoop:

Like the best feeling. Good job.

Adbot
ADBOT LOVES YOU

Ghost of Reagan Past
Oct 7, 2003

rock and roll fun
Through this I learned that x86-64 is bullshit for garbagemen, because holy poo poo jumping to long mode is a pain in the rear end.

I write Python and do web stuff for a living, so this is both way out of my comfort zone and pretty fun. The fun part is that Rust makes everything really straightforward and I don't have to do much with raw pointers (but I can, because Rust!). I don't know where I'm going with this but I'll figure it out.

Also, Windows Subsystem for Linux is ridiculously great. That's QEMU running in X, and it's built using the Linux toolchain, all without a VM in Windows. I'd use it over Mac OS for work if I could, it's that good.

Ghost of Reagan Past fucked around with this message at 05:28 on Dec 29, 2016

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply