HSP : Hot Soup Processor ver3.6 / onion software 1997-2021(c)

title

HSP3 Update Guide

  1. Introduction
  2. Overview of HSP3 update
  3. About the provision of Linux version
  4. About the end of packaging
  5. Differences from HSP2
  6. Overview of HSP3
    1. Operating environment
    2. Add instruction
    3. Function support
    4. Real number support
    5. Plugin
    6. Module
    7. Label variable support
    8. DLL call
    9. COM call
    10. Script Editor
    11. peas editor
    12. HSPTV browser
  7. Script migration from ver2.x
    1. Change calculation order
    2. Instruction functionalization
    3. Change instructions and system variables
    4. Module function specification change
    5. Plugin specification changes
    6. Array changes
    7. Changes to the memory buffer
    8. Change peek instruction
    9. Is HSP3 difficult? (About macros compatible with HSP2)

Introduction

HSP3.6 is a new version that replaces HSP3.5. There are no major changes in specifications, and various functions have been added so that it operates as upward compatibility.

Here, about the difference between HSP3.6 and HSP3.5. Then, I will explain the differences between HSP2.x and HSP3 in general.

Overview of HSP3 update

HSP3.6 can be used in the same way as the previous HSP3 without being aware of any changes.
For more information on the features added in HSP3.6, see HSP3.6 New Feature Highlights . Also, for the detailed update history of HSP3, refer to "HSP3 update history" .

HSP3.6 New Feature Highlights

update36.htm

HSP3 update history

history.txt

A sample script that allows you to easily try out the new features added in HSP3.6 is included in the "sample / new36" folder. Please try the operation with the new sample by actually executing it.

About the provision of Linux version

For the version that runs on Linux GUI environment (X Window System) and Raspberry Pi (Raspbian) The latest version is available on github.

	git clone https://github.com/onitama/OpenHSP
		

Please get it in the form of. For details, please see the following page. It also explains how to get the latest version and how to install it.

	HSP3 for Linux/Raspberry Pi
	https://hsp.tv/make/hsp3linux_pi.html
		

About the end of packaging

The llmod3, HGIMG / HGIMGX (3D drawing plug-in) / HSP3MT (runtime) / HSPLet packages that were included in the previous full set are not included. You can continue to use the runtime included in the old package, but it is treated as deprecated and no documentation or help is provided.

These plug-in modules have outdated code and are not guaranteed to work on current Windows. Compiling and executing existing code is supported, but may not be supported in future versions.

Since the HSPDX plug-in has many old users and can be executed on the current system, the plug-in file itself is included, but it is not recommended to use it newly.

The HSP3MT runtime and libraries were created for older systems and are designed for older systems. New runtimes such as hsp3utf and hsp3_64 can be substituted. Also, since the source is released as OpenHSP, the library itself can be distributed. We have determined that it is no longer necessary.

Difference from HSP2

HSP3 is the latest version of HSP3, which has undergone a major overhaul of specifications and programs up to HSP2. While inheriting the assets such as friendliness, ease of learning, and simplicity cultivated up to ver2.61 It has been developed to provide an environment with a wider range of applications and versatility.

It will be a scripting language that can be widely used by beginners to advanced users, including migration from previous versions. I hope that.

HSP3 is built around a completely newly designed core system. This core system allows for a platform-independent scripting engine and free extension. Has an architecture. Expanded components for various platforms under a simple and powerful core system We are aiming for a system that is prepared and realizes stable portability and productivity.

By inheriting the features of the existing formats and rules and reviewing unnecessary specifications, abundant materials and past assets can be effectively utilized. It can be utilized and the threshold for moving to the next version is low.

HSP3 inherits the format and rules up to ver2.61, but it is not completely compatible.
Even if you install HSP3 newly, HSP2.x is not deleted and can be used independently.

In order to migrate the source script up to ver2.61 to ver3.0, please refer to the notes. Be sure to change the incompatible parts.

In addition, even after ver3.0 is officially released, distribution and maintenance of ver2.x will continue for a while. We would like to make an effort so that all existing users can easily migrate to ver3.0.

Overview of HSP3

For users who have used HSP2, we will introduce an overview of HSP3.

Operating environment

The HSP3 core system runs on WIN32. HSP2.x supported Windows 95 or later versions, but HSP3 uses Windows 98 or later as the operating environment. (However, it can be operated in the environment of Windows95 + InternetExplorer4 or later.)

Add instruction

