Avatar

0xabad1dea

@abad1dea / abad1dea.tumblr.com

Suffering from a permanent case of code rage and writing gay teen adventures header (nsfwish) avatar
Avatar
reblogged

Nothing But The Blood

So I knocked out a short novel (under 100 pages) set in approximately the real world. It deals with themes of queerness, religious fundamentalism, the cost of internet celebrity, and how the Devil is just like, really hot.

It stars Bethlehem and Sammers, who you may be familiar with from MGLIAD, and a new little friend named Sanguine. How does this story interact with the lore of MGLIAD?: uhh, super do not think too hard about that. It’s written in a much more casual style than my fantasy novels, closer to how I tweet.

This story contains violence, sexual themes, and basically everything else you might want a content warning for. It is not fluffy.

Read in Google Docs (no download needed) here Download PDF here

    Volume 3 of Aspects of the Divinity is still coming! Get volume 1 and 2 here.

Avatar

ROMs and Mappers: Why NES Games Can Be So Different On The Same Hardware

time for another LONG POST

The Nintendo Entertainment System, as all gaming fans know, was a hugely successful console despite not being especially powerful even when it was new. Its popularity endures decades later. Its 2A03 processor ran at less than two megahertz, and it had exactly two kilobytes – yes, two kilobytes – of general purpose RAM. If you’re a retro gaming fan, you’ve doubtlessly played games that seem far too complex and technically impressive to possibly work under such constraints. How did they manage it?

If you’ve played many NES games, you’ve also noticed that they vary vastly in graphical quality and how much content they have to enjoy. Some of them are just cheapie budget games of course, but there’s more to it than that. Let’s compare some of the first few games Nintendo itself published with some of the last.

Here are screenshots of some of the first few games Nintendo published for its own console:

image
image
image
image

And here are some of the last few games Nintendo published for the NES:

image
image
image
image

The early games don’t look bad per se, but their visual language is overall much more limited. The backgrounds are very minimal, mostly just black voids. The screenshots of the early games are representative of what those entire games look like, while the screenshots of the late games show just a fraction of what there is to enjoy. I especially encourage you to look at a video of Kirby’s Adventure if you haven’t seen it before: it practically could pass as a 16-bit SNES platformer!

Now, of course some of this difference just comes from the ever-increasing experience of people working on games. Over the course of the NES era, artists came around to the conclusion that outlined sprites look much better than flat color sprites. Compare Super Mario Bros 1 with Super Mario Bros 3, which has much more visual clarity. That’s something that they could have, in principle, done from the beginning, but it had to be learned from experience. They also learned lessons about how to put together easy-to-use menus and interfaces.

Most of the differences however cannot be accounted for by learning alone. The NES was well-designed: highly affordable, with minimal hardware, but a special trick up its sleeve. The game cartridge can bring its own expansion hardware!

If you look at a physical NES cartridge, you will see that it has a wide connector with many “pins”. The console and the cartridge can two-way communicate over these pins. This is different from media such as compact discs, which the console can read from but not write to. If you open up a cartridge, you will find an entire circuit board inside. This circuit board can have basically anything that you can put in a full 8-bit computer attached to it. Even more RAM! In fact, this is how saving works on the NES games (such as Legend of Zelda) where you can save your game: it has extra RAM on the cartridge, and a watch battery to keep the RAM contents from fading when it’s not getting external power. (In modern times, we use flash storage, which doesn’t need to be kept powered.)

I said that the NES has two kilobytes of built-in general RAM, but that doesn’t mean it can only count to two kilobytes’ worth. The NES has a large “window” of address space which is available for the cartridge to fill how it sees fit. Specifically, there is a 32 kilobyte window for the game’s program code and an 8 kilobyte window for its graphics. These “windows” can be filled with ROM (read only memory) or RAM on the cartridge. The NES itself doesn’t really know or care. The real magic is this: a cartridge can have more than 32 kilobytes of code or 8 kilobytes of graphics. It just has to switch out the code and graphics in chunks. It has to do this itself with a microcontroller on the cartridge connected to the ROM and RAM chips. This microcontroller is called the mapper.

