Merge branch 'main' of ssh://src.le-moine.org:38172/gwh/saturn_bertolotti

This commit is contained in:
Gwenhael Le Moine 2024-09-18 14:13:58 +02:00
commit adf7370c18
No known key found for this signature in database
GPG key ID: FDFE3669426707A7
10 changed files with 160 additions and 112 deletions

39
.gitignore vendored
View file

@ -1,6 +1,14 @@
/libChf/mt_build/
/libChf/st_build/
/src/*.o
libChf/mt_build/
libChf/st_build/
src/*.o
dist/pack
dist/saturn
dist/Saturn
dist/pack
dist/saturn
dist/saturn.cat
dist/stateDir.*
dist/ROMs/*rom*
manual/saturn.toc
manual/saturn.aux
manual/saturn.cp
@ -9,14 +17,17 @@ manual/saturn.dvi
manual/saturn.info
manual/saturn.pdf
manual/saturn.ps
dist/pack
dist/saturn
dist/Saturn
dist/pack
dist/saturn
dist/saturn.cat
dist/stateDir.*
dist/ROMs/*rom*
/manual/saturn.log
manual/saturn.log
libChf/chf.tps
libChf/chf.tp
libChf/chf.toc
libChf/chf.pdf
libChf/chf.log
libChf/chf.info
libChf/chf.fns
libChf/chf.fn
libChf/chf.cps
libChf/chf.cp
libChf/chf.aux
libChf/chf.dvi
libChf/chf.ps

View file

@ -33,85 +33,85 @@ applies to its release 2.2.
@end ifinfo
@menu
* Overview::
* Initialization and exit::
* Condition generation and signal::
* General condition handling::
* Structured condition handling::
* Chf conditions::
* Message retrieval::
* Multithreading support::
* Other useful macro definitions::
* Other useful functions::
* Changes since release 1::
* Changes since release 2.1::
* Function Index::
* Data Type Index::
* Overview::
* Initialization and exit::
* Condition generation and signal::
* General condition handling::
* Structured condition handling::
* Chf conditions::
* Message retrieval::
* Multithreading support::
* Other useful macro definitions::
* Other useful functions::
* Changes since release 1::
* Changes since release 2.1::
* Function Index::
* Data Type Index::
* Concept Index::
@c @detailmenu --- The Detailed Node Listing ---
Initialization and exit
* ChfInit()::
* ChfMsgcatInit()::
* ChfStaticInit()::
* ChfWin32Init()::
* ChfExit()::
* ChfAbort()::
* Library header::
* ChfInit()::
* ChfMsgcatInit()::
* ChfStaticInit()::
* ChfWin32Init()::
* ChfExit()::
* ChfAbort()::
* Library header::
Condition generation and signal
* Generating a condition::
* Signaling a condition::
* Generating a condition::
* Signaling a condition::
Generating a condition
* ChfCondition::
* ChfEnd::
* ChfSeverity::
* ChfErrnoCondition::
* ChfCondition::
* ChfEnd::
* ChfSeverity::
* ChfErrnoCondition::
Signaling a condition
* ChfSignal()::
* ChfSignal()::
Condition handling
* Condition handlers::
* Condition descriptors::
* Condition handling state::
* Handler actions::
* Default handler::
* Condition handlers::
* Condition descriptors::
* Condition handling state::
* Handler actions::
* Default handler::
Condition handlers
* ChfHandler::
* ChfPushHandler()::
* ChfPopHandler()::
* ChfHandler::
* ChfPushHandler()::
* ChfPopHandler()::
Structured condition handling
* Syntax of structured condition handlers::
* Chf behavior during structured condition handling::
* Syntax of structured condition handlers::
* Chf behavior during structured condition handling::
Chf behavior during structured condition handling
* ChfTry::
* ChfCatch::
* ChfEndTry::
* ChfTry::
* ChfCatch::
* ChfEndTry::
Message retrieval
* Retrieving a message::
* Reserved module identifiers::
* Defining a new message retrieval subsystem::
* Retrieving a message::
* Reserved module identifiers::
* Defining a new message retrieval subsystem::
Retrieving a message
* ChfGetMessage()::
* ChfBuildMessage()::
* ChfGetMessage()::
* ChfBuildMessage()::
@c @end detailmenu
@end menu
@ -121,7 +121,7 @@ Retrieving a message
@cindex Overview
@cindex Win32 Support
The Condition Handling facility library
The Condition Handling facility library
provides a centralized, unified method of generating and
signaling exceptional conditions. This method can be used either in
conjunction with, or in alternative to, the traditional style of handling
@ -255,13 +255,13 @@ Moreover, each module using the Chf library must include the header file
@code{Chf.h} and provide some basic definitions. @xref{Library header}.
@menu
* ChfInit()::
* ChfMsgcatInit()::
* ChfStaticInit()::
* ChfWin32Init()::
* ChfExit()::
* ChfAbort()::
* Library header::
* ChfInit()::
* ChfMsgcatInit()::
* ChfStaticInit()::
* ChfWin32Init()::
* ChfExit()::
* ChfAbort()::
* Library header::
@end menu
@node ChfInit(), ChfMsgcatInit(), Initialization and exit, Initialization and exit
@ -661,7 +661,7 @@ be made:
@item CHF_MODULE_ID
This macro must expand into an integer representing the module identifier
of the module the source file belongs. The module identifiers with value
less than 10 are reserved for Chf internal use.
less than 10 are reserved for Chf internal use.
@xref{Reserved module identifiers}.
All conditions generated by the source module will use this module
@ -685,8 +685,8 @@ before including @code{Chf.h}.
@cindex Condition generation and signal
@menu
* Generating a condition::
* Signaling a condition::
* Generating a condition::
* Signaling a condition::
@end menu
@node Generating a condition, Signaling a condition, Condition generation and signal, Condition generation and signal
@ -697,10 +697,10 @@ When an unusual or noteworthy condition occurs, the application may generate
a condition that describes it.
@menu
* ChfCondition::
* ChfEnd::
* ChfSeverity::
* ChfErrnoCondition::
* ChfCondition::
* ChfEnd::
* ChfSeverity::
* ChfErrnoCondition::
@end menu
@node ChfCondition, ChfEnd, Generating a condition, Generating a condition
@ -844,7 +844,7 @@ previous section can be signaled using the following function, that starts
the condition signaling sequence.
@menu
* ChfSignal()::
* ChfSignal()::
@end menu
@node ChfSignal(), , Signaling a condition, Signaling a condition
@ -863,7 +863,7 @@ or the invoking application/thread will be terminated.
During the signaling of a condition group the following actions are
accomplished:
@table @bullet
@itemize @bullet
@item
First of all, a check is made to ensure that the Chf subsystem has been
correctly initialized. If not, the function @code{ChfAbort} is called.
@ -933,7 +933,7 @@ If an handler returned an invalid action code and it is not the condition
handler that was registered first, a new condition group is generated and
immediately signaled, containing the condition @code{CHF_F_INVALID_ACTION}
with module identifier @code{CHF_SET}.
@end table
@end itemize
@c 2.1, cibrario, 18-May-2000
@c Renamed 'condition handling' -> 'general condition handling'
@ -942,11 +942,11 @@ with module identifier @code{CHF_SET}.
@cindex Condition handling
@menu
* Condition handlers::
* Condition descriptors::
* Condition handling state::
* Handler actions::
* Default handler::
* Condition handlers::
* Condition descriptors::
* Condition handling state::
* Handler actions::
* Default handler::
@end menu
@node Condition handlers, Condition descriptors, General condition handling, General condition handling
@ -959,9 +959,9 @@ Moreover, the functions described below are available to push and pop
a condition handler to/from the condition handler stack.
@menu
* ChfHandler::
* ChfPushHandler()::
* ChfPopHandler()::
* ChfHandler::
* ChfPushHandler()::
* ChfPopHandler()::
@end menu
@node ChfHandler, ChfPushHandler(), Condition handlers, Condition handlers
@ -1043,7 +1043,7 @@ is popped from the condition stack.
The pointer @code{handler_context} may be set to the special (null) value
@code{CHF_NULL_POINTER} to indicate that the handler hasn't any private
context information.
If, in the future, the handler will request the @code{CHF_UNWIND}
action, the @code{sigsetjmp()} function invocation that established
@code{unwind_context} will appear to return again.
@ -1089,7 +1089,7 @@ if Chf hasn't been initialized.
This function pops the topmost condition handler from the handler stack and
returns to the caller.
If an error occurs during the execution, the function generates
and immediately signals one of the conditions listed below; the function
will never return directly to the caller, since all conditions have
@ -1165,7 +1165,7 @@ Returns to the caller the severity level of the condition @code{d}.
@end deftypefn
@deftypefn Macro int ChfGetLineNumber (Chf Descriptor *d)
@deftypefn Macro int ChfGetLineNumber (Chf Descriptor *d)
@cindex Line number
Returns to the caller the source line number where the condition @code{d}
@ -1221,7 +1221,7 @@ to conditions that have been generated but have not been signaled yet.
The application follows its normal control flow.
@item CHF_SIGNALING
The Condition Handling Facility is invoking the hierarchy of active
The Condition Handling Facility is invoking the hierarchy of active
condition handlers because @code{ChfSignal()} has been invoked with a
non-empty condition stack. None of the condition handlers invoked so far
has requested an unwind operation.
@ -1292,7 +1292,7 @@ The default condition handler of Chf is automatically
pushed into the condition handler stack by the Chf initialization
functions. It performs the following functions:
@table @bullet
@itemize @bullet
@item
if called during an unwind, it returns immediately to the caller,
requesting the action @code{CHF_RESIGNAL}, else
@ -1315,7 +1315,7 @@ if the @code{CHF_FATAL} condition was @strong{not} signaled during an unwind
operation, it returns to the caller requesting the action
@code{CHF_UNWIND}, otherwise it requests the action @code{CHF_RESIGNAL}.
@end table
@end itemize
@c 2.1, cibrario, 18-May-2000
@c New chapter: Structured condition handling
@ -1331,8 +1331,8 @@ simpler to implement. Chf supports both styles of condition handling;
the structured condition handling is layered above the general one.
@menu
* Syntax of structured condition handlers::
* Chf behavior during structured condition handling::
* Syntax of structured condition handlers::
* Chf behavior during structured condition handling::
@end menu
@node Syntax of structured condition handlers, Chf behavior during structured condition handling, Structured condition handling, Structured condition handling
@ -1531,9 +1531,9 @@ In summary, the following structured condition handling macros
are currently available:
@menu
* ChfTry::
* ChfCatch::
* ChfEndTry::
* ChfTry::
* ChfCatch::
* ChfEndTry::
@end menu
@node ChfTry, ChfCatch, Chf behavior during structured condition handling, Chf behavior during structured condition handling
@ -1657,9 +1657,9 @@ Some module identifiers/message sets are used for special purposes.
@xref{Reserved module identifiers}.
@menu
* Retrieving a message::
* Reserved module identifiers::
* Defining a new message retrieval subsystem::
* Retrieving a message::
* Reserved module identifiers::
* Defining a new message retrieval subsystem::
@end menu
@node Retrieving a message, Reserved module identifiers, Message retrieval, Message retrieval
@ -1667,8 +1667,8 @@ Some module identifiers/message sets are used for special purposes.
The following functions directly interact with the message retrieval subsystem:
@menu
* ChfGetMessage()::
* ChfBuildMessage()::
* ChfGetMessage()::
* ChfBuildMessage()::
@end menu
@node ChfGetMessage(), ChfBuildMessage(), Retrieving a message, Retrieving a message

View file

@ -235,7 +235,7 @@
for more than LONG_PRESS_THR milliseconds, the key stays pressed after
release.
*/
#define LONG_PRESS_THR 1000
#define LONG_PRESS_THR 750
/* Chf Module Identifiers:
Each main module of the emulator has its own Chf Module Identifier; the

View file

@ -69,6 +69,8 @@
.- */
#include <X11/Xlib.h>
/*---------------------------------------------------------------------------
Data type definitions - require config.h, machdep.h, cpu.h
---------------------------------------------------------------------------*/

