Old 8-bit computer command ideas in a console program

Just starting out? Need help? Post your questions and find answers here.
Desert Polar Bear
User
User
Posts: 25
Joined: Thu Feb 04, 2021 9:27 pm
Location: Nowhere Special, Arizona, USA

Old 8-bit computer command ideas in a console program

Post by Desert Polar Bear »

Short version: Trying to replicate three old 8-bit computer commands in a console program running on a Mac, so I can't cheat with DLLs, but maybe some kind of Mac magic behind the curtains?

1) BEEP. I accidentally found the command NSBeep_() in some source code on a forum message. It works, but I can't find any documentation on it anywhere. Also, I suspect there are number of other commands with the underscore "{Command}_()" syntax. How can I learn more about these?

2) CLEAR - Clear all numeric variables to 0 and all strings to "". Admittedly, this is kind of crazy, but...um...reasons!

3) SCREEN$ - Capture the console display and save as image.

4) SOUND - Generate specific frequency and wavelength tones without loading an mp3/ogg/Flac sound file.

Any help would be greatly appreciated. :?
"You should never judge a book by its cover."
"A picture is worth a thousand words."

Well, which...? Shuddup!
Image
- Desert Polar Bear • Nowhere Special • Arizona, USA
User avatar
Demivec
Addict
Addict
Posts: 4260
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: Old 8-bit computer command ideas in a console program

Post by Demivec »

Desert Polar Bear wrote:2) CLEAR - Clear all numeric variables to 0 and all strings to "". Admittedly, this is kind of crazy, but...um...reasons!
Define all variables, both numeric and string, within a structure. Use ResetStructure() to reset all as at first (numeric = 0, strings = "" or more accurately null).

Code: Select all

Structure all_vars
  ; change the names and typed to match your needs 
  n1.i
  n2.i
  n3.b 
  s1.s
  s2.s
  ; and so on
EndStructure 

Define vars.all_vars

vars\n3 = 5
vars\s2 = " blah "
Debug vars\n3
Debug vars\s2
ResetStructure(@vars,  all_vars)
Debug vars\n3
Debug vars\s2
User avatar
TI-994A
Addict
Addict
Posts: 2700
Joined: Sat Feb 19, 2011 3:47 am
Location: Singapore
Contact:

Re: Old 8-bit computer command ideas in a console program

Post by TI-994A »

Desert Polar Bear wrote:...some kind of Mac magic behind the curtains?
These might be of interest:

> MacOS Carbon APIs

> MacOS Cocoa APIs
Texas Instruments TI-99/4A Home Computer: the first home computer with a 16bit processor, crammed into an 8bit architecture. Great hardware - Poor design - Wonderful BASIC engine. And it could talk too! Please visit my YouTube Channel :D
Desert Polar Bear
User
User
Posts: 25
Joined: Thu Feb 04, 2021 9:27 pm
Location: Nowhere Special, Arizona, USA

Re: Old 8-bit computer command ideas in a console program

Post by Desert Polar Bear »

Demivec wrote:Define all variables, both numeric and string, within a structure.
Very cool. I have no experience with the Structure command, so I'm looking forward to learning more about it. Thanks!
"You should never judge a book by its cover."
"A picture is worth a thousand words."

Well, which...? Shuddup!
Image
- Desert Polar Bear • Nowhere Special • Arizona, USA
Desert Polar Bear
User
User
Posts: 25
Joined: Thu Feb 04, 2021 9:27 pm
Location: Nowhere Special, Arizona, USA

Re: Old 8-bit computer command ideas in a console program

Post by Desert Polar Bear »

TI-994A wrote:
Desert Polar Bear wrote:...some kind of Mac magic behind the curtains?
These might be of interest:

> MacOS Carbon APIs

> MacOS Cocoa APIs
Sakes! I've stepped in it now. Gonna have to put on my thinking cap for this stuff. Many thanks!
"You should never judge a book by its cover."
"A picture is worth a thousand words."

Well, which...? Shuddup!
Image
- Desert Polar Bear • Nowhere Special • Arizona, USA
Bitblazer
Enthusiast
Enthusiast
Posts: 761
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: Old 8-bit computer command ideas in a console program

Post by Bitblazer »

Desert Polar Bear wrote:Short version: Trying to replicate three old 8-bit computer commands in a console program running on a Mac, so I can't cheat with DLLs, but maybe some kind of Mac magic behind the curtains?

1) BEEP. I accidentally found the command NSBeep_() in some source code on a forum message. It works, but I can't find any documentation on it anywhere. Also, I suspect there are number of other commands with the underscore "{Command}_()" syntax. How can I learn more about these?
Seems you refer to windows API calls.

The MSDN has all the information for those (Beep). Check Section 5.3 of the PureBasic Survival Guide
Last edited by Bitblazer on Mon Feb 15, 2021 5:21 pm, edited 1 time in total.
Desert Polar Bear
User
User
Posts: 25
Joined: Thu Feb 04, 2021 9:27 pm
Location: Nowhere Special, Arizona, USA

Re: Old 8-bit computer command ideas in a console program

Post by Desert Polar Bear »

Bitblazer wrote:Seems you refer to windows API calls.
Running on a Mac, so not sure that's gonna work.

Thanks all the same, though! :)
"You should never judge a book by its cover."
"A picture is worth a thousand words."

Well, which...? Shuddup!
Image
- Desert Polar Bear • Nowhere Special • Arizona, USA
User avatar
mk-soft
Always Here
Always Here
Posts: 6207
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Old 8-bit computer command ideas in a console program

Post by mk-soft »

My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Desert Polar Bear
User
User
Posts: 25
Joined: Thu Feb 04, 2021 9:27 pm
Location: Nowhere Special, Arizona, USA

Re: Old 8-bit computer command ideas in a console program

Post by Desert Polar Bear »

Many thanks!
"You should never judge a book by its cover."
"A picture is worth a thousand words."

Well, which...? Shuddup!
Image
- Desert Polar Bear • Nowhere Special • Arizona, USA
Post Reply