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
Luigi Thirty
Apr 30, 2006

Emergency confection port.

Objective C is easy.

From the web:



to the iPhone:

    

Adbot
ADBOT LOVES YOU

Luigi Thirty
Apr 30, 2006

Emergency confection port.

akadajet posted:

Hah. I joked about making this on the LCs last night.

People have been asking me to make it for a while, actually. Might as well. Even got Valve's official permission to use their assets and everything.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

I got bored and thought "how hard could writing an interactive fiction engine be in Python?" and a day or two later I've got something basic working, more or less. Only supports a few verbs so far, LOOK, TAKE, DROP, PUT, USE, INVENTORY, N/S/W/E.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

I''m relearning C++ by writing an Apple I emulator. It has... a few issues.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

hendersa posted:

I HEARD THE CALL. I AM HERE.

Compiler: Watcom with DOS Extender
DOS 21h interrupt functions: Interrupt list
Free version of Abrash's Graphics Programming Black Book
55ms timer interrupt: RTC interfacing
Z80 instruction set: Here
Sound Blaster programming: Guide here

HOORAY! YOU WILL LEARN MUCH. :science:

Edit: I just pulled this monster off of my bookshelf and weighed it. It has 1342 pages and weighs 5.5 pounds.



Making some DOS game in Watcom is something I've wanted to do since I got a shovelware game CD and a bunch of books I didn't understand when I was like 9. I should grab this and make the dinky thing I've always wanted.

Or maybe I should finish my C# NES emulator! I have a working CPU core and I can render one frame of background at approx 0.01 FPS before everything explodes.

In the meantime, my first venture into F#: I bought the Neatest Little Guide to Stock Market Investing and it came with a spreadsheet in the back. Unfortunately the data that you need to fill in the spreadsheet for individual stocks isn't really in one place. So I made it available in one place thanks to Quandl:

Luigi Thirty fucked around with this message at 01:08 on May 22, 2016

Luigi Thirty
Apr 30, 2006

Emergency confection port.

MrMoo posted:

Consider you are only showing the consolidated market price, you should be able to get the price on each market venue, with some people preferring the primary exchange for NYSE. It quickly becomes a beast of data.

Currently I'm just grabbing whatever the closing price value is set to in this database since I've already got a library hooked up for reading from there. It also needs to be able to do annual instead of quarterly data, let you see the rest of the provided fundamentals (plus whatever else I can calculate), etc...

Luigi Thirty
Apr 30, 2006

Emergency confection port.

MrMoo posted:

I have access to everything but :effort:

Here's the basic page for Apples, check out all the tabs



Surprisingly not a lot of it is accessible programmatically, a mountain of hacks upon hacks.

I wish I had that kind of visualization! I've got about a hundred indicators I can get through the API that I'm using. I just need to, uh, figure out how to interpret most of it.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Factor Mystic posted:

Is this project open source? I'm curious for curiousity's sake.

Sure if you want a bunch of PPU code that doesn't work! I wrote the 6502 core for an Apple I emulator that I wrote that does work but I never finished adapting it for NES emulation.

https://github.com/Luigi30/nessarabia

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Factor Mystic posted:

This is a 404. Is the repo private or something?

Yeah, sorry.

In the meantime, I've been reliving 1994 with Open Watcom. (I am not an art.)



I've also got drawing code that allows for 2D wireframe shapes with up to 64 vertices and janky PCX loading code.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Neurion posted:

I'd love to see this, if you don't mind!

The code's a total mess since I'm learning as I go but here you go. I'm most proud of the UI widgets.

e: Well, it's missing the Watcom project file... but you can just add all the files to a DOS4/GW project in Watcom and compile it.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

DOS is fun! Sound programming is... not. :v:

https://www.youtube.com/watch?v=362rNaXCcjQ

One channel of 22KHz 8-bit mono WAV playback so far. It works through single-shot DMA transfer so that's where the annoying pops come from - once I figure out how the auto-initialized mode works I can just construct my own audio buffers as needed and throw them at the sound card.

