First reorganization

This commit is contained in:
Thomas Touhey 2016-05-15 14:00:40 +02:00
parent 63118d7b73
commit a708870ec5
57 changed files with 99 additions and 3609 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/obj
/Sound4Calc.sublime-workspace

View File

@ -1,48 +1,64 @@
.PHONY: all mrproper send
#!/usr/bin/make -f
# INCLUDE CONFIGURATION
include $(CURDIR)/Makefile.cfg
PREFIX = sh3eb-elf-
AS = $(PREFIX)as
CC = $(PREFIX)gcc
CXX = $(PREFIX)g++
OBJCOPY = $(PREFIX)objcopy
WRAPPER = g1a-wrapper
SEND = UsbConnector
# DEDUCED VARS
ALLOBJ = $(SRC:%=$(OBJDIR)/%.o)
FLAGS = -m3 -mb -Os -nostdlib
CFLAGS = -W -Wall -Wno-main -pedantic -std=c11
INCLUDE = -I. -Iinclude -isystem stdinc
LIBS = -Llib -lgcc -lfx
NAME = sound
# RULES
## Make it all (default rule)
all: $(NAME).g1a
OBJ = build/Sound4Calc.o build/crt0.o build/syscall.o
ICON = icon.bmp
## Make the object directory
$(OBJDIR):
mkdir -p $(OBJDIR)
## Make an object file out of an ASM source file
$(OBJDIR)/%.o: $(SRCDIR)/%.s
$(AS) -c -o $@ $<
all: build/$(NAME).bin
@ $(WRAPPER) build/$(NAME).bin -o bin/$(NAME).g1a
@ echo "Build finished."
@ stat -c "Output size is %s bytes." bin/$(NAME).g1a
## Make an object file out of a C source file
$(OBJDIR)/%.o: $(SRCDIR)/%.c
$(CC) -c -o $@ $< $(CFLAGS)
build/$(NAME).bin: build/$(NAME).elf
@ $(OBJCOPY) -R .comment -R .bss -O binary build/$(NAME).elf build/$(NAME).bin
## Make the ELF file
$(NAME).elf: $(OBJDIR) $(ALLOBJ)
$(LD) -o $@ $(ALLOBJ) $(LFLAGS)
build/$(NAME).elf: bin/addin.ld $(OBJ)
@ $(CC) $(FLAGS) $(OBJ) -T"bin/addin.ld" -o build/$(NAME).elf $(LIBS)
## Make the BIN file
$(NAME).bin: $(NAME).elf
$(OBJCOPY) -R .comment -R .bss -R '$$iop' -O binary $< $@
build/%.o: %.c
@ $(CC) $(FLAGS) -c $^ -o $@ $(INCLUDE) $(CFLAGS)
## Make the G1A file
$(NAME).g1a: $(NAME).bin
$(WRAPR) $< -o $(NAME).g1a
@stat -c "Build finished -- output size is %s bytes." $(NAME).g1a
build/%.o: %.s
@ $(AS) -c $^ -o $@
## Clean up your mess
clean:
$(RM) $(ALLOBJ)
$(RM) $(NAME).elf
$(RM) $(NAME).bin
## Clean up everything
mrproper: clean
$(RM) $(NAME).g1a
fclean: mrproper
## Remake
re: fclean all
## Send to calc
send:
@ cp bin/$(NAME).g1a $(NAME).g1a
@ $(SEND) SEND $(NAME).g1a $(NAME).g1a fls0
@ rm -f $(NAME).g1a
mrproper:
rm -f build/*.o
rm -f build/$(NAME).elf
rm -f build/$(NAME).bin
@if [ ! -f $(NAME).g1a ]; then \
echo "Please make before sending." >&2; false; \
fi
@if $(SENDR) SEND $(NAME).g1a $(NAME).g1a fls0 1>/dev/null; \
then true; \
else echo "UsbConnector: calculator not plugged-in/in receive mode" >&2; \
false; \
fi
## Phuneral phuture ?
.PHONY: all clean fclean mrproper re send
# END OF FILE

41
Makefile.cfg Normal file
View File

@ -0,0 +1,41 @@
#!/usr/bin/make -f
# PROJECT INFORMATION
NAME = Sound4Calc
ICON = ./icon.bmp
LIB = gcc fx
## DIRECTORIES
SRCDIR = ./src
INCDIR = ./include
OBJDIR = ./obj
LIBDIR = ./lib
SCPTDIR = ./scripts
# TOOLCHAIN
## Directory maker
MD = mkdir -p
## File remover
RM = rm -f
## Assembler
AS = sh3eb-elf-as
## C compiler
CC = sh3eb-elf-gcc
CFLAGS = -m3 -mb -Os -nostdlib -Wall -Wextra -Wno-main -pedantic -std=c11 -I $(INCDIR)
## Linker
LD = sh3eb-elf-ld
LFLAGS = -T $(SCPTDIR)/addin.ld -L $(LIBDIR) $(addprefix -l,$(LIB))
## Object copier
OBJCPY = sh3eb-elf-objcopy
## G1A Wrapper
WRAPR = g1a-wrapper
## Sender
SENDR = UsbConnector
# SOURCES
SRC = crt0 Sound4Calc syscall
# INCLUDES
INC = dispbios endian filebios fxlib keybios syscall timer \
Sound4Calc
# END OF FILE

View File

@ -1,576 +0,0 @@
{
"auto_complete":
{
"selected_items":
[
[
"a",
"a"
],
[
"ma",
"math"
],
[
"ml",
"ML_display_vram"
],
[
"boat_",
"boat_r"
],
[
"bot_",
"boat_r"
],
[
"bot",
"boat_r"
],
[
"l",
"l"
],
[
"hl",
"hl"
],
[
"c",
"c"
],
[
"d",
"d"
],
[
"L",
"Load_polygone_loop2"
],
[
"proprié",
"propriété"
],
[
"Del",
"Delta_Y"
],
[
"D",
"Delta_X"
],
[
"__",
"__base_printf"
],
[
"be",
"before"
]
]
},
"buffers":
[
{
"file": "Sound4Calc.c",
"settings":
{
"buffer_size": 5121,
"line_ending": "Unix"
}
},
{
"file": "addresses.h",
"settings":
{
"buffer_size": 40864,
"line_ending": "Unix"
}
},
{
"file": "Makefile",
"settings":
{
"buffer_size": 1104,
"line_ending": "Unix"
}
},
{
"file": "Sound4Calc.h",
"settings":
{
"buffer_size": 215,
"line_ending": "Unix"
}
}
],
"build_system": "",
"build_system_choices":
[
],
"build_varint": "",
"command_palette":
{
"height": 0.0,
"last_filter": "",
"selected_items":
[
],
"width": 0.0
},
"console":
{
"height": 153.0,
"history":
[
]
},
"distraction_free":
{
"menu_visible": true,
"show_minimap": false,
"show_open_files": false,
"show_tabs": false,
"side_bar_visible": false,
"status_bar_visible": false
},
"file_history":
[
"/home/ulimit/Bureau/Sound4Calc/Sound4Calc.sublime-workspace",
"/home/ulimit/.config/sublime-text-3/Packages/User/C++.sublime-settings",
"/home/ulimit/Bureau/Sound4Calc/Sound4Calc.h",
"/home/ulimit/Bureau/Sound4Calc/crt0.s",
"/home/ulimit/Bureau/CasioUsb-Files-14276/CasioUsb-Sources/Makefile",
"/home/ulimit/Bureau/Sound4Calc/Sound4Calc.c",
"/home/ulimit/Bureau/Sound4Calc/.git/refs/remotes/origin/master",
"/home/ulimit/Bureau/Sound4Calc/.git/refs/heads/master",
"/home/ulimit/.cache/.fr-hsDhJT/Sound4Calc-master-ea3869585beb9d01cd849a1ec4ee6a9f1551e9c4/Sound4Calc.c",
"/home/ulimit/Bureau/Git_depot/.git/config",
"/home/ulimit/.cache/.fr-HaPj72/GeometryDash-master-2de6dc00c6d375594eed64bc489aa43c44d0b05f/Menu.cpp",
"/home/ulimit/.cache/.fr-2XLUx2/GeometryDash-master-2de6dc00c6d375594eed64bc489aa43c44d0b05f/Menu.hpp",
"/home/ulimit/.cache/.fr-jL6Cxs/GeometryDash-master-2de6dc00c6d375594eed64bc489aa43c44d0b05f/README.md",
"/media/ulimit/Chang/Comté/.~lock.comté ecrit.odt#",
"/home/ulimit/.cache/.fr-8aSPsA/SCIFTEST.c",
"/home/ulimit/Bureau/Sound4Calc/autre/syscall.s",
"/home/ulimit/Bureau/Sound4Calc/syscall.h",
"/home/ulimit/Bureau/Sound4Calc/syscall.s",
"/media/ulimit/Chang/Sound4Calc/New/Sound4Calc.c",
"/home/ulimit/Bureau/key_test/Makefile",
"/home/ulimit/Bureau/key_test/syscall.h",
"/home/ulimit/Bureau/key_test/syscall.s",
"/home/ulimit/Bureau/key_test/key.c",
"/home/ulimit/Bureau/key_test/syscall.c",
"/home/ulimit/.cache/.fr-evMloG/RTC.c",
"/home/ulimit/Bureau/Nouveau dossier 3/Nouveau",
"/home/ulimit/Bureau/Nouveau dossier 3/Nouveau document",
"/home/ulimit/Bureau/RPi 3",
"/home/ulimit/Sound4Calc/.git/config",
"/home/ulimit/Bureau/Caisse Régionale Loire Haute Loire_files/infosbulle.js",
"/media/ulimit/OS/Program Files (x86)/Steam/steamapps/common/Empire Total War/data/campaigns/natives/scripting.lua",
"/media/ulimit/OS/Program Files (x86)/Steam/steamapps/common/Empire Total War/data/campaigns/natives/startpos.esf",
"/media/ulimit/OS/Program Files (x86)/Steam/steamapps/common/Empire Total War/data/anim.pack",
"/media/ulimit/OS/Program Files (x86)/Steam/steamapps/common/Empire Total War/data/all_scripted.lua",
"/media/ulimit/OS/Program Files (x86)/Steam/steamapps/common/Empire Total War/data/checksum",
"/media/ulimit/OS/Program Files (x86)/Steam/steamapps/common/Empire Total War/data/battle_scripted.lua",
"/home/ulimit/Bureau/mon_script.sh",
"/home/ulimit/Bureau/Nouveau dossier/xinput-decoder.py",
"/home/ulimit/Bureau/Nouveau dossier/xinputtest",
"/media/ulimit/My U3 Drive/ZbThumbnail.info",
"/media/ulimit/OS/Program Files (x86)/Steam/steamapps/common/Empire Total War/data/language.txt",
"/media/ulimit/e6e7f776-11a4-4cd7-b4fd-c44ecdbfcf90/etc/resolv.conf",
"/home/ulimit/.cache/.fr-v6y6TO/minetest.conf.example",
"/home/ulimit/.cache/.fr-tH2FKG/Jetpack Joyride Casio - LastIndev/fonctions.c",
"/home/ulimit/.cache/.fr-LkbQfI/Jetpack Joyride Casio - LastIndev/._fonctions.c",
"/home/ulimit/Bureau/test",
"/media/ulimit/FREEDOM/ ",
"/home/ulimit/.cache/.fr-tLHu3g/mods/mods_here.txt",
"/home/ulimit/.cache/.fr-pL7Ev9/misc/minetest.desktop",
"/home/ulimit/.cache/.fr-mugyGQ/CMakeLists.txt",
"/home/ulimit/.cache/.fr-KtLxHU/minetest.conf.example",
"/home/ulimit/.cache/.fr-LB61pY/po/minetest.pot",
"/home/ulimit/.cache/.fr-MaDHoM/C-Engine-master-88e60a9aea1f9f68623519f87ae25763c15d8add/CHeader.hpp",
"/home/ulimit/.cache/.fr-LwMtxQ/Jetpack Joyride Casio - LastIndev/include.h",
"/home/ulimit/.cache/.fr-bQC73D/Jetpack Joyride Casio - LastIndev/Jetpack.c",
"/home/ulimit/.cache/.fr-UQheAl/Jetpack Joyride Casio - LastIndev/Elements.c",
"/home/ulimit/Bureau/projet agrobot/logiciel agrobot/agrobot/main.c",
"/home/ulimit/Bureau/5001_1_43132081.pdf",
"/home/ulimit/.minetest/worlds/sylvaintest/world.mt",
"/home/ulimit/.minetest/worlds/sylvaintest/auth.txt",
"/home/ulimit/.minetest/worlds/sylvaintest/ipban.txt",
"/home/ulimit/.minetest/worlds/valentin/env_meta.txt",
"/home/ulimit/.minetest/worlds/valentin/map_meta.txt",
"/home/ulimit/.minetest/worlds/valentin/world.mt",
"/home/ulimit/.minetest/worlds/valentin/auth.txt",
"/home/ulimit/.minetest/worlds/valentin/players/singleplayer",
"/home/ulimit/Bureau/con-addin/bin/test_l.g1a",
"/home/ulimit/Bureau/con-addin/Makefile",
"/home/ulimit/Bureau/con-addin/test.c",
"/home/ulimit/Bureau/con-addin/crt0.s",
"/home/ulimit/Bureau/con-addin/test_l_si.g1a",
"/home/ulimit/.minetest/client/serverlist/favoriteservers.txt",
"/home/ulimit/Bureau/projet agrobot/logiciel agrobot/agrobot/agrobot.depend",
"/media/ulimit/2821-0000/System Volume Information/IndexerVolumeGuid",
"/home/ulimit/Bureau/fréquen.g1m",
"/home/ulimit/Bureau/con-addin/test_l.g1a",
"/home/ulimit/Bureau/Nouveau document",
"/home/ulimit/Bureau/Nouveau dossier/tampon",
"/home/ulimit/Bureau/worms/SH4Comp.c",
"/home/ulimit/Bureau/Atomas/atomas.c",
"/home/ulimit/Bureau/mon script.sh",
"/home/ulimit/Bureau/worms/bateau.c",
"/home/ulimit/Bureau/testbash",
"/home/ulimit/Bureau/chr_giant.info",
"/home/ulimit/Bureau/building_barbarian_hut_tex.sc",
"/run/user/1000/gvfs/mtp:host=%5Busb%3A002%2C006%5D/Card/Android/data/com.supercell.clashroyale/cache/swfcache/sc/arena_training.info",
"/home/ulimit/Bureau/arena_training.info",
"/run/user/1000/gvfs/mtp:host=%5Busb%3A002%2C006%5D/Card/Android/data/com.supercell.clashroyale/cache/swfcache/sc/building_barbarian_hut_tex.sc",
"/home/ulimit/Bureau/Atomas/maths.c",
"/run/user/1000/gvfs/mtp:host=%5Busb%3A002%2C006%5D/Card/Android/data/com.supercell.clashroyale/cache/swfcache/sc/building_elixir_collector.info",
"/home/ulimit/Bureau/1",
"/home/ulimit/Bureau/execute",
"/home/ulimit/Bureau/moteur 3D sylvain/bin/maths_add.asm",
"/home/ulimit/Bureau/moteur 3D sylvain/bin/transformations et quaternions/transformation.asm",
"/home/ulimit/Bureau/moteur 3D sylvain/bin2/classe_vecteur",
"/home/ulimit/Bureau/moteur 3D sylvain/bin/classe_polygone",
"/home/ulimit/Bureau/moteur 3D sylvain/bin/classes/classe_octree",
"/home/ulimit/Bureau/moteur 3D sylvain/bin/tables_align.inc",
"/home/ulimit/Bureau/moteur 3D sylvain/bin/ram_area.inc",
"/home/ulimit/Bureau/moteur 3D sylvain/bin/todolist",
"/home/ulimit/Bureau/moteur 3D sylvain/bin/transformations et quaternions/quaternions.asm",
"/home/ulimit/Bureau/Sound4Calc/Makefile",
"/home/ulimit/Bureau/Sound4Calc/addresses.h",
"/media/ulimit/LEXAR/tpe final/readme.txt",
"/media/ulimit/LEXAR/tpe final/readme",
"/home/ulimit/Bureau/jahshaka/INSTALL",
"/home/ulimit/.cache/.fr-1OmWIK/jahshaka/INSTALL",
"/home/ulimit/Bureau/TS3.run",
"/media/ulimit/LEXAR/fact",
"/media/ulimit/LEXAR/Nouveau document texte.txt",
"/run/user/1000/gvfs/mtp:host=%5Busb%3A002%2C028%5D/Phone/Android/data/com.fungames.sniper3d/files/Library",
"/run/user/1000/gvfs/mtp:host=%5Busb%3A002%2C028%5D/Phone/Android/data/uk.co.aifactory.chessfree/files/B.current",
"/run/user/1000/gvfs/mtp:host=%5Busb%3A002%2C028%5D/Phone/Android/data/com.fungames.sniper3d/files/savegame.bin.bkp",
"/run/user/1000/gvfs/mtp:host=%5Busb%3A002%2C028%5D/Phone/Android/data/com.fungames.sniper3d/files/savegame.bin",
"/home/ulimit/Bureau/2_05_0000_sh4.fls",
"/home/ulimit/Bureau/worms/bateau.h",
"/home/ulimit/Bureau/worms/MonochromeLib.c",
"/home/ulimit/Bureau/worms/sprite.c",
"/home/ulimit/Bureau/worms/Makefile",
"/home/ulimit/.cache/.fr-ZkiGuQ/worms/bateau.c",
"/home/ulimit/Bureau/webcalc/examples/old/suites.htm",
"/home/ulimit/Bureau/webcalc/tex-0.9.c",
"/home/ulimit/Bureau/webcalc/examples/old/lim asym.htm",
"/usr/share/magicrescue/recipes/png",
"/home/ulimit/Bureau/INTEGR.htm",
"/home/ulimit/Bureau/webcalc/libfont-3.1.c",
"/usr/share/magicrescue/recipes/jpeg-jfif",
"/home/ulimit/Sound4Calc/Sound4Calc.c.save"
],
"find":
{
"height": 27.0
},
"find_in_files":
{
"height": 0.0,
"where_history":
[
]
},
"find_state":
{
"case_sensitive": false,
"find_history":
[
"SH7305_PUDR",
"SH7305_PUCR",
"SH7305_PJCR",
"SH7305_PUCR",
"SH7305_PJDR",
"appart",
"math",
"j",
"itoa",
"strcat",
"sgn",
"ML_display_vram();",
"tbl64Div",
"RTC2Time",
"BCD2int",
"memory_user_select",
"strcmp",
"Sin",
"_Sin",
"sub_Sin",
"Key",
"IsKeyDown"
],
"highlight": true,
"in_selection": false,
"preserve_case": false,
"regex": false,
"replace_history":
[
""
],
"reverse": false,
"show_context": true,
"use_buffer2": true,
"whole_word": false,
"wrap": true
},
"groups":
[
{
"selected": 0,
"sheets":
[
{
"buffer": 0,
"file": "Sound4Calc.c",
"semi_transient": false,
"settings":
{
"buffer_size": 5121,
"regions":
{
},
"selection":
[
[
109,
109
]
],
"settings":
{
"syntax": "Packages/C++/C++.tmLanguage"
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 3,
"type": "text"
}
]
},
{
"selected": 1,
"sheets":
[
{
"buffer": 1,
"file": "addresses.h",
"semi_transient": false,
"settings":
{
"buffer_size": 40864,
"regions":
{
},
"selection":
[
[
0,
0
]
],
"settings":
{
"syntax": "Packages/C++/C++.tmLanguage"
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 1,
"type": "text"
},
{
"buffer": 2,
"file": "Makefile",
"semi_transient": false,
"settings":
{
"buffer_size": 1104,
"regions":
{
},
"selection":
[
[
0,
0
]
],
"settings":
{
"syntax": "Packages/Makefile/Makefile.tmLanguage"
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 0,
"type": "text"
}
]
},
{
"selected": 0,
"sheets":
[
{
"buffer": 3,
"file": "Sound4Calc.h",
"semi_transient": false,
"settings":
{
"buffer_size": 215,
"regions":
{
},
"selection":
[
[
215,
215
]
],
"settings":
{
"syntax": "Packages/C++/C++.tmLanguage"
},
"translation.x": 0.0,
"translation.y": 0.0,
"zoom_level": 1.0
},
"stack_index": 2,
"type": "text"
}
]
}
],
"incremental_find":
{
"height": 27.0
},
"input":
{
"height": 0.0
},
"layout":
{
"cells":
[
[
0,
0,
1,
2
],
[
1,
0,
2,
1
],
[
1,
1,
2,
2
]
],
"cols":
[
0.0,
0.7328125,
1.0
],
"rows":
[
0.0,
0.716904276986,
1.0
]
},
"menu_visible": true,
"output.find_results":
{
"height": 0.0
},
"pinned_build_system": "",
"project": "",
"replace":
{
"height": 50.0
},
"save_all_on_build": true,
"select_file":
{
"height": 0.0,
"last_filter": "",
"selected_items":
[
],
"width": 0.0
},
"select_project":
{
"height": 500.0,
"last_filter": "",
"selected_items":
[
[
"",
"~/Bureau/Sound4Calc/Sound4Calc.sublime-workspace"
]
],
"width": 380.0
},
"select_symbol":
{
"height": 0.0,
"last_filter": "",
"selected_items":
[
],
"width": 0.0
},
"selected_group": 1,
"settings":
{
"last_automatic_layout":
[
[
0,
0,
1,
2
],
[
1,
0,
2,
1
],
[
1,
1,
2,
2
]
]
},
"show_minimap": true,
"show_open_files": false,
"show_tabs": true,
"side_bar_visible": true,
"side_bar_width": 150.0,
"status_bar_visible": true,
"template_settings":
{
"max_columns": 2
}
}

View File

@ -1,51 +0,0 @@
void SetPin()
{
if(is_SH4)
{
*(unsigned char*)SH7305_PJDR |= 0x04;
*(unsigned char*)SH7305_PJDR &= ~0x08;
//set pin to 0x4B
}
else
{
*(unsigned char*)SH7337_SCPDR |= 0x01;
}
}
void ResetPin()
{
if(is_SH4)
{
*(unsigned char*)SH7305_PJDR &= ~0x04;
*(unsigned char*)SH7305_PJDR |= 0x08;
// set the pin to 0x47
}
else
{
*(unsigned char*)SH7337_SCPDR &= ~0x01;
}
}
char getMPU(void)
{
// Port L control register.
volatile unsigned short *plcr = (unsigned short *)0xa4000114;
// Saved value for PLCR.
unsigned short saved_plcr;
unsigned int tested_plcr;
saved_plcr = *plcr;
*plcr = 0xffff;
tested_plcr = *plcr;
*plcr = saved_plcr;
if(tested_plcr == 0x00ff || tested_plcr == 0x0fff)
{
return 0; // MPU_SH3
}
return 1; // MPU_SH4
}

Binary file not shown.

Binary file not shown.

View File

@ -1,12 +0,0 @@
#ifndef _SYSCALL_H
#define _SYSCALL_H
int IsKeyDown(short* matrixcode);
#define KEY_CTRL_EXE 0x0201
#define KEY_CTRL_SHIFT 0x0608
#endif

View File

@ -1,11 +0,0 @@
.global_IsKeyDown
_IsKeyDown:
mov.l sc_addr, r2
mov.l 1f, r0
jmp @r2
nop
1: .long 0x24B
sc_addr:
.long 0x80010070

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

Before

Width:  |  Height:  |  Size: 206 B

After

Width:  |  Height:  |  Size: 206 B

View File

@ -1,29 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C/C++ Compiler Ver. 6.0 */
/* Copyright (c) 1992,2000 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/***********************************************************************/
/* SPEC; */
/* NAME = _h_c_lib.h : */
/* */
/* FUNC = Include file for SH SERIES C/C++ Compiler environment */
/* */
/* CLAS = UNIT; */
/* */
/* END; */
/***********************************************************************/
#ifndef _H_C_LIB
#define _H_C_LIB
#ifdef __cplusplus
extern "C"{
#endif
extern void _CALL_INIT(void); /* for global class object initial processing */
extern void _CALL_END(void); /* for global class object post-processing */
#ifdef __cplusplus
}
#endif /* #ifdef __cplusplus */
#endif /* #ifndef _H_C_LIB */

