-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adding comments to all toolkit methods. Adding pulldown menu for prototypes. * Starting support for generating patches. Starting context sensitive menus that should make writing NewtonScript much easier. Much like NTK. * Added machine code function sample code. * Formatting. * Easier way to integrate sample scripts. * Use NS PatchFileFromARM to patch a ROM file using ARM instructions. * Disable Schlumberger Signature check. * Setting new version 2022.4.18 * Formatting * More formatting * Updating gitignore * Formatting autogenerated code. * Removing generated UI files * Linux complaints fixed. * Fix for MSWindows * More fixes for MSWindow
- Loading branch information
1 parent
afe1e32
commit abe2a5f
Showing
34 changed files
with
1,274 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,6 @@ jobs: | |
- uses: DoozyX/[email protected] | ||
with: | ||
source: '.' | ||
exclude: './libffi* ./portaudio ./Packages ./Resources ./Drivers' | ||
exclude: './libffi* ./portaudio ./Packages ./Resources ./Drivers ./Toolkit/TFLSampleScripts.cpp ./Toolkit/TFLSampleScripts.h' | ||
extensions: 'h,cpp,t,mm,c' | ||
clangFormatVersion: 13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// | ||
// NewtonScript example: Hello, World! | ||
// | ||
|
||
kAppName := "Hello:WONKO"; | ||
kAppSymbol := '|Hello:WONKO|; | ||
kAppLabel := "Hello"; | ||
|
||
newt.theForm := { | ||
viewBounds: { | ||
left: 0, top: 50, right: 200, bottom: 120 | ||
}, | ||
_proto: protoFloatNGo | ||
}; | ||
|
||
helloButton := { | ||
text: "Say Hello", | ||
viewBounds: { | ||
left: 50, top: 25, right: 150, bottom: 50 | ||
}, | ||
buttonClickScript: func() | ||
begin | ||
ModalConfirm( | ||
"Hello World of NewtonScript.\r\rHow exciting to see you!", | ||
[ "OK" ] | ||
); | ||
end, | ||
_proto: protoTextButton | ||
}; | ||
AddStepForm( newt.theForm, helloButton); | ||
StepDeclare( newt.theForm, helloButton, 'helloButton); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// NewtonScript example: Native Call | ||
// | ||
// How to write ARM machine code within NewtonScript. | ||
// | ||
|
||
kAppName := "Hello:WONKO"; | ||
kAppSymbol := '|Hello:WONKO|; | ||
kAppLabel := "Hello"; | ||
|
||
newt.theForm := { | ||
viewBounds: { | ||
left: 0, top: 50, right: 200, bottom: 120 | ||
}, | ||
_proto: protoFloatNGo | ||
}; | ||
|
||
mathFunction := { | ||
_proto: protoStaticText, | ||
text: "4+8 =", | ||
viewBounds: RelBounds(50, 25, 30, 20) | ||
}; | ||
AddStepForm(newt.theForm, mathFunction); | ||
StepDeclare(newt.theForm, mathFunction, 'mathFunction); | ||
|
||
mathResult := { | ||
_proto: protoStaticText, | ||
nativeMath: { | ||
class : 'BinCFunction, | ||
numArgs: 2, | ||
offset: 0, | ||
code: MakeBinaryFromARM(" | ||
ldr r1, [r1] @ Unref the first argument | ||
ldr r1, [r1] @ Get the integer object | ||
mov r1, r1, lsr #2 @ convert it into an integer | ||
ldr r2, [r2] | ||
ldr r2, [r2] @ do the same with the second arg | ||
mov r2, r2, lsr #2 | ||
add r0, r1, r2 @ add both integers | ||
mov r0, r0, lsl #2 @ convert the result into an integer object | ||
mov pc, lr @ return to the interpreter | ||
") | ||
}, | ||
newtonScriptMath: func(a, b) begin | ||
return a+b; | ||
end, | ||
ViewSetupFormScript: func() begin | ||
SetValue(self, 'text, NumberStr( self:nativeMath(4, 8) ) ); | ||
end, | ||
text: "Result", | ||
viewBounds: RelBounds(80, 25, 80, 20) | ||
}; | ||
AddStepForm(newt.theForm, mathResult); | ||
StepDeclare(newt.theForm, mathResult, 'mathResult); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# data file for the Fltk User Interface Designer (fluid) | ||
version 1.0400 | ||
avoid_early_includes | ||
header_name {.h} | ||
code_name {.cpp} | ||
data kToolkitSampleScriptHelloWorld {selected public local filename {SampleScripts/HelloWorld.ns} textmode | ||
} | ||
|
||
data kToolkitSampleScriptNativeFunction {public local filename {SampleScripts/NativeFunction.ns} textmode | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.