apemax Posted April 21, 2010 Share Posted April 21, 2010 I don't know if anyone knows what nerpnrn.h is? it's says its a C/C++ header file. i noticed it in the levels folder. here's the contents in the spoiler: // These are bit I seemed to have in every NRN file. // Bypass everything if objective still showing - will get past this when space pressed //GetObjectiveSwitch ? SetMessagePermit 0 //GetObjectiveSwitch ? :Skip //GetObjectiveShowing = 1 ? :Skip _GetObjectiveSwitch() ? _SetMessagePermit(0) _GetObjectiveSwitch() ? :SkippedSkip _GetObjectiveShowing() = 1 ? :Skip SkippedSkip: //Set wait times (sample length multiplier, time added after sample, time for no sample) TRUE ? _SetMessageTimerValues(1000,1000,10000) //GetOxygenLevel = 0 ? SetLevelFail //R0 is used as a general counter TRUE ? _AddR0(1) // Record function numbers TRUE ? _SetR6(0) // Jump to after the standard labels below TRUE ? :end Wbe: _GetMessageTimer() > 0 ? Stop TRUE ? _SetTimer0(0) TRUE ? _SetR0(0) TRUE ? _AddR5(1) Stop Skip: TRUE ? _SetTutorialFlags(4095) TRUE ? _SetMessagePermit(1) TRUE ? _SetTimer0(0) TRUE ? _SetTimer1(0) TRUE ? _SetTimer2(0) TRUE ? _SetR0(0) TRUE ? _SetR1(0) // This is just reset here, but not used TRUE ? _SetR5(0) TRUE ? _SetR7(1) TRUE ? _CameraUnlock() Stop Next: TRUE ? _AddR3(1) Clear: TRUE ? _SetR0(0) TRUE ? _SetTimer0(0) TRUE ? _AddR7(_GetR5()) TRUE ? _SetR5(0) Stop finish: Stop Complete: _GetMessageTimer() > 0 ? Stop TRUE ? _SetLevelCompleted() Stop // Continue running from here... end: // IMPORTANT NOTES: ///////////////////// // Register 0 is reserved for per-message counting // Register 2 is reserved for auto-function calling // Register 3 is reserved for current-function counter // Register 4 is reserved for initial function message number // Register 5 is reserved for per-function message offset // Register 6 is reserved for auto-function calling // Register 7 is reserved for automatic message numbering // thus leaving register 1 spare, which shall probably be needed for further NERPS++ development. // Maybe sometime it could be an idea to set aside // some extra registers especially for the above. // First of all, lets timestamp this file. ;;;;;;;;;;;;;;;;;;;;; ; NERPs Source File ; ;;;;;;;;;;;;;;;;;;;;; ; Generated ; __DATE__ ;;;;;;;;;;;;;;;;;;;;; ; Stamp it here: __TIME__: ;;;;;;;;;;;;;;;;;;;;; // Include command macros #include <nerpdef.h> // These are standard macros ///////////////////////////////////////////////////////////////////////////////// // Internally Used Macros // ///////////////////////////////////////////////////////////////////////////////// // Prints message onscreen - used internally #define msg(x) TRUE ? _SetR4(x) \ TRUE ? _AddR4(_GetR5()) \ _GetR0() = 1 ? _SetMessage(_GetR4(),0) // Prints message onscreen WITHOUT arrows - used internally #define msgn(x) TRUE ? _SetR4(x) \ TRUE ? _AddR4(_GetR5()) \ _GetR0() = 1 ? _SetMessage(_GetR4(),1) ///////////////////////////////////////////////////////////////////////////////// // Message Printing // ///////////////////////////////////////////////////////////////////////////////// // Increment message until x - waits for previous message to finish #define wait(x) _GetR5() < x ? :wbe // Removes messages from window #define Clear() _SetMessage(_GetR4(),1) \ TRUE ? _SetMessagePermit(1) ///////////////////////////////////////////////////////////////////////////////// // Function Types // ///////////////////////////////////////////////////////////////////////////////// // Defines function start and decides whether to skip it or not #define Func(x) TRUE ? _AddR6(1) \ TRUE ? _SetR2(1) \ TRUE ? _AddR2(_GetR3()) \ _GetR2() != _GetR6() ? :\ x/ \ x: \ msg( _GetR7() ) // (Without arrows)Defines function start and decides whether to skip it or not #define Funcn(x) TRUE ? _AddR6(1) \ TRUE ? _SetR2(1) \ TRUE ? _AddR2(_GetR3()) \ _GetR2() != _GetR6() ? :\ x/ \ x: \ msgn( _GetR7() ) // This is a function that does not print any messages whatsoever #define Function(x) TRUE ? _AddR6(1) \ TRUE ? _SetR2(1) \ TRUE ? _AddR2(_GetR3()) \ _GetR2() != _GetR6() ? :\ x/ \ x: \ // Defines function end - place to skip to #define FuncEnd(x) TRUE ? :Next \ x/: // Restart functions #define Start() TRUE ? _SetR3() 0 \ TRUE ? _SetR6() 0 \ Stop // Defines start of main function #define Main() __MainFunc: // Defines end of main function #define MainEnd() TRUE ? :Complete // Jump to label #define goto(x) Link to comment Share on other sites More sharing options...
Addictgamer Posted April 21, 2010 Share Posted April 21, 2010 Ah yes, we actually found this out along time ago. It is the header file for the nerps scripting language. If you look through some of the nrn's and nrm's, you will notice that they are pseudo c/c++ code. And, some of them link to nerpnrn.h. The purpose of nerps is to script goals, when slugs emerge, and other very useful things. Yes, the wiki is full of information on the nerps language. Oh, and here is the wiki link to the article on nerpnrn.h: Click here. Is there anything else you want to know? If so, just ask :) Link to comment Share on other sites More sharing options...
apemax Posted April 21, 2010 Author Share Posted April 21, 2010 aah... ok. i don't think there's anything else i need to know. thanks. :) Link to comment Share on other sites More sharing options...
ogun Posted April 28, 2010 Share Posted April 28, 2010 The .nrN files are the source for NERPS scripts. They then seem to be run through the C pre-processor to generate .nrM files, which are then compiled into .npl. My compiler is capable of doing the last step, so in fact the only part missing to be able to compile .nrN into .npl is the missing nerpdef.h file, which defines all the macros for the NERPS functions. Link to comment Share on other sites More sharing options...
Anonymouse Posted April 28, 2010 Share Posted April 28, 2010 The .nrN files are the source for NERPS scripts. They then seem to be run through the C pre-processor to generate .nrM files, which are then compiled into .npl. My compiler is capable of doing the last step, so in fact the only part missing to be able to compile .nrN into .npl is the missing nerpdef.h file, which defines all the macros for the NERPS functions. Isn't there an intermediate part between nrN and npl? Some kind of assembly/er? Link to comment Share on other sites More sharing options...
ogun Posted April 29, 2010 Share Posted April 29, 2010 The .nrN files are the source for NERPS scripts. They then seem to be run through the C pre-processor to generate .nrM files, which are then compiled into .npl. My compiler is capable of doing the last step, so in fact the only part missing to be able to compile .nrN into .npl is the missing nerpdef.h file, which defines all the macros for the NERPS functions. Isn't there an intermediate part between nrN and npl? Some kind of assembly/er? I took the quick and easy path in my compiler. As I was working out the format of the bytecode stream, I wrote a disassembler. As that was done, I wrote an assembler that could take the disassemled file and put it back into the same bytcode it came from. When I then wrote the compiler part, I just had it create an assembler source in memory and feed that to the assembler itself. You could compile directly to bytecode but as said I took the easy path I have by the way recreated bits of nerpdef.h and successfully compiled 01.nrn into a working 01.npl. Will expand that file over the coming days. Link to comment Share on other sites More sharing options...
Recommended Posts