View File

@ -1,39 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C Compiler Ver. 1.0 */
/* Copyright (c) 1992 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/***********************************************************************/
/* SPEC; */
/* NAME = assert.h : debug macro define ; */
/* */
/* FUNC = this module do the following functions; */
/* (1) if NDEBUG defined assert(x) = (void)0; */
/* CLAS = UNIT; */
/* */
/* END; */
/***********************************************************************/
#ifndef _ASSERT
#define _ASSERT
#include <stdio.h>
#ifdef NDEBUG
#ifdef assert
#undef assert
#endif
#define assert(x) ((void)0)
#else
#ifdef assert
#undef assert
#endif
#define assert(x) ( x ? (void) 0 : (fprintf(stderr,\
"ASSERTION FAILED: "#x" FILE %s,LINE %d \n", \
__FILE__,__LINE__),abort(),(void)0))
#endif
#ifdef __cplusplus
extern "C" {
void abort(void);
}
#endif
#endif

View File

@ -1,84 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C Compiler Ver. 6.0 */
/* Copyright (c) 1992, 2000 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/*****************************************************************/
/* SPEC ; */
/* NAME = builtin : */
/* */
/* FUNC = this header file do the following functions; */
/* (1)builtin function prototype define; */
/* */
/* CLAS = UNIT ; */
/* */
/* END ; */
/*****************************************************************/
#ifndef _BUILTIN
#define _BUILTIN
#ifdef __cplusplus
extern "C" {
/* follow math.h & mathf.h */
extern float _builtin_fabsf(float);
extern double _builtin_fabs(double);
extern float _builtin_sqrtf(float);
extern double _builtin_sqrt(double);
/* follow private.h */
extern void _builtin_fsca(long ,float *,float *);
extern float _builtin_fsrra(float);
/* follow smachine.h */
extern void _builtin_set_imask(int);
extern int _builtin_get_imask(void);
extern void _builtin_set_cr(int);
extern int _builtin_get_cr(void);
extern void _builtin_set_vbr(void *);
extern void *_builtin_get_vbr(void);
extern void _builtin_sleep(void);
/* follow string.h */
extern char *_builtin_strcpy(char *, const char *);
extern int _builtin_strcmp(const char *, const char *);
/* follow umachine.h */
extern void _builtin_set_gbr(void *);
extern void *_builtin_get_gbr(void);
extern unsigned char _builtin_gbr_read_byte(int);
extern unsigned short _builtin_gbr_read_word(int);
extern unsigned long _builtin_gbr_read_long(int);
extern void _builtin_gbr_write_byte(int, unsigned char);
extern void _builtin_gbr_write_word(int, unsigned short);
extern void _builtin_gbr_write_long(int, unsigned long);
extern void _builtin_gbr_and_byte(int, unsigned char);
extern void _builtin_gbr_or_byte(int, unsigned char);
extern void _builtin_gbr_xor_byte(int, unsigned char);
extern int _builtin_gbr_tst_byte(int, unsigned char);
extern int _builtin_tas(char *);
extern int _builtin_trapa(int);
extern int _builtin_macw(short *, short *, unsigned int);
extern int _builtin_macwl(short *, short *, unsigned int, unsigned int);
extern int _builtin_macl(int *, int *, unsigned int);
extern int _builtin_macll(int *, int *, unsigned int, unsigned int);
extern int _builtin_trapa_svc(...);
extern void _builtin_prefetch(void *);
extern void _builtin_set_fpscr(int);
extern int _builtin_get_fpscr(void);
extern float _builtin_fipr(float a1[], float b1[]);
extern void _builtin_ftrv(float a1[], float b1[]);
extern void _builtin_ftrvadd(float a1[], float b1[], float c1[]);
extern void _builtin_ftrvsub(float a1[], float b1[], float c1[]);
extern void _builtin_mtrx4mul(float [][4], float [][4]);
extern void _builtin_mtrx4muladd(float [][4], float [][4], float [][4]);
extern void _builtin_mtrx4mulsub(float [][4], float [][4], float [][4]);
extern void _builtin_ld_ext(float [][4]);
extern void _builtin_st_ext(float [][4]);
extern void _builtin_add4(float a1[], float b1[], float c1[]);
extern void _builtin_sub4(float a1[], float b1[], float c1[]);
extern void _builtin_trace(int);
}
#endif /* #ifdef __cplusplus */
#endif /* #ifndef _BUILTIN */

