X16Cell - a spreadsheet

User avatar
TediusTimmy
Posts: 15
Joined: Tue Apr 25, 2023 3:54 am

File Download X16Cell - a spreadsheet

Post by TediusTimmy »

This is ... a thing. I really just wanted to challenge myself with the restrictions of the X16. So, I made a spreadsheet program.

Limitations and caveats:
  • The numerics are a little sloppy, but should be fine for a household budget.
  • It is PAINFULLY slow.
Other than that... it's a spreadsheet and does spreadsheet things. The source code are available at my GitHub https://github.com/TediusTimmy/X16Cell. The code is licensed under the 3 Clause BSD license.

You are probably better off finding a copy of VisiCalc and reverse-engineering it to run on the slightly different hardware.

So you don't also have to go to GitHub:

Commands:
  • WASD and Cursor keys - Navigate the sheet
  • z or Home - Go to cell A0
  • [ - Decrease the size of the current column
  • ] - Increase the size of the current column
  • ' or " - Insert a label in this cell, overwriting previous contents
  • = or + - Insert a formula in this cell, overwriting previous contents
  • ! - Recalculate sheet
  • xx - Delete the current cell's contents
  • xr - Delete the current row's contents
  • xc - Delete the current column's contents
  • uu - Remove the current cell and shift cells right
  • uo - Remove the current cells and shift cells up
  • ur - Remove the current row
  • uc - Remove the current column
  • ii - Insert a cell and shift cells right
  • ir - Insert a row
  • ic - Insert a column
  • oo - Insert a cell and shift cells down
  • or - Insert a row below the current row
  • oc - Insert a column to the right of the current column
  • e - Edit the current cell (if it has contents)
  • q - Quit: you must follow a q with a y to really quit.
  • , - Toggle comma as the output decimal separator
  • j - Toggle row/column-major recalculation
  • k - Toggle left-to-right or right-to-left recalculation
  • l - Toggle top-to-bottom or bottom-to-top recalculation
  • n - Save file (use contents of current cell as file name)
  • m - "Load" file (use contents of current cell as file name)
  • ENTER - Exit edit mode
Formulas:
3 + @sum(A0; 2; 3; A2:B4)
5 + 2 * 3 - 7 / (3 + -5)
The supported functions are sum, count, average, min, max, trunc, round, and abs.

UPDATE 27 Oct 2023:
I reworked and removed the 14KB table. This has allowed me to:
* Increase the number of columns to 26.
* Add commands to insert and remove rows and columns.
I have also:
* Improved the performance when you aren't scrolling the screen.
* Improved the performance of file load.
* Moved to 80x30 text mode.
Not fixed:
* File load/save on real hardware.

Try It Now!

#R45
Attachments
Screen-2.0.png
Screen-2.0.png (45.19 KiB) Viewed 4641 times
calc-1.2.prg
(23.6 KiB) Downloaded 305 times
calc-1.1.prg
Fixed the A0-A1 bug.
(20.98 KiB) Downloaded 410 times
calc-1.0.prg
(20.98 KiB) Downloaded 496 times
calc-0.9.prg
(18.02 KiB) Downloaded 368 times
Last edited by TediusTimmy on Sat Oct 28, 2023 5:26 am, edited 3 times in total.
User avatar
Cyber
Posts: 482
Joined: Mon Apr 27, 2020 7:36 am

Re: X16Cell - a spreadsheet

Post by Cyber »

Yeah, it's very basic, but I'm happy to see some productivity software on X16!
DragWx
Posts: 342
Joined: Tue Mar 07, 2023 9:07 pm

Re: X16Cell - a spreadsheet

Post by DragWx »

I know this might seem silly, but the idea of a functional spreadsheet application running on the X16 made me grin like a doofus. :P

The VERA's bitmapped mode would allow a program like this to render various graphs and other data visualization charts pretty impressively, and I'm pretty sure it'd get some use even for the novelty. :P
Edmond D
Posts: 489
Joined: Thu Aug 19, 2021 1:42 am

Re: X16Cell - a spreadsheet

Post by Edmond D »

DragWx wrote: Tue May 02, 2023 6:21 pm I know this might seem silly, but the idea of a functional spreadsheet application running on the X16 made me grin like a doofus. :P

The VERA's bitmapped mode would allow a program like this to render various graphs and other data visualization charts pretty impressively, and I'm pretty sure it'd get some use even for the novelty. :P
I'd be happy to see the Excel Easter eggs ported first - https://eeggs.com/tree/279.html :D
User avatar
Daedalus
Posts: 229
Joined: Fri Nov 11, 2022 3:03 am

Re: X16Cell - a spreadsheet

Post by Daedalus »

Hey! How to I put in formulas?

To be fair, I'm sufficiently impressed that I could put a number in A1, then scroll to the right such that A1 was off screen... and when I scrolled back the number I put there was STILL THERE! What kind of computer magic is this???

Now put in mouse support! I wish to click on the cells.