In HSP2.x, image-related instructions, which were plug-in instructions, are provided as standard. Grotate, grect, gsquare commands to enlarge and rotate the image, Circle command to draw a circle, hsvcolor command to specify color by HSV, etc. Many features are supported.

Function support

You can now include functions in expressions. This replaces some instructions and system variables with functions.

Real number support

Supports real number calculation with 64-bit floating point numbers. Equipped with mathematical functions such as trigonometric functions and square roots You can perform highly accurate calculations.

Plugin

The specifications of the extension plug-in have been greatly expanded from 3.0. By creating a plugin exclusively for 3.0, you can extend the type and draw system, Allows significant system expansion, such as event management.

Almost all plug-ins up to HSP2.61 can be used as they are due to the compatibility function. In addition, all the extension plug-ins that came standard with HSP2.61 are included with the same name.

In HSP3, in addition to this, HSPINET, which specializes in HTTP and FTP network access, and Includes HGIM G3, which supports advanced 3D processing. A plug-in HSPCV specialized for more advanced image processing is included.

Module

The module function is to make the namespace of the script and the area of ​​variables independent. You can improve the reusability and maintainability of scripts. Creating user-defined instructions and module variables, It is an advanced mechanism linked to the definition of local variables. For details, see " Module Function Guide ".

Support for label variables

A label type variable is a mechanism for storing arbitrary position information of a script in a variable. By storing label information in variables, the possibilities of scripting are further expanded.

DLL call

It is possible to easily define and call an external DLL such as WIN32API. HSP2.61 loadlib related instructions and instructions included in llmod are not supported by HSP3.

COM call

Supports Windows COM component calls. You can easily use advanced technologies such as COM automation and COM events. This allows you to search and replace IE components, XML parsers, regular expressions, get RSS, etc. You can easily call the latest technology from a script.

Script Editor

Includes a new script editor. By removing the edit size limit, coloring keywords, adopting tabs, etc. It is highly functional. (Previous versions are also included as HSED3LE.EXE.) Peripheral tools (help browser, etc.) called from the script editor The upgraded version is included.

peas editor

With the peas editor, all you have to do is decide on the template (template) parts and the parameters and options. It provides a simple programming environment that automatically generates scripts. Users can write scripts in the editor as before, or just operate the mouse. You will be able to create a program.

HSPTV Browser

The HSPTV browser is included as standard. This is a content viewer that is updated over the network. You can easily download and enjoy HSP information and the latest software online.

Script migration from ver2.x

Here, for those who have already used ver2.x and those who want to migrate scripts We will inform you of changes and notes.

Change calculation order

In HSP3, the formulas prioritize each operator. As with many languages, "*" and "/" are calculated before "+" and "-". Due to this, the calculation formula up to ver2.x (processed from the left) and the result may differ. See the Language Specification Guide for more information on priorities.

Instruction functionalization

Some instructions are implemented as functions. Therefore, some of the instructions used in ver2.x can no longer be used as they are. The main functionalized instructions are:

For example, rnd a, 10 has the format a = rnd (10) .

Change instructions and system variables

The following keywords that existed in HSP 2.x have changed in 3.0. In most cases, alternative instructions allow for equivalent operation. Also, by using a macro (hsp261cmp.as) that works compatible with 2.x You will be able to have some degree of compatibility.

Modified instructions
Command name Changes
rnd rnd () format function now
gettime gettime () format function now
peek peek () format function now
wpeek wpeek () format function now
notemax It became a system variable (macro) called notemax
strlen strlen () format function now
sysinfo The function is now in the format sysinfo ()
getpath getpath () format function now
strmid strmid () format function now
instr instr () format function now
ginfo ginfo () format function now
sndload Renamed to mmload instruction
snd renamed to mmplay instruction
sndoff Renamed to mmstop instruction
skipperr Use interrupt by onerror instruction
objsend An alternative sendmsg instruction is available
palfade No alternative instructions available
palcopy No alternative instructions available
getpal Same function as palcolor
text The "hsp3util.as" module provides text and emes instructions
Changed system variables
System variable name Changes
csrx Renamed to ginfo_cx macro
csry Renamed to ginfo_cy macro
paluse Renamed to ginfo_paluse macro
dispx Renamed to ginfo_dispx macro
dispy renamed to ginfo_dispy macro
rval renamed to ginfo_r macro
gval renamed to ginfo_g macro
bval renamed to ginfo_b macro
winx Renamed to ginfo_winx macro
winy Renamed to ginfo_winy macro
cmdline Renamed to dir_cmdline macro
windir renamed to dir_win macro
curdir Renamed to dir_cur macro
exedir renamed to dir_exe macro
sysdir Renamed to dir_sys macro
prmx It is no longer necessary due to the specification change of the ginfo instruction
prmy It is no longer necessary due to the specification change of the ginfo instruction