View File

@ -1,189 +0,0 @@
//Embedded C++ Library
//Copyright (c) Hitachi,Ltd. 1997
//Licensed material of Hitachi,Ltd
//====================================================================
// File: complex
// Purpose: Numerics library / Complex numbers
// Header <complex>
// Create: 1997.09.20 Rev. 1.0
//====================================================================
#ifndef _COMPLEX_
#define _COMPLEX_
#include <istream>
#include <ostream>
class float_complex; // based on float
class double_complex; // based on double
// complex specialization
class float_complex {
public:
typedef float value_type;
float_complex(float re = 0.0f, float im = 0.0f){
_re = re; _im = im; return; }
float_complex(const double_complex&);
float real() const{ return (_re);}
float imag() const{ return (_im);}
float_complex& operator= (float rhs){
_re = rhs; _im = 0.0; return *this; }
float_complex& operator+=(float rhs){ _re += rhs; return *this; }
float_complex& operator-=(float rhs){ _re -= rhs; return *this; }
float_complex& operator*=(float rhs){
_re *= rhs; _im *= rhs; return *this; }
float_complex& operator/=(float rhs){
_re /= rhs; _im /= rhs; return *this; }
float_complex& operator=(const float_complex&rhs){
_re = rhs.real(); _im = rhs.imag(); return *this; }
float_complex& operator+=(const float_complex&rhs){
_re += rhs.real(); _im += rhs.imag(); return *this; }
float_complex& operator-=(const float_complex&rhs){
_re -= rhs.real(); _im -= rhs.imag(); return *this; }
float_complex& operator*=(const float_complex&);
float_complex& operator/=(const float_complex&);
private:
float _re, _im;
};
class double_complex {
public:
typedef double value_type;
double_complex(double re = 0.0, double im = 0.0){
_re = re; _im = im; return; }
double_complex(const float_complex&rhs){
_re = (double)rhs.real(); _im = (double)rhs.imag(); return; }
double real() const{ return (_re);}
double imag() const{ return (_im);}
double_complex& operator= (double rhs){
_re = rhs; _im = 0.0; return *this; }
double_complex& operator+=(double rhs){ _re += rhs; return *this; }
double_complex& operator-=(double rhs){ _re -= rhs; return *this; }
double_complex& operator*=(double rhs){
_re *= rhs; _im *= rhs; return *this; }
double_complex& operator/=(double rhs){
_re /= rhs; _im /= rhs; return *this; }
double_complex& operator=(const double_complex&rhs){
_re = rhs.real(); _im = rhs.imag(); return *this; }
double_complex& operator+=(const double_complex&rhs){
_re += rhs.real(); _im += rhs.imag(); return *this; }
double_complex& operator-=(const double_complex&rhs){
_re -= rhs.real(); _im -= rhs.imag(); return *this; }
double_complex& operator*=(const double_complex&);
double_complex& operator/=(const double_complex&);
private:
double _re, _im;
};
// complex non-member functions
float_complex operator+(const float_complex&);
float_complex operator-(const float_complex&);
float_complex operator+(const float_complex&, const float_complex&);
float_complex operator+(const float_complex&, const float&);
float_complex operator+(const float&, const float_complex&);
float_complex operator-(const float_complex&, const float_complex&);
float_complex operator-(const float_complex&, const float&);
float_complex operator-(const float&, const float_complex&);
float_complex operator*(const float_complex&, const float_complex&);
float_complex operator*(const float_complex&, const float&);
float_complex operator*(const float&, const float_complex&);
float_complex operator/(const float_complex&, const float_complex&);
float_complex operator/(const float_complex&, const float&);
float_complex operator/(const float&, const float_complex&);
bool operator==(const float_complex&, const float_complex&);
bool operator==(const float_complex&, const float&);
bool operator==(const float&, const float_complex&);
bool operator!=(const float_complex&, const float_complex&);
bool operator!=(const float_complex&, const float&);
bool operator!=(const float&, const float_complex&);
istream& operator>>(istream&, float_complex&);
ostream& operator<<(ostream&, const float_complex&);
double_complex operator+(const double_complex&);
double_complex operator-(const double_complex&);
double_complex operator+(const double_complex&, const double_complex&);
double_complex operator+(const double_complex&, const double&);
double_complex operator+(const double&, const double_complex&);
double_complex operator-(const double_complex&, const double_complex&);
double_complex operator-(const double_complex&, const double&);
double_complex operator-(const double&, const double_complex&);
double_complex operator*(const double_complex&, const double_complex&);
double_complex operator*(const double_complex&, const double&);
double_complex operator*(const double&, const double_complex&);
double_complex operator/(const double_complex&, const double_complex&);
double_complex operator/(const double_complex&, const double&);
double_complex operator/(const double&, const double_complex&);
bool operator==(const double_complex&, const double_complex&);
bool operator==(const double_complex&, const double&);
bool operator==(const double&, const double_complex&);
bool operator!=(const double_complex&, const double_complex&);
bool operator!=(const double_complex&, const double&);
bool operator!=(const double&, const double_complex&);
istream& operator>>(istream&, double_complex&);
ostream& operator<<(ostream&, const double_complex&);
// complex value operations
float real(const float_complex&);
float imag(const float_complex&);
float abs(const float_complex&);
float arg(const float_complex&);
float norm(const float_complex&);
float_complex conj(const float_complex&);
float_complex polar(const float&, const float&);
double real(const double_complex&);
double imag(const double_complex&);
double abs(const double_complex&);
double arg(const double_complex&);
double norm(const double_complex&);
double_complex conj(const double_complex&);
double_complex polar(const double&, const double&);
// complex transcendentals
#ifdef sqrt
#undef sqrt
extern "C" double sqrt(double);
#endif
float_complex cos (const float_complex&);
float_complex cosh (const float_complex&);
float_complex exp (const float_complex&);
float_complex log (const float_complex&);
float_complex log10(const float_complex&);
float_complex pow(const float_complex&, int);
float_complex pow(const float_complex&, const float&);
float_complex pow(const float_complex&, const float_complex&);
float_complex pow(const float&, const float_complex&);
float_complex sin (const float_complex&);
float_complex sinh (const float_complex&);
float_complex sqrt (const float_complex&);
float_complex tan (const float_complex&);
float_complex tanh (const float_complex&);
double_complex cos (const double_complex&);
double_complex cosh (const double_complex&);
double_complex exp (const double_complex&);
double_complex log (const double_complex&);
double_complex log10(const double_complex&);
double_complex pow(const double_complex&, int);
double_complex pow(const double_complex&, const double&);
double_complex pow(const double_complex&, const double_complex&);
double_complex pow(const double&, const double_complex&);
double_complex sin (const double_complex&);
double_complex sinh (const double_complex&);
double_complex sqrt (const double_complex&);
double_complex tan (const double_complex&);
double_complex tanh (const double_complex&);
#endif

View File

@ -1,66 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C Compiler Ver. 1.0 */
/* Copyright (c) 1992 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/*****************************************************************/
/* SPEC ; */
/* NAME = ctype : */
/* FUNC = */
/* ; */
/* */
/* */
/* */
/* CLAS = UNIT ; */
/* END ; */
/*****************************************************************/
#ifndef _CTYPE
#define _CTYPE
#ifdef __cplusplus
extern "C" {
#endif
extern unsigned char _ctype[];
extern int isalnum(int);
extern int isalpha(int);
extern int iscntrl(int);
extern int isdigit(int);
extern int isgraph(int);
extern int islower(int);
extern int isprint(int);
extern int ispunct(int);
extern int isspace(int);
extern int isupper(int);
extern int isxdigit(int);
extern int tolower(int);
extern int toupper(int);
#ifdef __cplusplus
}
#endif
#define _UPPER 0x01
#define _LOWER 0x02
#define _DIGIT 0x04
#define _SPACE 0x08
#define _PUNCT 0x10
#define _CNTRL 0x20
#define _WHITE 0x40
#define _HEX 0x80
#define isalnum(c) (_ctype[(c) & 0xff] & (_UPPER | _LOWER | _DIGIT))
#define isalpha(c) (_ctype[(c) & 0xff] & (_UPPER | _LOWER))
#define iscntrl(c) (_ctype[(c) & 0xff] & _CNTRL)
#define isdigit(c) (_ctype[(c) & 0xff] & _DIGIT)
#define isgraph(c) (_ctype[(c) & 0xff] & (_UPPER | _LOWER | _DIGIT | _PUNCT))
#define islower(c) (_ctype[(c) & 0xff] & _LOWER)
#define isprint(c) (_ctype[(c) & 0xff] & (_UPPER|_LOWER|_DIGIT|_PUNCT|_SPACE))
#define ispunct(c) (_ctype[(c) & 0xff] & _PUNCT)
#define isspace(c) (_ctype[(c) & 0xff] & _WHITE)
#define isupper(c) (_ctype[(c) & 0xff] & _UPPER)
#define isxdigit(c) (_ctype[(c) & 0xff] & _HEX)
#define tolower(c) (isupper(c) ? ((c)-'A'+'a') : (c))
#define toupper(c) (islower(c) ? ((c)-'a'+'A') : (c))
#endif

View File

@ -1,257 +0,0 @@
/*
*SHDSP Library
*Copyright (c) Hitachi,Ltd. 1998
*Licensed material of Hitachi,Ltd
*/
/***********************************************************
* File: ensigdsp.h
* Purpose: Common
* Create: 1998.03.20 Rev. 1.0
***********************************************************/
/*
** Copyright Ensigma Ltd. 1995
**
** Unauthorised copying or distribution of this software is prohibited.
**
** Version 1.0.
**
*/
/*
** ENSIGMA DSP Library
*/
/* Constants */
#ifndef _ENSIGDSP
#define _ENSIGDSP
#define BIQUAD_SIZE 6 /* no. coefficients in an IIR biquad */
#define EDSP_OK 0
#define EDSP_BAD_ARG 1
#define EDSP_NO_HEAP 2
#define EFFTALLSCALE (-1L)
#define EFFTMIDSCALE 0x55555555L
#define EFFTNOSCALE 0x00000000L
#ifdef __cplusplus /*A-10-014-01*/
extern"C"{ /*A-10-014-01*/
#endif /*A-10-014-01*/
/*
** Fourier transforms
*/
int FftComplex(short op_x[],
short op_y[],
const short ip_x[],
const short ip_y[],
long size,
long scale);
int FftInComplex(short data_x[],
short data_y[],
long size,
long scale);
int FftReal(short op_x[],
short op_y[],
const short ip[],
long size,
long scale);
/* int ip_is_x);*/
int FftInReal(short data_x[],
short data_y[],
long size,
long scale,
int not_sure_about_ip_format);
int IfftComplex(short op_x[],
short op_y[],
const short ip_x[],
const short ip_y[],
long size,
long scale);
int IfftInComplex(short data_x[],
short data_y[],
long size,
long scale);
int IfftReal(short op_x[],
short op_y[],
const short ip_x[],
const short ip_y[],
long size,
long scale,
int op_is_x_scratch_is_y);
int IfftInReal(short data_x[],
short data_y[],
long size,
long scale,
int not_sure_about_op_format);
int InitFft(long max_size);
void FreeFft(void); /*A-10-015-01*/
int LogMagnitude(short output[],
const short ip_x[],
const short ip_y[],
long no_elements,
float fscale);
/*
** These three variables are for the internal use of the library FFT
** functions only. They should not be accessed by user programs.
*/
extern long max_fft_size;
extern short *twtble;
/*
** Window functions
*/
int GenBlackman(short data[], long N);
int GenHamming(short data[], long N);
int GenHanning(short data[], long N);
int GenTriangle(short data[], long N);
/*
** Filters. The coefficients must be supplied in X and the workspace in Y.
** If it is straightforward we can support the opposite, ie Xworkspace and
** Ycoeff.
*/
int FreeFir(short **Yworkspace, long order);
int InitFir(short **Yworkspace, long order);
int InitIir(short **Yworkspace, long no_sections);
int FreeIir(short **Yworkspace, long no_sections); /*A-10-015-01*/
int InitDIir(long **Yworkspace, long no_sections);
int FreeDIir(long **Yworkspace, long no_sections); /*A-10-015-01*/
int InitLms(short **Yworkspace, long order);
int FreeLms(short **Yworkspace, long order); /*A-10-015-01*/
int Fir(short op[],
const short ip[],
long no_samples,
const short Xcoeff[],
long order,
int res_shift,
short *Yworkspace);
int Fir1(short *op_ptr,
short input,
const short Xcoeff[],
long order,
int res_shift,
short *Yworkspace);
int Iir(short op[],
const short ip[],
long no_samples,
const short Xcoeff[],
long no_sections,
short *Yworkspace);
int Iir1(short *op_ptr,
short input,
const short Xcoeff[],
long no_sections,
short *Yworkspace);
int DIir(short op[],
const short ip[],
long no_samples,
const long Xcoeff[],
long no_sections,
long *Yworkspace);
int DIir1(short *op_ptr,
const short input, /*98.01.09 C-10-005-01 */
/* short input, 98.01.09 D-10-005-01 */
const long Xcoeff[],
long no_sections,
long *Yworkspace);
int Lms(short op[],
const short ip[],
const short ref[],
long no_samples,
short Xcoeff[],
long order,
int res_shift,
short mu,
short *Yworkspace);
int Lms1(short *op_ptr,
short input,
short ref_op,
short Xcoeff[],
long order,
int res_shift,
short mu,
short *Yworkspace);
/*
** Convolution and Correlation
*/
int ConvComplete(short op[],
const short ix[],
const short iy[],
long ix_size,
long iy_size,
int res_shift);
int ConvCyclic(short op[],
const short ix[],
const short iy[],
long size,
int res_shift);
int ConvPartial(short op[],
const short ix[],
const short iy[],
long ix_size,
long iy_size,
int res_shift);
int Correlate(short op[],
const short ix[],
const short iy[],
long ix_size,
long iy_size,
long no_corr,
int x_is_larger,
int res_shift);
int CorrCyclic(short op[],
const short ix[],
const short iy[],
long size,
int reverse,
int res_shift);
/*
** Miscellaneous
*/
int GenGWnoise(short output[], long no_samples, float variance);
int MinI(short **min_ptr, short buffer[], long buff_len, int src_is_x);
int MaxI(short **max_ptr, short buffer[], long buff_len, int src_is_x);
int PeakI(short **peak_ptr, short buffer[], long buff_len, int src_is_x);
int Mean(short *mean_ptr, const short buffer[], long buff_len, int src_is_x);
int Variance(long *variance_ptr,
short *mean_ptr,
const short buffer[],
long buff_len, int src_is_x);
int VectorMult(short dest[],
const short matrixX[],
const short matrixY[],
long length,
int res_shift);
int MatrixMult(void *matrix3,
const void *matrixX,
const void *matrixY,
long m,
long n,
long p,
int res_shift, int dest_is_x);
int MsPower(long *pow_ptr, const short input[], long buff_size, int src_is_x);
int CopyXtoY(short y[], const short x[], long n);
int CopyYtoX(short x[], const short y[], long n);
int CopyToX(short x[], const short src[], long n);
int CopyToY(short y[], const short src[], long n);
int CopyFromX(short src[], const short x[], long n);
int CopyFromY(short src[], const short y[], long n);
int Limit(short data[], long no_elements, int data_is_x);
#ifdef __cplusplus /*A-10-014-01*/
} /*A-10-014-01*/
#endif /*A-10-014-01*/
#endif