Super Mario Bros 1 is an instructive game to look at because it’s essentially the most complicated a NES game can be without a special mapper. Nintendo called mappers “memory management controllers,” or MMCs. We say a cartridge has “MMC0” (that’s a zero) if it doesn’t actually have anything special to “bankswitch” between different ROM and RAM chips. If you look at a ROM file that you’d use in an emulator, you’ll see that Super Mario Bros 1 is 41 kilobytes. Take off one kilobyte because that’s the header added so that the emulator knows how to load the game. That leaves 40 kilobytes: 32 kilobytes of program ROM and 8 kilobytes of graphics ROM. That fills the cartridge memory window exactly.

How much graphics is 8 kilobytes’ worth? It’s exactly 512 tiles, which are 8x8 pixels each, supporting four colors per tile. The 512 tiles are divided into two “pages”: 256 for sprites and 256 for backgrounds. Super Mario Bros 1 is a masterclass in getting the most gameplay out of the fewest graphical components. Famously, the bushes and clouds are actually the exact same graphical tiles with different color palettes applied. (If I went into how coloring works on the NES, we’d be here until the sun goes supernova. Suffice to say, the cloud/bush tiles only need to be stored once, not twice, despite appearing in two different colors.) 

Literally dozens of different mappers were developed and in fact are still developed to this day by pirates and homebrew enthusiasts. The completely plug-and-play nature means there’s nothing stopping someone making a new mapper with new features, and the NES will happily work with it. Part of the reason emulators often have trouble with obscure or pirated games is that the emulator needs specific support for every mapper, since it’s emulating the mapper chip itself as well as the NES. Some mappers are much more common than others of course; many of the best-known games use MMC1 or MMC3.

Super Mario Bros 3 is an MMC3 game. If you check the ROM file, it is a little less than 400 kilobytes. Quite a bit of that, 128 kilobytes, is different pages of graphics. SMB3 has much, much more graphical variety than SMB1. The different worlds actually look like completely different places, rather than the same place but in a different color. 256 kilobytes contain all the code and non-graphical data such as the music. Again, only 32 kilobytes of it can be loaded at a time. The game code tells the mapper microcontroller what changes to make as it executes.

There’s more to MMC3 than just facilitating this swapping around. It brings entirely new hardware features to the NES. The NES’s built-in support for timers is... extremely limited. MMC3 has its own timer that can be used to achieve special graphical effects. It may be trifling by modern standards, but on the NES, having a status bar that stayed still while the game background scrolled was a special effect! This timer is also at play during the minigames in Super Mario Bros 3 which split the screen three different ways. It was a very impressive effect at the time.

So, now you know how cartridges can bring their own hardware to bulk up the NES’s meager capabilities. You may be wondering: why didn’t they just do this all the time? Why didn’t Super Mario Bros 1 have the same fancy mapper as Super Mario Bros 3?

The answer is raw monetary cost. ROM and RAM chips cost an appreciable amount of money, but, that cost dropped rapidly over the NES’s lifetime. Each year, you could fit more kilobytes of ROM on your cartridge for the same price. Hence, Super Mario Bros 1′s design of exactly filling up the memory window and not one byte more was the best financial decision at the time, but the wise cartridge design of the NES meant that games could and did get steadily larger and more complex. Homebrew and multicart games can reach into the megabytes, which is on par with the small end of entirely modern games. The Game Boy had the same type of cartridge design and followed the same arc.

It really is incredible how much an 8-bit toy computer can achieve!

If you’d like to learn more technical details, check out the nesdev wiki. This post was written out of my personal experience as a hobbyist programmer for NES.

Avatar
reblogged

Glory in the Thunder revised + Resplendent in the Sky are OUT

After LITERALLY YEARS of very slow progress due to my health problems, Aspects of the Divinity, Book One: Glory in the Thunder revised edition and Aspects of the Divinity, Book Two: Resplendent in the Sky are finished, done, and OUT. Right now they are only available as direct download from my cloud storage, because if I wait until I have the energy to upload to other distribution services then it will just never happen. Yes, they’re free! More on why they’re free down below.

