Jump to content
  • entries
    46
  • comments
    9
  • views
    48,007

dCalc - Get Set


k-Pack

1,236 views

Do you ever wonder if this will be my last blog entry? Well, I still think that I can write a calculator program for diamond. Its just taking me a little longer then I thought. Seems like my attention span was a little longer before getting married, getting a house, having grandchildren and ….....

 

I have started coding the screen display but first things first. The link program was loaded, then the code was added to initialize the diamond cartridge. B0 was set to 0 for High Rez. Mode and the USR(DIAMOND, INIT) was called. Then the EVENTTYPE was checked, when something happened the program ended and the READY prompt appears. The initial test run went well.

 

A call to a subroutine to set up the screen display was the next code. The subroutine to place the 21 icons on the screens and draw some lines to keep it pretty was coded. A blank button was used for most of the icons until they can be defined. (I didn't want to wait.) The initial test run did not go well.

 

Or the next, or the next, or the next. Code morphed as each minor change was made but nothing seemed to help. Then as I'm reading the code, there it was, but not in the subroutine. In the first line of code to initialize the Diamond environment was B0=0 when I should have made the location at B0 equal to 0 (POKE B0,0). The first time a function was called location B0 must have equaled 0 because poking memory location 0 with information for the next call to Diamond sent the computer into La La Land.

 

While all this was happening it became apparent that any of the information passed to diamond will not be there after the USR call. The information in location B0-B7 and W0-W7 needs to be set within the loop that is calling the Diamond function.

 

The following is one of the first attempts at icon and line placement that didn't crash the computer. As you can see its not quite there.

 

blogentry-37655-0-09126500-1397588691_thumb.jpg

 

 

The Icon placement is OK but Diamond's plot, line and box functions work in ways not similar to BASIC's. I'm almost hoping that BASIC's PLOT and DRAWTO commands can be used to finish the screen design and then I can experiment with Diamond's functions later. I'll have it figured out before my next post.

 

 

 

This little BASIC program may be my most important contribution to anyone programming the Diamond functions.

 

10 PRINT “I think I can.”,

20 GOTO 10

 

 

 

 

 

 

0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

×   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...