View File

@ -1,114 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C Compiler Ver. 1.0 */
/* Copyright (c) 1992 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/*****************************************************************/
/* SPEC ; */
/* NAME = errno : */
/* FUNC = */
/* ; */
/* */
/* */
/* */
/* CLAS = UNIT ; */
/* END ; */
/*****************************************************************/
#ifndef _ERRNO
#define _ERRNO
#ifndef ERANGE
#define ERANGE 1100
#endif
#ifndef EDOM
#define EDOM 1101
#endif
#ifndef EDIV
#define EDIV 1102
#endif
#ifndef ESTRN
#define ESTRN 1104
#endif
#ifndef PTRERR
#define PTRERR 1106
#endif
#ifndef SEQERR
#define SEQERR 1108
#endif
#ifndef ECBASE
#define ECBASE 1200
#endif
#ifndef ETLN
#define ETLN 1202
#endif
#ifndef EEXP
#define EEXP 1204
#endif
#ifndef EEXPN
#define EEXPN 1206
#endif
#ifndef ENUM
#define ENUM 1208
#endif
#ifndef EFLOATO
#define EFLOATO 1210
#endif
#ifndef EFLOATU
#define EFLOATU 1220
#endif
#ifndef EDBLO
#define EDBLO 1250
#endif
#ifndef EDBLU
#define EDBLU 1260
#endif
#ifndef ELDBLO
#define ELDBLO 1270
#endif
#ifndef ELDBLU
#define ELDBLU 1280
#endif
#ifndef NOTOPN
#define NOTOPN 1300
#endif
#ifndef EBADF
#define EBADF 1302
#endif
#ifndef ECSPEC
#define ECSPEC 1304
#endif
#ifdef __cplusplus
extern "C" {
#endif
extern volatile int _errno;
#ifdef __cplusplus
}
#endif
#ifndef errno
#define errno _errno
#endif
#endif

View File

@ -1,74 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C Compiler Ver. 1.0 */
/* Copyright (c) 1992 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/***********************************************************************/
/* SPEC; */
/* NAME = exception.h : */
/* */
/* FUNC = Include file for exception handling (see 18.6) */
/* */
/* CLAS = UNIT; */
/* */
/* END; */
/***********************************************************************/
#ifndef _EXCEPTION_H
#define _EXCEPTION_H
/* This lets users disable the EDG supplied exception classes. */
#ifndef __NO_EDG_EXCEPTION_CLASSES
#include <stdexcept.h>
#ifdef __EDG_RUNTIME_USES_NAMESPACES
namespace std {
#endif /* ifdef __EDG_RUNTIME_USES_NAMESPACES */
/*
If bool is not supported, use a typedef for bool.
*/
#ifdef _BOOL
typedef bool __bool;
#else /* ifndef _BOOL */
typedef int __bool;
#endif /* ifdef _BOOL */
class bad_exception : public exception {
public:
bad_exception() throw();
bad_exception(const bad_exception&) throw();
bad_exception& operator=(const bad_exception&) throw();
virtual ~bad_exception() throw();
virtual const char* what() const throw();
};
typedef void (*terminate_handler)();
extern terminate_handler set_terminate(terminate_handler);
typedef void (*unexpected_handler)();
extern unexpected_handler set_unexpected(unexpected_handler);
/* unexpected and terminate are in the WP definition of exception.h.
It is not clear why. */
void terminate();
void unexpected();
extern __bool uncaught_exception();
#ifdef __EDG_RUNTIME_USES_NAMESPACES
} /* namespace */
#ifdef __EDG_IMPLICIT_USING_STD
/* Implicitly include a using directive for the STD namespace when this
preprocessing flag is TRUE. */
using namespace std;
#endif /* ifdef __EDG_IMPLICIT_USING_STD */
#endif /* ifdef __EDG_RUNTIME_USES_NAMESPACES */
#endif /* ifndef __NO_EDG_EXCEPTION_CLASSES */
#endif /* _EXCEPTION_H */

View File

@ -1,26 +0,0 @@
/*
*SHDSP Library
*Copyright (c) Hitachi,Ltd. 1998
*Licensed material of Hitachi,Ltd
*/
/***********************************************************
* File: filt_ws.h
* Purpose: Filter
* Create: 1998.03.20 Rev. 1.0
***********************************************************/
#ifndef FILT_WS
#define FILT_WS
#ifndef WS_SIZE
#define WS_SIZE 1024 /* Set Global workspace buffer size=1024 shorts (2048 bytes) */
#endif
#define MEMSIZE WS_SIZE*sizeof(short)
#pragma section Y /*need to equate DYRAM with link.cmd file*/
short ws_mem[WS_SIZE];
short * ws_ptr=ws_mem;
long ws_left=MEMSIZE;
#pragma section
#endif

View File

@ -1,208 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C Compiler Ver. 1.0 */
/* Copyright (c) 1992 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/*****************************************************************/
/* SPEC ; */
/* NAME = float : */
/* FUNC = limit about float type and double type ; */
/* */
/* */
/* END ; */
/*****************************************************************/
#ifndef _FLOAT
#define _FLOAT
extern const float _FLT_MAX_VAL;
extern const float _FLT_MIN_VAL;
extern const double _DBL_MAX_VAL;
extern const double _DBL_MIN_VAL;
extern const long double _LDBL_MAX_VAL;
extern const long double _LDBL_MIN_VAL;
#ifndef _FPD
#define FLT_RADIX 2
#if defined(_SH2E)|defined(_SH3E)|(defined(_SH4)&!defined(_RON))
#define FLT_ROUNDS 0
#define FLT_GUARD 0
#else
#define FLT_ROUNDS 1
#define FLT_GUARD 1
#endif
#define FLT_NORMALIZE 1
#define FLT_MAX _FLT_MAX_VAL
#define FLT_MIN _FLT_MIN_VAL
#define FLT_MAX_EXP 127
#if defined(_SH2E)|defined(_SH3E)|(defined(_SH4)&!defined(_DON))
#define FLT_MIN_EXP (-126)
#else
#define FLT_MIN_EXP (-149)
#endif
#define FLT_MAX_10_EXP 38
#if defined(_SH2E)|defined(_SH3E)|(defined(_SH4)&!defined(_DON))
#define FLT_MIN_10_EXP (-38)
#else
#define FLT_MIN_10_EXP (-44)
#endif
#define FLT_DIG 6
#define FLT_MANT_DIG 24
#define FLT_EXP_DIG 8
#if defined(_SH2E)|defined(_SH3E)|(defined(_SH4)&!defined(_RON))
#define FLT_POS_EPS 1.1920928955078125e-7f
#if defined(_DON)
#define FLT_NEG_EPS 1.4012984643248171e-45f
#else
#define FLT_NEG_EPS 1.1754943508222876e-38f
#endif
#else
#define FLT_POS_EPS 5.9604648328104311e-8f
#define FLT_NEG_EPS 2.9802324164052156e-8f
#endif
#define FLT_POS_EPS_EXP (-23)
#if defined(_SH2E)|defined(_SH3E)|defined(_SH4)
#define FLT_NEG_EPS_EXP (-126)
#else
#define FLT_NEG_EPS_EXP (-24)
#endif
#endif
#if defined(_FLT)|defined(_FPS)
#define DBL_RADIX FLT_RADIX
#define DBL_ROUNDS FLT_ROUNDS
#define DBL_GUARD FLT_GUARD
#define DBL_NORMALIZE FLT_NORMALIZE
#define DBL_MAX _FLT_MAX_VAL
#define DBL_MIN _FLT_MIN_VAL
#define DBL_MAX_EXP FLT_MAX_EXP
#define DBL_MIN_EXP FLT_MIN_EXP
#define DBL_MAX_10_EXP FLT_MAX_10_EXP
#define DBL_MIN_10_EXP FLT_MIN_10_EXP
#define DBL_DIG FLT_DIG
#define DBL_MANT_DIG FLT_MANT_DIG
#define DBL_EXP_DIG FLT_EXP_DIG
#define DBL_POS_EPS FLT_POS_EPS
#define DBL_NEG_EPS FLT_NEG_EPS
#define DBL_POS_EPS_EXP FLT_POS_EPS_EXP
#define DBL_NEG_EPS_EXP FLT_NEG_EPS_EXP
#else
#define DBL_RADIX 2
#if defined(_SH4)&!defined(_RON)
#define DBL_ROUNDS 0
#define DBL_GUARD 0
#else
#define DBL_ROUNDS 1
#define DBL_GUARD 1
#endif
#define DBL_NORMALIZE 1
#define DBL_MAX _DBL_MAX_VAL
#define DBL_MIN _DBL_MIN_VAL
#define DBL_MAX_EXP 1023
#if defined(_SH4)&!defined(_DON)
#define DBL_MIN_EXP (-1022)
#else
#define DBL_MIN_EXP (-1074)
#endif
#define DBL_MAX_10_EXP 308
#if defined(_SH4)&!defined(_DON)
#define DBL_MIN_10_EXP (-308)
#else
#define DBL_MIN_10_EXP (-323)
#endif
#define DBL_DIG 15
#define DBL_MANT_DIG 53
#define DBL_EXP_DIG 11
#if defined(_SH4)&!defined(_RON)
#define DBL_POS_EPS 2.2204460492503131e-16
#if defined(_DON)
#define DBL_NEG_EPS 4.9406564584124655e-324
#else
#define DBL_NEG_EPS 2.2250738585072014e-308
#endif
#else
#define DBL_POS_EPS 1.1102230246251567e-16
#define DBL_NEG_EPS 5.5511151231257834e-17
#endif
#define DBL_POS_EPS_EXP (-52)
#ifdef _SH4
#ifdef _RON
#define DBL_NEG_EPS_EXP (-53)
#else
#ifdef _DON
#define DBL_NEG_EPS_EXP (-1023)
#else
#define DBL_NEG_EPS_EXP (-1022)
#endif
#endif
#else
#define DBL_NEG_EPS_EXP (-53)
#endif
#ifdef _FPD
#define FLT_RADIX DBL_RADIX
#define FLT_ROUNDS DBL_ROUNDS
#define FLT_GUARD DBL_GUARD
#define FLT_NORMALIZE DBL_NORMALIZE
#define FLT_MAX _DBL_MAX_VAL
#define FLT_MIN _DBL_MIN_VAL
#define FLT_MAX_EXP DBL_MAX_EXP
#define FLT_MIN_EXP DBL_MIN_EXP
#define FLT_MAX_10_EXP DBL_MAX_10_EXP
#define FLT_MIN_10_EXP DBL_MIN_10_EXP
#define FLT_DIG DBL_DIG
#define FLT_MANT_DIG DBL_MANT_DIG
#define FLT_EXP_DIG DBL_EXP_DIG
#define FLT_POS_EPS DBL_POS_EPS
#define FLT_NEG_EPS DBL_NEG_EPS
#define FLT_POS_EPS_EXP DBL_POS_EPS_EXP
#define FLT_NEG_EPS_EXP DBL_NEG_EPS_EXP
#endif
#endif
#ifdef _FLT
#define LDBL_RADIX 2
#define LDBL_ROUNDS 1
#define LDBL_GUARD 1
#define LDBL_NORMALIZE 1
#define LDBL_MAX _LDBL_MAX_VAL
#define LDBL_MIN _LDBL_MIN_VAL
#define LDBL_MAX_EXP 1023
#define LDBL_MIN_EXP (-1074)
#define LDBL_MAX_10_EXP 308
#define LDBL_MIN_10_EXP (-323)
#define LDBL_DIG 15
#define LDBL_MANT_DIG 53
#define LDBL_EXP_DIG 11
#define LDBL_POS_EPS 1.1102230246251567e-16
#define LDBL_NEG_EPS 5.5511151231257834e-17
#define LDBL_POS_EPS_EXP (-52)
#define LDBL_NEG_EPS_EXP (-53)
#else
#define LDBL_RADIX DBL_RADIX
#define LDBL_ROUNDS DBL_ROUNDS
#define LDBL_GUARD DBL_GUARD
#define LDBL_NORMALIZE DBL_NORMALIZE
#define LDBL_MAX DBL_MAX
#define LDBL_MIN DBL_MIN
#define LDBL_MAX_EXP DBL_MAX_EXP
#define LDBL_MIN_EXP DBL_MIN_EXP
#define LDBL_MAX_10_EXP DBL_MAX_10_EXP
#define LDBL_MIN_10_EXP DBL_MIN_10_EXP
#define LDBL_DIG DBL_DIG
#define LDBL_MANT_DIG DBL_MANT_DIG
#define LDBL_EXP_DIG DBL_EXP_DIG
#define LDBL_POS_EPS DBL_POS_EPS
#define LDBL_NEG_EPS DBL_NEG_EPS
#define LDBL_POS_EPS_EXP DBL_POS_EPS_EXP
#define LDBL_NEG_EPS_EXP DBL_NEG_EPS_EXP
#endif
#endif

View File

