Jump to content
IGNORED

New GUI for the Atari 8-bit


flashjazzcat

Recommended Posts

funny thing, it reminds me of a certain optimization that snuck into Android's 'bionic' C library sometime before the release of 4.0, memset() had been rewritten as an inline macro that ALWAYS used 0x0 as the fill bit. This caused quite a surprise for certain programs, libraries, and drivers that were using it to fill a section of memory. Google found the bug some months later, and fixed it...

 

-Thom

Link to comment
Share on other sites

This looks marvelous. Can't wait for a public API to write a first dedicated program :-)

I'll post the source to the (incomplete) task manager later on. That'll at least offer a peek at what a typical application looks like.

 

funny thing, it reminds me of a certain optimization that snuck into Android's 'bionic' C library sometime before the release of 4.0, memset() had been rewritten as an inline macro that ALWAYS used 0x0 as the fill bit. This caused quite a surprise for certain programs, libraries, and drivers that were using it to fill a section of memory. Google found the bug some months later, and fixed it...

Nice one. I ended up reading this. Apple's "goto fail" SSL bug is especially juicy. Last bug I found was a simple typo: missing ",Y" on the end of an indexed load. Providing critical routines are optimal, now we're at 22,000 lines of code, I'm absolutely all for readability and maintainability over "quick and dirty". :)

  • Like 2
Link to comment
Share on other sites

Here's the task manager / profiler source, such as it is. It'll make more sense when the API is written up, but the API is similar to that of SymbOS, as I've said.

task_manager_source.txt

The application is very simple, and makes no direct reference to any kernel locations. It merely sets up a menu bar, window, and three tabs full of controls. It obtains the process data via a kernel call thus:

	ldxy #SampleBuffer
	SysCall Kernel.GetProcessInfo
	jsr GetCPULoad ; get the CPU load percentage

This function (currently) returns a buffer full records describing all the processes. Each record contains:

 

  • Process name
  • Process ID
  • Priority (1-7)
  • Type (ROM or RAM)
  • State (Ready, Idle, Sleeping)
  • Percentage CPU load

The profiler just copies the data into a list control, and uses the percentage value to update the left graph. After it's done this, the process puts itself to sleep for three seconds:

	lda #150 ; go to sleep for 150 "ticks" (jiffies, in this case)
	ldxy #0 ; MSB of 24-bit counter
	SysCall Kernel.Sleep ; OS will wake us up when timer expires or when we get a message

The OS will wake up the process when the timer expires or when a message is received (say, if the user clicked on a different tab in the dialog). On returning from Kernel.Sleep, the remainder of the sleep interval will be returned in A,X,Y. If this value is non-zero, it means the sleep was interrupted by a message, and the process may subsequently sleep again for the remaining time (although we don't bother in this case). It's possible - if unlikely - that a message could wake up the task at the exact same time that its sleep counter reaches zero, so although a non-zero sleep counter means a message has been received, a zero sleep counter doesn't necessarily mean there's no pending message in the queue: so it's worth checking to be sure.

 

The more usual method of waiting for a message from the GUI is via MessageSleepReceive which puts the process to sleep indefinitely until a message is received. If your application doesn't need to periodically update anything, that's what you'd use.

 

It should be apparent that the bulk of the source is taken up by resources. The kludgy code which creates a percentage string is just bodge and can even be jettisoned once the GUI provides a "number out" function. The "DTA" statements are instances of MADS structures, but these are really just a lot of BYTE and WORD fields: structs make them a little more readable and convenient to code up.

 

The application is not yet relocatable, hence the explicit page zero assignments. There's a lot of dummy data in there too (totals, RAM usage, etc), which we'll pull out of the process records eventually.

Edited by flashjazzcat
  • Like 2
Link to comment
Share on other sites

Here's the task manager / profiler source, such as it is. It'll make more sense when the API is written up, but the API is similar to that of SymbOS, as I've said.

Nothing kills the fun of programming like having to write docs!

 

 

Thanks for the examples Jon - wanting to write apps for your OS might finally wean me off Quick!

Link to comment
Share on other sites

That sorta looks like a high-level language! I would have thought setting up the initial UI would be more brutal than that. My wife is going to hate you when you have the API spec ready. Don't know what I'm going to write yet, but I'm going to write somethin' ;-)

 

After a release or two maybe someone will write a visual form builder for the PC to generate the UI code. That would be extremely cool.

 

When you say similar to SymbOS API.... are we talking UNIX / Linux similar or GEM / Windows similar?

Link to comment
Share on other sites

Nothing kills the fun of programming like having to write docs!

To be honest, I'll be glad of the change of pace offered by documenting the thing when there isn't such a huge amount of coding still to do. :)

 

Thanks for the examples Jon - wanting to write apps for your OS might finally wean me off Quick!

From what I can gather, Quick is pretty closely tied to the assembly equivalent, so with a bunch of nice macros in MADS, it really shouldn't that big of a leap.

 

That sorta looks like a high-level language! I would have thought setting up the initial UI would be more brutal than that. My wife is going to hate you when you have the API spec ready. Don't know what I'm going to write yet, but I'm going to write somethin' ;-)

Yeah - I'm besotted with the "Kernel.MessageReceive" notation which MADS allows. Structures are also a great way of avoiding reams of BYTE and WORD statements, and they're more readable.

 

After a release or two maybe someone will write a visual form builder for the PC to generate the UI code. That would be extremely cool.