View file

@ -118,8 +118,6 @@ static char rcs_id[] = "$Id: emulator.c,v 4.1 2000/12/11 09:54:19 cibrario Rel $
#include <unistd.h>
#include <sys/time.h>
#include <X11/Xlib.h>
#include "config.h"
#include "machdep.h"
#include "cpu.h"

View file

@ -79,6 +79,8 @@
.- */
#include "cpu.h"
/*---------------------------------------------------------------------------
Function prototypes
---------------------------------------------------------------------------*/

View file

@ -86,6 +86,7 @@ static char rcs_id[] = "$Id: t48.c,v 4.1 2000/12/11 09:54:19 cibrario Rel $";
#include "x11.h"
#include "args.h"
#include "debug.h"
#include "monitor.h"
#define CHF_MODULE_ID X11_CHF_MODULE_ID
#include <Chf.h>
@ -579,15 +580,12 @@ int main( int argc, char* argv[] )
CpuReset();
}
if ( opt.monitor ) {
if ( opt.monitor )
/* Call Monitor */
Monitor();
}
else {
else
/* Call Emulator directly */
Emulator();
}
return EXIT_SUCCESS;
}

View file

@ -76,8 +76,6 @@ static char rcs_id[] = "$Id: monitor.c,v 4.1 2000/12/11 09:54:19 cibrario Rel $"
#include <signal.h>
#include <errno.h>
#include <X11/Xlib.h>
#include "config.h"
#include "machdep.h"
#include "cpu.h"

37
src/monitor.h Normal file
View file

@ -0,0 +1,37 @@
#ifndef _MONITOR_H
#define _MONITOR_H 1
/* -------------------------------------------------------------------------
saturn - A poor-man's emulator of some HP calculators
Copyright (C) 1998-2000 Ivan Cibrario Bertolotti
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the documentation of this program; if not, write to
the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
For more information, please contact the author, preferably by email,
at the following address:
Ivan Cibrario Bertolotti
IRITI - National Research Council
c/o IEN "Galileo Ferraris"
Strada delle Cacce, 91
10135 - Torino (ITALY)
email: cibrario@iriti.cnr.it
------------------------------------------------------------------------- */
void Monitor( void );
#endif /*!_MONITOR_H*/

View file

@ -72,6 +72,8 @@
.- */
#include "cpu.h"
/*---------------------------------------------------------------------------
Macro/Data type definitions - require cpu.h
---------------------------------------------------------------------------*/