@ -1,60 +0,0 @@
//Embedded C++ Library
//Copyright (c) Hitachi,Ltd. 1997
//Licensed material of Hitachi,Ltd
//
// Embeded C++ Library Header <iomanip>
//
//====================================================================
// File: iomanip
// Purpose: Definition of class iomanip
// Create: 1997.09.20 Rev. 1.0
//====================================================================
#ifndef _IOMANIP_
#define _IOMANIP_
#include <istream>
#include <ostream>
//Class
class smanip{
private:
union{
int val_i;
char val_c;
ios_base::fmtflags val_f;
};
union{
ios_base& (*pfi)(ios_base&,int);
ios_base& (*pfc)(ios_base&,char);
ios_base& (*pff)(ios_base&,ios_base::fmtflags);
};
enum _ec2p_smanip_t{
_ec2p_smanip_i,_ec2p_smanip_c ,_ec2p_smanip_f
}_ec2p_smanip_data;
public:
smanip(ios_base& (*pf)(ios_base&,int),int arg)
:pfi(pf),val_i(arg),_ec2p_smanip_data(_ec2p_smanip_i){}
smanip(ios_base& (*pf)(ios_base&,char),char arg)
:pfc(pf),val_c(arg),_ec2p_smanip_data(_ec2p_smanip_c){}
smanip(ios_base& (*pf)(ios_base&,ios_base::fmtflags),ios_base::fmtflags arg)
:pff(pf),val_f(arg),_ec2p_smanip_data(_ec2p_smanip_f){}
friend ostream& operator << (ostream&,smanip);
friend istream& operator >> (istream&,smanip);
};
//Manipulators
smanip resetiosflags(ios_base::fmtflags);
smanip setiosflags(ios_base::fmtflags);
smanip setbase(int);
smanip setfill(char);
smanip setprecision(int);
smanip setw(int);
#endif

View File

@ -1,192 +0,0 @@
//Embedded C++ Library
//Copyright (c) Hitachi,Ltd. 1997
//Licensed material of Hitachi,Ltd
//
// Embeded C++ Class Library Header <ios>
//
//====================================================================
// File: ios
// Purpose: Definition of class ios
// Create: 1997.09.20 Rev. 1.0
//====================================================================
#ifndef _IOS_
#define _IOS_
class streambuf;
class ostream;
typedef long POS_T;
typedef long INT_T;
typedef long SZ_T;
typedef long OFF_T;
typedef OFF_T streamoff;
typedef SZ_T streamsize;
typedef INT_T int_type;
typedef POS_T pos_type;
typedef OFF_T off_type;
class ios_base {
public:
typedef long fmtflags;
static const fmtflags boolalpha;
static const fmtflags dec;
static const fmtflags fixed;
static const fmtflags hex;
static const fmtflags internal;
static const fmtflags left;
static const fmtflags oct;
static const fmtflags right;
static const fmtflags scientific;
static const fmtflags showbase;
static const fmtflags showpoint;
static const fmtflags showpos;
static const fmtflags skipws;
static const fmtflags unitbuf;
static const fmtflags uppercase;
static const fmtflags adjustfield;
static const fmtflags basefield;
static const fmtflags floatfield;
typedef int iostate;
static const iostate badbit;
static const iostate eofbit;
static const iostate failbit;
static const iostate goodbit;
typedef int openmode;
static const openmode app;
static const openmode ate;
static const openmode binary;
static const openmode in;
static const openmode out;
static const openmode trunc;
typedef int seekdir;
static const seekdir beg;
static const seekdir cur;
static const seekdir end;
class Init;
fmtflags flags() const {return (fmtflags)fmtfl;}
fmtflags flags(fmtflags);
fmtflags setf(fmtflags) ;
fmtflags setf(fmtflags, fmtflags);
void unsetf(fmtflags);
char fill() const {
return (char)fillch;
}
char fill(char);
int precision() const {
return prec;
}
streamsize precision(streamsize);
streamsize width() const {return wide;}
streamsize width(streamsize);
// static int xalloc() {return index++;} // Not implemented
// long & ipword(int); // Not implemented
// long * &pword(int); // Not implemented
~ios_base(){} // destructor
// callbacks -- exposition only
enum event {
erase_event,
imbue_event,
copyfmt_event
};
typedef void (*event_callback)(event, ios_base&, int index);
void register_callback(event_callback fn, int index);
static bool sync_with_stdio(bool sync = true){ return true; }
class Init{
public:
Init(){init_cnt++;}
~Init(){init_cnt--;}
private:
static int init_cnt;
};
protected:
ios_base(){Init::Init();}
void _ec2p_init_base();
void _ec2p_copy_base(ios_base &);
static const fmtflags _fmtmask;
static const iostate _statemask;
private:
fmtflags fmtfl; // format flag
streamsize prec; // number of after floating point
streamsize wide; // field width
char fillch; // fill charactor
// static int index; // exposition only
// long *iarray; // exposition only
// void **parray; // exposition only
};
class ios : public ios_base {
public:
// Types:
// typedef INT_T int_type;
// typedef POS_T pos_type;
// typedef OFF_T off_type;
operator void*() const {
return (void*)!fail();
}
bool operator!() const{return (bool)fail();}
iostate rdstate () const{return (iostate)state;}
void clear(iostate = goodbit);
void setstate(iostate);
bool good() const {return (bool)(state==goodbit);}
bool eof() const {return (bool)(state&eofbit);}
bool fail() const {return (bool)(state&(badbit|failbit));}
bool bad() const {return (bool)(state&badbit);}
iostate exceptions() const; // exposition only
void exceptions(iostate); // exposition only
ios(streambuf *sbptr){ // Constructor
init(sbptr);
}
virtual ~ios(){}; // Destructor
ostream *tie() const {return tiestr;}
ostream *tie(ostream*);
streambuf *rdbuf() const{return sb;}
streambuf *rdbuf(streambuf*);
ios & copyfmt(const ios &);
ios(){init(0);}
void init(streambuf*);
private:
streambuf *sb; // pointer to streambuf object
ostream *tiestr; // pointer to ostream object
int state; // status
};
//Manipulators
ios_base & boolalpha(ios_base&);
ios_base & noboolalpha(ios_base&);
ios_base & showbase(ios_base&);
ios_base & noshowbase(ios_base&);
ios_base & showpoint(ios_base&);
ios_base & noshowpoint(ios_base&);
ios_base & showpos(ios_base&);
ios_base & noshowpos(ios_base&);
ios_base & skipws(ios_base&);
ios_base & noskipws(ios_base&);
ios_base & uppercase(ios_base&);
ios_base & nouppercase(ios_base&);
//Adjustfield
ios_base & internal(ios_base&);
ios_base & left(ios_base&);
ios_base & right(ios_base&);
//Basefield
ios_base & dec(ios_base&);
ios_base & hex(ios_base&);
ios_base & oct(ios_base&);
//floatfield
ios_base & fixed(ios_base&);
ios_base & scientific(ios_base&);
#endif

View File

@ -1,27 +0,0 @@
//Embedded C++ Library
//Copyright (c) Hitachi,Ltd. 1997
//Licensed material of Hitachi,Ltd
//
// Standard iostream objects
// Embeded C++ Library Header <iostream>
//
//====================================================================
// File: iostream
// Purpose: Definition of class iostream
// Create: 1997.09.20 Rev. 1.0
//====================================================================
#ifndef _IOSTREAM_
#define _IOSTREAM_
#include <mystrbuf>
#include <istream>
#include <ostream>
extern istream cin;
extern ostream cout;
// extern ostream cerr; // EC++, not implemented
#endif

View File

@ -1,112 +0,0 @@
//Embedded C++ Library
//Copyright (c) Hitachi,Ltd. 1997
//Licensed material of Hitachi,Ltd
//====================================================================
// File: istream
// Purpose: Definition of class istream
// Create: 1997.09.20 Rev. 1.0
//====================================================================
#ifndef _ISTREAM_
#define _ISTREAM_
#include <streambuf>
class istream : public ios {
public:
// Types (inherited from ios):
// typedef INT_T int_type;
// typedef POS_T pos_type;
// typedef OFF_T off_type;
istream(streambuf *sb)
:chcount(0),ios(sb){} // Constructor
virtual ~istream(){} // Destructor
class sentry; // Prefix/Suffix
// Formatted input
istream& operator >>(istream& (*pf)(istream&)){
return ((*pf)(*this)); }
istream& operator >>(ios& (*pf)(ios&)){
(*pf)(* (ios *)this); return (*this); }
istream& operator>> (ios_base& (*pf)(ios_base&)){
(*pf)(* (ios*)this); return (*this); }
istream & operator >>(bool &n);
istream & operator >>(short &n);
istream & operator >>(unsigned short &n);
istream & operator >>(int &n);
istream & operator >>(unsigned int &n);
istream & operator >>(long &n);
istream & operator >>(unsigned long &n);
istream & operator >>(float &f);
istream & operator >>(double &f);
istream & operator >>(long double &f);
istream & operator >>(void * &p);
istream & operator >>(streambuf *sb);
// Unformatted input
streamsize gcount() const{return chcount;}
int_type get();
istream & get( char& c );
istream & get( signed char& c );
istream & get( unsigned char& c );
istream & get( char* s, streamsize n);
istream & get( char* s, streamsize n, char delim );
istream & get( signed char* s, streamsize n);
istream & get( signed char* s, streamsize n, char delim );
istream & get( unsigned char* s, streamsize n);
istream & get( unsigned char* s, streamsize n, char delim );
istream & get( streambuf& sb);
istream & get( streambuf& sb, char delim );
istream & getline( char* s, streamsize n);
istream & getline( char* s, streamsize n, char delim );
istream & getline( signed char* s, streamsize n );
istream & getline( signed char* s, streamsize n, char delim );
istream & getline( unsigned char* s, streamsize n );
istream & getline( unsigned char* s, streamsize n, char delim );
istream & ignore( streamsize n=1, int_type delim=streambuf::eof );
int_type peek();
istream & read( char* s, streamsize n );
istream & read( signed char* s, streamsize n );
istream & read( unsigned char* s, streamsize n );
streamsize readsome( char* s, streamsize n );
streamsize readsome( signed char* s, streamsize n );
streamsize readsome( unsigned char* s, streamsize n );
istream & putback( char c );
istream & unget();
int sync();
pos_type tellg();
istream & seekg( pos_type pos );
istream & seekg( off_type off, ios_base::seekdir dir );
private:
streamsize chcount;
streamsize _ec2p_gets( char* s, streamsize n, char delim, int mode );
int _ec2p_getistr(char* str, unsigned int dig, int mode);
int _ec2p_getfstr(char* str, unsigned int dig);
unsigned long _ec2p_strtoul(char *nptr, char **endptr, int base);
long _ec2p_extlong();
unsigned long _ec2p_extulong();
};
class istream::sentry {
public:
sentry(istream& is, bool noskipws = false);
~sentry(){}
operator bool() { return ok_; }
private:
bool ok_;
};
// character extraction templates:
istream& operator>>(istream&, char&);
istream& operator>>(istream&, unsigned char&);
istream& operator>>(istream&, signed char&);
istream& operator>>(istream&, char*);
istream& operator>>(istream&, unsigned char*);
istream& operator>>(istream&, signed char*);
// Manipulator
istream& ws(istream& is );
#endif

View File

@ -1,35 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C Compiler Ver. 1.0 */
/* Copyright (c) 1992 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/***********************************************************************/
/* SPEC; */
/* NAME = limits.h : */
/* */
/* FUNC = this module do the following functions */
/* */
/* CLAS = UNIT; */
/* */
/* END; */
/***********************************************************************/
#ifndef _LIMITS
#define _LIMITS
#define CHAR_BIT 8
#define CHAR_MAX 127
#define CHAR_MIN (-128)
#define SCHAR_MAX 127
#define SCHAR_MIN (-128)
#define UCHAR_MAX 255
#define SHRT_MAX 32767
#define SHRT_MIN (-32768)
#define USHRT_MAX 65535
#define INT_MAX 2147483647
#define INT_MIN (-2147483647-1)
#define UINT_MAX 4294967295u
#define LONG_MAX 2147483647
#define LONG_MIN (-2147483647L-1L)
#define ULONG_MAX 4294967295u
#endif

View File

@ -1,23 +0,0 @@
/*------------------------------------------------------*/
/* SH C Compiler Ver. 1.0 */
/* Copyright (c) 1992 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/*****************************************************************/
/* SPEC ; */
/* NAME = machine.h : */
/* FUNC = */
/* ; */
/* */
/* */
/* */
/* CLAS = UNIT ; */
/* END ; */
/*****************************************************************/
#ifndef _MACHINE
#define _MACHINE
#include <smachine.h>
#include <umachine.h>
#endif

View File

