Sunday, 14 December 2025

MEGAphone User Interface and Text Messaging Software

This post is really just a summary of the work done for the telephony software user interface and SMS/Text messaging user interface.  Various other posts describe the considerable work done to achieve this, and the requirements of the software. 

This software is one area that I think is fair to say that I underestimated the work required. That said, the result is much better than I had originally anticipated -- we have a full anti-aliased proportional text rendering engine that can even display emoji and other arbitrary unicode characters, and with quite good performance -- no mean feat on a machine with 384KB RAM and a 40MHz 8-bit processor!  

The architecture that it has ended up with for the software is quite sound, and fairly easy to extend now, with a very modular structure, which I exploit since a single ~50KB program file (the practical limit with the C64 memory layout and compiler tool-chain I'm using) can't fit everything.  A 4KB shared state structure is passed between the sub-programs that are loaded practically instantly from the SD card.

Speaking of compilers, a fair bit of work went into switching from CC65 to MOS-LLVM to improve performance and code density, as well as getting LLVM's much better compiler warnings and errors.

The net result is something that looks quite credible and on a similar graphical standing to the Nokia S60-series of phones.  Before we jump into the technicality of what's been done, and mapping that to the milestones for the NLnet grant that has so generously supported this work, let's have a look at some representative screen-shots and a short video that shows the user-interface in action.

 

Let's start with the status bar at the top of the display, where we have both network signal strength and battery charge information in the top-right. Both of these are already "live", and will reflect the real phone state once we hook the cellular modem in: 

Then on the top-left we have the time and phone network information, again live and pending only the cellular modem integration to become fully active:
Between the two of these is space for message and other notifications.

So let's look now at the user-interface itself. Again we can see the use of the nice proportional text. I know I mentioned it before, but I'm still really quite pleased with the result -- remember this computer has so little RAM (intentionally), that a 720x400 pixel frame buffer with 8-bit colour depth would require 288KB, leaving very little RAM left for either code or data.  So instead it is implemented using the VIC-IV's crazy text modes, which allow for variable width characters, hardware anti-aliasing and a variety of other subtle features that make this feat possible.  

This is also why the display draws so quickly: The software doesn't have to render pixels -- it renders characters, and the anti-aliasing and other compositing effects are all done in hardware. 

But back to the UI...

First up we have the default display of the phone, with dialpad on the left and contact list on the right. In terms of core telephony, this is the heart of what matters, so we've made it simple.  The side-by-side layout means that you don't have to swap between the views endlessly.  You can scroll up and down through the contacts, or add new contacts as needed.
 

By hitting F1, we can copy the phone number of a contact into the dial-pad, ready to dial:

Hit F1 a second time, and it will place the call. Now we see the dialer state change, with the call button changing from green to yellow that call is being established. The cross also goes to red to indicate that we can end the call by hitting that. Also I've hit the "mute button", causing that to go red.  
Both the call-establishing and mute activated buttons blink, so that you have a visual indicator to remind you that they are active (see below). Again, the blinking is done in hardware, so the software doesn't have to do anything to maintain the display:

The other main part of the display -- and that can be used during a call as well as when the phone is idle -- is that contact list. Hitting F3 (or tapping on the contact -- I've been listing keyboard short-cuts for things above that I use for ease of development, but all of them map to the touch-interface as well) brings up the SMS thread for that contact, from where we can read and write SMS messages. 

Being able to text back and forth while in a call is one of those things that I personally find quite useful, but is absurdly convoluted to do on most phones.

So that's a quick guide through the user-interface for telephony, contacts and text messages.

But let's now attend to the specific milestones associated with this work:

m. 1.4 Telephony software User-Interface: Requirements Specification 

So let's look at the requirements for the telephony software:

1. Dialpad that allows dialing.

Visible in the demonstration video. 

2. Contact list that allows storage of contacts, including creation and editing of contacts.

Visible in the demonstration video. 

3. Ability to dial based on contacts, including showing the name of a contact.

4. Scrolling through contact list.

Demonstrated in this blog post: https://c65gs.blogspot.com/2025/11/megaphone-contact-list-and-dialer.html 

5. Selecting a contact to view the SMS message thread for. 

6. Implementation of call state management.

7. UI elements update according to call state.

8. Telephone battery status indication.

9. Cellular network status information. 

n. 1.4 Telephony software User-Interface: Implementation
o. 1.4 Telephony software User-Interface: Testing
p. 1.4 Telephony software User-Interface: Revision

The evidence for these three milestones is presented in this post (implementation), and in previous posts where the software has been implemented, tested and revised to reach the point of demonstration in this blog post that satisfies the requirements of this component.

The source code is as usual at https://github.com/MEGA65/megaphone-modular/tree/main/src/telephony

In terms of evidence of progress, the development of the software is covered in multiple blog-posts, e.g.:

https://c65gs.blogspot.com/2025/06/accessing-shared-resources-from-mega65.html

https://c65gs.blogspot.com/2025/07/megaphone-call-sms-and-contacts.html

https://c65gs.blogspot.com/2025/08/megaphone-software-tools-and-laying.html

https://c65gs.blogspot.com/2025/09/stack-backtrace-on-mega65-using-mos-llvm.html

https://c65gs.blogspot.com/2025/10/simple-memory-protection-scheme.html

https://c65gs.blogspot.com/2025/10/sms-thread-display-message-editing-etc.html

https://c65gs.blogspot.com/2025/11/megaphone-contact-list-and-dialer.html

https://c65gs.blogspot.com/2025/12/megaphone-contact-list-and-dialer.html 

u. 1.6 Text Messaging Software: Requirements Specification 

1. Ability to display SMS messages.

2. Ability to draft SMS messages.

3. Ability to request the sending of an SMS via the cellular network. 

4. Logging of a sent SMS message.

5. Differentiation between received and sent SMS messages.

6. Scrolling through SMS messages.

In addition, we had stretch-goals of:

7. Supporting international characters in SMS messages.

8. Supporting emoji in SMS messages.  

v. 1.6 Text Messaging Software: Implementation
w. 1.6 Text Messaging Software: Testing
x. 1.6 Text Messaging Software: Revision 

The evidence for these three milestones is presented in this post (implementation), and in previous posts where the software has been implemented, tested and revised to reach the point of demonstration in this blog post that satisfies the requirements of this component.

The source code is as usual at https://github.com/MEGA65/megaphone-modular/tree/main/src/telephony

The same blog-posts referenced above also cover the process of developing this software.

No comments:

Post a Comment