Kerbal Mission Control

All 680x0 related coding posts in this section please.

Moderators: exxos, simonsunnyboy, Mug UK, Zorro 2, Moderator Team

LuigiThirty
Atariator
Atariator
Posts: 28
Joined: Sat Sep 03, 2016 12:20 am

Kerbal Mission Control

Postby LuigiThirty » Sat Oct 01, 2016 6:11 pm

Now that I've got a working 1040ST, I've been working on a project for a while: A Kerbal Space Program mission control display for the Atari ST. I had a text mode prototype that I made a while ago which successfully connected to KSP (you can find it on github) and now I'm working on a new GEM desktop version.

It connects to the PC over a 19200bps serial link, using the KSPSerialIO plugin for KSP. My goal is not to have to make any changes to the plugin even though that would make it faster to process the data, most of which is float values, on the Atari. Obviously the 1040ST has no FPU so I currently convert them to strings with printf("%.2f") which is pretty slow. The desktop application doesn't actually support the serial link yet, just using test data while I get everything hooked up. The source for the desktop version is in this other repository.

Not much to look at quite yet (and the code isn't well-organized), but I'm learning GEM and 68k assembly through it so I'm having fun. :)

Here's the text version running on my 1040ST.

User avatar
LaceySnr
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 111
Joined: Wed Jun 26, 2013 5:00 am
Contact:

Re: Kerbal Mission Control

Postby LaceySnr » Sat Oct 01, 2016 8:01 pm

Way too cool. Love it!

LuigiThirty
Atariator
Atariator
Posts: 28
Joined: Sat Sep 03, 2016 12:20 am

Re: Kerbal Mission Control

Postby LuigiThirty » Sun Oct 02, 2016 12:45 am

Thanks! :)

LuigiThirty
Atariator
Atariator
Posts: 28
Joined: Sat Sep 03, 2016 12:20 am

Re: Kerbal Mission Control

Postby LuigiThirty » Mon Oct 03, 2016 12:08 am

Today's progress: Figured out how to draw overlapping windows and also plot coordinates on a planetary map. Not sure how I'll do the sinusoidal orbit track...

Image

LuigiThirty
Atariator
Atariator
Posts: 28
Joined: Sat Sep 03, 2016 12:20 am

Re: Kerbal Mission Control

Postby LuigiThirty » Tue Oct 04, 2016 2:32 am

Aaaaaand we have continents!

Image

They'll be shaded as soon as I figure out how to... do that.

LuigiThirty
Atariator
Atariator
Posts: 28
Joined: Sat Sep 03, 2016 12:20 am

Re: Kerbal Mission Control

Postby LuigiThirty » Tue Oct 04, 2016 11:14 pm

I've got a question about interrupt handling. It looks like I need to hook interrupt vector $000130 to handle incoming serial data. (In the text version I was just using Cauxis to check for a character and Cauxin to put it into my buffer, but that won't work if I'm waiting for an event with evnt_multi.)

I'm running into a problem though - it hard locks when I receive a serial character! To figure it out, I set up a breakpoint in Mon that fires on my interrupt routine when the I receive the interrupt. But the system hard locks as soon as the interrupt routine is called. My application's mouse pointer freezes and if I'm running Mon, the debugger appears and locks up.

Here's what I'm doing:

Code: Select all

HookRS232ReceiveVector:
   move.l   $130, OldRS232Vector
   move.l   #RS232ReceiveException, $130 ;ST-MFP-12
   RTS

UnhookRS232ReceiveVector
   move.l   OldRS232Vector, $130
   RTS

RS232ReceiveException:
   PUSHW   #1 ;aux: <-- Mon hard locks here
   PUSHW   #bconin
   trap   #13
   addq.l   #4,sp

   move.w   d0, SerialBuffer
   RTE

[...]
   
Main:
   ;hook the RS-232 receive vector
   PEA    HookRS232ReceiveVector
   PUSHW    #supexec
   trap    #14 ;XBIOS call
   addq.l   #6,sp
   
[...]


Am I doing something wrong with this exception?

Bonus progress screenshot:

Image

Dal
Administrator
Administrator
Posts: 4080
Joined: Tue Jan 18, 2011 12:31 am
Location: Cheltenham, UK
Contact:

Re: Kerbal Mission Control

Postby Dal » Wed Oct 05, 2016 6:43 am

This is a really cool idea! Can't help with your interrupt issue, I'm afraid though.
TT030: 4MB/16MB + Crazy Dots, Mega"SST" 12, MegaSTE, STE: Desktopper case, IDE interface, UltraSatan (8GB + 512Mb) + HXC floppy emulator. Plus some STE's/STFM's

LuigiThirty
Atariator
Atariator
Posts: 28
Joined: Sat Sep 03, 2016 12:20 am

Re: Kerbal Mission Control

Postby LuigiThirty » Wed Oct 05, 2016 7:56 pm

Bored at work and looking through some old text files. Looks like I am doing it wrong:

Whatever happened to GEM?
-------------------------

None of this discussion has dealt with GEM. Why? Because so far as
GEM is concerned, the serial port doesn't exist.

The AES Event Manager doesn't poll the aux port to determine whether
an event has occurred.

If you want to write a GEM event-driven communications program that
will cooperate with desk accessories for multitasking, you'll need to
use the timer with a time value of 0. This will allow a task switch
to take place, and when you regain control you can check the serial
port's status with GEMDOS or BIOS.

If you're worried that the serial input buffer will overflow while
some system-hog task is running, resize the buffer as described
below.


Seems like a workaround to force a task switch but I guess that works.

LuigiThirty
Atariator
Atariator
Posts: 28
Joined: Sat Sep 03, 2016 12:20 am

Re: Kerbal Mission Control

Postby LuigiThirty » Mon Oct 10, 2016 3:17 am

It turns out Jeb also built mission control.

Image

I've got the serial link working now... sort of. It works with an individual test packet I captured but not with KSP quite yet. I've also been doing a lot of reorganizing of the spaghetti-er parts of the codebase, splitting it up into modules and stuff like that. I also sped up the software floating point a lot so it will run at a decent clip (on an emulated 32MHz 68000 anyway).

LuigiThirty
Atariator
Atariator
Posts: 28
Joined: Sat Sep 03, 2016 12:20 am

Re: Kerbal Mission Control

Postby LuigiThirty » Tue Oct 18, 2016 2:26 pm

Managed to get sidetracked working on some low-res color graphics stuff. I haven't quite figured out how to horizontal shift my 100x100 ST-format graphic yet. I can only blit it to word-aligned X coordinates :(


Social Media

     

Return to “680x0”

Who is online

Users browsing this forum: No registered users and 2 guests