@ -1,111 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C Compiler Ver. 1.0 */
/* Copyright (c) 1992 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/*****************************************************************/
/* SPEC ; */
/* NAME = math : */
/* FUNC = */
/* ; */
/* */
/* */
/* */
/* CLAS = UNIT ; */
/* END ; */
/*****************************************************************/
#ifndef _MATH
#define _MATH
#ifdef __cplusplus
#include <builtin.h>
#endif
#ifndef ERANGE
#define ERANGE 1100
#endif
#ifndef EDOM
#define EDOM 1101
#endif
#ifndef ENUM
#define ENUM 1208
#endif
#ifdef __cplusplus
extern "C" {
#endif
extern volatile int _errno;
extern const double _HUGE_VAL;
#define HUGE_VAL _HUGE_VAL
extern double frexp(double, int *);
extern double ldexp(double, int );
extern double modf(double, double *);
extern double ceil(double);
#ifdef _SH4
#ifdef _FPS
#define fabs _builtin_fabsf
#else
#define fabs _builtin_fabs
#endif
#else
#if defined(_SH2E)|defined(_SH3E)
#ifdef _FLT
#define fabs _builtin_fabsf
#else
extern double fabs(double);
#endif
#else
extern double fabs(double);
#endif
#endif
extern double floor(double);
extern double fmod(double, double);
extern double acos(double);
extern double asin(double);
extern double atan(double);
extern double atan2(double,double);
extern double cos(double);
extern double sin(double);
extern double tan(double);
extern double cosh(double);
extern double tanh(double);
extern double sinh(double);
extern double exp(double);
extern double log(double);
extern double log10(double);
extern double pow(double,double);
#ifdef _COMPLEX_
extern double sqrt(double);
#else
#ifdef _SH4
#ifdef _FPS
#define sqrt _builtin_sqrtf
#else
#define sqrt _builtin_sqrt
#endif
#else
#ifdef _SH3E
#ifdef _FLT
#define sqrt _builtin_sqrtf
#else
extern double sqrt(double);
#endif
#else
extern double sqrt(double);
#endif
#endif
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,66 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C Compiler Ver. 1.1 */
/* Copyright (c) 1992 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/*****************************************************************/
/* SPEC ; */
/* NAME = mathf */
/* FUNC = */
/* ; */
/* */
/* */
/* */
/* CLAS = UNIT ; */
/* END ; */
/*****************************************************************/
#ifndef _MATHF
#define _MATHF
#ifdef __cplusplus
extern "C" {
#include <builtin.h>
#endif
extern float frexpf(float, int *);
extern float ldexpf(float, int);
extern float modff(float, float *);
extern float ceilf(float);
#if defined(_SH2E)|defined(_SH3E)|defined(_SH4)
#ifdef _FPD
#define fabsf _builtin_fabs
#else
#define fabsf _builtin_fabsf
#endif
#else
extern float fabsf(float);
#endif
extern float floorf(float);
extern float fmodf(float, float);
extern float acosf(float);
extern float asinf(float);
extern float atanf(float);
extern float atan2f(float,float);
extern float cosf(float);
extern float sinf(float);
extern float tanf(float);
extern float coshf(float);
extern float tanhf(float);
extern float sinhf(float);
extern float expf(float);
extern float logf(float);
extern float log10f(float);
extern float powf(float,float);
#if defined(_SH3E)|defined(_SH4)
#ifdef _FPD
#define sqrtf _builtin_sqrt
#else
#define sqrtf _builtin_sqrtf
#endif
#else
extern float sqrtf(float);
#endif
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,53 +0,0 @@
//Embedded C++ Library
//Copyright (c) Hitachi,Ltd. 1997
//Licensed material of Hitachi,Ltd
//
// Embeded C++ Library <mystrbuf>
//
//====================================================================
// File: mystrbuf
// Purpose: Definition of class mystrbuf
// Create: 1997.09.20 Rev. 1.0
//====================================================================
#ifndef _MYSTRBUF_
#define _MYSTRBUF_
#ifdef _EC2P_GPP
#define _bufbase _base
#define _bufptr _ptr
#define _bufcnt _cnt
// #define _buflen _bufsiz
#define _ioflag1 _flag
#endif
#include <streambuf>
struct _f_type;
class mystrbuf : public streambuf {
public:
mystrbuf(){_file_Ptr = 0;}
mystrbuf(void *_fp){_Init((_f_type*)_fp);}
virtual ~mystrbuf(){close();}
void *myfptr() const{return _file_Ptr;}
mystrbuf *open(const char *, int);
mystrbuf *close();
protected:
virtual streambuf *setbuf(char *, streamsize);
virtual pos_type seekoff(off_type, ios_base::seekdir,
ios_base::openmode=(ios_base::openmode)(ios_base::in|ios_base::out));
virtual pos_type seekpos(pos_type sp,
ios_base::openmode=(ios_base::openmode)(ios_base::in|ios_base::out));
virtual int sync();
virtual int showmanyc(){return 0;}
virtual int_type underflow();
virtual int_type pbackfail(int_type=streambuf::eof);
virtual int_type overflow(int_type=streambuf::eof);
private:
void _Init(_f_type *);
_f_type *_file_Ptr;
#ifdef _EC2P_GPP
long _buflen_wk;
#endif
};
#endif

View File

@ -1,31 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C Compiler Ver. 6.0 */
/* Copyright (c) 1992, 2000 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/***********************************************************************/
/* SPEC; */
/* NAME = new : */
/* */
/* FUNC = Include file for C++ default operator new . */
/* */
/* CLAS = UNIT; */
/* */
/* END; */
/***********************************************************************/
#ifndef __NEW__
#define __NEW__
#ifdef __embedded_cplusplus
#include <new_ecpp.h> // include Embeded C++ Library Header
#else
#include <new_edg.h> // include ANSI C++ Library Header
#endif /* ifdef __embedded_cplusplus */
#endif /* ifndef __NEW__ */

View File

@ -1,41 +0,0 @@
//Embedded C++ Library
//Copyright (c) Hitachi,Ltd. 1997
//Licensed material of Hitachi,Ltd
//
// Dynamic memory management
// Embeded C++ Library Header <new>
//
//====================================================================
// File: new
// Purpose: Definition of class new
// Create: 1997.09.20 Rev. 1.0
//====================================================================
#ifndef _NEW_
#define _NEW_
#include <stdlib.h>
// Storage allocation and deallocation
void *operator new(size_t);
void *operator new[] (size_t);
void *operator new(size_t,void *);
void *operator new[](size_t,void *);
void operator delete(void *);
void operator delete[](void *);
// void operator delete(void *, void *); // Not implemented
// void operator delete[](void *, void *); // Not implemented
// Type new_handler
typedef void (*new_handler)();
// set_new_handler
new_handler set_new_handler(new_handler new_P);
// new_handler
extern new_handler _ec2p_new_handler;
#endif

View File

@ -1,122 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C Compiler Ver. 6.0 */
/* Copyright (c) 1992, 2000 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/***********************************************************************/
/* SPEC; */
/* NAME = new_edg.h : */
/* */
/* FUNC = Include file for C++ default operator new . */
/* */
/* CLAS = UNIT; */
/* */
/* END; */
/***********************************************************************/
#ifndef __NEW_H
#define __NEW_H
#ifndef _STDDEF
#include <stddef.h>
#endif /* ifndef _STDDEF */
#ifndef _EXCEPTION_H
#include <exception.h>
#endif /* _EXCEPTION_H */
#ifndef __EDG_STD_NAMESPACE
/* If not already defined, define a macro that expands to the namespace
containing the standard library. */
#ifdef __EDG_RUNTIME_USES_NAMESPACES
#define __EDG_STD_NAMESPACE std
#else /* ifndef __EDG_RUNTIME_USES_NAMESPACES */
#define __EDG_STD_NAMESPACE /* nothing */
#endif /* ifdef __EDG_RUNTIME_USES_NAMESPACES */
#endif /* ifdef __EDG_STD_NAMESPACE */
#ifdef __EDG_RUNTIME_USES_NAMESPACES
namespace std {
#endif /* ifdef __EDG_RUNTIME_USES_NAMESPACES */
/* This lets users disable the EDG supplied exception classes. */
#ifndef __NO_EDG_EXCEPTION_CLASSES
class bad_alloc : public exception {
public:
bad_alloc() throw();
bad_alloc(const bad_alloc&) throw();
bad_alloc& operator=(const bad_alloc&) throw();
virtual ~bad_alloc() throw();
virtual const char* what() const throw();
};
#endif /* ifndef __NO_EDG_EXCEPTION_CLASSES */
typedef void (*new_handler)();
new_handler set_new_handler(new_handler);
struct nothrow_t { };
// Declaration of object nothrow to permit the use of the placement new
// syntax: new (nothrow) T;
const nothrow_t nothrow = {};
#ifdef __EDG_RUNTIME_USES_NAMESPACES
} /* namespace std */
#ifdef __EDG_IMPLICIT_USING_STD
/* Implicitly include a using directive for the STD namespace when this
preprocessing flag is TRUE. */
using namespace std;
#endif /* ifdef __EDG_IMPLICIT_USING_STD */
#endif /* ifdef __EDG_RUNTIME_USES_NAMESPACES */
/* Normal operator new. */
void *operator new(size_t) throw(__EDG_STD_NAMESPACE::bad_alloc);
/* Normal operator delete. */
void operator delete(void*) throw ();
/* Nothrow version of operator new. */
void *operator new(size_t, const __EDG_STD_NAMESPACE::nothrow_t&) throw();
/* Nothrow version of operator delete. */
void operator delete(void*, const __EDG_STD_NAMESPACE::nothrow_t&) throw();
/* Placement new. */
void *operator new(size_t, void*) throw();
/* Placement delete. */
#ifdef __PLACEMENT_DELETE
void operator delete(void*, void*) throw();
#endif /* ifdef __PLACEMENT_DELETE */
#ifdef __ARRAY_OPERATORS
/* Array new. */
void *operator new[](size_t) throw(__EDG_STD_NAMESPACE::bad_alloc);
/* Array delete. */
void operator delete[](void*) throw ();
/* Placement array new. */
void *operator new[](size_t, void*) throw();
/* Placement array delete. */
#ifdef __PLACEMENT_DELETE
void operator delete[](void*, void*) throw();
#endif /* ifdef __PLACEMENT_DELETE */
/* Nothrow version of array new. */
void *operator new[](size_t,
const __EDG_STD_NAMESPACE::nothrow_t&) throw();
/* Nothrow version of array delete. */
void operator delete[](void*,
const __EDG_STD_NAMESPACE::nothrow_t&) throw();
#endif /* __ARRAY_OPERATORS */
// EC++ use new_handler
extern __EDG_STD_NAMESPACE::new_handler _ec2p_new_handler;
#endif /* ifndef __NEW_H */

View File

@ -1,87 +0,0 @@
//Embedded C++ Library
//Copyright (c) Hitachi,Ltd. 1997
//Licensed material of Hitachi,Ltd
//====================================================================
// File: ostream
// Purpose: Definition of class ostream
// Create: 1997.09.20 Rev. 1.0
//====================================================================
#ifndef _OSTREAM_
#define _OSTREAM_
#include <streambuf>
class ostream : public ios {
public:
// Types (inherited from ios):
// typedef INT_T int_type;
// typedef POS_T pos_type;
// typedef OFF_T off_type;
ostream(streambuf *sbptr) : ios(sbptr){}
virtual ~ostream(){}
class sentry; // Prefix/Suffix
ostream& operator <<(ostream& (*pf)(ostream&)){
return (*pf)(*this); }
ostream& operator <<(ios& (*pf)(ios&)){
(*pf)(*(ios*)this); return *this; }
ostream& operator<< (ios_base& (*pf)(ios_base&)){
(*pf)(*(ios*)this); return *this; }
ostream & operator <<(bool n){
*this<<(int)n; return *this; }
ostream & operator <<(short);
ostream & operator <<(unsigned short);
ostream & operator <<(int);
ostream & operator <<(unsigned int);
ostream & operator <<(long);
ostream & operator <<(unsigned long);
ostream & operator <<(float);
ostream & operator <<(double);
ostream & operator <<(long double);
ostream & operator <<(void *);
ostream & operator <<(streambuf *);
ostream & put(char);
ostream & write(const char *, streamsize);
ostream & write(const signed char *, streamsize);
ostream & write(const unsigned char *, streamsize);
ostream & flush();
pos_type tellp();
ostream& seekp( pos_type );
ostream& seekp( off_type , ios_base::seekdir );
int _ec2p_strput(const char*);
private:
void _ec2p_IntPrint(const char*, short);
void _ec2p_FloatPrint(const char*, short);
void _ec2p_DataPut(const char*, int, int, int, int);
void _ec2p_int_fmtparam(const char*, char*);
void _ec2p_flt_fmtparam(const char*, char*);
};
// Class ostream::sentry
class ostream::sentry {
public:
sentry(ostream& os);
~sentry();
operator bool() { return ok_; }
private:
bool ok_;
ostream* __ec2p_os;
};
// character inserters
ostream& operator<<(ostream&, char);
ostream& operator<<(ostream&, const char*);
// signed and unsigned
ostream& operator<<(ostream&, signed char);
ostream& operator<<(ostream&, unsigned char);
// signed and unsigned
ostream& operator<<(ostream&, const signed char*);
ostream& operator<<(ostream&, const unsigned char*);
ostream & endl( ostream & );
ostream & ends( ostream & );
ostream & flush( ostream & );
#endif

View File

@ -1,48 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C Compiler Ver. 1.0 */
/* Copyright (c) 1992 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/***********************************************************************/
/* SPEC; */
/* NAME = setjmp.h : ; */
/* */
/* FUNC = this module do the following functions ; */
/* */
/* CLAS = UNIT; */
/* */
/* END; */
/***********************************************************************/
#ifndef _SETJMP
#define _SETJMP
#if defined(_SH2E)|defined(_SH3E)||defined(_SH4)
typedef int jmp_buf[38];
#else
typedef int jmp_buf[20];
#endif
#ifdef _SH4
typedef int jmp_buf_a[54];
#endif
#ifdef __cplusplus
extern "C" {
#endif
extern int setjmp(jmp_buf);
extern void longjmp(jmp_buf, int);
#ifdef _SH4
extern int setjmp_a(jmp_buf);
extern void longjmp_a(jmp_buf, int);
#endif
extern volatile int _errno;
#ifdef __cplusplus
}
#endif
#ifndef SEQERR
#define SEQERR 1108
#endif
#endif

View File

@ -1,28 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C Compiler Ver. 3.0 */
/* Copyright (c) 1992,1995 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/*****************************************************************/
/* SPEC ; */
/* NAME = smachine.h : */
/* FUNC = ; */
/* CLAS = UNIT ; */
/* END ; */
/*****************************************************************/
#ifndef _SMACHINE
#define _SMACHINE
#ifdef __cplusplus
#include <builtin.h>
#endif
#define set_imask(mask) _builtin_set_imask(mask)
#define get_imask() _builtin_get_imask()
#define set_cr(cr) _builtin_set_cr(cr)
#define get_cr() _builtin_get_cr()
#define set_vbr(base) _builtin_set_vbr(base)
#define get_vbr() _builtin_get_vbr()
#define sleep() _builtin_sleep()
#endif

View File

@ -1,36 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C Compiler Ver. 1.0 */
/* Copyright (c) 1992 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/*****************************************************************/
/* SPEC ; */
/* NAME = stdarg : */
/* FUNC = this module do the following finctions ; */
/* */
/* (1) initialize parameter pointer */
/* (2) set parameter pointer to next parameter */
/* */
/* */
/* END ; */
/*****************************************************************/
#ifndef _STDARG
#define _STDARG
typedef char *va_list ;
#define va_start(ap,param) (void)((ap)=(int)\
((char *) &(param)+sizeof(param))%4u?\
(char *) &(param)+sizeof(param)+(4u-(sizeof(param)%4u)):\
(char *) &(param)+sizeof(param))
#define va_arg(ap,type) (*((ap)=((int)((ap)+sizeof(type))%4u?\
(ap)+sizeof(type)+(4u-(sizeof(type)%4u)):\
(ap)+sizeof(type)),\
(type *)((int)((ap)-sizeof(type))%4u?\
(ap)-sizeof(type)-(4u-(sizeof(type)%4u)):\
(ap)-sizeof(type))))
#define va_end(ap)
#endif