The loadlib related instructions are DLL calls using #uselib and #func, or Or it is inherited by an external call by the callfunc function. The following instructions are not supported by HSP3. (ll_poke, ll_peek, etc. can be replaced by "dupptr instruction + poke instruction / peek function".)

Module function specification change

The specifications of the module function have been changed. If you want to pass non-numeric parameters to a user-defined instruction, you need to modify the script. Also, please note that there are some functional changes for the mref instruction. See the Language Specification Guide for more information.

Plugin specification change

It supports all plug-in rules of HSP2.5 or later, but Please note that there are some restrictions due to changes in the internal specifications of HSP3.

In other respects, the same information as HSP ver2.61 will be passed. Please note that HSP2.61 compatible plug-ins have the following restrictions. In addition, the compatibility function of the plug-in does not guarantee the operation of all HSP 2.x plug-ins.

When assigning a value to a variable from a plugin, the buffer is not automatically expanded. Be careful not to cause a buffer overflow.

For the full set archive, among the plug-ins included in ver2.61, hspda, hspdb, hspdx, Contains hspext, hspsock, hgimg (x) and header files. These plugins are exactly the same DLLs that are included in ver2.61. The file is working with the 3.0 plugin compatibility feature. (Compatibility of user-created plug-ins not included with HSP depends on each specification.)

For hspdx.dll, in palette mode due to the picload specification change of HSP3.0 The palette of imported images is not reflected. Therefore, from the image file A collection of modules that define bmppalette instructions for retrieving palette data, "Hsp3util.as" is provided. See the hspdx sample script for a use case.

Changes to arrays

The handling of array variables has changed significantly from ver3.0. In ver2.x, it was used after securing the maximum number of arrays by dim or sdim instruction. In ver3.0, it is possible to assign to an array variable without securing an array. (However, referencing the contents of an unassigned array will result in an error)

In ver2.x, arrays from 0 to 15 (in the case of numeric variables) were available by default, but There is no default reservation in ver3.0 (0 only). This difference can cause some scripts to fail while referencing the array.

Changes to the memory buffer

From HSP3, string type variables will be handled with free size data by automatic expansion. Therefore, if you create a string type array variable, multiple variable length variable buffers will be created. It will no longer be managed in a continuous memory space like up to ver2.x. As a result, when a command that directly manipulates memory such as bsave, bload, etc. is executed for a character string type array variable, I was able to access all dimensions in ver2.x, From ver3.0, it will be accessed in units of specific array elements.

I don't think there are many scripts that actually do that, Be careful when manipulating memory on string-type array variables.

Change peek instruction

The peek instruction has become a peek function, but at the same time, the character string reading function supported by ver2.x has been abolished. To perform the same processing, use the getstr instruction to set the delimited character code to 0.

Is HSP3 difficult?

Among the users who have used HSP2 so far, there are a lot of new elements in HSP3. Many people think that it has become difficult because it was introduced.

HSP3 is designed to be migrated and used by all users who have used HSP2. The major change in HSP3 is the introduction of functions, which used to be instructions. It is something that can be described in the calculation formula, and the function has not changed. Many other added functions are mechanisms for extending HSP, such as module functions and General users can easily add new functions such as external API calls (corresponding to loadlib related instructions). It is made to be usable.

With HSP3, you can write more flexibly, but each person's style is different. Since it is, you can write it in the same way as HSP2, and you do not need to use functions that you do not need. If you're used to HSP2, add a line like this to the beginning of your script: Most of the major instructions can now be executed in the same way as HSP2.

 #include "hsp261cmp.as"; ver2.61 Enable compatibility 

This is defined in "hsp261cmp.as" which exists in the common folder It is converted to an appropriate instruction so that it works with 3.0 or later by the ver2.61 compatible macro. However, the current ver2.61 compatible macro is a beta version and supports all descriptions. Not at all. Also, the priority of the calculation formula is not changed. Although it is not perfect, if it is a script to some extent, it will be 3.0 as it is It is possible to operate.

After setting the ver2.61 compatible macro, the instructions and definition files dedicated to ver3.x are provided. Please be careful not to put it.

ONION software