(The PDF is formatted as a printed book. .mobi format is for Kindle. .epub format is for iBooks and most other readers that aren’t Kindle.)

Aspects of the Divinity is my life project, a story about queerness and mental illness set in a fantasy version of the Silk Road. The road’s cultures worship a handful of people who are bound to powers cleaved from the Will of the World. The combined length of the first two books is well over a thousand pages, and I still have more books to write.

As you might guess, I myself am both queer and mentally ill. I finished the first edition of Glory in the Thunder in 2013 when I was still barely healthy enough to hold down a job, but since 2015 I have been on disability. Disability payments have kept me alive and I have worked on my writing when I am able; I often go weeks or months at a time unable to write a single word. I’m in no shape to hold down an aggressive schedule and I don’t know how long the third book will take, but if I got through this then I can get through the next book. This is all to say that the books are free because they’re something I’ve done for myself at my own pace while I am healing. 

Anyway, if you like the idea of a gay princess and her lady knight, or a sweet rural boy being entangled in the affairs of a beautiful but distrusting nobleman, or old people that are really explicitly canonically queer, or angry women in general, have I got the story for you!

Content warnings: The age rating is teen. There are no sex scenes. There are violent scenes. The narrative occasionally touches on the subject of suicide, especially in the second book. The font used in the PDF is IM Fell Great Primer. I think that’s everything.

Oh yeah, the rest of the pages on this tumblr site need to be updated, but it can wait. Only use links in this post for now.

Avatar

How Math Can Be Racist: Giraffing

You may have heard about AOC catching a lot of flack from conservatives for claiming that computer algorithms can be biased – in the sense of being racist, sexist, et cetera. How, these people asked, can something made of math be biased? It’s math, so it must be objectively correct, right?

Well, any computer scientist or experienced programmer knows right away that being “made of math” does not demonstrate anything about the accuracy or utility of a program. Math is a lot more of a social construct than most people think. But we don’t need to spend years taking classes in algorithms to understand how and why the types of algorithms used in artificial intelligence systems today can be tremendously biased. Here, look at these four photos. What do they have in common?

You’re probably thinking “they’re all outdoors, I guess...?” But they have something much more profound in common than that. They’re all photos of giraffes!

At least, that’s what Microsoft’s world-class, state-of-the-art artificial intelligence claimed when shown each of these pictures. You don’t see any giraffes? Well, the computer said so. It used math to come to this conclusion. Lots of math. And data! This AI learns from photographs, which of course depict the hard truth of reality. Right?

It turns out that mistaking things for giraffes is a very common issue with computer vision systems. How? Why? It’s quite simple. Humans universally find giraffes very interesting. How many depictions of a giraffe have you seen in your life? And how many actual giraffes have you seen? Many people have seen one or two, if they’re lucky. But can you imagine seeing a real giraffe and not stopping to take a photo? Everyone takes a photo if they see a giraffe. It’s a giraffe!

The end result is that giraffes are vastly overrepresented in photo databases compared to the real world. Artificial intelligence systems are trained on massive amounts of “real world data” such as labeled photos. This means the learning algorithms see a lot of giraffes... and they come to the mathematically correct conclusion: giraffes are everywhere. One should reasonably expect there might be a giraffe in any random image.

Look at the four photos again. Each of them contains a strong vertical element. The computer vision system has incorrectly come to the belief that long, near-vertical lines in general are very likely to be a giraffe’s neck. This might be a “correct” adaptation if the vision system’s only task was sorting pictures of zoo animals. But since its goal is to recognize everything in the real world, it’s a very bad adaptation. Giraffes are actually very unlikely.

Now, here’s the clincher: there are thousands and thousands of things that are over-represented or under-represented in photo databases. The AI is thoroughly giraffed in more ways than we could possibly guess or anticipate. How do you even measure such a thing? You only have the data you have – the dataset you trained the AI with in the first place.