View File

@ -1,46 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C Compiler Ver. 1.0 */
/* Copyright (c) 1992 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/***********************************************************************/
/* SPEC; */
/* NAME = stddef : */
/* */
/* FUNC = this module do the following functions */
/* */
/* CLAS = UNIT; */
/* */
/* END; */
/***********************************************************************/
#ifndef _STDDEF
#define _STDDEF
#ifndef _PTRDIFF_T
#define _PTRDIFF_T
typedef int ptrdiff_t;
#endif
#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned long size_t;
#endif
#ifndef NULL
#ifdef __cplusplus
#define NULL (0)
#else
#define NULL ((void *)0)
#endif
#endif
#ifndef offsetof
#define offsetof(type,id) ((char *)(&(((type *)NULL)->id)) - \
(char *)((type *)NULL))
#endif
#ifndef errno
#define errno _errno
#endif
#endif

View File

@ -1,47 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C Compiler Ver. 1.0 */
/* Copyright (c) 1992 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/***********************************************************************/
/* SPEC; */
/* NAME = stdexcept.h : */
/* */
/* FUNC = Include file for exception handling (see 19.1.1) */
/* */
/* CLAS = UNIT; */
/* */
/* END; */
/***********************************************************************/
#ifndef _STDEXCEPT_H
#define _STDEXCEPT_H
/* This lets users disable the EDG supplied exception classes. */
#ifndef __NO_EDG_EXCEPTION_CLASSES
#ifdef __EDG_RUNTIME_USES_NAMESPACES
namespace std {
#endif /* ifdef __EDG_RUNTIME_USES_NAMESPACES */
class exception {
public:
exception() throw();
exception& operator=(const exception&) throw();
virtual ~exception() throw();
virtual const char* what() const throw();
};
#ifdef __EDG_RUNTIME_USES_NAMESPACES
} /* namespace std */
#ifdef __EDG_IMPLICIT_USING_STD
/* Implicitly include a using directive for the STD namespace when this
preprocessing flag is TRUE. */
using namespace std;
#endif /* ifdef __EDG_IMPLICIT_USING_STD */
#endif /* ifdef __EDG_RUNTIME_USES_NAMESPACES */
#endif /* ifndef __NO_EDG_EXCEPTION_CLASSES */
#endif /* _STDEXCEPT_H */

View File

@ -1,146 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C Compiler Ver. 1.0 */
/* Copyright (c) 1992 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/***********************************************************************/
/* SPEC; */
/* NAME = stdio : header file for standard I/O function ; */
/* */
/* FUNC = this header file do the following functions; */
/* (1) file entry table define; */
/* (2) I/O macro define; */
/* (3) symbol define; */
/* CLAS = UNIT; */
/* */
/* END; */
/***********************************************************************/
#ifndef _STDIO
#define _STDIO
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#endif
#define _NFILE 20
#define SYS_OPEN 20
extern struct _iobuf {
unsigned char *_bufptr; /* buffer pointer */
long _bufcnt; /* buffer count */
unsigned char *_bufbase; /* buffer base pointer */
long _buflen; /* buffer length */
char _ioflag1; /* I/O control flag 1 */
char _ioflag2; /* I/O control flag 2 */
char _iofd;
} _iob[_NFILE];
extern volatile int _errno;
typedef struct _iobuf FILE; /* define FILE of file-stream */
/* define function of prototype */
extern int _fillbuf(FILE*);
extern int _flshbuf(int,FILE*);
extern void _putcsub(FILE*);
extern int fclose(FILE *);
extern int fflush(FILE *);
extern FILE *fopen(const char *, const char *);
extern FILE *freopen(const char *, const char *, FILE *);
extern void setbuf(FILE *, char *);
extern int setvbuf(FILE *, char *, int, size_t);
extern int fprintf(FILE *, const char *, ...);
extern int fscanf(FILE *, const char *, ...);
extern int printf(const char * ,...);
extern int scanf(const char * ,...);
extern int sprintf(char *, const char * ,...);
extern int sscanf(const char *, const char * ,...);
extern int vfprintf(FILE *, const char *, char *);
extern int vprintf(const char *, char *);
extern int vsprintf(char *, const char *, char *);
extern int fgetc(FILE *);
extern char *fgets(char *, int, FILE *);
extern int fputc(int , FILE *);
extern int fputs(const char *, FILE *);
extern int getc(FILE *);
extern int getchar(void);
extern char *gets(char *);
extern int putc(int, FILE *);
extern int putchar(int);
extern int puts(const char *);
extern int ungetc(int, FILE *);
extern size_t fread(void *, size_t, size_t, FILE *);
extern size_t fwrite(const void *, size_t, size_t, FILE *);
extern int fseek(FILE *, long int, int);
extern long ftell(FILE *);
extern void rewind(FILE *);
extern void clearerr(FILE *);
extern int feof(FILE *);
extern int ferror(FILE *);
extern void perror(const char *);
#ifdef __cplusplus
}
#endif
#define _IOFBF 1 /* define _IOFBF of full buffering */
#define _IOLBF 2 /* define _IOLBF of line buffering */
#define _IONBF 3 /* define _IONBF of non buffering */
#define SEEK_SET 0 /* allocate top position */
#define SEEK_CUR 1 /* allocate current position */
#define SEEK_END 2 /* allocate bottom position */
#define BUFSIZ 512 /* default buffer size */
/* error number define */
#ifndef EBADF
#define EBADF 1302 /* I/O operation error */
#endif
#ifndef PTRERR
#define PTRERR 1106 /* fp null */
#endif
#ifndef ECSPEC
#define ECSPEC 1304 /* format err */
#endif
#ifndef NOTOPN
#define NOTOPN 1300 /* file not open */
#endif
/* I/O flags for _ioflag1 */
#define _IOREAD 1 /* only read or update read */
#define _IOWRITE 2 /* only write or update write */
#define _IORW 4 /* update file */
#define _IOUNBUF 8 /* unbffering I/O */
#define _IOBGBUF 16 /* automatic buffer allocate */
#define _IOEOF 32 /* end of file */
#define _IOERR 64 /* I/O error */
#define _IOBIN 128 /* binaly file */
#define _UNGTC 1 /* ungetc issued (_ioflag2) */
#define _IOLINBUF 2 /* line buffering */
#define EOF (-1)
#define _EOL (0X0A) /* end of line */
#define stdin (&_iob[0]) /* standard input file */
#define stdout (&_iob[1]) /* standard output file */
#define stderr (&_iob[2]) /* standard error output file */
#define getc(fp) ((fp)->_ioflag2&=~_UNGTC,(((fp)->_ioflag1&(_IORW|_IOWRITE))==\
(_IORW|_IOWRITE))&&(fp)->_bufcnt==(fp)->_buflen?(_fillbuf(fp)):\
--(fp)->_bufcnt>=0 ?((int)*(fp)->_bufptr++):_fillbuf(fp))
#define putc(x,fp) (((((fp)->_ioflag1&_IORW)!=0&&((fp)->_ioflag1&_IOWRITE)==0)\
?_putcsub(fp):(void)0),((((fp)->_bufcnt==0)||((((fp)->_ioflag2&_IOLINBUF)!=0)\
&& ((fp)->_bufbase!=(fp)->_bufptr)&&(*((fp)->_bufptr-1)==_EOL)))\
?_flshbuf((int)(x),(fp)):\
(((fp)->_bufcnt--),((int)(*(fp)->_bufptr++=(unsigned char)(x))))))
#define getchar() getc(stdin)
#define putchar(x) putc(x,stdout)
#define feof(fp) ((fp)->_ioflag1&_IOEOF)
#define ferror(fp) ((fp)->_ioflag1&_IOERR)
#define clearerr(fp) ((void)((fp)->_ioflag1&=~(_IOEOF|_IOERR)))
#endif

View File

@ -1,97 +0,0 @@
//Embedded C++ Library
//Copyright (c) Hitachi,Ltd. 1997
//Licensed material of Hitachi,Ltd
//
// Embeded C++ Library <streambuf>
//
//====================================================================
// File: streambuf
// Purpose: Definition of class streambuf
// Create: 1997.09.20 Rev. 1.0
//====================================================================
#ifndef _STREAMBUF_
#define _STREAMBUF_
#include <ios>
class streambuf {
public:
virtual ~streambuf(){}
streambuf *pubsetbuf(char *cptr, streamsize nnum){
return setbuf(cptr, nnum);
}
pos_type pubseekoff(off_type off,ios_base::seekdir way,
ios_base::openmode which
=(ios_base::openmode)
(ios_base::in|ios_base::out)){
return seekoff(off, way, which);
}
pos_type pubseekpos(pos_type sp,
ios_base::openmode which
=(ios_base::openmode)
(ios_base::in|ios_base::out)){
return seekpos(sp, which);
}
int pubsync(){
return sync();
}
streamsize in_avail(){
return ((gptr()!=0)&&(gptr()<egptr()) ?
egptr()-gptr(): showmanyc());
}
int_type snextc() {return ((sbumpc()==eof) ? eof:sgetc());}
int_type sbumpc();
int_type sgetc();
int sgetn(char* cptr, streamsize nnum) {return xsgetn( cptr, nnum);}
int_type sputbackc(char);
int sungetc();
int sputc(char);
int_type sputn(const char *cptr, streamsize nnum)
{return xsputn( cptr, nnum);}
enum {eof=-1};
protected:
streambuf();
char *eback() const {return *B_beg_pptr;}
char *gptr() const {return *B_next_pptr;}
char *egptr() const {return (*B_next_pptr+(*_B_cnt_ptr));}
void gbump(int nptr);
void setg(char *gbeg, char *gnext, char *gend)
{*B_beg_pptr = gbeg;*B_next_pptr = gnext;B_end_ptr = gend;
*_B_cnt_ptr=gend-gnext;*_B_len_ptr=gend-gbeg;}
char *pbase() const {return *B_beg_pptr;}
char *pptr() const {return *B_next_pptr;}
char *epptr() const {return (*B_beg_pptr+(*_B_len_ptr));}
char *_ec2p_getflag() const { return ((char*)C_flg_ptr);}
void pbump(int nptr);
void setp(char *pbeg, char *pend)
{*B_beg_pptr = pbeg;*B_next_pptr = pbeg;B_end_ptr = pend;
*_B_cnt_ptr=pend-pbeg;*_B_len_ptr=pend-pbeg;}
virtual streambuf *setbuf(char *, streamsize){ return this; }
virtual pos_type seekoff(off_type, ios_base::seekdir,
ios_base::openmode=(ios_base::openmode)
(ios_base::in|ios_base::out)){ return -1; }
virtual pos_type seekpos(pos_type, ios_base::openmode=
(ios_base::openmode)(ios_base::in|ios_base::out)){
return -1; }
virtual int sync(){ return 0; }
virtual int showmanyc(){ return 0; }
virtual streamsize xsgetn(char *, streamsize);
virtual int_type underflow(){ return eof; }
virtual int_type uflow();
virtual int_type pbackfail(int_type=eof){ return eof; }
virtual streamsize xsputn(const char *, streamsize);
virtual int_type overflow(int_type=eof){ return eof; }
char *& _ec2p_gnptr(){ return (char *&)*B_next_pptr;}
char *& _ec2p_pnptr(){ return (char *&)*B_next_pptr;}
void _ec2p_bcntplus(){(*_B_cnt_ptr)++;}
void _ec2p_bcntminus(){(*_B_cnt_ptr)--;}
void _ec2p_setbPtr(char**, char**, long*, long*,char*);
private:
long *_B_cnt_ptr, *_B_len_ptr;
char *B_beg_ptr, *B_next_ptr, *B_end_ptr;
char **B_beg_pptr, **B_next_pptr;
char *C_flg_ptr;
};
#endif

View File