Luigi Thirty fucked around with this message at 04:22 on Jun 14, 2016

Luigi Thirty
Apr 30, 2006

Emergency confection port.

And here I am failing to get IRQ5 hooked up to a protected-mode interrupt handler. :mad:

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Neurion posted:

How're you trying to do this? I've successfully hooked to IRQ1 in protected-mode to make a keyboard handler, so I might be able to help there.

I figured out the problem. Turns out hooking IRQ5 doesn't help when Dosbox's Sound Blaster is on IRQ7...

Luigi Thirty
Apr 30, 2006

Emergency confection port.


I can do that! The Sound Blaster lets you transfer 64KB of 8 or 16-bit uncompressed digital sound at up to 44.1KHz via DMA without needing to hook any IRQs. To play back longer samples, you need to rig it up to fire an interrupt every 32KB so you can refill the buffer as needed. I haven't quite gotten there yet but I can play single samples out of an array of pointers to WAV files.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Neurion posted:

I haven't looked too closely at the DMA / sound buffers thing yet, but does the buffer have to be that large, or can it be something a bit more reasonable like 1/30th of a second's worth of samples?

I'm sure it's gonna be real fun to figure out a speedy way to mix multiple concurrent playing sounds as you build your sound buffer, and do it in a way that doesn't make it sound like poo poo. I've toyed with the idea myself and came up with some crazy fixed-point decimal representation and bit-shifting nonsense in order to handle it, but I've yet to actually try implementing it.

Yeah, you can give the DMA chip and the DSP different buffer sizes anywhere between 1 byte and 64KB. The ISR just needs to acknowledge the interrupt and then you can do whatever you want.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

I want to make my own 1990s-quality shareware game as a challenge. I'd rather not just use external libraries wholesale if possible but I've got Duke 3D's sound library to look at plus that one. Midas has a weird noncommercial license, Duke 3D's audio libs are GPLed.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

One Eye Open posted:

Well, I don't know if it's suitable, but the Miles Sound System for DOS was put into the public domain a while back:- It's here, near the bottom(AIL version 2).

Thanks, that should help even if it's in assembly. I dug up the Sound Blaster programming manual so I'm not just going by text files from 20 years ago too.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Neurion posted:

Update on working with the SoundBlaster 16 -- Things are going really great, except for the fact that almost NONE of the documentation I read made mention of the fact that the PIC will ignore IRQs if their mask bit is set. I spent hours last night trying to figure out why my IRQ handler wasn't being called, only to discover later that the SB16 IRQ starts off as masked when you boot up DOSBox. 2 I/O port writes later and I'm back in business. Still frustrating as hell, though.

Oh, and I also made a teensy single-character mistake in my DPMI code that resulted in a severe buffer overrun if you tried to allocate an amount memory that wasn't a multiple of 16. That bug also took too long to discover and fix. Remember to test your code against all possible use cases, kids!

I added MIDI playback to my DOS game. Then I decided to start bolting a 3D renderer onto it!

A week or so of teaching myself 3D geometry and:

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Back-face culling, Z buffering, and flat shading!



2 FPS!

Luigi Thirty
Apr 30, 2006

Emergency confection port.

ErIog posted:

Man, that makes me disappointed my current spare time project got side-tracked with studying for work-related certifications instead.

I've been reading up on geometry and asking dumb questions in YOSPOS.

I changed the triangle rasterization from using barycentric coordinates to the much faster method of splitting the drat things in half and rendering them as a series of horizontal lines instead, with the added bonus of being able to dump the barycentric Z calculation for each pixel and solving a much faster plane equation instead! Now it's infinitely fast :pcgaming:

Luigi Thirty
Apr 30, 2006

Emergency confection port.

My graphics knowledge ends somewhere around 1989. Currently I've got four 320x200 layers that get overlaid to produce the final framebuffer: Background, polygons, UI widgets, and text. I suppose this architecture could be a problem if I figure out VBE and upgrade the framebuffers to 640x480.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

RexJericho posted:

