Thursday 19 September 2019

Keeping it Simple


One think that’s been bobbing about at the back of my mind is making the code easy to customise – In particular the various components of the data signal. At present they are pretty much hard coded into the code for development, but going forwards I’m going to move away from that idea, so that if someone did not want to use any of the “standard” setups, they can amend the signal to cover whatever is needed.


The easiest way to do this would be to include an additional header/include file that only contains the definitions of what the magazine size is and what each byte will be. When compiled these would then be included in the code, without having to edit the code at all.

The actual values would be in the documentations, though it would also not be too bad to ad a comment section to the file with the same information, or at least a summary of the information as well.


Pretty much the format below:


#define magazine_size 30

#define signal_byte_1 01

#define signal_byte_2 00

#define signal_byte_3 00

#define signal_byte_4 00

#define signal_byte_5 00


//this would be a standard 1 hit damage shot with a magazine size of 30


With comments in the define file giving the value options. That way the only changes needed are in the HFA_Setup.INC or HFA_setup.H files to change the pewpew behaviour


If do implement a 2nd mode switch (I.e. Kill/stun) also include


#define signal2_byte_1 02

#define signal2_byte_2 01

#define signal2_byte_3 00

#define signal2_byte_4 00

#define signal2_byte_5 00


This would be a stun shot with 5 minute duration.


So the full include/header file for a 30 shot magazine, 1 point no special damage alternate fire mode of 5 minute stun would be:


/*************************************************************

HFA_Setup.H – set the customisable data for the Heretik Forge/Arcturus

                                IR Emitter circuit. This enables anyone who is willing to

                                Customise the output for the circuits to go alongside

                                The “standard” setups that are ready and in the case

                                Of the C/Pic files already compiled into the Hex file

                                Ready to burn onto the chip

*************************************************************

Created: 19/9/19 by Ady: heretikforge@gmail.com

*************************************************************/

#define magazine_size 30


#define signal_byte_1 01

#define signal_byte_2 00

#define signal_byte_3 00

#define signal_byte_4 00

#define signal_byte_5 00


#define signal2_byte_1 02

#define signal2_byte_2 01

#define signal2_byte_3 00

#define signal2_byte_4 00

#define signal2_byte_5 00

No comments:

Post a Comment