@ -1,213 +0,0 @@
//Embedded C++ Library
//Copyright (c) Hitachi,Ltd. 1997
//Licensed material of Hitachi,Ltd
//
// Strings library / String classes
// Embedded C++ Library Header <string>
//
//====================================================================
// File: string
// Purpose: Definition of class string
// Create: 1997.09.20 Rev. 1.0
//====================================================================
#ifndef _STRING_
#define _STRING_
#include <stdlib.h>
#include <string.h>
#include <istream>
#include <ostream>
#include <new>
class string;
string operator + (const string &lhs,const string &rhs);
string operator + (const char *lhs,const string &rhs);
string operator + (char lhs,const string &rhs);
string operator + (const string &lhs,const char *rhs);
string operator + (const string &lhs,char rhs);
bool operator == (const string &lhs,const string &rhs);
bool operator == (const char *lhs,const string &rhs);
bool operator == (const string &lhs,const char *rhs);
bool operator != (const string &lhs,const string &rhs);
bool operator != (const char *lhs,const string &rhs);
bool operator != (const string &lhs,const char *rhs);
bool operator < (const string &lhs,const string &rhs);
bool operator < (const char *lhs,const string &rhs);
bool operator < (const string &lhs,const char *rhs);
bool operator > (const string &lhs,const string &rhs);
bool operator > (const char *lhs,const string &rhs);
bool operator > (const string &lhs,const char *rhs);
bool operator <= (const string &lhs,const string &rhs);
bool operator <= (const char *lhs,const string &rhs);
bool operator <= (const string &lhs,const char *rhs);
bool operator >= (const string &lhs,const string &rhs);
bool operator >= (const char *lhs,const string &rhs);
bool operator >= (const string &lhs,const char *rhs);
void swap(string &lhs, string &rhs);
istream & operator >> (istream &is,string &str);
ostream & operator << (ostream &os,const string &str);
istream & getline (istream &is,string &str,char delim);
istream & getline (istream &is,string &str);
class string {
public:
typedef char* iterator;
typedef const char* const_iterator;
static const size_t npos;
string(void) {
_ec2p_getmem(NULL, 0, NULL, false);
}
string(const string& str, size_t pos = 0, size_t n = npos) {
size_t wkpos = pos > str.size() ? str.size() : pos;
size_t rlen = (n > (str.size() - wkpos)) ? str.size() - wkpos : n;
_ec2p_getmem(&str.c_str()[wkpos], rlen, NULL, false);
}
string(const char* s, size_t n) {
_ec2p_getmem(s, n, NULL, false);
}
string(const char* s) {
_ec2p_getmem(s, strlen(s), NULL, false);
}
string(size_t n, char c) {
_ec2p_getmem(NULL, n, c, true);
}
#ifdef _EC2P_GPP
string(char c) {
_ec2p_getmem(NULL, 1, c, true);
}
#endif
~string() {
if (s_ptr != NULL) {
delete [] s_ptr;
s_ptr = NULL;
}
}
string& operator=(const string& str);
string& operator=(const char* s);
string& operator=(char c);
iterator begin() { return((iterator)s_ptr); }
const_iterator begin() const { return((const_iterator)s_ptr); }
iterator end() { return((iterator)&s_ptr[s_len]); }
const_iterator end() const { return((const_iterator)&s_ptr[s_len]);}
size_t size() const { return(s_len); }
size_t length() const { return(s_len); }
size_t max_size() const { return(s_res); }
void resize(size_t n, char c);
void resize(size_t n);
size_t capacity() const { return(s_res); }
void reserve(size_t res_arg = 0);
void clear();
bool empty() const { return( s_len == 0 ? true : false ); }
const char & operator[](size_t pos) const;
char & operator[](size_t pos);
const char & at(size_t n) const;
char & at(size_t n);
string& operator+=(const string& str);
string& operator+=(const char* s);
string& operator+=(char c);
string& append(const string& str);
string& append(const string& str, size_t pos, size_t n);
string& append(const char* s, size_t n);
string& append(const char* s);
string& append(size_t n, char c);
string& assign(const string&);
string& assign(const string& str, size_t pos, size_t n);
string& assign(const char* s, size_t n);
string& assign(const char* s);
string& assign(size_t n, char c);
string& insert(size_t pos1, const string& str);
string& insert(size_t pos1, const string& str,
size_t pos2, size_t n);
string& insert(size_t pos, const char* s, size_t n);
string& insert(size_t pos, const char* s);
string& insert(size_t pos, size_t n, char c);
iterator insert(iterator p, char c = char());
void insert(iterator p, size_t n, char c);
string& erase(size_t pos = 0, size_t n = npos);
iterator erase(iterator position);
iterator erase(iterator first, iterator last);
string& replace(size_t pos1, size_t n1, const string& str);
string& replace(size_t pos1, size_t n1, const string& str,
size_t pos2, size_t n2);
string& replace(size_t pos, size_t n1, const char* s, size_t n2);
string& replace(size_t pos, size_t n1, const char* s);
string& replace(size_t pos, size_t n1, size_t n2, char c);
string& replace(iterator i1, iterator i2, const string& str);
string& replace(iterator i1, iterator i2, const char* s, size_t n);
string& replace(iterator i1, iterator i2, const char* s);
string& replace(iterator i1, iterator i2, size_t n, char c);
size_t copy(char* s, size_t n, size_t pos = 0) const;
void swap(string&);
const char* c_str() const { return(s_ptr); }
const char* data() const {
if (s_len == 0) {
s_ptr[0] = '\0';
}
return(s_ptr);
}
size_t find (const string& str, size_t pos = 0) const;
size_t find (const char* s, size_t pos, size_t n) const;
size_t find (const char* s, size_t pos = 0) const;
size_t find (char c, size_t pos = 0) const;
size_t rfind(const string& str, size_t pos = npos) const;
size_t rfind(const char* s, size_t pos, size_t n) const;
size_t rfind(const char* s, size_t pos = npos) const;
size_t rfind(char c, size_t pos = npos) const;
size_t find_first_of(const string& str, size_t pos = 0) const;
size_t find_first_of(const char* s, size_t pos, size_t n) const;
size_t find_first_of(const char* s, size_t pos = 0) const;
size_t find_first_of(char c, size_t pos = 0) const;
size_t find_last_of (const string& str, size_t pos = npos) const;
size_t find_last_of (const char* s, size_t pos, size_t n) const;
size_t find_last_of (const char* s, size_t pos = npos) const;
size_t find_last_of (char c, size_t pos = npos) const;
size_t find_first_not_of(const string& str, size_t pos = 0) const;
size_t find_first_not_of(const char* s, size_t pos, size_t n) const;
size_t find_first_not_of(const char* s, size_t pos = 0) const;
size_t find_first_not_of(char c, size_t pos = 0) const;
size_t find_last_not_of (const string& str, size_t pos = npos) const;
size_t find_last_not_of (const char* s, size_t pos, size_t n) const;
size_t find_last_not_of (const char* s, size_t pos = npos) const;
size_t find_last_not_of (char c, size_t pos = npos) const;
string substr(size_t pos = 0, size_t n = npos) const;
int compare(const string& str) const;
int compare(size_t pos1, size_t n1, const string& str) const;
int compare(size_t pos1, size_t n1, const string& str,
size_t pos2, size_t n2) const;
int compare(const char* s) const;
int compare(size_t pos1, size_t n1,
const char* s, size_t n2 = npos) const;
private:
char *s_ptr;
size_t s_len, s_res;
void _ec2p_getmem(const char *s, size_t n, char c, bool flg=false);
char *_ec2p_extmem(size_t n);
static const char _ec2p_at;
};
#endif

View File

@ -1,57 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C Compiler Ver. 1.0 */
/* Copyright (c) 1992 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/*****************************************************************/
/* SPEC ; */
/* NAME = string : */
/* FUNC = */
/* ; */
/* */
/* */
/* */
/* CLAS = UNIT ; */
/* LINK = */
/* NOTE = */
/* ; */
/* */
/* END ; */
/*****************************************************************/
#ifndef _STRING
#define _STRING
#include <stddef.h>
#ifdef __cplusplus
extern "C" {
#include <builtin.h>
#endif
extern void *memcpy(void *, const void *, size_t);
extern void *memmove(void *, const void *, size_t);
extern char *strcpy(char *, const char *);
extern char *strncpy(char *, const char *, size_t);
extern char *strcat(char *, const char *);
extern char *strncat(char *, const char *,size_t);
extern int memcmp(const void *, const void *,size_t);
extern int strcmp(const char *, const char *);
extern int strncmp(const char *, const char *, size_t);
extern void *memchr(const void *, int, size_t);
extern char *strchr(const char *, int);
extern size_t strcspn(const char *, const char *);
extern char *strpbrk(const char *, const char *);
extern char *strrchr(const char *, int);
extern size_t strspn(const char *, const char *);
extern char *strstr(const char *, const char *);
extern char *strtok(char *, const char *);
extern void *memset(void *, int, size_t);
extern char *strerror(int);
extern size_t strlen(const char *);
#ifdef __cplusplus
}
#endif
#define strcpy(s1,s2) _builtin_strcpy(s1,s2)
#define strcmp(s1,s2) _builtin_strcmp(s1,s2)
#endif

View File

@ -1,82 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C Compiler Ver. 1.0 */
/* Copyright (c) 1992 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/***********************************************************************/
/* SPEC; */
/* NAME = typeinfo.h : */
/* */
/* FUNC = Include file for type information (18.5.1) */
/* */
/* CLAS = UNIT; */
/* */
/* END; */
/***********************************************************************/
#ifndef _TYPEINFO_H
#define _TYPEINFO_H
#include <stdexcept.h>
#ifdef __EDG_RUNTIME_USES_NAMESPACES
namespace std {
#endif /* ifdef __EDG_RUNTIME_USES_NAMESPACES */
/*
If bool is not supported, use a typedef for bool.
*/
#ifdef _BOOL
typedef bool __bool;
#else /* ifndef _BOOL */
typedef int __bool;
#endif /* ifdef _BOOL */
/* The following pragma is used so that the compiler knows that this definition
of type_info is the one that corresponds to the type returned by typeid. */
#pragma define_type_info
class type_info {
public:
virtual ~type_info();
__bool operator==(const type_info&) const;
__bool operator!=(const type_info&) const;
__bool before(const type_info&) const;
const char* name() const;
private:
type_info& operator=(const type_info&); // Not actually defined
protected:
// Protected instead of private to suppress the "no accessible
// constructor" warning
type_info(const type_info&); // Not actually defined
};
class bad_cast : public exception {
public:
bad_cast() throw();
bad_cast(const bad_cast&) throw();
bad_cast& operator=(const bad_cast&) throw();
virtual ~bad_cast() throw();
virtual const char* what() const throw();
};
class bad_typeid : public exception {
public:
bad_typeid() throw();
bad_typeid(const bad_typeid&) throw();
bad_typeid& operator=(const bad_typeid&) throw();
virtual ~bad_typeid() throw();
virtual const char* what() const throw();
};
#ifdef __EDG_RUNTIME_USES_NAMESPACES
} /* namespace std */
#ifdef __EDG_IMPLICIT_USING_STD
/* Implicitly include a using directive for the STD namespace when this
preprocessing flag is TRUE. */
using namespace std;
#endif /* ifdef __EDG_IMPLICIT_USING_STD */
#endif /* ifdef __EDG_RUNTIME_USES_NAMESPACES */
#endif /* _TYPEINFO_H */

View File

@ -1,55 +0,0 @@
/*------------------------------------------------------*/
/* SH SERIES C Compiler Ver. 3.0 */
/* Copyright (c) 1992, 1995 Hitachi,Ltd. */
/* Licensed material of Hitachi,Ltd. */
/*------------------------------------------------------*/
/*****************************************************************/
/* SPEC ; */
/* NAME = umachine.h : */
/* FUNC = ; */
/* CLAS = UNIT ; */
/* END ; */
/*****************************************************************/
#ifndef _UMACHINE
#define _UMACHINE
#ifdef __cplusplus
#include <builtin.h>
#endif
#define set_gbr(base) _builtin_set_gbr(base)
#define get_gbr() _builtin_get_gbr()
#define gbr_read_byte(offset) _builtin_gbr_read_byte(offset)
#define gbr_read_word(offset) _builtin_gbr_read_word(offset)
#define gbr_read_long(offset) _builtin_gbr_read_long(offset)
#define gbr_write_byte(offset,data) _builtin_gbr_write_byte(offset,data)
#define gbr_write_word(offset,data) _builtin_gbr_write_word(offset,data)
#define gbr_write_long(offset,data) _builtin_gbr_write_long(offset,data)
#define gbr_and_byte(offset,mask) _builtin_gbr_and_byte(offset,mask)
#define gbr_or_byte(offset,mask) _builtin_gbr_or_byte(offset,mask)
#define gbr_xor_byte(offset,mask) _builtin_gbr_xor_byte(offset,mask)
#define gbr_tst_byte(offset,mask) _builtin_gbr_tst_byte(offset,mask)
#define tas(addr) _builtin_tas(addr)
#define trapa(trap_no) _builtin_trapa(trap_no)
#define macw(ptr1, ptr2, count) _builtin_macw(ptr1, ptr2, count)
#define macwl(ptr1, ptr2, count, mask) _builtin_macwl(ptr1, ptr2, count, mask)
#define macl(ptr1, ptr2, count) _builtin_macl(ptr1, ptr2, count)
#define macll(ptr1, ptr2, count, mask) _builtin_macll(ptr1, ptr2, count, mask)
#define trapa_svc _builtin_trapa_svc
#define prefetch _builtin_prefetch
#define set_fpscr(cr) _builtin_set_fpscr(cr)
#define get_fpscr() _builtin_get_fpscr()
#define fipr(vec1, vec2) _builtin_fipr(vec1, vec2)
#define ftrv(vec1, vec2) _builtin_ftrv(vec1, vec2)
#define ftrvadd(vec1, vec2, vec3) _builtin_ftrvadd(vec1, vec2, vec3)
#define ftrvsub(vec1, vec2, vec3) _builtin_ftrvsub(vec1, vec2, vec3)
#define mtrx4mul(mx1, mx2) _builtin_mtrx4mul(mx1, mx2)
#define mtrx4muladd(mx1, mx2, mx3) _builtin_mtrx4muladd(mx1, mx2, mx3)
#define mtrx4mulsub(mx1, mx2, mx3) _builtin_mtrx4mulsub(mx1, mx2, mx3)
#define ld_ext(mx) _builtin_ld_ext(mx)
#define st_ext(mx) _builtin_st_ext(mx)
#define add4(vec1, vec2, vec3) _builtin_add4(vec1, vec2, vec3)
#define sub4(vec1, vec2, vec3) _builtin_sub4(vec1, vec2, vec3)
#define trace(tv) _builtin_trace(tv)
#endif

View File

@ -1,34 +1,16 @@
#include "fxlib.h"
#include <fxlib.h>
#include <stdlib.h>
#include "addresses.h"
#include "Sound4Calc.h"
#include <addresses.h>
#include <Sound4Calc.h>
#include "syscall.h"
#include <syscall.h>
//#define DEBUG
#define PI 3.14159265358
/*#define SH7305_PJDR ((volatile unsigned char*)0xA4050130)
#define SH7305_PJCR ((volatile unsigned short*)0xA4050110)
#define SH7305_PUCR ((volatile unsigned short*)0xA4050142)
#define SH7305_PUDR ((volatile unsigned char*)0xA4050162)
#define SH7305_MSTPCR0 ((volatile unsigned int*)0xA4150030)
#define SH7305_SCSCR ((volatile unsigned short*)0xA4410008)
//SH3 addresses
#define SH7337_STBCR3 ((volatile unsigned int*)0xA40A0000)
#define SH7337_SCSCR2 ((volatile unsigned int*)0xA4410008)
#define SH7337_PGCR ((volatile unsigned int*)0xA400010C)
#define SH7337_PLCR ((volatile unsigned int*)0xA4000114)
#define SH7337_SCPCR ((volatile unsigned int*)0xA4000116)
#define SH7337_PGDR ((volatile unsigned int*)0xA400012C)
#define SH7337_SCPDR ((volatile unsigned int*)0xA4000136)*/
//typedef unsigned volatile;
char *itoa(int n, unsigned char* str, int base)
{
int i=1, j=0, x;

View File