This is how computer algorithms “made of math” can be sexist, racist, or any other sort of prejudiced that a human can be. Face photo datasets are highly biased towards certain types of appearances. Datasets about what demographics are most likely to commit crimes were assembled by humans who may have made fundamentally racist decisions about who did and didn’t commit a crime. All datasets have their giraffes. Here’s a real world example where the giraffe was the name “Jared.”

Any time “a computer” or “math” is involved in making decisions, you need to ask yourself: what’s been giraffed up this time?

Thanks to Janelle Shane whose tweet showing her asking an AI how many giraffes are in the photograph of The Dress prompted this post.

Please note that Microsoft does try to take steps to correct their computer vision system’s errors, so the above photos may have improved their detections since they were first evaluated by @picdescbot. (They did all still register as giraffes on 31 Jan 2019.)

Avatar

Hey, just wondering if you would reupload your executable mimetype program from this blog post: "Analyzing Binaries with Hopper’s Decompiler". Thanks! If not, I can probably go ahead and compile it too. Just letting you know, people are still finding your article in google searches!

Avatar

Hopefully this link to my google drive will work: https://drive.google.com/open?id=0B2IfHssIKuJgT1NjOVVMVXhwd1U

Avatar

@staff @support Please, please, please, PLEASE respect the "Reduce Motion" iOS operating system setting and freeze-frame gifs like this one and make my life that much less of a living hell! I like gifs! When I watch them on purpose and not when they jump me and ruin my life with SURPRISE MOTION SICKNESS! This is why the OS lets apps ask about this sort of thing! *sobs*

Avatar
reblogged

I think the most recent tweak in medication has been helpful, as I’ve been able to write more often. To quote what I think is my favorite line of Katarosi’s in book 2: “Antaram has angered many gods. We will endure.”

If this is your favorite line, then I’m disappointed that “I’m so mucking gay oh my gods” didn’t make it in :P

Avatar
abad1dea

“She thought of Ismyrn – she thought very distinctly of the blue buttons down Ismyrn’s favorite shirt –”

Avatar
Avatar
abad1dea

I did a rendering of the Mayor’s Office from Majora’s Mask in somewhat less-Nintendo-64ish instruments. Downloadable for all your heated argument needs.

May I ask what you used to make this?

GarageBand with East/West Composer Cloud instruments (iirc they’re all from Symphonic Orchestra)

Avatar
reblogged

Abusing my platform here for a sec to spread the word: tumblr now offers https for your blog’s subdomain. You have to manually turn it on in settings on a blog-by-blog basis (and it doesn’t work for custom domains because Thrilling Technical Reasons). Hopefully this is a stepping stone to taking tumblr 100% https but this is important and you should turn it on to help make everyone’s day a little more private.

If your blog theme directly includes things by url over http, check whether those urls are also available over https or can be rehosted somewhere with https to make your theme https-safe.

Thanks to the people at tumblr, especially Aloria because I kinda assume everyone at tumblr is Aloria.

Avatar
abad1dea

reblogging myself... is that a sin?

Avatar

Randos Are Priority Infinity.

If you just asked me for my time, and I linked this to you in response, this is where you and I stand.

You are a rando. You might be nice, you might be reasonable, but nonetheless, everyone is someone’s rando and you are my rando. I have a lot of priorities and a lot of randos and randos are priority infinity. Here, I made a list:

1. Finish Resplendent in the Sky, my second novel.

2. Dutch language comprehension.

3. Drawing and improving my drawing.

4. Music composition.

5. Developing My Guild Leader Is A Demon, my side-fiction.

6. Study architecture and play with voxel art.

7. Actually play some video games once in a while.

8. Study history, politics, and war.

[ any number of other interesting and worthwhile things ]

∞. Randos.

You might notice my infosec career didn’t even make the top eight, because I have been extraordinarily sick for months and months and I’m on disability leave so things that make me happy without hurting me are my top priorities.

If you asked me something about feminism or social justice: here, maybe this will help.

If you asked me to disprove your conspiracy theory: here, maybe this will help.

If you think you’re entitled to demand I play your troll “debate” games or to violate my contact policy, here, maybe this will help.

My time is finite. My energy is finite. My will to live is dangerously finite. Ultima Ratio Gaudiī.