Definitely. If you head over to the MSX Resource Centre, you'll see a discussion about the revised resource editor/IDE for SymbOS. That's the kind of thing we need. I'm (finally) knuckling down to learning Java at the moment, but I have no aspirations to write all the PC-side tools myself - it's just too much work. Fortunately I've had interest from people wanting to write resource editors when the time comes (i.e. when the API is written up). SymStudio was quite clever in as much as it abstracted the message passing somewhat: it almost seemed as if one was writing callbacks attached directly to GUI components (kind of how I remember VBA).

 

When you say similar to SymbOS API.... are we talking UNIX / Linux similar or GEM / Windows similar?

Since the API is so closely modelled on that of SymbOS, it would probably be best (and interesting) if we heard from Prodatron on what his design cues were. However, the API and the basic reliance on IPC is probably where the similarities end, since we're talking about two completely different implementations. I think the A8 kernel is more Unix-like than anything else. I checked out Lunix (LNG) and OS/A65 (Geck/OS) when designing the kernel, and there are even a few calls in my kernel (such as Sleep) which work exactly like the Unix counterparts. The A8 kernel is slightly more "message-centric" than either of those OSs, though, and obviously I had to design something which was geared up to avail itself of a lot of banked RAM from the ground up (existing Unix-like implementations on the 6502 tend to have a tiny amount of space for applications, running terminals in text mode, etc). The API was very GEM-like before the big redesign, but all that's gone now. So - the answer would be Unix/Linux, I guess. :)

Edited by flashjazzcat
Link to comment
Share on other sites

Definitely. If you head over to the MSX Resource Centre, you'll see a discussion about the revised resource editor/IDE for SymbOS. That's the kind of thing we need. I'm (finally) knuckling down to learning Java at the moment, but I have no aspirations to write all the PC-side tools myself - it's just too much work. Fortunately I've had interest from people wanting to write resource editors when the time comes (i.e. when the API is written up). SymStudio was quite clever in as much as it abstracted the message passing somewhat: it almost seemed as if one was writing callbacks attached directly to GUI components (kind of how I remember VBA).

 

To have an idea how this looks like you can watch these videos about SymStudio:

Starting from 5:20 Trebmint shows how to create a form and how to add code for different events, which is quite interesting. This is the first of 3 videos about SymStudio Trebmint uploaded.

 

 

Since the API is so closely modelled on that of SymbOS, it would probably be best (and interesting) if we heard from Prodatron on what his design cues were.

 

TBH I didn't look at other APIs when I created the SymbOS APIs and the data structures. Hope this answer is not too deflating :D

  • Like 2
Link to comment
Share on other sites

TBH I didn't look at other APIs when I created the SymbOS APIs and the data structures. Hope this answer is not too deflating :D

Not at all, and I'm not surprised. Sometimes it's best to begin with a clean slate (especially when there are few successful precedents), but SymbOS provides a great reference model for small systems.

 

Starting from 5:20 Trebmint shows how to create a form and how to add code for different events, which is quite interesting. This is the first of 3 videos about SymStudio Trebmint uploaded.

This is really impressive. I like the way in which the high-level instructions completely abstract what's going on underneath (i.e. checking for Desktop Manager messages and changing the strings in the control records).

Edited by flashjazzcat
Link to comment
Share on other sites

This bloody Mac-style menu bar is pretty complicated. :) Anyway, I wrote a (dummy) clock process which simply sets up a "menulet" on the RHS of the menu bar:

 

post-21964-0-68534500-1413581521_thumb.png

 

Menulets are added to the third node in the menu bar list (System menu being the first node, App menu being the second), so the most recently added menulet is always immediately after the application menu bar. The application menu bar container gets resized every time a new menulet is registered, or if one is de-registered. It's just a lot of list manipulation. In any case - we won't have room for too many menulets. :D (Although menulets will usually be 8x8 icons rather than textual items.)

 

I should also give a shout-out to the updated System Bold font visible in this screen-shot, courtesy of the redoubtable MrFish. :)

Edited by flashjazzcat
  • Like 2
Link to comment
Share on other sites

Menulets are added to the third node in the menu bar list (System menu being the first node, App menu being the second), so the most recently added menulet is always immediately after the application menu bar. The application menu bar container gets resized every time a new menulet is registered, or if one is de-registered. It's just a lot of list manipulation. In any case - we won't have room for too many menulets. :D (Although menulets will usually be 8x8 icons rather than textual items.)

I imagine a keyboard layout indicator as another menulet, similar to Windows keyboard switcher (eg. EN/DE for English/German layout or EN/CZ for us Czech users :-) ).

  • Like 1
Link to comment
Share on other sites

Jon, you sound remarkably like Conrad Lant in that interview. It was so surreal listening to the thing, because I kept picturing Cronos sitting there in his tall red boots talking Atari-tech, ha. When you mentioned "Newcastle upon Tyne", then I was like, "Oh, yeah, that's why.".

 

If you did a jazz rendition of "Countess Bathory", with just a spoken word recital of the lyrics, it would be a great hoax-recording, or just a good, totally unexpected cover to throw into your set, at a pub, ha... A lot of people have had "feature requests", but I believe that this is the first "song request", in this thread.

 

= )

  • Like 1
Link to comment
Share on other sites

BTW: Just listened to your interview with the Atari Podcast. Absolute GOLD, I tell ya. I hadn't realized how much serious Atari stuff you're involved with. A big "Bravo" to you. :)

:lol: Same as me.... Some month ago, I sent a package to Flashjazzcat. He offered me his help regarding my A800XL.

After he gave me his adress, I thought...hmmm... england... that reminds me .... what was the name of this guy

who wrote LastWord??? He' s living in england too!? I wanted to contact him also... :-D Halliday or so...

 

Stefan

  • Like 2
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...