Edited to add: I have some cell editing code you can have... it even works with the mouse. You use assembly, right?
Edit2: Oh! I figured out how to add formulas. It even remembers the formula when you change the numbers that it calculates! <GLEE!>
Quality of life change: Add the arrow keys to the cell movement so they work too. Can't be a legit "Productivity Program" while using the "gaming keys!"
Edit 3: I go to the git hub and see:
TediusTimmy Changes: the cursor keys can now be used for navigation,
Last edited by Daedalus on Thu May 04, 2023 12:19 am, edited 3 times in total.
User avatar
Daedalus
Posts: 229
Joined: Fri Nov 11, 2022 3:03 am

Re: X16Cell - a spreadsheet

Post by Daedalus »

DragWx wrote: Tue May 02, 2023 6:21 pm I know this might seem silly, but the idea of a functional spreadsheet application running on the X16 made me grin like a doofus. :P

The VERA's bitmapped mode would allow a program like this to render various graphs and other data visualization charts pretty impressively, and I'm pretty sure it'd get some use even for the novelty. :P
I know, right? I wanna call it "Commander Calc."
User avatar
TediusTimmy
Posts: 15
Joined: Tue Apr 25, 2023 3:54 am

Re: X16Cell - a spreadsheet

Post by TediusTimmy »

I'm sorry, but I don't really have any intention of mice or graphs. Those would probably make me need to turn to assembly, and then it wouldn't compile and run on Windows and Linux (I don't have a Mac to test with).
"Commander Calc"
-> This can be your application, which uses binary floating point, has mouse support, and displays graphs and charts.
voidstar
Posts: 494
Joined: Thu Apr 15, 2021 8:05 am

Re: X16Cell - a spreadsheet

Post by voidstar »

Running that 1.1 PRG build on DevBoard hardware !!

Commander Business Machines, ready to serve your number crunching needs :P

All in cc65? Very nice!

It's a little sluggish even at just moving the cell/cursor around. Maybe just try a 40x30 for now? (though maybe screen size isn't the current performance issue)

I think SAVE worked, but the filename came out bad and I couldn't reload the data. The save took a few seconds (2-3 seconds). I put the name in the cell and hit LOAD, but it just said file not found. There is now an extra file on the SD card, but the filename isnt readable during F7 (the filenames do appear after cycle SHIFT+ALT once). Maybe Save/Load or something using a mismatched character set convention?

What's the symbol/number at the top right? In old-school VisiCalc, the number they put up there was amount of memory remaining (at 0, couldn't enter any more data into cells).

It can almost be a Tracker - put some values/notes in the cells, and have some PLAY button :D

Cool stuff!

The only real feature I'd request is a row/col insert utility.
Attachments
IMG_0229B.jpg
IMG_0229B.jpg (220.92 KiB) Viewed 6591 times
User avatar
TediusTimmy
Posts: 15
Joined: Tue Apr 25, 2023 3:54 am

Re: X16Cell - a spreadsheet

Post by TediusTimmy »

I just dropped off the face of the Earth there, didn't I?
It's a little sluggish even at just moving the cell/cursor around.
Yes. What really needs to be done is to not redraw the whole screen every update (yes ... it is THAT bad). It isn't very performant. I was just doing a thing and making something for the X16 seemed like a fun challenge.
The save took a few seconds (2-3 seconds).
Not. Very. Performant. I would love to see someone port VisiCalc.
Maybe Save/Load or something using a mismatched character set convention?
I don't know. It's probable. Sadly, I don't have hardware to test on.
What's the symbol/number at the top right? In old-school VisiCalc, the number they put up there was amount of memory remaining (at 0, couldn't enter any more data into cells).
This is a little weird: the T says that it evaluates the sheet from top-to-bottom; the L says that it is going left-to-right; that the T is first means that it is going column-by-column, left-to-right to evaluate the sheet.
The sheet is stored in memory in a manner such that all 2000 of the available cells are backed by memory. That's part of the reason that the sheet is so small. And part of the reason that save is so slow is that it walks all 2000 cells during a save. The program limitations constrain it within memory at all times.
User avatar
TediusTimmy
Posts: 15
Joined: Tue Apr 25, 2023 3:54 am

Re: X16Cell - a spreadsheet

Post by TediusTimmy »

voidstar wrote: Sat Aug 05, 2023 11:53 pm The only real feature I'd request is a row/col insert utility.
I'm already fighting with the compiler over the size of the resulting ROM, due to keeping a 14KB table in low RAM.

About your save issue: using the emulator, I am seeing strange behavior. The name "bob.txt" saved as "BOB.TXT" and the name "BOB.TXT" saved as mojibake. I don't know where a name translation would occur, but also note that I do just pass the cell contents on to fopen(), which calls into the kernal. I believe that the C run time puts the machine into character set 2 and I don't know if I should handle that differently. Honestly, I don't know enough about the Commodore filesystem to know what I am doing: I was hoping that the user would be an expert in its idiosyncrasies. Sorry.
Attachments
Bob.png
Bob.png (14.36 KiB) Viewed 4977 times
Post Reply