I've been writing this hobby program that makes my computer real hot for hours on end and also simulates liquid fluids. Right now I'm using the program to animate fluid flowing through portals. This one's been taking my tiny laptop about 5-10minutes to simulate and 12-15 minutes to render each frame.

Here's a frame rendered in Blender:


Liquid is falling into the orange portals and exiting through the blue portals on the wall.

I've got a GitHub repository for the project here: https://github.com/rlguy/GridFluidSim3D

And some animations created with the program here: https://www.youtube.com/watch?v=zdTcAg_G0Go

That's awesome.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Eela6 posted:

Edit: That fluid simulation stuff is absolutely stunning.

Suddenly my FAT12 driver for Sim68K is less impressive

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Scaramouche posted:

Look at you guys all freaking out because someone has a slow mo camera, a bunch of blue paint, the ability to levitate bunny shaped water globs, and a bunch of free time on his hands. Pfft.



Here's a directory reading for a FAT12 disk image in 68k assembly :shrug:

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Hell yeah my OS can load programs now.



Op success.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Well it took me 2 days but I have a working M68K toolchain on my Linux VM. Now I can view some KSP orbital parameters on my Atari ST without a hardware FPU!



Well... as soon as I figure out how to scale them so they make sense.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Turns out I'm actually a dummy and was reading the floats wrong. Mission Control! :sun:

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Bresenham line drawing on the Atari ST, ported to 68K ASM from C! :woop:

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Upgrading my Atari KSP secondary display to be a mouse-driven GUI application instead of just a bunch of crap spat out into a text console.



Luigi Thirty
Apr 30, 2006

Emergency confection port.

Internet Janitor posted:

Badass. What was your approach to dithering for the world map?

The ST's graphics primitives are slow. It does support pattern dithering but defining Kerbin as an object would be impractical. In order to have it not take a year, I grabbed a Kerbin map and created a dithered 1bpp image out of it. (That's era-appropriate though I used Photoshop instead of Deluxe Paint...) It's blitted to the screen which is an adventure in itself thanks to the 1986 implementation of device-independent bitmaps and then the grid and current location of the craft is drawn over it.

Luigi Thirty
Apr 30, 2006

Emergency confection port.

taqueso posted:

So you wrote an emulator so you could write a kerbal clone for atari*? Badass, indeed. I've got a friend that is going to love those screenshots.

*or are you writing a Kerbal clone to test the emulator?

I didn't write an emulator. This is an Atari ST program that communicates with a PC running KSP and KSPSerialIO. KSP sends vessel status updates over a serial link and the Atari becomes a mission control computer.

I have written an Apple I emulator and half of an NES one in the past!

Luigi Thirty
Apr 30, 2006

Emergency confection port.

That's a lot of FPS.

Content: I finally fixed this program so I can display a Degas Elite image with the proper palette without crashing the system or loving up the colors on the desktop!

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?

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!)

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.

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.

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

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

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Ghost of Reagan Past posted:

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.

Not going to lie, x86 GDT and segmenting garbage no human should have to deal with is why my toy assembler projects are pretty much all 68000. 16MB is enough for anyone. Memory protection is for losers who suck at pointers as evidenced by how many Enforcer hits my game causes.

Luigi Thirty fucked around with this message at 05:59 on Dec 29, 2016

Adbot
ADBOT LOVES YOU

Luigi Thirty
Apr 30, 2006

Emergency confection port.

Ferg posted:

I built some hobby retro gaming emulators a few years ago and decided to do an OS kernel as a follow up. The attitudes at OSDev turned me off immediately, especially compared to the awesome folks at NESDev who all seem to have the patience of a saint when explaining something complicated. Awesome job with what you've done so far!

The people at English Amiga Board helped me out with my scrolling stuff and even went over my ASM blit routine on Github for me to figure out why it didn't work. The Atari forums are full of helpful people too.

Skim Milk posted:

yo luigi30 write something useful for actual humans because it would probably be very good+cool

Too many people do that, my niche is things nobody will ever use. I did put a command alias I use on Aminet this week which has 69 downloads.

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