Major clean up

Everything seems to be in working order now
This commit is contained in:
clobber 2014-08-14 03:51:51 -05:00
parent e43794acad
commit 2c3ab6beca
73 changed files with 2543 additions and 3762 deletions

175
Makefile Normal file
View File

@ -0,0 +1,175 @@
DEBUG = 0
ifeq ($(platform),)
platform = unix
ifeq ($(shell uname -a),)
platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
platform = osx
arch = intel
ifeq ($(shell uname -p),powerpc)
arch = ppc
endif
else ifneq ($(findstring MINGW,$(shell uname -a)),)
platform = win
endif
endif
# system platform
system_platform = unix
ifeq ($(shell uname -a),)
EXE_EXT = .exe
system_platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
system_platform = osx
arch = intel
ifeq ($(shell uname -p),powerpc)
arch = ppc
endif
else ifneq ($(findstring MINGW,$(shell uname -a)),)
system_platform = win
endif
TARGET_NAME := o2em
ifeq ($(platform), unix)
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
SHARED := -shared -Wl,--no-undefined -Wl,--version-script=link.T
else ifeq ($(platform), osx)
TARGET := $(TARGET_NAME)_libretro.dylib
fpic := -fPIC
SHARED := -dynamiclib
ifeq ($(arch),ppc)
FLAGS += -DMSB_FIRST
OLD_GCC = 1
endif
OSXVER = `sw_vers -productVersion | cut -c 4`
ifneq ($(OSXVER),9)
fpic += -mmacosx-version-min=10.5
endif
else ifeq ($(platform), ios)
TARGET := $(TARGET_NAME)_libretro_ios.dylib
fpic := -fPIC
SHARED := -dynamiclib
CC = clang -arch armv7 -isysroot $(IOSSDK)
CXX = clang++ -arch armv7 -isysroot $(IOSSDK)
OSXVER = `sw_vers -productVersion | cut -c 4`
ifneq ($(OSXVER),9)
SHARED += -miphoneos-version-min=5.0
CC += -miphoneos-version-min=5.0
CXX += -miphoneos-version-min=5.0
endif
else ifeq ($(platform), qnx)
TARGET := $(TARGET_NAME)_libretro_qnx.so
fpic := -fPIC
SHARED := -shared -Wl,--no-undefined -Wl,--version-script=link.T
CC = qcc -Vgcc_ntoarmv7le
CXX = QCC -Vgcc_ntoarmv7le_cpp
else ifeq ($(platform), ps3)
TARGET := $(TARGET_NAME)_libretro_ps3.a
CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
CXX = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-g++.exe
AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe
STATIC_LINKING = 1
FLAGS += -DMSB_FIRST
OLD_GCC = 1
else ifeq ($(platform), sncps3)
TARGET := $(TARGET_NAME)_libretro_ps3.a
CC = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
CXX = $(CELL_SDK)/host-win32/sn/bin/ps3ppusnc.exe
AR = $(CELL_SDK)/host-win32/sn/bin/ps3snarl.exe
STATIC_LINKING = 1
FLAGS += -DMSB_FIRST
NO_GCC = 1
else ifeq ($(platform), psp1)
TARGET := $(TARGET_NAME)_libretro_psp1.a
CC = psp-gcc$(EXE_EXT)
CXX = psp-g++$(EXE_EXT)
AR = psp-ar$(EXE_EXT)
STATIC_LINKING = 1
FLAGS += -G0 -DLSB_FIRST
else
TARGET := $(TARGET_NAME)_libretro.dll
CC = gcc
CXX = g++
SHARED := -shared -Wl,--no-undefined -Wl,--version-script=link.T
LDFLAGS += -static-libgcc -static-libstdc++ -lwinmm
endif
O2EM_DIR := src
O2EM_SOURCES := $(O2EM_DIR)/audio.c \
$(O2EM_DIR)/cpu.c \
$(O2EM_DIR)/crc32.c \
$(O2EM_DIR)/cset.c \
$(O2EM_DIR)/debug.c \
$(O2EM_DIR)/keyboard.c \
$(O2EM_DIR)/score.c \
$(O2EM_DIR)/table.c \
$(O2EM_DIR)/timefunc.c \
$(O2EM_DIR)/vdc.c \
$(O2EM_DIR)/vmachine.c \
$(O2EM_DIR)/voice.c \
$(O2EM_DIR)/vpp.c \
$(O2EM_DIR)/vpp_cset.c
LIBRETRO_SOURCES := libretro.c
SOURCES_C := allegrowrapper/wrapalleg.c \
SOURCES := $(LIBRETRO_SOURCES) $(O2EM_SOURCES)
OBJECTS := $(SOURCES:.c=.o) $(SOURCES_C:.c=.o)
all: $(TARGET)
ifeq ($(DEBUG),1)
FLAGS += -O0 -g
else
FLAGS += -O2 -DNDEBUG
endif
LDFLAGS += $(fpic) -lz $(SHARED)
FLAGS += $(fpic)
FLAGS += -I. -Isrc -Iallegrowrapper
ifeq ($(OLD_GCC), 1)
WARNINGS := -Wall
else ifeq ($(NO_GCC), 1)
WARNINGS :=
else
WARNINGS := -Wall \
-Wno-narrowing \
-Wno-sign-compare \
-Wno-unused-variable \
-Wno-unused-function \
-Wno-uninitialized \
-Wno-unused-result \
-Wno-strict-aliasing \
-Wno-overflow \
-fno-strict-overflow
endif
FLAGS += -D__LIBRETRO__ $(WARNINGS)
CXXFLAGS += $(FLAGS)
CFLAGS += $(FLAGS)
$(TARGET): $(OBJECTS)
ifeq ($(STATIC_LINKING), 1)
$(AR) rcs $@ $(OBJECTS)
else
$(CXX) -o $@ $^ $(LDFLAGS)
endif
%.o: %.cpp
$(CXX) -c -o $@ $< $(CXXFLAGS)
%.o: %.c
$(CC) -c -o $@ $< $(CFLAGS)
clean:
rm -f $(TARGET) $(OBJECTS)
.PHONY: clean

View File

@ -1,138 +0,0 @@
The Clarified Artistic License
Preamble
The intent of this document is to state the conditions under which a
Package may be copied, such that the Copyright Holder maintains some
semblance of artistic control over the development of the package,
while giving the users of the package the right to use and distribute
the Package in a more-or-less customary fashion, plus the right to make
reasonable modifications.
Definitions:
"Package" refers to the collection of files distributed by the
Copyright Holder, and derivatives of that collection of files
created through textual modification.
"Standard Version" refers to such a Package if it has not been
modified, or has been modified in accordance with the wishes
of the Copyright Holder as specified below.
"Copyright Holder" is whoever is named in the copyright or
copyrights for the package.
"You" is you, if you're thinking about copying or distributing
this Package.
"Distribution fee" is a fee you charge for providing a copy
of this Package to another party.
"Freely Available" means that no fee is charged for the right to
use the item, though there may be fees involved in handling the
item. It also means that recipients of the item may redistribute
it under the same conditions they received it.
1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.
2. You may apply bug fixes, portability fixes and other modifications
derived from the Public Domain, or those made Freely Available, or from
the Copyright Holder. A Package modified in such a way shall still be
considered the Standard Version.
3. You may otherwise modify your copy of this Package in any way, provided
that you insert a prominent notice in each changed file stating how and
when you changed that file, and provided that you do at least ONE of the
following:
a) place your modifications in the Public Domain or otherwise make them
Freely Available, such as by posting said modifications to Usenet or an
equivalent medium, or placing the modifications on a major network
archive site allowing unrestricted access to them, or by allowing the
Copyright Holder to include your modifications in the Standard Version
of the Package.
b) use the modified Package only within your corporation or organization.
c) rename any non-standard executables so the names do not conflict
with standard executables, which must also be provided, and provide
a separate manual page for each non-standard executable that clearly
documents how it differs from the Standard Version.
d) make other distribution arrangements with the Copyright Holder.
e) permit and encourge anyone who receives a copy of the modified Package
permission to make your modifications Freely Available
in some specific way.
4. You may distribute the programs of this Package in object code or
executable form, provided that you do at least ONE of the following:
a) distribute a Standard Version of the executables and library files,
together with instructions (in the manual page or equivalent) on where
to get the Standard Version.
b) accompany the distribution with the machine-readable source of
the Package with your modifications.
c) give non-standard executables non-standard names, and clearly
document the differences in manual pages (or equivalent), together
with instructions on where to get the Standard Version.
d) make other distribution arrangements with the Copyright Holder.
e) offer the machine-readable source of the Package, with your
modifications, by mail order.
5. You may charge a distribution fee for any distribution of this Package.
If you offer support for this Package, you may charge any fee you choose
for that support. You may not charge a license fee for the right to use
this Package itself. You may distribute this Package in aggregate with
other (possibly commercial and possibly nonfree) programs as part of a
larger (possibly commercial and possibly nonfree) software distribution,
and charge license fees for other parts of that software distribution,
provided that you do not advertise this Package as a product of your own.
If the Package includes an interpreter, You may embed this Package's
interpreter within an executable of yours (by linking); this shall be
construed as a mere form of aggregation, provided that the complete
Standard Version of the interpreter is so embedded.
6. The scripts and library files supplied as input to or produced as
output from the programs of this Package do not automatically fall
under the copyright of this Package, but belong to whoever generated
them, and may be sold commercially, and may be aggregated with this
Package. If such scripts or library files are aggregated with this
Package via the so-called "undump" or "unexec" methods of producing a
binary executable image, then distribution of such an image shall
neither be construed as a distribution of this Package nor shall it
fall under the restrictions of Paragraphs 3 and 4, provided that you do
not represent such an executable image as a Standard Version of this
Package.
7. C subroutines (or comparably compiled subroutines in other
languages) supplied by you and linked into this Package in order to
emulate subroutines and variables of the language defined by this
Package shall not be considered part of this Package, but are the
equivalent of input as in Paragraph 6, provided these subroutines do
not change the language in any way that would cause it to fail the
regression tests for the language.
8. Aggregation of the Standard Version of the Package with a commercial
distribution is always permitted provided that the use of this Package
is embedded; that is, when no overt attempt is made to make this Package's
interfaces visible to the end user of the commercial distribution.
Such use shall not be construed as a distribution of this Package.
9. The name of the Copyright Holder may not be used to endorse or promote
products derived from this software without specific prior written permission.
10. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
The End

View File

@ -1,333 +0,0 @@
O2EM v1.18 (Jan/2007)
an Odyssey 2 & Videopac+ emulator
copyright 1996/1998 by Daniel Boris <dboris@comcast.net>
Developed by Daniel Boris, Andre de la Rocha and Arlindo Oliveira
This package is released under the
Clarified Artistic License (see license.txt)
Project Homepage
http://o2em.sourceforge.net
---------------------------------------------------------------------------
O2EM is an open source Odyssey2 / Videopac console emulator, created by
Daniel Boris in 1996. Since version 0.80 it has been developed by André de
la Rocha and since version 1.16 it has been developed by Arlindo M. de Oliveira.
This release includes the source code for O2EM v1.18 and binaries for
Windows. The sources probably can also be compiled under other platforms
that support the Allegro game library. The binary version for Linux/X11 and
DOS continues available just until the version 1.16.
With the Windows binary, the latest stable version of the Allegro DLL is also
included. To use the Linux version you must get the Allegro library for Linux
yourself and install it as root. The DOS version does not need additional
files.
O2EM is a command line based program, but there are several Windows frontends
you can use. The "official" one is O2EM Launcher, created by Heitor
Barcellos.
In order to build O2EM from its sources, you need either the MingW or Cygwin
packages on Windows, DJGPP on DOS and GCC on Linux. See the links below.
The latest version of O2EM can be found at http://o2em.sourceforge.net If you
want to send bug reports, or be part of the O2EM development, go to the O2EM
project page at SourceForge : http://sourceforge.net/projects/o2em/
Useful links:
Dan Boris' home page: http://www.atarihq.com/danb/
Allegro library: http://alleg.sourceforge.net/
MingW C/C++ compiler: http://sourceforge.net/projects/mingw/
Soeren Gust page : http://soeren.informationstheater.de/
Odyssey2 Home: http://www.classicgaming.com/o2home/
Odysseymania the brazilian webpage : http://odysseymania.classicgaming.com.br
OdysseyBR Group: http://gamesource.groups.yahoo.com/group/OdysseyBR/
Videopac Forum: http://www.videopac.org
Acknowledgments:
We wish to thank the following people:
Keita Iida (Keita/Pooka/Fygar)
for his enthusiasm, for the O2EM beta testing, and general encouragement.
Marco Kerstens (MarcoK)
for providing Videopac schematics, and general support.
Matthew Pritchard
for sending some official O2 programming documents.
Bo Krogsgaard (Therion23)
for putting the idea of doing the emulator into my head to start with.
Jason F. Gohlke
for providing valuable Voice tech info as well as the voice samples.
Soeren Gust : For sending his patches to O2EM and for technical
information about the console. Part of his technical document was
used to implement VP+ emulation.
René van den Enden : for providing information about several
unsupported games and other help.
Simon Scudder : for sending technical information about the O2
(including the datasheet of the VP+ gfx chipset), sampled sounds and
his nice O2 disassembler.
Heitor Barcellos : for creating the O2EM Launcher frontend.
Marcelo Ribeiro : for the icon used with the windows version of O2EM,
bug reports, and for information about O2 games.
Rafael : for compiling a big list of bugs present in O2EM v0.87.
Zimmerman : for sending his patch to add key customization, on which
v1.00 customization was based.
Arlindo de Oliveira : for sending patches to fix bugs in O2EM and for
his interest in keeping the O2 emulation alive.
The members of the OdysseyBR user group: for several bug reports, as
well for support in general.
-----------------------------------------------------------------------------
Quick Setup:
To get O2EM up and running quickly follow these steps:
1. Unzip the O2EM archive on your hard drive, that will create the necessary
standard directories: ROMS, BIOS and VOICE into the main directory O2EM118.
2. Download the bios ROM O2ROM.BIN (or G7400.BIN, or C52.BIN, or JOPAC.BIN)
and put it into BIOS directory.
3. Download one or more game ROMs, for example KCMUNCH.BIN for KC Munchkin and
put the ROM in ROMS directory.
4. From the O2EM118 directory type: o2em KCMUNCH.BIN to start the game.If wants
to play KC Munchkin with BIOS VP+, type: o2em KCMUNCH.BIN -g7400
---------------------------------------------------------------------------
Setup:
Before you can run O2EM you need a copy of the Odyssey2 or Videopac bios
ROM. For copyright reasons, this ROM image can not be included in this
archive. This ROM image is stored inside the 8048 processor and can be read
out with the appropriate equipment. The image should be 1024 bytes long and
should be in the BIOS directory into the main directory O2EM118.
You will also need cartridge images, but again for copyright reasons
these can not be provided. PLEASE DO NOT E-mail us asking for ROM images! All
messages asking for ROM images will be promptly deleted.
If you wish to use Voice emulation for games like KC's Krazy Chase.
Download the voice samples and unzip them into the VOICE directory
into the main directory O2EM118. There are two sets of voice samples,
mainsamp.zip which is the main voice samples and sidsamp.zip which are the
samples used by the game Sid the Spellbinder. You only need the Sid samples
if you want voice in that game.
---------------------------------------------------------------------------
Usage:
o2em <file> [options]
<file> = file to load with extension
options:
-help Help display
-wsize=n Window size used by the emulator (1=original, 2=double size, etc.)
-fullscreen Use full screen mode
-scanlines Enable scanlines use by the video emulation. Scanlines are a
feature that makes your display look like a TV screen.
-nosound Turn off sound emulation
-novoice Turn off voice emulation
-svolume=n Set sound volume (0-100)
-vvolume=n Set voice volume (0-100)
-debug Start the emulator in debug mode
-speed=n Relative speed (100 = original speed)
-nolimit Turn off speed limiter
-bios=file Set the file name and directory to find the console
bios. By default it looks for a file named o2rom.bin.
You can use a bios file from an Odyssey2, Videopac or
Videopac+ console. If you want to run VP+ games (in
VP+ mode) then you need a VP+ bios.
-romdir=path Set the directory to find the game rom. By default it
looks for path named .../roms
-biosdir=path Set the directory to find the console bios. By default it
looks for path named .../bios
-o2rom Start the emulator with Odyssey 2 bios (default for most games).
-c52 Start the emulator with french Odyssey 2 bios.
-g7400 Start the emulator with VP+ bios (default for detected VP+ only games).
-jopac Start the emulator with french VP+ bios.
-euro This option enables the use of European timing / 50Hz mode.
This option is usually not needed as most of the games that
really require this mode will be auto-detected.
-filter Enable the low-pass audio filter.
-scshot=file Set the screen shot file name or template. The screen shot
will be saved when you press the F8 key in the emulator.
The extension of the file you give will set the file type.
supported file types are bmp, pcx and tga. You can also give
a template to save several files, using the @ character.
Using an option like -scshot=dump@.bmp will save files with
names like dump00.bmp, dump01.bmp, etc. The pictures will
have a resolution of (320x240)*wsize.
-exrom Enable the use of an alternative ROM mapping for 4Kb games, to
support some games that use a special 3kb program rom/1kb data
ROM mode. The only known that use it are Four in 1 Row and
Musician and both are detected by their CRC and set correctly.
So this option is to be used only with games that are currently
unknown to O2EM. Do not enable it as default, as it will make
all the 4kb games that do not use this special mode crash.
-s0=QUIT,PAUSE,DEBUG,RESET,SCREENCAP,SAVE,LOAD,INJECT_HIGH
These option defines which keys are used for some of the system
keys, if you use this option, you have to enter all 8 keys, to
override the original keys (ESC,F1,F4,F5,F8,F2,F3,F6)
-s1=mode/keys Define stick 1 mode/keys
-s2=mode/keys Define stick 2 mode/keys
These options define how the console joysticks are emulated.
You can use a joystick connected to your computer or use
the keyboard. You can specify a mode number (compatible with
previous versions of O2EM) to disable the joystick emulation,
to select an actual joystick or to set a default keyboard
emulation mode :
0=Disable,
1=Default Right keys (arrows keys and right shift)
2=Default Left keys (W,S,A,D,SPACE)
3=Joystick
Example: -s1=1 -s2=3
You can also specify a list of 5 keyboard codes that will
be used to emulate the joystick, separated by comas
(without spaces), using this order : UP,DOWN,LEFT,RIGHT,FIRE.
The following codes are accepted (not case sensitive):
A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
0_PAD,1_PAD,2_PAD,3_PAD,4_PAD,5_PAD,6_PAD,7_PAD,8_PAD,9_PAD,
TILDE, MINUS, EQUALS, BACKSPACE, TAB, OPENBRACE, CLOSEBRACE,
ENTER, COLON, QUOTE, BACKSLASH, BACKSLASH2, COMMA, STOP,
SLASH, SPACE, INSERT, DEL, HOME, END, PGUP, PGDN, LEFT,
RIGHT, UP, DOWN, SLASH_PAD, ASTERISK, MINUS_PAD, PLUS_PAD,
DEL_PAD, ENTER_PAD, PRTSCR, PAUSE, ABNT_C1, YEN, KANA, AT,
CIRCUMFLEX, COLON2, KANJI, LSHIFT, RSHIFT, LCONTROL,
RCONTROL, ALT, ALTGR, LWIN, RWIN, MENU, SCRLOCK, NUMLOCK
Example: -s1=y,h,g,j,lcontrol -s2=8_PAD,5_PAD,4_PAD,6_PAD,RCONTROL
-scoreadr=address where the high-score is saved for specific rom
-scoretype=type how the high-score is saved for specific rom
-score=highscore default highscore on launch ("inject" with F6)
-scorefile=file file where the highscore is saved on exit
-savefile=file filename for save/load state
----------------------------------------------------------------------------
Default configuration file:
O2EM now can use a configuration file to set the default options, so you can
specify your preferred options in this file, instead of typing it every time
you execute the emulator. The command line options override the default
settings in the file. This file must be called o2em_def.cfg and be in the
same directory of O2EM118. This configuration file is a text file where you can
put the same options you would use when calling O2EM by the command line, but
each option must be in a different line and you should not precede it with
the - character. You can also put comment lines in the file, starting the
line with the # character. Example configuration file:
# My config
wsize=3
Euro
scanlines
filter
g7400
s1=8_pad,5_pad,4_pad,6_pad,rcontrol
You disable any option set in this file when you call O2EM in the command
line, passing the =0 parameter to the option. For this example configuration,
you could disable the filter option set in the file putting -filter=0 when
you call O2EM.
----------------------------------------------------------------------------
Controls:
Arrow keys + L = Default joystick 1 emulation
W,D,S,A + Space = Default joystick 2 emulation
ESC/F12 = Leave the emulator
F1 = Pause/Information
F2 = Save State-File
F3 = Load State-File
F4 = Enter debugger
F5 = Reset emulator (same as pressing the reset on the O2 keyboard)
F6 = Inject Highscore
F8 = Make a screen shot
Caps Lock = Enables/Disables the O2 keyboard input of the keys used by
joystick emulation
----------------------------------------------------------------------------
Debugger:
The emulator comes with a built in debugger that was used for development.
The debugger is not very polished and fairly incomplete but it can be useful
for single stepping through programs and watching their behavior.
H = display help
----------------------------------------------------------------------------

View File

@ -1,316 +0,0 @@
v1.18: 01/15/2007
- added the option -biosdir to define bios directory path
- added the option -romdir to define rom directory path
- added the option -help to help display
- directory search fix : When you don't have the "roms/" and/or "bios/"
directory, the program will dump core (by Walter de Jong).
- O2Launcher works now, o2em ignore roms and bios path if o2Launcher
is running.
- quad display fix: changed the way quad chars are drawn, fixes problems
in KTAA as well as score display in Black Hole and Red Baron (Soeren Gust)
- support for Soerens MegaCART bank switching (Information about
how to use this will be included in the next verison of Soerens
Bios-Documentation) (Soeren Gust)
- new feature in debugger: savevpp to make an uncompressed dump of the VPP
screen and slide data (Soeren Gust)
- dis48: fix to work under linux again (Soeren Gust)
- init_sound volume is not set to maximum (By Gunter Wambaugh)
- added makefile and options for freeBSD (By Gunter Wambaugh)
- Other minor fixes.
all the next changes were implemented by Manopac:
- added the option -s0 to redefine the system keys (see o2em.txt for usage)
- bugfix: highscore-file is only written if scoretype is set
- changed Default Stick 1 key from right <Control> to "L" to enable Fire and
movement at the same time
- two joysticks can be used now: first stick in command-line is mapped to joystick 1,
second to joystick 2 (compatible to old command line options)
- changes in debugger: status of registers is now displayed after instructions
are executed
- new features in debugger: savedatah and savedatab to save data from memory
as sourcecode ("db xxx")
- changed Default Stick 1 key from right <Control> to "L" to enable Fire
and movement at the same time
- two joysticks can be used now: first stick in command-line is mapped to
joystick 1, second to joystick 2 (compatible to old command line options)
- changes in debugger: status of registers is now displayed after
instructions are executed
- new features in debugger: savedatah and savedatab to save data from memory
as sourcecode ("db xxx")
- removed the limit that KTAA was the only 3K enabled rom (every
rom divideable by 3K is allowed now)
- dis48: added option -bios to disassemble bios (start at address 0)
- dis48: empty line after each page
- new feature to save the highscore in games (F6 to set in game)
- new feature to save/load state (F2/F3) (with command line option savefile)
- new features in debugger: savevdc and saveext to save data from Extram and VDC
- new feature in debugger: viewsprite
- new feature in debugger: bp (breakpoint) - o2em runs with output until
breakpoint is reached (bpc to clear)
- new feature in debugger: so (step over) - runs to next instruction in memory
- more explicit register display (P1 & PSW)
- fixed the "double size sprites are shifted only 1 instead of 2 pixles" bug
- new features in debugger (load / save file, change values in memory,
assemble to memory)
v1.17: 05/01/2005
- BIOS identified by CRC, to activate a specific BIOS type: -o2rom, or
-g7400, or -c52, or -jopac. The old form can be used. See O2EM.txt for more.
- Automatic identification of BIOS VP+ when the selected game is only VP+.
- Creation of the standard directories (ROMS, BIOS, VOICE) when uncompressing
O2EM archive.
- ATLANTIS, FROGGER, COMANDO NOTURNO and CATCH THE BALL now work without
graphic bugs. This correction is based on a specific patch for each game.
Thanks Rafael Cardoso for reports these bugs.
V1.16: 12/28/2004
- Fixed a slowdown in Pick Axe Pete (based on a patch by Arlindo de
Oliveira).
- Reverted back to the old palette for O2 games, while using the new
palette for Videpac Plus games (selected based on bios version in use).
V1.15: 12/12/2004
- Added support for 12kb and 16kb games. Trans American Rally+ works now.
- Added fixes to the VP+ gfx emulation made by Soeren Gust. Flashpoint
works properly now.
- Fixed a bug in the Windows-specific emulation timing code that caused
the emulator to crash when run on a Windows machine which was on for a
few days without a reboot.
- Fixed a bug in the emulation of the DAA instruction, which caused bugs
in the score of several games (Le Tresor Englouti, Cosmic Conflict, etc.).
- Fixed instruction timings (patch by Soeren)
- Modified the palette to use values calculated from the Videopac+ RGB
encoder specs by René van den Enden, instead of guessed values.
- Other minor fixes.
V1.01: 10/23/2002
- Major speed optimization.
- Implemented VDC <-> VP+ collision detection.
- On the original machines it is possible to make all VDC
colors bright by clearing P17. This affects the background and
dark grid colors. Implemented. Now the Killer Bees! intro screen
works correctly.
- Fixed the wrong color order when mixing between VP+ and VDC graphics.
Jopac Moto Crash now works. Fixed by Soeren Gust.
- Now the VBLANK pulse is visible on the T1 input. This can be used
to differentiate between PAL and NTSC.
- Other minor fixes.
V1.00: 09/12/2002
- Implemented complete Videopac+ G7400 emulation. Implemented it from
scratch, based on the EF9340/41 datasheet (sent by Simon Scudder), on
the technical docs made by Soeren Gust and disassembling the VP+ bios.
You will need a Videopac+ bios image file in order to use this feature.
You can use the -bios option to select it, rename the file to o2rom.bin,
or select it in O2EM Launcher settings. Please note that a few O2 games
do not work with the VP+ bios, so most likely you will need both bios
versions to be able to run all the games. For copyright reasons these
files are not included with O2EM, but you can find them in the Internet.
- Added a default configuration file. Now you can specify your preferred
options in a configuration file, instead of typing it every time you
execute the emulator. The command line options override the default
settings in the file. See O2EM.txt for more.
- Extended the -s1 and -s2 switches to allow customizable keys with the
joystick emulation. Based on a patch written by Zimmerman that
implemented customizable keys it in a different way. See O2EM.txt for
more.
- Added support to the Four in 1 Row game.
- Added the -exrom switch to enable the use of a special ROM mapping mode.
See O2EM.txt for more.
- Improved the sound with Frogger and Popeye.
- Minor fixes.
V0.90: 08/07/2002
- Fixed the color palette, based on screen shots from a real O2 console.
- Fixed a bug in the sprite drawing priority. Now in several games the
sprites look better (Demon Attack, Turtles, Atlantis, Computer Golf,
Football, Helicopter Rescue, etc.).
- Modified the emulation of sprites and characters in the border region of
the screen. Fixed the bug of character wrapping to the other side of the
screen and other problems (Atlantis and others). Now the main characters of
P.T.Barnum's Acrobats! do not fall from the edge of screen.
- Fixed the audio pitch and implemented white noise emulation. Now
explosions sound much better!
- Fixed a background line blinking problem that used to affect lots of
games.
- Fixed the color bar at the left of the screen.
- Enhanced the support for European/Pal games. Now several games look and
play better. Shark Hunter intro works correctly. Frogger and Depth Charge
are fully playable !
- Implemented an audio filter that accurately emulates the behavior of the
low-pass filter present in the audio output of the real console. The sound
is better now. (Enable it with -filter).
- Fixed the screen size. Now you can see all the graphics in the game,
including the time in Labyrinth.
- Implemented Dot Grid emulation. Now Marksman is playable.
- Implemented a cached video emulation, to make it run faster with slow
machines / video cards.
- Implemented screen shots (use the F8 key and the -scshot option)
- Implemented the sprite shifted/smooth modes. Now the main character of
Q*bert looks hi-res.
- Several minor fixes.
The following fixes were made by Soeren Gust:
- Implemented the missing JNI instruction.
- Implemented the 1kb data ROM / 3kb program ROM addressing mode used by
Musician.
- Fixed the height of the grid lines.
- Added support for 3Kb per bank
V0.87: 06/21/2002
- Fixed a collision bug introduced with version 0.86.
Now Cosmic Conflict runs again. Thanks to Dan Boris for reporting
this bug.
- Implemented the option to set the O2 bios file name/dir, as
requested by my friend Heitor, to enable him to support it with his
nice O2EMLauncher frontend for O2EM 0.8x, as requested by its users.
Get O2EMLauncher here: http://www.odyssey.com.br/o2emlauncher/
Version 0.86:
- Fixed a bug in the drawing of quad characters. Now you can play
Q*Bert and Nimble Numbers Ned. Some other games will also have
improved graphics or text (Popeye, Super Cobra, etc.) .
- Fixed another bug in the collision detection. Now Demon Attack
works correctly.
Version 0.85:
- Fixed the collision detection. Now you can play Killer Bees!
- Implemented partial support to mid-screen changes to the VDC
registers without interrupts. Now several games look better, and some
that didn't work can be played, including Power Lords and Super Cobra.
- Fixed a bug in the video emulation that made some games like Turtles
and Shark Hunter appear with some strange static characters.
Version 0.80:
The following changes were already implemented by Daniel Boris in version
0.701. Implemented them again in the sources based on version v0.65:
- Fixed a bug in the CPU core related to the handling of branch
instructions near page boundaries. (Without it Sid the Spellbinder
crashed after the first level).
- CPU core now jumps to the correct address on an external interrupt.
Killer Bees runs again.
- Fixed shape of '$' character and added missing 64th character to
character set (ripped the correct character data from the v0.701
executable file).
- Fixed bug in drawing of bottom grid line.
- Added Voice support. Re implemented it from scratch, based on O2
technical specs released by Dan Boris and disassembling Smithereens
and Turtles (now it always work with Turtles).
The following changes are new to version 0.80:
- Updated the code to compile with Allegro 4.0.x and to work
without changes under Windows, Linux and DOS, with optimizations
for each.
- Implemented the option of windowed or fullscreen video modes,
with scaling, centering and optional 50% scanlines.
- Cleaned the code to make it more portable and maintainable.
- Improved timing, using the most accurate way available for
each platform.
- Fixed the keyboard scan code translation table.
- Fixed and improved the built-in debugger.
- Fixed the reset. It now works with Turtles.
- Fixed joystick detection code.
- Implemented variable speed control relative to original O2.
- Implemented individual volume control for sounds and voice.
- Implemented Pause/Information (F1).
- Avoided collision of keyboard input with key joystick
emulation. Now Caps Lock enables/disables the W,D,S,A,Space keys
for keyboard input when they are used by joystick emulation.
Works well with games like K.C.'s Krazy Chase.
- It now releases more CPU time to the system (if possible).
- Other minor changes/fixes.

View File

@ -1,103 +0,0 @@
O2EM v1.18 (Jan/2007)
an Odyssey 2 & Videopac+ emulator
copyright 1996/1998 by Daniel Boris <dboris@comcast.net>
Developed by Daniel Boris, Andre de la Rocha and Arlindo Oliveira
This package is released under the
Clarified Artistic License (see license.txt)
Project Homepage
http://o2em.sourceforge.net
---------------------------------------------------------------------------
WIP Libretro port , see original O2EM.TXT in Docs directory.
Very WIP and very bad quick hack to port O2EM to libretro.
Voice are not supported for now , sound is risky and screenshot not implemented .
At this time , works the basis but buggy on linux /android.
Remember ,Everything not working well, It's a debug release , so expect to more bug.
---------------------------------------------------------------------------
1) build
cd build
make "platform=android" or make "platform=unix"
2) Install
put bios/ and roms/ in :
/mnt/sdcard/O2EM/ for android
./build for unix
launch retroarch ,select game ...
3) Usage
L2 show/hide Statut
R2 swap kbd pages
L show/hide vkbd
R switch Shift ON/OFF
SEL EMU KSPACE
STR EMU KRETURN
A fire/valid key in vkbd
B EMU KL
X EMU K0
Y EMU K1
VKBD :
PAGE 1
0 1 2 3 4 5 6 7 8 9
+ - * / = yes no clear enter VKBD PG2
q w e r t y u i o p
a s d f g h j k l SOUND OFF/ON
z x c v b n m . ? SPACE
PAGE 2
0 1 2 3 4 5 6 7 8 9
Quit Pause Reset SShot Save Load Score KBDCol VKBD VKBD PG1
q w e r t y u i o p
a s d f g h j k l SOUND OFF/ON
z x c v b n m . ? SPACE
---------------------------------------------------------------------------
Credits:
an Odyssey 2 & Videopac+ emulator
copyright 1996/1998 by Daniel Boris <dboris@comcast.net>
Developed by Daniel Boris, Andre de la Rocha and Arlindo Oliveira
You can download the O2EM source code here : http://o2em.sourceforge.net
RetroArch/Libretro team : http://www.libretro.com

View File

@ -1,111 +0,0 @@
DEBUG := 0
include ./makefile_common.mk
ifeq ($(platform),)
platform = unix
ifeq ($(shell uname -a),)
platform = win
else ifneq ($(findstring MINGW,$(shell uname -a)),)
platform = win
else ifneq ($(findstring Darwin,$(shell uname -a)),)
platform = osx
else ifneq ($(findstring win,$(shell uname -a)),)
platform = win
endif
endif
ifeq ($(platform), android)
CC = arm-linux-androideabi-gcc
AR = @arm-linux-androideabi-ar
LD = @arm-linux-androideabi-g++
TARGET := libretro-o2em.so
fpic := -fPIC
SHARED := -Wl,--fix-cortex-a8 -llog -lz -shared -Wl,--version-script=$(LIBRETRO)/link.T -Wl,--no-undefined
PLATFLAGS := -DRETRO -DAND -DLSB_FIRST -DALIGN_DWORD -D__LIBRETRO__
else ifeq ($(platform), unix)
CC = gcc
TARGET := libretro-o2em.so
fpic := -fPIC
SHARED := -shared -Wl,--version-script=$(LIBRETRO)/link.T -Wl,--no-undefined
PLATFLAGS := -DRETRO -DLSB_FIRST -DALIGN_DWORD -D__LIBRETRO__
else ifeq ($(platform), osx)
TARGET := libretro.dylib
fpic := -fPIC
SHARED := -dynamiclib
PLATFLAGS := -DRETRO -DLSB_FIRST -DALIGN_DWORD -D__LIBRETRO__
else ifeq ($(platform), wii)
TARGET := hatari_libretro_wii.a
CC = $(DEVKITPPC)/bin/powerpc-eabi-gcc$(EXE_EXT)
CXX = $(DEVKITPPC)/bin/powerpc-eabi-g++$(EXE_EXT)
AR = $(DEVKITPPC)/bin/powerpc-eabi-ar$(EXE_EXT)
ZLIB_DIR = ../sources/utils/zlib/
ZLIB_OBJECTS := $(ZLIB_DIR)adler32.o $(ZLIB_DIR)compress.o $(ZLIB_DIR)crc32.o $(ZLIB_DIR)deflate.o \
$(ZLIB_DIR)gzclose.o $(ZLIB_DIR)gzlib.o $(ZLIB_DIR)gzread.o\
$(ZLIB_DIR)gzwrite.o $(ZLIB_DIR)infback.o $(ZLIB_DIR)inffast.o $(ZLIB_DIR)inflate.o \
$(ZLIB_DIR)trees.o $(ZLIB_DIR)inftrees.o $(ZLIB_DIR)uncompr.o $(ZLIB_DIR)uncompr.o $(ZLIB_DIR)zutil.o
CFLAGS += -DSDL_BYTEORDER=SDL_BIG_ENDIAN -DMSB_FIRST -DBYTE_ORDER=BIG_ENDIAN -DBYTE_ORDER=BIG_ENDIAN \
-DWIIPORT=1 -DHAVE_MEMALIGN -DHAVE_ASPRINTF -I$(ZLIB_DIR) -I$(DEVKITPRO)/libogc/include \
-D__powerpc__ -D__POWERPC__ -DGEKKO -DHW_RVL -mrvl -mcpu=750 -meabi -mhard-float -D__ppc__
SHARED := -lm -lpthread -lc
PLATFLAGS := -DRETRO -DALIGN_DWORD -DWIIPORT
else ifeq ($(platform), ps3)
TARGET := hatari_libretro_ps3.a
CC = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-gcc.exe
CXX = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-g++.exe
AR = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ar.exe
ZLIB_DIR = ../sources/utils/zlib/
ZLIB_OBJECTS := $(ZLIB_DIR)adler32.o $(ZLIB_DIR)compress.o $(ZLIB_DIR)crc32.o $(ZLIB_DIR)deflate.o \
$(ZLIB_DIR)gzclose.o $(ZLIB_DIR)gzlib.o $(ZLIB_DIR)gzread.o\
$(ZLIB_DIR)gzwrite.o $(ZLIB_DIR)infback.o $(ZLIB_DIR)inffast.o $(ZLIB_DIR)inflate.o \
$(ZLIB_DIR)trees.o $(ZLIB_DIR)inftrees.o $(ZLIB_DIR)uncompr.o $(ZLIB_DIR)uncompr.o $(ZLIB_DIR)zutil.o
SHARED := -lm -lpthread -lc
CFLAGS += -DSDL_BYTEORDER=SDL_BIG_ENDIAN -DMSB_FIRST -DBYTE_ORDER=BIG_ENDIAN -DBYTE_ORDER=BIG_ENDIAN \
-D__CELLOS_LV2 -DPS3PORT=1 -DHAVE_MEMALIGN -DHAVE_ASPRINTF -I$(ZLIB_DIR)
PLATFLAGS := -DRETRO -DALIGN_DWORD
else
CC = i586-mingw32msvc-gcc
#x86_64-w64-mingw32-gcc
PLATFLAGS := -DRETRO -DLSB_FIRST -DALIGN_DWORD -DWIN32PORT -DWIN32
TARGET := retro-hatari.dll
SHARED := -shared -static-libgcc -s -Wl,--version-script=$(LIBRETRO)/link.T -Wl,--no-undefined
endif
ifeq ($(DEBUG), 1)
CFLAGS += -O0 -g
else
CFLAGS += -O3
endif
CFLAGS += $(SHARED) $(fpic) \
-std=gnu99 -finline-functions -funroll-loops -fsigned-char \
-Wno-strict-prototypes -ffast-math -fomit-frame-pointer -fno-strength-reduce -fno-builtin -finline-functions -s
CXXFLAGS += $(CFLAGS) -std=gnu++0x
CPPFLAGS += $(CFLAGS)
all: $(TARGET)
ifeq ($(platform), wii)
$(TARGET): $(OBJECTS)
$(AR) rcs $@ $(OBJECTS)
else ifeq ($(platform), ps3)
$(TARGET): $(OBJECTS)
$(AR) rcs $@ $(OBJECTS)
else ifeq ($(platform), win)
$(TARGET): $(OBJECTS)
$(CC) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) -lm -lz
else
$(TARGET): $(OBJECTS)
$(CC) $(fpic) $(SHARED) $(INCLUDES) -o $@ $(OBJECTS) -lm
endif
%.o: %.c
$(CC) $(CFLAGS) $(PLATFLAGS) $(HINCLUDES) -c -o $@ $<
clean:
rm -f $(OBJECTS) $(TARGET)
.PHONY: clean

View File

@ -1,16 +0,0 @@
EMU = ../sources/src
LIBRETRO = ../sources/libretro
WALLEGRO = ../sources/allegrowrapper
CORE_SRCS = $(EMU)/audio.o $(EMU)/cpu.o $(EMU)/cset.o $(EMU)/keyboard.o $(EMU)/main.o $(EMU)/table.o $(EMU)/vdc.o \
$(EMU)/vmachine.o $(EMU)/debug.o $(EMU)/timefunc.o $(EMU)/voice.o $(EMU)/crc32.o $(EMU)/vpp_cset.o $(EMU)/vpp.o $(EMU)/score.o
BUILD_APP = $(ZLIB_OBJECTS) $(CORE_SRCS)
HINCLUDES := -I./$(EMU) -I$(LIBRETRO) -I$(WALLEGRO)
OBJECTS := $(BUILD_APP) $(WALLEGRO)/wrapalleg.o $(LIBRETRO)/libretro-o2em.o $(LIBRETRO)/o2em-mapper.o $(LIBRETRO)/vkbd.o \
$(LIBRETRO)/graph.o $(LIBRETRO)/fontmsx.o \

View File

@ -1,206 +0,0 @@
#include "wrapalleg.h"
#include <stdio.h>
#include <stdlib.h>
#define abs(a) miabs(a)
int miabs(int a){
if((a)<0)a=-a;
return a;
}
void upcase(char *p)
{
while(*p != '\0')
{
if(*p >= 97 && *p <= 122)
*p -= 32;
++p;
}
}
void downcase(char *p)
{
while(*p != '\0')
{
if(*p >= 97-32 && *p <= 122-32)
*p += 32;
++p;
}
}
void clear(BITMAP *buff){
memset(&buff->line,0,buff->w*buff->h);
}
BITMAP *create_bitmap(int w,int h){
BITMAP *buff;
buff = malloc(sizeof (BITMAP));
buff->line=malloc(1*w*h);
buff->w=w;
buff->h=h;
buff->pitch=w;
buff->depth=1;
return buff;
}
int destroy_bitmap(BITMAP *buff){
if (buff->line) {
free(buff->line);
}
free(buff);
return 0;
}
void rect(BITMAP *buff,int x,int y,int x2,int y2,unsigned char color){
int i,j,idx;
int dx= abs(x2-x);
int dy= abs(y2-y);
int V_WIDTH = buff->w;
unsigned char *buffer=buff->line[0];
for(i=x;i<x+dx;i++){
idx=i+y*V_WIDTH;
buffer[idx]=color;
idx=i+(y+dy)*V_WIDTH;
buffer[idx]=color;
}
for(j=y;j<y+dy;j++){
idx=x+j*V_WIDTH;
buffer[idx]=color;
idx=(x+dx)+j*V_WIDTH;
buffer[idx]=color;
}
}
void rectfill(BITMAP *buff,int x,int y,int x2,int y2,unsigned char color){
int i,j,idx;
int dx= abs(x2-x);
int dy= abs(y2-y);
int V_WIDTH = buff->w;
unsigned char *buffer=buff->line[0];
for(i=x;i<x+dx;i++){
for(j=y;j<y+dy;j++){
idx=i+j*V_WIDTH;
buffer[idx]=color;
}
}
}
void DrawHline(BITMAP *buff,int x,int y,int dx,int dy,unsigned char color){
int i,j,idx;
int V_WIDTH = buff->w;
unsigned char *buffer=buff->line[0];
for(i=x;i<x+dx;i++){
idx=i+y*V_WIDTH;
buffer[idx]=color;
}
}
void DrawVline(BITMAP *buff,int x,int y,int dx,int dy,unsigned char color){
int i,j,idx;
int V_WIDTH = buff->w;
unsigned char *buffer=buff->line[0];
for(j=y;j<y+dy;j++){
idx=x+j*V_WIDTH;
buffer[idx]=color;
}
}
void line(BITMAP *buff,int x1,int y1,int x2,int y2,unsigned char color){
int pixx, pixy;
int x, y;
int dx, dy;
int sx, sy;
int swaptmp;
int idx;
int V_WIDTH = buff->w;
unsigned char *buffer=buff->line[0];
dx = x2 - x1;
dy = y2 - y1;
sx = (dx >= 0) ? 1 : -1;
sy = (dy >= 0) ? 1 : -1;
if (dx==0) {
if (dy>0) {
DrawVline(buff, x1, y1,0, dy, color);
return;
} else if (dy<0) {
DrawVline(buff, x1, y2,0, -dy, color);
return;
} else {
idx=x1+y1*V_WIDTH;
buffer[idx]=color;
return ;
}
}
if (dy == 0) {
if (dx>0) {
DrawHline(buff, x1, y1, dx, 0, color);
return;
} else if (dx<0) {
DrawHline(buff, x2, y1, -dx,0, color);
return;
}
}
dx = sx * dx + 1;
dy = sy * dy + 1;
pixx = 1;
pixy = V_WIDTH;
pixx *= sx;
pixy *= sy;
if (dx < dy) {
swaptmp = dx;
dx = dy;
dy = swaptmp;
swaptmp = pixx;
pixx = pixy;
pixy = swaptmp;
}
x = 0;
y = 0;
idx=x1+y1*V_WIDTH;
for (; x < dx; x++, idx +=pixx) {
buffer[idx]=color;
y += dy;
if (y >= dx) {
y -= dx;
idx += pixy;
}
}
}

View File

@ -1,38 +0,0 @@
#ifndef WRAP_H
#define WRAP_H 1
#define INLINE static inline
#define rest(a) usleep(a)
#define strupr upcase
#define strlwr downcase
#define keypressed() 0
#define poll_keyboard()
#define yield_timeslice()
typedef struct
{
unsigned char *line;
int w;
int h;
int pitch;
int depth;
}BITMAP;
typedef struct
{
unsigned char r;
unsigned char g;
unsigned char b;
}APALETTE;
extern unsigned char key[256*2];
#define INLINE static inline
#endif

View File

@ -1,270 +0,0 @@
/****************************************************************/
/* Apple IIgs emulator */
/* */
/* Apple 2GS Original fonts. */
/* All the characters are coded in their original set. */
/* Only the USA keyboard is recognized with ROM 01. */
/* */
/****************************************************************/
unsigned char font_array[256*8]
= {
0xc7, 0xbb, 0xab, 0xa3, 0xa7, 0xbf, 0xc3, 0xff,
0xef, 0xd7, 0xbb, 0xbb, 0x83, 0xbb, 0xbb, 0xff,
0x87, 0xbb, 0xbb, 0x87, 0xbb, 0xbb, 0x87, 0xff,
0xc7, 0xbb, 0xbf, 0xbf, 0xbf, 0xbb, 0xc7, 0xff,
0x87, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0x87, 0xff,
0x83, 0xbf, 0xbf, 0x87, 0xbf, 0xbf, 0x83, 0xff,
0x83, 0xbf, 0xbf, 0x87, 0xbf, 0xbf, 0xbf, 0xff,
0xc3, 0xbf, 0xbf, 0xbf, 0xb3, 0xbb, 0xc3, 0xff,
0xbb, 0xbb, 0xbb, 0x83, 0xbb, 0xbb, 0xbb, 0xff,
0xc7, 0xef, 0xef, 0xef, 0xef, 0xef, 0xc7, 0xff,
0xfb, 0xfb, 0xfb, 0xfb, 0xfb, 0xbb, 0xc7, 0xff,
0xbb, 0xb7, 0xaf, 0x9f, 0xaf, 0xb7, 0xbb, 0xff,
0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0xbf, 0x83, 0xff,
0xbb, 0x93, 0xab, 0xab, 0xbb, 0xbb, 0xbb, 0xff,
0xbb, 0xbb, 0x9b, 0xab, 0xb3, 0xbb, 0xbb, 0xff,
0xc7, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xc7, 0xff,
0x87, 0xbb, 0xbb, 0x87, 0xbf, 0xbf, 0xbf, 0xff,
0xc7, 0xbb, 0xbb, 0xbb, 0xab, 0xb7, 0xcb, 0xff,
0x87, 0xbb, 0xbb, 0x87, 0xaf, 0xb7, 0xbb, 0xff,
0xc7, 0xbb, 0xbf, 0xc7, 0xfb, 0xbb, 0xc7, 0xff,
0x83, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xff,
0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xc7, 0xff,
0xbb, 0xbb, 0xbb, 0xbb, 0xbb, 0xd7, 0xef, 0xff,
0xbb, 0xbb, 0xbb, 0xab, 0xab, 0x93, 0xbb, 0xff,
0xbb, 0xbb, 0xd7, 0xef, 0xd7, 0xbb, 0xbb, 0xff,
0xbb, 0xbb, 0xd7, 0xef, 0xef, 0xef, 0xef, 0xff,
0x83, 0xfb, 0xf7, 0xef, 0xdf, 0xbf, 0x83, 0xff,
0x83, 0x9f, 0x9f, 0x9f, 0x9f, 0x9f, 0x83, 0xff,
0xff, 0xbf, 0xdf, 0xef, 0xf7, 0xfb, 0xff, 0xff,
0x83, 0xf3, 0xf3, 0xf3, 0xf3, 0xf3, 0x83, 0xff,
0xff, 0xff, 0xef, 0xd7, 0xbb, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x01,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xef, 0xef, 0xef, 0xef, 0xef, 0xff, 0xef, 0xff,
0xd7, 0xd7, 0xd7, 0xff, 0xff, 0xff, 0xff, 0xff,
0xd7, 0xd7, 0x83, 0xd7, 0x83, 0xd7, 0xd7, 0xff,
0xef, 0xc3, 0xaf, 0xc7, 0xeb, 0x87, 0xef, 0xff,
0x9f, 0x9b, 0xf7, 0xef, 0xdf, 0xb3, 0xf3, 0xff,
0xdf, 0xaf, 0xaf, 0xdf, 0xab, 0xb7, 0xcb, 0xff,
0xef, 0xef, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff,
0xef, 0xdf, 0xbf, 0xbf, 0xbf, 0xdf, 0xef, 0xff,
0xef, 0xf7, 0xfb, 0xfb, 0xfb, 0xf7, 0xef, 0xff,
0xef, 0xab, 0xc7, 0xef, 0xc7, 0xab, 0xef, 0xff,
0xff, 0xef, 0xef, 0x83, 0xef, 0xef, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xef, 0xef, 0xdf, 0xff,
0xff, 0xff, 0xff, 0x83, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0xff,
0xff, 0xfb, 0xf7, 0xef, 0xdf, 0xbf, 0xff, 0xff,
0xc7, 0xbb, 0xb3, 0xab, 0x9b, 0xbb, 0xc7, 0xff,
0xef, 0xcf, 0xef, 0xef, 0xef, 0xef, 0xc7, 0xff,
0xc7, 0xbb, 0xfb, 0xe7, 0xdf, 0xbf, 0x83, 0xff,
0x83, 0xfb, 0xf7, 0xe7, 0xfb, 0xbb, 0xc7, 0xff,
0xf7, 0xe7, 0xd7, 0xb7, 0x83, 0xf7, 0xf7, 0xff,
0x83, 0xbf, 0x87, 0xfb, 0xfb, 0xbb, 0xc7, 0xff,
0xe3, 0xdf, 0xbf, 0x87, 0xbb, 0xbb, 0xc7, 0xff,
0x83, 0xfb, 0xf7, 0xef, 0xdf, 0xdf, 0xdf, 0xff,
0xc7, 0xbb, 0xbb, 0xc7, 0xbb, 0xbb, 0xc7, 0xff,
0xc7, 0xbb, 0xbb, 0xc3, 0xfb, 0xf7, 0x8f, 0xff,
0xff, 0xff, 0xef, 0xff, 0xef, 0xff, 0xff, 0xff,
0xff, 0xff, 0xef, 0xff, 0xef, 0xef, 0xdf, 0xff,
0xf7, 0xef, 0xdf, 0xbf, 0xdf, 0xef, 0xf7, 0xff,
0xff, 0xff, 0x83, 0xff, 0x83, 0xff, 0xff, 0xff,
0xdf, 0xef, 0xf7, 0xfb, 0xf7, 0xef, 0xdf, 0xff,
0xc7, 0xbb, 0xf7, 0xef, 0xef, 0xff, 0xef, 0xff,
0x08, 0x10, 0x6c, 0xfe, 0xfc, 0xfc, 0x7e, 0x6c,
0x08, 0x10, 0x6c, 0x82, 0x84, 0x84, 0x52, 0x6c,
0x00, 0x00, 0x40, 0x60, 0x70, 0x78, 0x6c, 0x42,
0xfe, 0x44, 0x28, 0x10, 0x10, 0x28, 0x54, 0xfe,
0x00, 0x02, 0x04, 0x88, 0x50, 0x20, 0x20, 0x00,
0xfe, 0xfc, 0xfa, 0x36, 0xae, 0xde, 0xde, 0xfe,
0xfc, 0xfc, 0xfc, 0xdc, 0x9c, 0x00, 0x9e, 0xde,
0xfe, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0x00, 0xfe,
0x10, 0x20, 0x40, 0xfe, 0x40, 0x20, 0x10, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x54,
0x10, 0x10, 0x10, 0x10, 0x92, 0x54, 0x38, 0x10,
0x10, 0x38, 0x54, 0x92, 0x10, 0x10, 0x10, 0x10,
0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x02, 0x02, 0x02, 0x22, 0x62, 0xfe, 0x60, 0x20,
0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc,
0xc8, 0x18, 0x38, 0x7e, 0x38, 0x18, 0x08, 0xf6,
0x26, 0x30, 0x38, 0xfc, 0x38, 0x30, 0x20, 0xde,
0x02, 0x12, 0x10, 0xfe, 0x7c, 0x38, 0x12, 0x02,
0x02, 0x12, 0x38, 0x7c, 0xfe, 0x10, 0x12, 0x02,
0x00, 0x00, 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xfe,
0x10, 0x08, 0x04, 0xfe, 0x04, 0x08, 0x10, 0x00,
0x54, 0xaa, 0x54, 0xaa, 0x54, 0xaa, 0x54, 0xaa,
0xaa, 0x54, 0xaa, 0x54, 0xaa, 0x54, 0xaa, 0x54,
0x00, 0x7c, 0x82, 0x80, 0x80, 0x80, 0xfe, 0x00,
0x00, 0x00, 0xfc, 0x02, 0x02, 0x02, 0xfe, 0x00,
0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
0x10, 0x38, 0x7c, 0xfe, 0x7c, 0x38, 0x10, 0x00,
0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
0x28, 0x28, 0xee, 0x00, 0xee, 0x28, 0x28, 0x00,
0xfe, 0x02, 0x02, 0x32, 0x32, 0x02, 0x02, 0xfe,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0xdf, 0xef, 0xf7, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xc7, 0xfb, 0xc3, 0xbb, 0xc3, 0xff,
0xbf, 0xbf, 0x87, 0xbb, 0xbb, 0xbb, 0x87, 0xff,
0xff, 0xff, 0xc3, 0xbf, 0xbf, 0xbf, 0xc3, 0xff,
0xfb, 0xfb, 0xc3, 0xbb, 0xbb, 0xbb, 0xc3, 0xff,
0xff, 0xff, 0xc7, 0xbb, 0x83, 0xbf, 0xc3, 0xff,
0xe7, 0xdb, 0xdf, 0x87, 0xdf, 0xdf, 0xdf, 0xff,
0xff, 0xff, 0xc7, 0xbb, 0xbb, 0xc3, 0xfb, 0xc7,
0xbf, 0xbf, 0x87, 0xbb, 0xbb, 0xbb, 0xbb, 0xff,
0xef, 0xff, 0xcf, 0xef, 0xef, 0xef, 0xc7, 0xff,
0xf7, 0xff, 0xe7, 0xf7, 0xf7, 0xf7, 0xb7, 0xcf,
0xbf, 0xbf, 0xbb, 0xb7, 0x8f, 0xb7, 0xbb, 0xff,
0xcf, 0xef, 0xef, 0xef, 0xef, 0xef, 0xc7, 0xff,
0xff, 0xff, 0x93, 0xab, 0xab, 0xab, 0xbb, 0xff,
0xff, 0xff, 0x87, 0xbb, 0xbb, 0xbb, 0xbb, 0xff,
0xff, 0xff, 0xc7, 0xbb, 0xbb, 0xbb, 0xc7, 0xff,
0xff, 0xff, 0x87, 0xbb, 0xbb, 0x87, 0xbf, 0xbf,
0xff, 0xff, 0xc3, 0xbb, 0xbb, 0xc3, 0xfb, 0xfb,
0xff, 0xff, 0xa3, 0x9f, 0xbf, 0xbf, 0xbf, 0xff,
0xff, 0xff, 0xc3, 0xbf, 0xc7, 0xfb, 0x87, 0xff,
0xdf, 0xdf, 0x87, 0xdf, 0xdf, 0xdb, 0xe7, 0xff,
0xff, 0xff, 0xbb, 0xbb, 0xbb, 0xb3, 0xcb, 0xff,
0xff, 0xff, 0xbb, 0xbb, 0xbb, 0xd7, 0xef, 0xff,
0xff, 0xff, 0xbb, 0xbb, 0xab, 0xab, 0x93, 0xff,
0xff, 0xff, 0xbb, 0xd7, 0xef, 0xd7, 0xbb, 0xff,
0xff, 0xff, 0xbb, 0xbb, 0xbb, 0xc3, 0xfb, 0xc7,
0xff, 0xff, 0x83, 0xf7, 0xef, 0xdf, 0x83, 0xff,
0xe3, 0xcf, 0xcf, 0x9f, 0xcf, 0xcf, 0xe3, 0xff,
0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef,
0x8f, 0xe7, 0xe7, 0xf3, 0xe7, 0xe7, 0x8f, 0xff,
0xcb, 0xa7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xab, 0xd7, 0xab, 0xd7, 0xab, 0xff, 0xff,
0x38, 0x44, 0x54, 0x5c, 0x58, 0x40, 0x3c, 0x00,
0x10, 0x28, 0x44, 0x44, 0x7c, 0x44, 0x44, 0x00,
0x78, 0x44, 0x44, 0x78, 0x44, 0x44, 0x78, 0x00,
0x38, 0x44, 0x40, 0x40, 0x40, 0x44, 0x38, 0x00,
0x78, 0x44, 0x44, 0x44, 0x44, 0x44, 0x78, 0x00,
0x7c, 0x40, 0x40, 0x78, 0x40, 0x40, 0x7c, 0x00,
0x7c, 0x40, 0x40, 0x78, 0x40, 0x40, 0x40, 0x00,
0x3c, 0x40, 0x40, 0x40, 0x4c, 0x44, 0x3c, 0x00,
0x44, 0x44, 0x44, 0x7c, 0x44, 0x44, 0x44, 0x00,
0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00,
0x04, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38, 0x00,
0x44, 0x48, 0x50, 0x60, 0x50, 0x48, 0x44, 0x00,
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7c, 0x00,
0x44, 0x6c, 0x54, 0x54, 0x44, 0x44, 0x44, 0x00,
0x44, 0x44, 0x64, 0x54, 0x4c, 0x44, 0x44, 0x00,
0x38, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00,
0x78, 0x44, 0x44, 0x78, 0x40, 0x40, 0x40, 0x00,
0x38, 0x44, 0x44, 0x44, 0x54, 0x48, 0x34, 0x00,
0x78, 0x44, 0x44, 0x78, 0x50, 0x48, 0x44, 0x00,
0x38, 0x44, 0x40, 0x38, 0x04, 0x44, 0x38, 0x00,
0x7c, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00,
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00,
0x44, 0x44, 0x44, 0x44, 0x44, 0x28, 0x10, 0x00,
0x44, 0x44, 0x44, 0x54, 0x54, 0x6c, 0x44, 0x00,
0x44, 0x44, 0x28, 0x10, 0x28, 0x44, 0x44, 0x00,
0x44, 0x44, 0x28, 0x10, 0x10, 0x10, 0x10, 0x00,
0x7c, 0x04, 0x08, 0x10, 0x20, 0x40, 0x7c, 0x00,
0x7c, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7c, 0x00,
0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00,
0x7c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x7c, 0x00,
0x00, 0x00, 0x10, 0x28, 0x44, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00,
0x28, 0x28, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00,
0x28, 0x28, 0x7c, 0x28, 0x7c, 0x28, 0x28, 0x00,
0x10, 0x3c, 0x50, 0x38, 0x14, 0x78, 0x10, 0x00,
0x60, 0x64, 0x08, 0x10, 0x20, 0x4c, 0x0c, 0x00,
0x20, 0x50, 0x50, 0x20, 0x54, 0x48, 0x34, 0x00,
0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
0x10, 0x20, 0x40, 0x40, 0x40, 0x20, 0x10, 0x00,
0x10, 0x08, 0x04, 0x04, 0x04, 0x08, 0x10, 0x00,
0x10, 0x54, 0x38, 0x10, 0x38, 0x54, 0x10, 0x00,
0x00, 0x10, 0x10, 0x7c, 0x10, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x20, 0x00,
0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
0x00, 0x04, 0x08, 0x10, 0x20, 0x40, 0x00, 0x00,
0x38, 0x44, 0x4c, 0x54, 0x64, 0x44, 0x38, 0x00,
0x10, 0x30, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00,
0x38, 0x44, 0x04, 0x18, 0x20, 0x40, 0x7c, 0x00,
0x7c, 0x04, 0x08, 0x18, 0x04, 0x44, 0x38, 0x00,
0x08, 0x18, 0x28, 0x48, 0x7c, 0x08, 0x08, 0x00,
0x7c, 0x40, 0x78, 0x04, 0x04, 0x44, 0x38, 0x00,
0x1c, 0x20, 0x40, 0x78, 0x44, 0x44, 0x38, 0x00,
0x7c, 0x04, 0x08, 0x10, 0x20, 0x20, 0x20, 0x00,
0x38, 0x44, 0x44, 0x38, 0x44, 0x44, 0x38, 0x00,
0x38, 0x44, 0x44, 0x3c, 0x04, 0x08, 0x70, 0x00,
0x00, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00,
0x00, 0x00, 0x10, 0x00, 0x10, 0x10, 0x20, 0x00,
0x08, 0x10, 0x20, 0x40, 0x20, 0x10, 0x08, 0x00,
0x00, 0x00, 0x7c, 0x00, 0x7c, 0x00, 0x00, 0x00,
0x20, 0x10, 0x08, 0x04, 0x08, 0x10, 0x20, 0x00,
0x38, 0x44, 0x08, 0x10, 0x10, 0x00, 0x10, 0x00,
0x38, 0x44, 0x54, 0x5c, 0x58, 0x40, 0x3c, 0x00,
0x10, 0x28, 0x44, 0x44, 0x7c, 0x44, 0x44, 0x00,
0x78, 0x44, 0x44, 0x78, 0x44, 0x44, 0x78, 0x00,
0x38, 0x44, 0x40, 0x40, 0x40, 0x44, 0x38, 0x00,
0x78, 0x44, 0x44, 0x44, 0x44, 0x44, 0x78, 0x00,
0x7c, 0x40, 0x40, 0x78, 0x40, 0x40, 0x7c, 0x00,
0x7c, 0x40, 0x40, 0x78, 0x40, 0x40, 0x40, 0x00,
0x3c, 0x40, 0x40, 0x40, 0x4c, 0x44, 0x3c, 0x00,
0x44, 0x44, 0x44, 0x7c, 0x44, 0x44, 0x44, 0x00,
0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00,
0x04, 0x04, 0x04, 0x04, 0x04, 0x44, 0x38, 0x00,
0x44, 0x48, 0x50, 0x60, 0x50, 0x48, 0x44, 0x00,
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7c, 0x00,
0x44, 0x6c, 0x54, 0x54, 0x44, 0x44, 0x44, 0x00,
0x44, 0x44, 0x64, 0x54, 0x4c, 0x44, 0x44, 0x00,
0x38, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00,
0x78, 0x44, 0x44, 0x78, 0x40, 0x40, 0x40, 0x00,
0x38, 0x44, 0x44, 0x44, 0x54, 0x48, 0x34, 0x00,
0x78, 0x44, 0x44, 0x78, 0x50, 0x48, 0x44, 0x00,
0x38, 0x44, 0x40, 0x38, 0x04, 0x44, 0x38, 0x00,
0x7c, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00,
0x44, 0x44, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00,
0x44, 0x44, 0x44, 0x44, 0x44, 0x28, 0x10, 0x00,
0x44, 0x44, 0x44, 0x54, 0x54, 0x6c, 0x44, 0x00,
0x44, 0x44, 0x28, 0x10, 0x28, 0x44, 0x44, 0x00,
0x44, 0x44, 0x28, 0x10, 0x10, 0x10, 0x10, 0x00,
0x7c, 0x04, 0x08, 0x10, 0x20, 0x40, 0x7c, 0x00,
0x7c, 0x60, 0x60, 0x60, 0x60, 0x60, 0x7c, 0x00,
0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00,
0x7c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x7c, 0x00,
0x00, 0x00, 0x10, 0x28, 0x44, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xfe,
0x20, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x38, 0x04, 0x3c, 0x44, 0x3c, 0x00,
0x40, 0x40, 0x78, 0x44, 0x44, 0x44, 0x78, 0x00,
0x00, 0x00, 0x3c, 0x40, 0x40, 0x40, 0x3c, 0x00,
0x04, 0x04, 0x3c, 0x44, 0x44, 0x44, 0x3c, 0x00,
0x00, 0x00, 0x38, 0x44, 0x7c, 0x40, 0x3c, 0x00,
0x18, 0x24, 0x20, 0x78, 0x20, 0x20, 0x20, 0x00,
0x00, 0x00, 0x38, 0x44, 0x44, 0x3c, 0x04, 0x38,
0x40, 0x40, 0x78, 0x44, 0x44, 0x44, 0x44, 0x00,
0x10, 0x00, 0x30, 0x10, 0x10, 0x10, 0x38, 0x00,
0x08, 0x00, 0x18, 0x08, 0x08, 0x08, 0x48, 0x30,
0x40, 0x40, 0x44, 0x48, 0x70, 0x48, 0x44, 0x00,
0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x00,
0x00, 0x00, 0x6c, 0x54, 0x54, 0x54, 0x44, 0x00,
0x00, 0x00, 0x78, 0x44, 0x44, 0x44, 0x44, 0x00,
0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00,
0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x40, 0x40,
0x00, 0x00, 0x3c, 0x44, 0x44, 0x3c, 0x04, 0x04,
0x00, 0x00, 0x5c, 0x60, 0x40, 0x40, 0x40, 0x00,
0x00, 0x00, 0x3c, 0x40, 0x38, 0x04, 0x78, 0x00,
0x20, 0x20, 0x78, 0x20, 0x20, 0x24, 0x18, 0x00,
0x00, 0x00, 0x44, 0x44, 0x44, 0x4c, 0x34, 0x00,
0x00, 0x00, 0x44, 0x44, 0x44, 0x28, 0x10, 0x00,
0x00, 0x00, 0x44, 0x44, 0x54, 0x54, 0x6c, 0x00,
0x00, 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00,
0x00, 0x00, 0x44, 0x44, 0x44, 0x3c, 0x04, 0x38,
0x00, 0x00, 0x7c, 0x08, 0x10, 0x20, 0x7c, 0x00,
0x1c, 0x30, 0x30, 0x60, 0x30, 0x30, 0x1c, 0x00,
0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10,
0x70, 0x18, 0x18, 0x0c, 0x18, 0x18, 0x70, 0x00,
0x34, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x54, 0x28, 0x54, 0x28, 0x54, 0x00, 0x00,
};
/* Well, this is finally done ! */

View File

@ -1,131 +0,0 @@
unsigned char msx[]=
"\x00\x00\x00\x00\x00\x00\x00\x00\x3c\x42\xa5\x81\xa5\x99\x42\x3c"
"\x3c\x7e\xdb\xff\xff\xdb\x66\x3c\x6c\xfe\xfe\xfe\x7c\x38\x10\x00"
"\x10\x38\x7c\xfe\x7c\x38\x10\x00\x10\x38\x54\xfe\x54\x10\x38\x00"
"\x10\x38\x7c\xfe\xfe\x10\x38\x00\x00\x00\x00\x30\x30\x00\x00\x00"
"\xff\xff\xff\xe7\xe7\xff\xff\xff\x38\x44\x82\x82\x82\x44\x38\x00"
"\xc7\xbb\x7d\x7d\x7d\xbb\xc7\xff\x0f\x03\x05\x79\x88\x88\x88\x70"
"\x38\x44\x44\x44\x38\x10\x7c\x10\x30\x28\x24\x24\x28\x20\xe0\xc0"
"\x3c\x24\x3c\x24\x24\xe4\xdc\x18\x10\x54\x38\xee\x38\x54\x10\x00"
"\x10\x10\x10\x7c\x10\x10\x10\x10\x10\x10\x10\xff\x00\x00\x00\x00"
"\x00\x00\x00\xff\x10\x10\x10\x10\x10\x10\x10\xf0\x10\x10\x10\x10"
"\x10\x10\x10\x1f\x10\x10\x10\x10\x10\x10\x10\xff\x10\x10\x10\x10"
"\x10\x10\x10\x10\x10\x10\x10\x10\x00\x00\x00\xff\x00\x00\x00\x00"
"\x00\x00\x00\x1f\x10\x10\x10\x10\x00\x00\x00\xf0\x10\x10\x10\x10"
"\x10\x10\x10\x1f\x00\x00\x00\x00\x10\x10\x10\xf0\x00\x00\x00\x00"
"\x81\x42\x24\x18\x18\x24\x42\x81\x01\x02\x04\x08\x10\x20\x40\x80"
"\x80\x40\x20\x10\x08\x04\x02\x01\x00\x10\x10\xff\x10\x10\x00\x00"
"\x00\x00\x00\x00\x00\x00\x00\x00\x20\x20\x20\x20\x00\x00\x20\x00"
"\x50\x50\x50\x00\x00\x00\x00\x00\x50\x50\xf8\x50\xf8\x50\x50\x00"
"\x20\x78\xa0\x70\x28\xf0\x20\x00\xc0\xc8\x10\x20\x40\x98\x18\x00"
"\x40\xa0\x40\xa8\x90\x98\x60\x00\x10\x20\x40\x00\x00\x00\x00\x00"
"\x10\x20\x40\x40\x40\x20\x10\x00\x40\x20\x10\x10\x10\x20\x40\x00"
"\x20\xa8\x70\x20\x70\xa8\x20\x00\x00\x20\x20\xf8\x20\x20\x00\x00"
"\x00\x00\x00\x00\x00\x20\x20\x40\x00\x00\x00\x78\x00\x00\x00\x00"
"\x00\x00\x00\x00\x00\x60\x60\x00\x00\x00\x08\x10\x20\x40\x80\x00"
"\x70\x88\x98\xa8\xc8\x88\x70\x00\x20\x60\xa0\x20\x20\x20\xf8\x00"
"\x70\x88\x08\x10\x60\x80\xf8\x00\x70\x88\x08\x30\x08\x88\x70\x00"
"\x10\x30\x50\x90\xf8\x10\x10\x00\xf8\x80\xe0\x10\x08\x10\xe0\x00"
"\x30\x40\x80\xf0\x88\x88\x70\x00\xf8\x88\x10\x20\x20\x20\x20\x00"
"\x70\x88\x88\x70\x88\x88\x70\x00\x70\x88\x88\x78\x08\x10\x60\x00"
"\x00\x00\x20\x00\x00\x20\x00\x00\x00\x00\x20\x00\x00\x20\x20\x40"
"\x18\x30\x60\xc0\x60\x30\x18\x00\x00\x00\xf8\x00\xf8\x00\x00\x00"
"\xc0\x60\x30\x18\x30\x60\xc0\x00\x70\x88\x08\x10\x20\x00\x20\x00"
"\x70\x88\x08\x68\xa8\xa8\x70\x00\x20\x50\x88\x88\xf8\x88\x88\x00"
"\xf0\x48\x48\x70\x48\x48\xf0\x00\x30\x48\x80\x80\x80\x48\x30\x00"
"\xe0\x50\x48\x48\x48\x50\xe0\x00\xf8\x80\x80\xf0\x80\x80\xf8\x00"
"\xf8\x80\x80\xf0\x80\x80\x80\x00\x70\x88\x80\xb8\x88\x88\x70\x00"
"\x88\x88\x88\xf8\x88\x88\x88\x00\x70\x20\x20\x20\x20\x20\x70\x00"
"\x38\x10\x10\x10\x90\x90\x60\x00\x88\x90\xa0\xc0\xa0\x90\x88\x00"
"\x80\x80\x80\x80\x80\x80\xf8\x00\x88\xd8\xa8\xa8\x88\x88\x88\x00"
"\x88\xc8\xc8\xa8\x98\x98\x88\x00\x70\x88\x88\x88\x88\x88\x70\x00"
"\xf0\x88\x88\xf0\x80\x80\x80\x00\x70\x88\x88\x88\xa8\x90\x68\x00"
"\xf0\x88\x88\xf0\xa0\x90\x88\x00\x70\x88\x80\x70\x08\x88\x70\x00"
"\xf8\x20\x20\x20\x20\x20\x20\x00\x88\x88\x88\x88\x88\x88\x70\x00"
"\x88\x88\x88\x88\x50\x50\x20\x00\x88\x88\x88\xa8\xa8\xd8\x88\x00"
"\x88\x88\x50\x20\x50\x88\x88\x00\x88\x88\x88\x70\x20\x20\x20\x00"
"\xf8\x08\x10\x20\x40\x80\xf8\x00\x70\x40\x40\x40\x40\x40\x70\x00"
"\x00\x00\x80\x40\x20\x10\x08\x00\x70\x10\x10\x10\x10\x10\x70\x00"
"\x20\x50\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf8\x00"
"\x40\x20\x10\x00\x00\x00\x00\x00\x00\x00\x70\x08\x78\x88\x78\x00"
"\x80\x80\xb0\xc8\x88\xc8\xb0\x00\x00\x00\x70\x88\x80\x88\x70\x00"
"\x08\x08\x68\x98\x88\x98\x68\x00\x00\x00\x70\x88\xf8\x80\x70\x00"
"\x10\x28\x20\xf8\x20\x20\x20\x00\x00\x00\x68\x98\x98\x68\x08\x70"
"\x80\x80\xf0\x88\x88\x88\x88\x00\x20\x00\x60\x20\x20\x20\x70\x00"
"\x10\x00\x30\x10\x10\x10\x90\x60\x40\x40\x48\x50\x60\x50\x48\x00"
"\x60\x20\x20\x20\x20\x20\x70\x00\x00\x00\xd0\xa8\xa8\xa8\xa8\x00"
"\x00\x00\xb0\xc8\x88\x88\x88\x00\x00\x00\x70\x88\x88\x88\x70\x00"
"\x00\x00\xb0\xc8\xc8\xb0\x80\x80\x00\x00\x68\x98\x98\x68\x08\x08"
"\x00\x00\xb0\xc8\x80\x80\x80\x00\x00\x00\x78\x80\xf0\x08\xf0\x00"
"\x40\x40\xf0\x40\x40\x48\x30\x00\x00\x00\x90\x90\x90\x90\x68\x00"
"\x00\x00\x88\x88\x88\x50\x20\x00\x00\x00\x88\xa8\xa8\xa8\x50\x00"
"\x00\x00\x88\x50\x20\x50\x88\x00\x00\x00\x88\x88\x98\x68\x08\x70"
"\x00\x00\xf8\x10\x20\x40\xf8\x00\x18\x20\x20\x40\x20\x20\x18\x00"
"\x20\x20\x20\x00\x20\x20\x20\x00\xc0\x20\x20\x10\x20\x20\xc0\x00"
"\x40\xa8\x10\x00\x00\x00\x00\x00\x00\x00\x20\x50\xf8\x00\x00\x00"
"\x70\x88\x80\x80\x88\x70\x20\x60\x90\x00\x00\x90\x90\x90\x68\x00"
"\x10\x20\x70\x88\xf8\x80\x70\x00\x20\x50\x70\x08\x78\x88\x78\x00"
"\x48\x00\x70\x08\x78\x88\x78\x00\x20\x10\x70\x08\x78\x88\x78\x00"
"\x20\x00\x70\x08\x78\x88\x78\x00\x00\x70\x80\x80\x80\x70\x10\x60"
"\x20\x50\x70\x88\xf8\x80\x70\x00\x50\x00\x70\x88\xf8\x80\x70\x00"
"\x20\x10\x70\x88\xf8\x80\x70\x00\x50\x00\x00\x60\x20\x20\x70\x00"
"\x20\x50\x00\x60\x20\x20\x70\x00\x40\x20\x00\x60\x20\x20\x70\x00"
"\x50\x00\x20\x50\x88\xf8\x88\x00\x20\x00\x20\x50\x88\xf8\x88\x00"
"\x10\x20\xf8\x80\xf0\x80\xf8\x00\x00\x00\x6c\x12\x7e\x90\x6e\x00"
"\x3e\x50\x90\x9c\xf0\x90\x9e\x00\x60\x90\x00\x60\x90\x90\x60\x00"
"\x90\x00\x00\x60\x90\x90\x60\x00\x40\x20\x00\x60\x90\x90\x60\x00"
"\x40\xa0\x00\xa0\xa0\xa0\x50\x00\x40\x20\x00\xa0\xa0\xa0\x50\x00"
"\x90\x00\x90\x90\xb0\x50\x10\xe0\x50\x00\x70\x88\x88\x88\x70\x00"
"\x50\x00\x88\x88\x88\x88\x70\x00\x20\x20\x78\x80\x80\x78\x20\x20"
"\x18\x24\x20\xf8\x20\xe2\x5c\x00\x88\x50\x20\xf8\x20\xf8\x20\x00"
"\xc0\xa0\xa0\xc8\x9c\x88\x88\x8c\x18\x20\x20\xf8\x20\x20\x20\x40"
"\x10\x20\x70\x08\x78\x88\x78\x00\x10\x20\x00\x60\x20\x20\x70\x00"
"\x20\x40\x00\x60\x90\x90\x60\x00\x20\x40\x00\x90\x90\x90\x68\x00"
"\x50\xa0\x00\xa0\xd0\x90\x90\x00\x28\x50\x00\xc8\xa8\x98\x88\x00"
"\x00\x70\x08\x78\x88\x78\x00\xf8\x00\x60\x90\x90\x90\x60\x00\xf0"
"\x20\x00\x20\x40\x80\x88\x70\x00\x00\x00\x00\xf8\x80\x80\x00\x00"
"\x00\x00\x00\xf8\x08\x08\x00\x00\x84\x88\x90\xa8\x54\x84\x08\x1c"
"\x84\x88\x90\xa8\x58\xa8\x3c\x08\x20\x00\x00\x20\x20\x20\x20\x00"
"\x00\x00\x24\x48\x90\x48\x24\x00\x00\x00\x90\x48\x24\x48\x90\x00"
"\x28\x50\x20\x50\x88\xf8\x88\x00\x28\x50\x70\x08\x78\x88\x78\x00"
"\x28\x50\x00\x70\x20\x20\x70\x00\x28\x50\x00\x20\x20\x20\x70\x00"
"\x28\x50\x00\x70\x88\x88\x70\x00\x50\xa0\x00\x60\x90\x90\x60\x00"
"\x28\x50\x00\x88\x88\x88\x70\x00\x50\xa0\x00\xa0\xa0\xa0\x50\x00"
"\xfc\x48\x48\x48\xe8\x08\x50\x20\x00\x50\x00\x50\x50\x50\x10\x20"
"\xc0\x44\xc8\x54\xec\x54\x9e\x04\x10\xa8\x40\x00\x00\x00\x00\x00"
"\x00\x20\x50\x88\x50\x20\x00\x00\x88\x10\x20\x40\x80\x28\x00\x00"
"\x7c\xa8\xa8\x68\x28\x28\x28\x00\x38\x40\x30\x48\x48\x30\x08\x70"
"\x00\x00\x00\x00\x00\x00\xff\xff\xf0\xf0\xf0\xf0\x0f\x0f\x0f\x0f"
"\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00"
"\x00\x00\x00\x3c\x3c\x00\x00\x00\xff\xff\xff\xff\xff\xff\x00\x00"
"\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\x0f\x0f\x0f\x0f\xf0\xf0\xf0\xf0"
"\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\x03\x03\x03\x03\x03\x03\x03\x03"
"\x3f\x3f\x3f\x3f\x3f\x3f\x3f\x3f\x11\x22\x44\x88\x11\x22\x44\x88"
"\x88\x44\x22\x11\x88\x44\x22\x11\xfe\x7c\x38\x10\x00\x00\x00\x00"
"\x00\x00\x00\x00\x10\x38\x7c\xfe\x80\xc0\xe0\xf0\xe0\xc0\x80\x00"
"\x01\x03\x07\x0f\x07\x03\x01\x00\xff\x7e\x3c\x18\x18\x3c\x7e\xff"
"\x81\xc3\xe7\xff\xff\xe7\xc3\x81\xf0\xf0\xf0\xf0\x00\x00\x00\x00"
"\x00\x00\x00\x00\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x00\x00\x00\x00"
"\x00\x00\x00\x00\xf0\xf0\xf0\xf0\x33\x33\xcc\xcc\x33\x33\xcc\xcc"
"\x00\x20\x20\x50\x50\x88\xf8\x00\x20\x20\x70\x20\x70\x20\x20\x00"
"\x00\x00\x00\x50\x88\xa8\x50\x00\xff\xff\xff\xff\xff\xff\xff\xff"
"\x00\x00\x00\x00\xff\xff\xff\xff\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0"
"\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\xff\xff\xff\xff\x00\x00\x00\x00"
"\x00\x00\x68\x90\x90\x90\x68\x00\x30\x48\x48\x70\x48\x48\x70\xc0"
"\xf8\x88\x80\x80\x80\x80\x80\x00\xf8\x50\x50\x50\x50\x50\x98\x00"
"\xf8\x88\x40\x20\x40\x88\xf8\x00\x00\x00\x78\x90\x90\x90\x60\x00"
"\x00\x50\x50\x50\x50\x68\x80\x80\x00\x50\xa0\x20\x20\x20\x20\x00"
"\xf8\x20\x70\xa8\xa8\x70\x20\xf8\x20\x50\x88\xf8\x88\x50\x20\x00"
"\x70\x88\x88\x88\x50\x50\xd8\x00\x30\x40\x40\x20\x50\x50\x50\x20"
"\x00\x00\x00\x50\xa8\xa8\x50\x00\x08\x70\xa8\xa8\xa8\x70\x80\x00"
"\x38\x40\x80\xf8\x80\x40\x38\x00\x70\x88\x88\x88\x88\x88\x88\x00"
"\x00\xf8\x00\xf8\x00\xf8\x00\x00\x20\x20\xf8\x20\x20\x00\xf8\x00"
"\xc0\x30\x08\x30\xc0\x00\xf8\x00\x18\x60\x80\x60\x18\x00\xf8\x00"
"\x10\x28\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\xa0\x40"
"\x00\x20\x00\xf8\x00\x20\x00\x00\x00\x50\xa0\x00\x50\xa0\x00\x00"
"\x00\x18\x24\x24\x18\x00\x00\x00\x00\x30\x78\x78\x30\x00\x00\x00"
"\x00\x00\x00\x00\x30\x00\x00\x00\x3e\x20\x20\x20\xa0\x60\x20\x00"
"\xa0\x50\x50\x50\x00\x00\x00\x00\x40\xa0\x20\x40\xe0\x00\x00\x00"
"\x00\x38\x38\x38\x38\x38\x38\x00\x00\x00\x00\x00\x00\x00\x00";

View File

@ -1,452 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <math.h>
#include "graph.h"
#include "libretro-o2em.h"
extern unsigned char msx[];
void printch(char *buffer,int x, int y, unsigned couleur,unsigned char ch,int taille,int pl,int zde)
{
int i,j;
unsigned char *font;
int rectx,recty;
#if defined PITCH && PITCH == 4
unsigned *mbuffer=(unsigned*)buffer;
#else
unsigned short *mbuffer=(unsigned short *)buffer;
#endif
font=&msx[(int)ch * 8];
for(i=0;i<8;i++,font++)
{
for(j=0;j<8;j++)
{
if ((*font &(128>>j)))
{
rectx = x+(j<<0);
if(taille==1)recty = y+(i<<1);
else recty = y+(i<<0);
mbuffer[recty* VIRTUAL_WIDTH + rectx] = couleur;
if(pl==1)mbuffer[(recty+1)* VIRTUAL_WIDTH + rectx] = couleur;
}
}
}
}
void textpixel(char *buffer,int x,int y,unsigned color,int tail,int plein,int zdep, char *string,...)
{
int boucle=0;
char text[256];
va_list ap;
if (string == NULL)return;
va_start(ap, string);
vsprintf(text, string, ap);
va_end(ap);
while(text[boucle]!=0){
printch(buffer,x,y,color,text[boucle],tail,plein,zdep);
boucle++;x+=8;//6;
}
}
void textCLpixel(char *buffer,int lim,int x,int x2,int y,unsigned color,int tail,int plein,int zdep,char *string,...)
{
int boucle=0;
char text[256];
va_list ap;
if (string == NULL)return;
va_start(ap, string);
vsprintf(text, string, ap);
va_end(ap);
while(text[boucle]!=0 && boucle<lim)boucle++;
boucle=(x2-x)/2 -(boucle*3);
x=boucle;
boucle=0;
while(text[boucle]!=0 && boucle<lim){
printch(buffer,x,y,color,text[boucle],tail,plein,zdep);
boucle++;x+=8;//6;
}
}
void textCpixel(char *buffer,int x,int x2,int y,unsigned color,int tail,int plein,int zdep,char *string,...)
{
int boucle=0;
char text[256];
va_list ap;
if (string == NULL)return;
va_start(ap, string);
vsprintf(text, string, ap);
va_end(ap);
while(text[boucle]!=0)boucle++;
boucle=(x2-x)/2 -(boucle*3);
x=boucle;
boucle=0;
while(text[boucle]!=0){
printch(buffer,x,y,color,text[boucle],tail,plein,zdep);
boucle++;x+=8;//6;
}
}
void DrawFBoxBmp(char *buffer,int x,int y,int dx,int dy,unsigned color){
int i,j,idx;
#if defined PITCH && PITCH == 4
unsigned *mbuffer=(unsigned*)buffer;
#else
unsigned short *mbuffer=(unsigned short *)buffer;
#endif
for(i=x;i<x+dx;i++){
for(j=y;j<y+dy;j++){
idx=i+j*VIRTUAL_WIDTH;
mbuffer[idx]=color;
}
}
}
void DrawBoxBmp(char *buffer,int x,int y,int dx,int dy,unsigned color){
int i,j,idx;
#if defined PITCH && PITCH == 4
unsigned *mbuffer=(unsigned*)buffer;
#else
unsigned short *mbuffer=(unsigned short *)buffer;
#endif
for(i=x;i<x+dx;i++){
idx=i+y*VIRTUAL_WIDTH;
mbuffer[idx]=color;
idx=i+(y+dy)*VIRTUAL_WIDTH;
mbuffer[idx]=color;
}
for(j=y;j<y+dy;j++){
idx=x+j*VIRTUAL_WIDTH;
mbuffer[idx]=color;
idx=(x+dx)+j*VIRTUAL_WIDTH;
mbuffer[idx]=color;
}
}
void DrawHlineBmp(char *buffer,int x,int y,int dx,int dy,unsigned color){
int i,j,idx;
#if defined PITCH && PITCH == 4
unsigned *mbuffer=(unsigned*)buffer;
#else
unsigned short *mbuffer=(unsigned short *)buffer;
#endif
for(i=x;i<x+dx;i++){
idx=i+y*VIRTUAL_WIDTH;
mbuffer[idx]=color;
}
}
void DrawVlineBmp(char *buffer,int x,int y,int dx,int dy,unsigned color){
int i,j,idx;
#if defined PITCH && PITCH == 4
unsigned *mbuffer=(unsigned*)buffer;
#else
unsigned short *mbuffer=(unsigned short *)buffer;
#endif
for(j=y;j<y+dy;j++){
idx=x+j*VIRTUAL_WIDTH;
mbuffer[idx]=color;
}
}
void DrawlineBmp(char *buffer,int x1,int y1,int x2,int y2,unsigned color){
int pixx, pixy;
int x, y;
int dx, dy;
int sx, sy;
int swaptmp;
int idx;
#if defined PITCH && PITCH == 4
unsigned *mbuffer=(unsigned*)buffer;
#else
unsigned short *mbuffer=(unsigned short *)buffer;
#endif
dx = x2 - x1;
dy = y2 - y1;
sx = (dx >= 0) ? 1 : -1;
sy = (dy >= 0) ? 1 : -1;
if (dx==0) {
if (dy>0) {
DrawVlineBmp(buffer, x1, y1,0, dy, color);
return;
} else if (dy<0) {
DrawVlineBmp(buffer, x1, y2,0, -dy, color);
return;
} else {
idx=x1+y1*VIRTUAL_WIDTH;
mbuffer[idx]=color;
return ;
}
}
if (dy == 0) {
if (dx>0) {
DrawHlineBmp(buffer, x1, y1, dx, 0, color);
return;
} else if (dx<0) {
DrawHlineBmp(buffer, x2, y1, -dx,0, color);
return;
}
}
dx = sx * dx + 1;
dy = sy * dy + 1;
pixx = 1;
pixy = VIRTUAL_WIDTH;
pixx *= sx;
pixy *= sy;
if (dx < dy) {
swaptmp = dx;
dx = dy;
dy = swaptmp;
swaptmp = pixx;
pixx = pixy;
pixy = swaptmp;
}
x = 0;
y = 0;
idx=x1+y1*VIRTUAL_WIDTH;
for (; x < dx; x++, idx +=pixx) {
mbuffer[idx]=color;
y += dy;
if (y >= dx) {
y -= dx;
idx += pixy;
}
}
}
/*
void DrawBox(char *buffer,box b,char t[],unsigned color){
DrawBoxBmp(mbuffer,b.x,b.y,b.dx,b.dy,color);
textCpixel(mbuffer,b.x, 3*b.x + b.dx ,b.y+2,color,1,1,4,"%s",t);
}
void DrawBoxF(char *buffer,box b,char t[],unsigned color,unsigned border){
int ydec=b.y+(b.dy/2)-4;
if(ydec<b.y+2)ydec=b.y+2;
DrawBoxBmp(mbuffer,b.x,b.y,b.dx,b.dy,border);
DrawFBoxBmp(mbuffer,b.x+1,b.y+1,b.dx-2,b.dy-2,color);
textCpixel(mbuffer,b.x, 3*b.x + b.dx , ydec ,border,1,1,4,"%s",t);
}
*/
const float DEG2RAD = 3.14159/180;
void DrawCircle(char *buf,int x, int y, int radius,unsigned rgba,int full)
{
int i;
float degInRad;
int x1,y1;
#if defined PITCH && PITCH == 4
unsigned *mbuffer=(unsigned*)buf;
#else
unsigned short *mbuffer=(unsigned short *)buf;
#endif
for ( i=0; i < 360; i++){
degInRad = i*DEG2RAD;
x1=x+cos(degInRad)*radius;
y1=y+sin(degInRad)*radius;
if(full)DrawlineBmp(buf,x,y, x1,y1,rgba);
else {
mbuffer[x1+y1*VIRTUAL_WIDTH]=rgba;
}
}
}
#ifdef FILTER16X2
//UINT16
void filter_scale2x(unsigned char *srcPtr, unsigned srcPitch,
unsigned char *dstPtr, unsigned dstPitch,
int width, int height)
{
unsigned int nextlineSrc = srcPitch / sizeof(short);
short *p = (short *)srcPtr;
unsigned int nextlineDst = dstPitch / sizeof(short);
short *q = (short *)dstPtr;
while(height--) {
int i = 0, j = 0;
for(i = 0; i < width; ++i, j += 2) {
short B = *(p + i - nextlineSrc);
short D = *(p + i - 1);
short E = *(p + i);
short F = *(p + i + 1);
short H = *(p + i + nextlineSrc);
*(q + j) = D == B && B != F && D != H ? D : E;
*(q + j + 1) = B == F && B != D && F != H ? F : E;
*(q + j + nextlineDst) = D == H && D != B && H != F ? D : E;
*(q + j + nextlineDst + 1) = H == F && D != H && B != F ? F : E;
}
p += nextlineSrc;
q += nextlineDst << 1;
}
}
#endif
#include "font2.c"
void Draw_string(char *surf, signed short int x, signed short int y, const char *string,unsigned short maxstrlen,unsigned short xscale, unsigned short yscale, unsigned fg, unsigned bg)
{
int k,strlen;
unsigned char *linesurf;
signed int ypixel;
int col, bit;
unsigned char b;
int xrepeat, yrepeat;
#if defined PITCH && PITCH == 4
unsigned *yptr;
#elif defined PITCH && PITCH == 2
unsigned short *yptr;
#elif defined PITCH && PITCH == 1
unsigned char *yptr;
#endif
#if defined PITCH && PITCH == 4
unsigned *mbuffer=(unsigned*)surf;
#elif defined PITCH && PITCH == 2
unsigned short *mbuffer=(unsigned short *)surf;
#elif defined PITCH && PITCH == 1
unsigned char *mbuffer=(unsigned char *)surf;
#endif
if(string==NULL)return;
for(strlen = 0; strlen<maxstrlen && string[strlen]; strlen++) {}
int surfw=strlen * 7 * xscale;
int surfh=8 * yscale;
#if defined PITCH && PITCH == 4
linesurf =(unsigned char *)malloc(sizeof(unsigned )*surfw*surfh );
yptr = (unsigned *)&linesurf[0];
#elif defined PITCH && PITCH == 2
linesurf =(unsigned char *)malloc(sizeof(unsigned short)*surfw*surfh );
yptr = (unsigned short *)&linesurf[0];
#elif defined PITCH && PITCH == 1
linesurf =(unsigned char *)malloc(sizeof(unsigned char)*surfw*surfh );
yptr = (unsigned char *)&linesurf[0];
#endif
for(ypixel = 0; ypixel<8; ypixel++) {
for(col=0; col<strlen; col++) {
b = font_array[(string[col]^0x80)*8 + ypixel];
for(bit=0; bit<7; bit++, yptr++) {
*yptr = (b & (1<<(7-bit))) ? fg : bg;
for(xrepeat = 1; xrepeat < xscale; xrepeat++, yptr++)
yptr[1] = *yptr;
}
}
for(yrepeat = 1; yrepeat < yscale; yrepeat++)
for(xrepeat = 0; xrepeat<surfw; xrepeat++, yptr++)
*yptr = yptr[-surfw];
}
#if defined PITCH && PITCH == 4
yptr = (unsigned *)&linesurf[0];
#elif defined PITCH && PITCH == 2
yptr = (unsigned short*)&linesurf[0];
#elif defined PITCH && PITCH == 1
yptr = (unsigned char*)&linesurf[0];
#endif
for(yrepeat = y; yrepeat < y+ surfh; yrepeat++)
for(xrepeat = x; xrepeat< x+surfw; xrepeat++,yptr++)
if(*yptr!=0)mbuffer[xrepeat+yrepeat*VIRTUAL_WIDTH] = *yptr;
free(linesurf);
}
void Draw_text(char *buffer,int x,int y,unsigned fgcol,unsigned int bgcol ,int scalex,int scaley , int max,const char *string,...)
{
int boucle=0;
char text[256];
va_list ap;
if (string == NULL)return;
va_start(ap, string);
vsprintf(text, string, ap);
va_end(ap);
Draw_string(buffer, x,y, (const char *)text,max, scalex, scaley,fgcol,bgcol);
}

View File

@ -1,34 +0,0 @@
#ifndef GRAPH_H
#define GRAPH_H 1
extern void printch(char *buffer,int x, int y, unsigned couleur,unsigned char ch,int taille,int pl,int zde);
extern void textpixel(char *buffer,int x,int y,unsigned color,int tail,int plein,int zdep, char *string,...);
extern void textCLpixel(char *buffer,int lim,int x,int x2,int y,unsigned color,int tail,int plein,int zdep,char *string,...);
extern void textCpixel(char *buffer,int x,int x2,int y,unsigned color,int tail,int plein,int zdep,char *string,...);
extern void DrawFBoxBmp(char *buffer,int x,int y,int dx,int dy,unsigned color);
extern void DrawBoxBmp(char *buffer,int x,int y,int dx,int dy,unsigned color);
extern void DrawHlineBmp(char *buffer,int x,int y,int dx,int dy,unsigned color);
extern void DrawVlineBmp(char *buffer,int x,int y,int dx,int dy,unsigned color);
extern void DrawlineBmp(char *buffer,int x1,int y1,int x2,int y2,unsigned color);
/*
extern void DrawBox(void *buf,box b,char t[],unsigned color);
extern void DrawBoxF(void *buf,box b,char t[],unsigned color,unsigned border);
*/
extern void DrawCircle(char *buf,int x, int y, int radius,unsigned rgba,int full);
extern void Draw_string(char *surf, signed short int x, signed short int y, const char *string, unsigned short int maxstrlen, unsigned short int xscale, unsigned short int yscale,unsigned int fg, unsigned int bg);
extern void Draw_text(char *buffer,int x,int y,unsigned fgcol,unsigned int bgcol ,int scalex,int scaley , int max,const char *string,...);
#endif

View File

@ -1,211 +0,0 @@
#include "libretro.h"
#include "libretro-o2em.h"
extern unsigned short int mbmp[TEX_WIDTH * TEX_HEIGHT];
extern int SHIFTON,RLOOP,pauseg,SND ,snd_sampler;
extern short signed int SNDBUF[1024*2];
extern char RPATH[512];
extern void update_input(void);
extern void texture_init(void);
extern void Emu_init();
extern void Emu_uninit();
static retro_video_refresh_t video_cb;
static retro_audio_sample_t audio_cb;
static retro_audio_sample_batch_t audio_batch_cb;
static retro_environment_t environ_cb;
void retro_init(void)
{
texture_init();
}
void retro_deinit(void)
{
Emu_uninit();
}
unsigned retro_api_version(void)
{
return RETRO_API_VERSION;
}
void retro_set_controller_port_device(unsigned port, unsigned device)
{
(void)port;
(void)device;
}
void retro_get_system_info(struct retro_system_info *info)
{
memset(info, 0, sizeof(*info));
info->library_name = "O2EM";
info->library_version = "1.18";
info->valid_extensions = "bin";
info->need_fullpath = true;
info->block_extract = false;
}
void retro_get_system_av_info(struct retro_system_av_info *info)
{
struct retro_game_geometry geom = { TEX_WIDTH, TEX_HEIGHT, TEX_WIDTH, TEX_HEIGHT,4.0 / 3.0 };
struct retro_system_timing timing = { 60.0, 44100.0 };
info->geometry = geom;
info->timing = timing;
}
void retro_set_environment(retro_environment_t cb)
{
environ_cb = cb;
}
void retro_set_audio_sample(retro_audio_sample_t cb)
{
audio_cb = cb;
}
void retro_set_audio_sample_batch(retro_audio_sample_batch_t cb)
{
audio_batch_cb = cb;
}
void retro_set_video_refresh(retro_video_refresh_t cb)
{
video_cb = cb;
}
void retro_reset(void){}
void retro_shutdown_o2em(void)
{
environ_cb(RETRO_ENVIRONMENT_SHUTDOWN, NULL);
}
void dumpaudio(int len){
int x;
if(SND==1)
{
signed short int *p=(signed short int *)SNDBUF;
for(x=0;x<len;x++)audio_cb(*p,*p++);
}
}
void retro_run(void)
{
RetroLoop();
update_input();
video_cb(mbmp,EMUWITH,EMUHEIGHT,TEX_WIDTH << 1);
}
static void keyboard_cb(bool down, unsigned keycode, uint32_t character, uint16_t mod)
{
char retrok=keycode;
// printf( "Down: %s, Code: %d, Char: %u, Mod: %u. ,(%d)\n",
// down ? "yes" : "no", keycode, character, mod,cpck);
if (keycode>=320);
else{
if(down && retrok==304/*0x2a*/){
if(SHIFTON == 1)retro_key_up(retrok);
else retro_key_down(retrok);
SHIFTON=-SHIFTON;
}
else {
if(down && retrok!=-1)
retro_key_down(retrok);
else if(!down && retrok!=-1)
retro_key_up(retrok);
}
}
}
bool retro_load_game(const struct retro_game_info *info)
{
const char *full_path;
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
{
fprintf(stderr, "RGB565 is not supported.\n");
return false;
}
struct retro_keyboard_callback cb = { keyboard_cb };
environ_cb(RETRO_ENVIRONMENT_SET_KEYBOARD_CALLBACK, &cb);
(void)info;
full_path = info->path;
strcpy(RPATH,full_path);
RLOOP=1;
Emu_init();
return true;
}
void retro_unload_game(void){
}
unsigned retro_get_region(void)
{
return RETRO_REGION_NTSC;
}
bool retro_load_game_special(unsigned type, const struct retro_game_info *info, size_t num)
{
(void)type;
(void)info;
(void)num;
return false;
}
size_t retro_serialize_size(void)
{
return 0;
}
bool retro_serialize(void *data_, size_t size)
{
return false;
}
bool retro_unserialize(const void *data_, size_t size)
{
return false;
}
void *retro_get_memory_data(unsigned id)
{
(void)id;
return NULL;
}
size_t retro_get_memory_size(unsigned id)
{
(void)id;
return 0;
}
void retro_cheat_reset(void) {}
void retro_cheat_set(unsigned index, bool enabled, const char *code)
{
(void)index;
(void)enabled;
(void)code;
}

View File

@ -1,44 +0,0 @@
#ifndef LIBRETRO_HATARI_H
#define LIBRETRO_HATARI_H 1
#include <stdint.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <stdio.h>
#define Uint8 unsigned char
#define Uint16 unsigned short int
#define Uint32 unsigned int
#include <stdbool.h>
#define PITCH 2
#define EMUWITH 340
#define EMUHEIGHT 250
#define TEX_WIDTH 400
#define TEX_HEIGHT 300
#define VIRTUAL_WIDTH TEX_WIDTH
#define CROP_WIDTH 340
#define CROP_HEIGHT 210
#define NPLGN 10
#define NLIGN 5
#define NLETT 5
#define XSIDE (CROP_WIDTH/NPLGN -1)
#define YSIDE (CROP_HEIGHT/8 -1)
#define YBASE0 (CROP_HEIGHT - NLIGN*YSIDE -8)
#define XBASE0 0+4+2
#define XBASE3 0
#define YBASE3 YBASE0 -4
#define STAT_DECX 120
#define STAT_YSZ 20
#define RGB565(r, g, b) (((r) << (5+6)) | ((g) << 6) | (b))
#endif

View File

@ -1,787 +0,0 @@
/* Copyright (C) 2010-2013 The RetroArch team
*
* ---------------------------------------------------------------------------------------
* The following license statement only applies to this libretro API header (libretro.h).
* ---------------------------------------------------------------------------------------
*
* Permission is hereby granted, free of charge,
* to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
* and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef LIBRETRO_H__
#define LIBRETRO_H__
#include <stdint.h>
#include <stddef.h>
#include <limits.h>
// Hack applied for MSVC when compiling in C89 mode as it isn't C99 compliant.
#ifdef __cplusplus
extern "C" {
#else
#if defined(_MSC_VER) && !defined(SN_TARGET_PS3) && !defined(__cplusplus)
#define bool unsigned char
#define true 1
#define false 0
#else
#include <stdbool.h>
#endif
#endif
// Used for checking API/ABI mismatches that can break libretro implementations.
// It is not incremented for compatible changes to the API.
#define RETRO_API_VERSION 1
// Libretro's fundamental device abstractions.
#define RETRO_DEVICE_MASK 0xff
#define RETRO_DEVICE_NONE 0
// The JOYPAD is called RetroPad. It is essentially a Super Nintendo controller,
// but with additional L2/R2/L3/R3 buttons, similar to a PS1 DualShock.
#define RETRO_DEVICE_JOYPAD 1
// The mouse is a simple mouse, similar to Super Nintendo's mouse.
// X and Y coordinates are reported relatively to last poll (poll callback).
// It is up to the libretro implementation to keep track of where the mouse pointer is supposed to be on the screen.
// The frontend must make sure not to interfere with its own hardware mouse pointer.
#define RETRO_DEVICE_MOUSE 2
// KEYBOARD device lets one poll for raw key pressed.
// It is poll based, so input callback will return with the current pressed state.
#define RETRO_DEVICE_KEYBOARD 3
// Lightgun X/Y coordinates are reported relatively to last poll, similar to mouse.
#define RETRO_DEVICE_LIGHTGUN 4
// The ANALOG device is an extension to JOYPAD (RetroPad).
// Similar to DualShock it adds two analog sticks.
// This is treated as a separate device type as it returns values in the full analog range
// of [-0x8000, 0x7fff]. Positive X axis is right. Positive Y axis is down.
// Only use ANALOG type when polling for analog values of the axes.
#define RETRO_DEVICE_ANALOG 5
// Abstracts the concept of a pointing mechanism, e.g. touch.
// This allows libretro to query in absolute coordinates where on the screen a mouse (or something similar) is being placed.
// For a touch centric device, coordinates reported are the coordinates of the press.
//
// Coordinates in X and Y are reported as:
// [-0x7fff, 0x7fff]: -0x7fff corresponds to the far left/top of the screen,
// and 0x7fff corresponds to the far right/bottom of the screen.
// The "screen" is here defined as area that is passed to the frontend and later displayed on the monitor.
// The frontend is free to scale/resize this screen as it sees fit, however,
// (X, Y) = (-0x7fff, -0x7fff) will correspond to the top-left pixel of the game image, etc.
//
// To check if the pointer coordinates are valid (e.g. a touch display actually being touched),
// PRESSED returns 1 or 0.
// If using a mouse, PRESSED will usually correspond to the left mouse button.
// PRESSED will only return 1 if the pointer is inside the game screen.
//
// For multi-touch, the index variable can be used to successively query more presses.
// If index = 0 returns true for _PRESSED, coordinates can be extracted
// with _X, _Y for index = 0. One can then query _PRESSED, _X, _Y with index = 1, and so on.
// Eventually _PRESSED will return false for an index. No further presses are registered at this point.
#define RETRO_DEVICE_POINTER 6
// These device types are specializations of the base types above.
// They should only be used in retro_set_controller_type() to inform libretro implementations
// about use of a very specific device type.
//
// In input state callback, however, only the base type should be used in the 'device' field.
#define RETRO_DEVICE_JOYPAD_MULTITAP ((1 << 8) | RETRO_DEVICE_JOYPAD)
#define RETRO_DEVICE_LIGHTGUN_SUPER_SCOPE ((1 << 8) | RETRO_DEVICE_LIGHTGUN)
#define RETRO_DEVICE_LIGHTGUN_JUSTIFIER ((2 << 8) | RETRO_DEVICE_LIGHTGUN)
#define RETRO_DEVICE_LIGHTGUN_JUSTIFIERS ((3 << 8) | RETRO_DEVICE_LIGHTGUN)
// Buttons for the RetroPad (JOYPAD).
// The placement of these is equivalent to placements on the Super Nintendo controller.
// L2/R2/L3/R3 buttons correspond to the PS1 DualShock.
#define RETRO_DEVICE_ID_JOYPAD_B 0
#define RETRO_DEVICE_ID_JOYPAD_Y 1
#define RETRO_DEVICE_ID_JOYPAD_SELECT 2
#define RETRO_DEVICE_ID_JOYPAD_START 3
#define RETRO_DEVICE_ID_JOYPAD_UP 4
#define RETRO_DEVICE_ID_JOYPAD_DOWN 5
#define RETRO_DEVICE_ID_JOYPAD_LEFT 6
#define RETRO_DEVICE_ID_JOYPAD_RIGHT 7
#define RETRO_DEVICE_ID_JOYPAD_A 8
#define RETRO_DEVICE_ID_JOYPAD_X 9
#define RETRO_DEVICE_ID_JOYPAD_L 10
#define RETRO_DEVICE_ID_JOYPAD_R 11
#define RETRO_DEVICE_ID_JOYPAD_L2 12
#define RETRO_DEVICE_ID_JOYPAD_R2 13
#define RETRO_DEVICE_ID_JOYPAD_L3 14
#define RETRO_DEVICE_ID_JOYPAD_R3 15
// Index / Id values for ANALOG device.
#define RETRO_DEVICE_INDEX_ANALOG_LEFT 0
#define RETRO_DEVICE_INDEX_ANALOG_RIGHT 1
#define RETRO_DEVICE_ID_ANALOG_X 0
#define RETRO_DEVICE_ID_ANALOG_Y 1
// Id values for MOUSE.
#define RETRO_DEVICE_ID_MOUSE_X 0
#define RETRO_DEVICE_ID_MOUSE_Y 1
#define RETRO_DEVICE_ID_MOUSE_LEFT 2
#define RETRO_DEVICE_ID_MOUSE_RIGHT 3
// Id values for LIGHTGUN types.
#define RETRO_DEVICE_ID_LIGHTGUN_X 0
#define RETRO_DEVICE_ID_LIGHTGUN_Y 1
#define RETRO_DEVICE_ID_LIGHTGUN_TRIGGER 2
#define RETRO_DEVICE_ID_LIGHTGUN_CURSOR 3
#define RETRO_DEVICE_ID_LIGHTGUN_TURBO 4
#define RETRO_DEVICE_ID_LIGHTGUN_PAUSE 5
#define RETRO_DEVICE_ID_LIGHTGUN_START 6
// Id values for POINTER.
#define RETRO_DEVICE_ID_POINTER_X 0
#define RETRO_DEVICE_ID_POINTER_Y 1
#define RETRO_DEVICE_ID_POINTER_PRESSED 2
// Returned from retro_get_region().
#define RETRO_REGION_NTSC 0
#define RETRO_REGION_PAL 1
// Passed to retro_get_memory_data/size().
// If the memory type doesn't apply to the implementation NULL/0 can be returned.
#define RETRO_MEMORY_MASK 0xff
// Regular save ram. This ram is usually found on a game cartridge, backed up by a battery.
// If save game data is too complex for a single memory buffer,
// the SYSTEM_DIRECTORY environment callback can be used.
#define RETRO_MEMORY_SAVE_RAM 0
// Some games have a built-in clock to keep track of time.
// This memory is usually just a couple of bytes to keep track of time.
#define RETRO_MEMORY_RTC 1
// System ram lets a frontend peek into a game systems main RAM.
#define RETRO_MEMORY_SYSTEM_RAM 2
// Video ram lets a frontend peek into a game systems video RAM (VRAM).
#define RETRO_MEMORY_VIDEO_RAM 3
// Special memory types.
#define RETRO_MEMORY_SNES_BSX_RAM ((1 << 8) | RETRO_MEMORY_SAVE_RAM)
#define RETRO_MEMORY_SNES_BSX_PRAM ((2 << 8) | RETRO_MEMORY_SAVE_RAM)
#define RETRO_MEMORY_SNES_SUFAMI_TURBO_A_RAM ((3 << 8) | RETRO_MEMORY_SAVE_RAM)
#define RETRO_MEMORY_SNES_SUFAMI_TURBO_B_RAM ((4 << 8) | RETRO_MEMORY_SAVE_RAM)
#define RETRO_MEMORY_SNES_GAME_BOY_RAM ((5 << 8) | RETRO_MEMORY_SAVE_RAM)
#define RETRO_MEMORY_SNES_GAME_BOY_RTC ((6 << 8) | RETRO_MEMORY_RTC)
// Special game types passed into retro_load_game_special().
// Only used when multiple ROMs are required.
#define RETRO_GAME_TYPE_BSX 0x101
#define RETRO_GAME_TYPE_BSX_SLOTTED 0x102
#define RETRO_GAME_TYPE_SUFAMI_TURBO 0x103
#define RETRO_GAME_TYPE_SUPER_GAME_BOY 0x104
// Keysyms used for ID in input state callback when polling RETRO_KEYBOARD.
enum retro_key
{
RETROK_UNKNOWN = 0,
RETROK_FIRST = 0,
RETROK_BACKSPACE = 8,
RETROK_TAB = 9,
RETROK_CLEAR = 12,
RETROK_RETURN = 13,
RETROK_PAUSE = 19,
RETROK_ESCAPE = 27,
RETROK_SPACE = 32,
RETROK_EXCLAIM = 33,
RETROK_QUOTEDBL = 34,
RETROK_HASH = 35,
RETROK_DOLLAR = 36,
RETROK_AMPERSAND = 38,
RETROK_QUOTE = 39,
RETROK_LEFTPAREN = 40,
RETROK_RIGHTPAREN = 41,
RETROK_ASTERISK = 42,
RETROK_PLUS = 43,
RETROK_COMMA = 44,
RETROK_MINUS = 45,
RETROK_PERIOD = 46,
RETROK_SLASH = 47,
RETROK_0 = 48,
RETROK_1 = 49,
RETROK_2 = 50,
RETROK_3 = 51,
RETROK_4 = 52,
RETROK_5 = 53,
RETROK_6 = 54,
RETROK_7 = 55,
RETROK_8 = 56,
RETROK_9 = 57,
RETROK_COLON = 58,
RETROK_SEMICOLON = 59,
RETROK_LESS = 60,
RETROK_EQUALS = 61,
RETROK_GREATER = 62,
RETROK_QUESTION = 63,
RETROK_AT = 64,
RETROK_LEFTBRACKET = 91,
RETROK_BACKSLASH = 92,
RETROK_RIGHTBRACKET = 93,
RETROK_CARET = 94,
RETROK_UNDERSCORE = 95,
RETROK_BACKQUOTE = 96,
RETROK_a = 97,
RETROK_b = 98,
RETROK_c = 99,
RETROK_d = 100,
RETROK_e = 101,
RETROK_f = 102,
RETROK_g = 103,
RETROK_h = 104,
RETROK_i = 105,
RETROK_j = 106,
RETROK_k = 107,
RETROK_l = 108,
RETROK_m = 109,
RETROK_n = 110,
RETROK_o = 111,
RETROK_p = 112,
RETROK_q = 113,
RETROK_r = 114,
RETROK_s = 115,
RETROK_t = 116,
RETROK_u = 117,
RETROK_v = 118,
RETROK_w = 119,
RETROK_x = 120,
RETROK_y = 121,
RETROK_z = 122,
RETROK_DELETE = 127,
RETROK_KP0 = 256,
RETROK_KP1 = 257,
RETROK_KP2 = 258,
RETROK_KP3 = 259,
RETROK_KP4 = 260,
RETROK_KP5 = 261,
RETROK_KP6 = 262,
RETROK_KP7 = 263,
RETROK_KP8 = 264,
RETROK_KP9 = 265,
RETROK_KP_PERIOD = 266,
RETROK_KP_DIVIDE = 267,
RETROK_KP_MULTIPLY = 268,
RETROK_KP_MINUS = 269,
RETROK_KP_PLUS = 270,
RETROK_KP_ENTER = 271,
RETROK_KP_EQUALS = 272,
RETROK_UP = 273,
RETROK_DOWN = 274,
RETROK_RIGHT = 275,
RETROK_LEFT = 276,
RETROK_INSERT = 277,
RETROK_HOME = 278,
RETROK_END = 279,
RETROK_PAGEUP = 280,
RETROK_PAGEDOWN = 281,
RETROK_F1 = 282,
RETROK_F2 = 283,
RETROK_F3 = 284,
RETROK_F4 = 285,
RETROK_F5 = 286,
RETROK_F6 = 287,
RETROK_F7 = 288,
RETROK_F8 = 289,
RETROK_F9 = 290,
RETROK_F10 = 291,
RETROK_F11 = 292,
RETROK_F12 = 293,
RETROK_F13 = 294,
RETROK_F14 = 295,
RETROK_F15 = 296,
RETROK_NUMLOCK = 300,
RETROK_CAPSLOCK = 301,
RETROK_SCROLLOCK = 302,
RETROK_RSHIFT = 303,
RETROK_LSHIFT = 304,
RETROK_RCTRL = 305,
RETROK_LCTRL = 306,
RETROK_RALT = 307,
RETROK_LALT = 308,
RETROK_RMETA = 309,
RETROK_LMETA = 310,
RETROK_LSUPER = 311,
RETROK_RSUPER = 312,
RETROK_MODE = 313,
RETROK_COMPOSE = 314,
RETROK_HELP = 315,
RETROK_PRINT = 316,
RETROK_SYSREQ = 317,
RETROK_BREAK = 318,
RETROK_MENU = 319,
RETROK_POWER = 320,
RETROK_EURO = 321,
RETROK_UNDO = 322,
RETROK_LAST,
RETROK_DUMMY = INT_MAX // Ensure sizeof(enum) == sizeof(int)
};
enum retro_mod
{
RETROKMOD_NONE = 0x0000,
RETROKMOD_SHIFT = 0x01,
RETROKMOD_CTRL = 0x02,
RETROKMOD_ALT = 0x04,
RETROKMOD_META = 0x08,
RETROKMOD_NUMLOCK = 0x10,
RETROKMOD_CAPSLOCK = 0x20,
RETROKMOD_SCROLLOCK = 0x40,
RETROKMOD_DUMMY = INT_MAX // Ensure sizeof(enum) == sizeof(int)
};
// If set, this call is not part of the public libretro API yet. It can change or be removed at any time.
#define RETRO_ENVIRONMENT_EXPERIMENTAL 0x10000
// Environment commands.
#define RETRO_ENVIRONMENT_SET_ROTATION 1 // const unsigned * --
// Sets screen rotation of graphics.
// Is only implemented if rotation can be accelerated by hardware.
// Valid values are 0, 1, 2, 3, which rotates screen by 0, 90, 180, 270 degrees
// counter-clockwise respectively.
//
#define RETRO_ENVIRONMENT_GET_OVERSCAN 2 // bool * --
// Boolean value whether or not the implementation should use overscan, or crop away overscan.
//
#define RETRO_ENVIRONMENT_GET_CAN_DUPE 3 // bool * --
// Boolean value whether or not frontend supports frame duping,
// passing NULL to video frame callback.
//
// Environ 4, 5 are no longer supported (GET_VARIABLE / SET_VARIABLES), and reserved to avoid possible ABI clash.
#define RETRO_ENVIRONMENT_SET_MESSAGE 6 // const struct retro_message * --
// Sets a message to be displayed in implementation-specific manner for a certain amount of 'frames'.
// Should not be used for trivial messages, which should simply be logged to stderr.
#define RETRO_ENVIRONMENT_SHUTDOWN 7 // N/A (NULL) --
// Requests the frontend to shutdown.
// Should only be used if game has a specific
// way to shutdown the game from a menu item or similar.
//
#define RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVEL 8
// const unsigned * --
// Gives a hint to the frontend how demanding this implementation
// is on a system. E.g. reporting a level of 2 means
// this implementation should run decently on all frontends
// of level 2 and up.
//
// It can be used by the frontend to potentially warn
// about too demanding implementations.
//
// The levels are "floating", but roughly defined as:
// 0: Low-powered embedded devices such as Raspberry Pi
// 1: 6th generation consoles, such as Wii/Xbox 1, and phones, tablets, etc.
// 2: 7th generation consoles, such as PS3/360, with sub-par CPUs.
// 3: Modern desktop/laptops with reasonably powerful CPUs.
// 4: High-end desktops with very powerful CPUs.
//
// This function can be called on a per-game basis,
// as certain games an implementation can play might be
// particularily demanding.
// If called, it should be called in retro_load_game().
//
#define RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY 9
// const char ** --
// Returns the "system" directory of the frontend.
// This directory can be used to store system specific ROMs such as BIOSes, configuration data, etc.
// The returned value can be NULL.
// If so, no such directory is defined,
// and it's up to the implementation to find a suitable directory.
//
#define RETRO_ENVIRONMENT_SET_PIXEL_FORMAT 10
// const enum retro_pixel_format * --
// Sets the internal pixel format used by the implementation.
// The default pixel format is RETRO_PIXEL_FORMAT_0RGB1555.
// This pixel format however, is deprecated (see enum retro_pixel_format).
// If the call returns false, the frontend does not support this pixel format.
// This function should be called inside retro_load_game() or retro_get_system_av_info().
//
#define RETRO_ENVIRONMENT_SET_INPUT_DESCRIPTORS 11
// const struct retro_input_descriptor * --
// Sets an array of retro_input_descriptors.
// It is up to the frontend to present this in a usable way.
// The array is terminated by retro_input_descriptor::description being set to NULL.
// This function can be called at any time, but it is recommended to call it as early as possible.
#define RETRO_ENVIRONMENT_SET_KEYBOARD_CALLBACK 12
// const struct retro_keyboard_callback * --
// Sets a callback function used to notify core about keyboard events.
//
#define RETRO_ENVIRONMENT_SET_DISK_CONTROL_INTERFACE 13
// const struct retro_disk_control_callback * --
// Sets an interface which frontend can use to eject and insert disk images.
// This is used for games which consist of multiple images and must be manually
// swapped out by the user (e.g. PSX).
#define RETRO_ENVIRONMENT_SET_HW_RENDER (14 | RETRO_ENVIRONMENT_EXPERIMENTAL)
// struct retro_hw_render_callback * --
// NOTE: This call is currently very experimental, and should not be considered part of the public API.
// The interface could be changed or removed at any time.
// Sets an interface to let a libretro core render with hardware acceleration.
// Should be called in retro_load_game().
// If successful, libretro cores will be able to render to a frontend-provided framebuffer.
// The size of this framebuffer will be at least as large as max_width/max_height provided in get_av_info().
// If HW rendering is used, pass only RETRO_HW_FRAME_BUFFER_VALID or NULL to retro_video_refresh_t.
#define RETRO_ENVIRONMENT_GET_VARIABLE 15
// struct retro_variable * --
// Interface to aquire user-defined information from environment
// that cannot feasibly be supported in a multi-system way.
// 'key' should be set to a key which has already been set by SET_VARIABLES.
// 'data' will be set to a value or NULL.
//
#define RETRO_ENVIRONMENT_SET_VARIABLES 16
// const struct retro_variable * --
// Allows an implementation to signal the environment
// which variables it might want to check for later using GET_VARIABLE.
// This allows the frontend to present these variables to a user dynamically.
// This should be called as early as possible (ideally in retro_set_environment).
//
// 'data' points to an array of retro_variable structs terminated by a { NULL, NULL } element.
// retro_variable::key should be namespaced to not collide with other implementations' keys. E.g. A core called 'foo' should use keys named as 'foo_option'.
// retro_variable::value should contain a human readable description of the key as well as a '|' delimited list of expected values.
// The number of possible options should be very limited, i.e. it should be feasible to cycle through options without a keyboard.
// First entry should be treated as a default.
//
// Example entry:
// { "foo_option", "Speed hack coprocessor X; false|true" }
//
// Text before first ';' is description. This ';' must be followed by a space, and followed by a list of possible values split up with '|'.
// Only strings are operated on. The possible values will generally be displayed and stored as-is by the frontend.
//
#define RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE 17
// bool * --
// Result is set to true if some variables are updated by
// frontend since last call to RETRO_ENVIRONMENT_GET_VARIABLE.
// Variables should be queried with GET_VARIABLE.
//
#define RETRO_ENVIRONMENT_SET_SUPPORT_NO_GAME 18
// const bool * --
// If true, the libretro implementation supports calls to retro_load_game() with NULL as argument.
// Used by cores which can run without particular game data.
// This should be called within retro_set_environment() only.
// Pass this to retro_video_refresh_t if rendering to hardware.
// Passing NULL to retro_video_refresh_t is still a frame dupe as normal.
#define RETRO_HW_FRAME_BUFFER_VALID ((void*)-1)
// Invalidates the current HW context.
// If called, all GPU resources must be reinitialized.
// Usually called when frontend reinits video driver.
// Also called first time video driver is initialized, allowing libretro core to init resources.
typedef void (*retro_hw_context_reset_t)(void);
// Gets current framebuffer which is to be rendered to. Could change every frame potentially.
typedef uintptr_t (*retro_hw_get_current_framebuffer_t)(void);
// Get a symbol from HW context.
typedef void (*retro_proc_address_t)(void);
typedef retro_proc_address_t (*retro_hw_get_proc_address_t)(const char *sym);
enum retro_hw_context_type
{
RETRO_HW_CONTEXT_NONE = 0,
RETRO_HW_CONTEXT_OPENGL, // OpenGL 2.x. Latest version available before 3.x+.
RETRO_HW_CONTEXT_OPENGLES2, // GLES 2.0
RETRO_HW_CONTEXT_DUMMY = INT_MAX
};
struct retro_hw_render_callback
{
enum retro_hw_context_type context_type; // Which API to use. Set by libretro core.
retro_hw_context_reset_t context_reset; // Set by libretro core.
retro_hw_get_current_framebuffer_t get_current_framebuffer; // Set by frontend.
retro_hw_get_proc_address_t get_proc_address; // Set by frontend.
bool depth; // Set if render buffers should have depth component attached.
};
// Callback type passed in RETRO_ENVIRONMENT_SET_KEYBOARD_CALLBACK. Called by the frontend in response to keyboard events.
// down is set if the key is being pressed, or false if it is being released.
// keycode is the RETROK value of the char.
// character is the text character of the pressed key. (UTF-32).
// key_modifiers is a set of RETROKMOD values or'ed together.
typedef void (*retro_keyboard_event_t)(bool down, unsigned keycode, uint32_t character, uint16_t key_modifiers);
struct retro_keyboard_callback
{
retro_keyboard_event_t callback;
};
// Callbacks for RETRO_ENVIRONMENT_SET_DISK_CONTROL_INTERFACE.
// Should be set for implementations which can swap out multiple disk images in runtime.
// If the implementation can do this automatically, it should strive to do so.
// However, there are cases where the user must manually do so.
//
// Overview: To swap a disk image, eject the disk image with set_eject_state(true).
// Set the disk index with set_image_index(index). Insert the disk again with set_eject_state(false).
// If ejected is true, "ejects" the virtual disk tray.
// When ejected, the disk image index can be set.
typedef bool (*retro_set_eject_state_t)(bool ejected);
// Gets current eject state. The initial state is 'not ejected'.
typedef bool (*retro_get_eject_state_t)(void);
// Gets current disk index. First disk is index 0.
// If return value is >= get_num_images(), no disk is currently inserted.
typedef unsigned (*retro_get_image_index_t)(void);
// Sets image index. Can only be called when disk is ejected.
// The implementation supports setting "no disk" by using an index >= get_num_images().
typedef bool (*retro_set_image_index_t)(unsigned index);
// Gets total number of images which are available to use.
typedef unsigned (*retro_get_num_images_t)(void);
//
// Replaces the disk image associated with index.
// Arguments to pass in info have same requirements as retro_load_game().
// Virtual disk tray must be ejected when calling this.
// Replacing a disk image with info = NULL will remove the disk image from the internal list.
// As a result, calls to get_image_index() can change.
//
// E.g. replace_image_index(1, NULL), and previous get_image_index() returned 4 before.
// Index 1 will be removed, and the new index is 3.
struct retro_game_info;
typedef bool (*retro_replace_image_index_t)(unsigned index, const struct retro_game_info *info);
// Adds a new valid index (get_num_images()) to the internal disk list.
// This will increment subsequent return values from get_num_images() by 1.
// This image index cannot be used until a disk image has been set with replace_image_index.
typedef bool (*retro_add_image_index_t)(void);
struct retro_disk_control_callback
{
retro_set_eject_state_t set_eject_state;
retro_get_eject_state_t get_eject_state;
retro_get_image_index_t get_image_index;
retro_set_image_index_t set_image_index;
retro_get_num_images_t get_num_images;
retro_replace_image_index_t replace_image_index;
retro_add_image_index_t add_image_index;
};
enum retro_pixel_format
{
// 0RGB1555, native endian. 0 bit must be set to 0.
// This pixel format is default for compatibility concerns only.
// If a 15/16-bit pixel format is desired, consider using RGB565.
RETRO_PIXEL_FORMAT_0RGB1555 = 0,
// XRGB8888, native endian. X bits are ignored.
RETRO_PIXEL_FORMAT_XRGB8888 = 1,
// RGB565, native endian. This pixel format is the recommended format to use if a 15/16-bit format is desired
// as it is the pixel format that is typically available on a wide range of low-power devices.
// It is also natively supported in APIs like OpenGL ES.
RETRO_PIXEL_FORMAT_RGB565 = 2,
// Ensure sizeof() == sizeof(int).
RETRO_PIXEL_FORMAT_UNKNOWN = INT_MAX
};
struct retro_message
{
const char *msg; // Message to be displayed.
unsigned frames; // Duration in frames of message.
};
// Describes how the libretro implementation maps a libretro input bind
// to its internal input system through a human readable string.
// This string can be used to better let a user configure input.
struct retro_input_descriptor
{
// Associates given parameters with a description.
unsigned port;
unsigned device;
unsigned index;
unsigned id;
const char *description; // Human readable description for parameters.
// The pointer must remain valid until retro_unload_game() is called.
};
struct retro_system_info
{
// All pointers are owned by libretro implementation, and pointers must remain valid until retro_deinit() is called.
const char *library_name; // Descriptive name of library. Should not contain any version numbers, etc.
const char *library_version; // Descriptive version of core.
const char *valid_extensions; // A string listing probably rom extensions the core will be able to load, separated with pipe.
// I.e. "bin|rom|iso".
// Typically used for a GUI to filter out extensions.
bool need_fullpath; // If true, retro_load_game() is guaranteed to provide a valid pathname in retro_game_info::path.
// ::data and ::size are both invalid.
// If false, ::data and ::size are guaranteed to be valid, but ::path might not be valid.
// This is typically set to true for libretro implementations that must load from file.
// Implementations should strive for setting this to false, as it allows the frontend to perform patching, etc.
bool block_extract; // If true, the frontend is not allowed to extract any archives before loading the real ROM.
// Necessary for certain libretro implementations that load games from zipped archives.
};
struct retro_game_geometry
{
unsigned base_width; // Nominal video width of game.
unsigned base_height; // Nominal video height of game.
unsigned max_width; // Maximum possible width of game.
unsigned max_height; // Maximum possible height of game.
float aspect_ratio; // Nominal aspect ratio of game. If aspect_ratio is <= 0.0,
// an aspect ratio of base_width / base_height is assumed.
// A frontend could override this setting if desired.
};
struct retro_system_timing
{
double fps; // FPS of video content.
double sample_rate; // Sampling rate of audio.
};
struct retro_system_av_info
{
struct retro_game_geometry geometry;
struct retro_system_timing timing;
};
struct retro_variable
{
const char *key; // Variable to query in RETRO_ENVIRONMENT_GET_VARIABLE.
// If NULL, obtains the complete environment string if more complex parsing is necessary.
// The environment string is formatted as key-value pairs delimited by semicolons as so:
// "key1=value1;key2=value2;..."
const char *value; // Value to be obtained. If key does not exist, it is set to NULL.
};
struct retro_game_info
{
const char *path; // Path to game, UTF-8 encoded. Usually used as a reference.
// May be NULL if rom was loaded from stdin or similar.
// retro_system_info::need_fullpath guaranteed that this path is valid.
const void *data; // Memory buffer of loaded game. Will be NULL if need_fullpath was set.
size_t size; // Size of memory buffer.
const char *meta; // String of implementation specific meta-data.
};
// Callbacks
//
// Environment callback. Gives implementations a way of performing uncommon tasks. Extensible.
typedef bool (*retro_environment_t)(unsigned cmd, void *data);
// Render a frame. Pixel format is 15-bit 0RGB1555 native endian unless changed (see RETRO_ENVIRONMENT_SET_PIXEL_FORMAT).
// Width and height specify dimensions of buffer.
// Pitch specifices length in bytes between two lines in buffer.
// For performance reasons, it is highly recommended to have a frame that is packed in memory, i.e. pitch == width * byte_per_pixel.
// Certain graphic APIs, such as OpenGL ES, do not like textures that are not packed in memory.
typedef void (*retro_video_refresh_t)(const void *data, unsigned width, unsigned height, size_t pitch);
// Renders a single audio frame. Should only be used if implementation generates a single sample at a time.
// Format is signed 16-bit native endian.
typedef void (*retro_audio_sample_t)(int16_t left, int16_t right);
// Renders multiple audio frames in one go. One frame is defined as a sample of left and right channels, interleaved.
// I.e. int16_t buf[4] = { l, r, l, r }; would be 2 frames.
// Only one of the audio callbacks must ever be used.
typedef size_t (*retro_audio_sample_batch_t)(const int16_t *data, size_t frames);
// Polls input.
typedef void (*retro_input_poll_t)(void);
// Queries for input for player 'port'. device will be masked with RETRO_DEVICE_MASK.
// Specialization of devices such as RETRO_DEVICE_JOYPAD_MULTITAP that have been set with retro_set_controller_port_device()
// will still use the higher level RETRO_DEVICE_JOYPAD to request input.
typedef int16_t (*retro_input_state_t)(unsigned port, unsigned device, unsigned index, unsigned id);
// Sets callbacks. retro_set_environment() is guaranteed to be called before retro_init().
// The rest of the set_* functions are guaranteed to have been called before the first call to retro_run() is made.
void retro_set_environment(retro_environment_t);
void retro_set_video_refresh(retro_video_refresh_t);
void retro_set_audio_sample(retro_audio_sample_t);
void retro_set_audio_sample_batch(retro_audio_sample_batch_t);
void retro_set_input_poll(retro_input_poll_t);
void retro_set_input_state(retro_input_state_t);
// Library global initialization/deinitialization.
void retro_init(void);
void retro_deinit(void);
// Must return RETRO_API_VERSION. Used to validate ABI compatibility when the API is revised.
unsigned retro_api_version(void);
// Gets statically known system info. Pointers provided in *info must be statically allocated.
// Can be called at any time, even before retro_init().
void retro_get_system_info(struct retro_system_info *info);
// Gets information about system audio/video timings and geometry.
// Can be called only after retro_load_game() has successfully completed.
// NOTE: The implementation of this function might not initialize every variable if needed.
// E.g. geom.aspect_ratio might not be initialized if core doesn't desire a particular aspect ratio.
void retro_get_system_av_info(struct retro_system_av_info *info);
// Sets device to be used for player 'port'.
void retro_set_controller_port_device(unsigned port, unsigned device);
// Resets the current game.
void retro_reset(void);
// Runs the game for one video frame.
// During retro_run(), input_poll callback must be called at least once.
//
// If a frame is not rendered for reasons where a game "dropped" a frame,
// this still counts as a frame, and retro_run() should explicitly dupe a frame if GET_CAN_DUPE returns true.
// In this case, the video callback can take a NULL argument for data.
void retro_run(void);
// Returns the amount of data the implementation requires to serialize internal state (save states).
// Beetween calls to retro_load_game() and retro_unload_game(), the returned size is never allowed to be larger than a previous returned value, to
// ensure that the frontend can allocate a save state buffer once.
size_t retro_serialize_size(void);
// Serializes internal state. If failed, or size is lower than retro_serialize_size(), it should return false, true otherwise.
bool retro_serialize(void *data, size_t size);
bool retro_unserialize(const void *data, size_t size);
void retro_cheat_reset(void);
void retro_cheat_set(unsigned index, bool enabled, const char *code);
// Loads a game.
bool retro_load_game(const struct retro_game_info *game);
// Loads a "special" kind of game. Should not be used except in extreme cases.
bool retro_load_game_special(
unsigned game_type,
const struct retro_game_info *info, size_t num_info
);
// Unloads a currently loaded game.
void retro_unload_game(void);
// Gets region of game.
unsigned retro_get_region(void);
// Gets region of memory.
void *retro_get_memory_data(unsigned id);
size_t retro_get_memory_size(unsigned id);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -1,296 +0,0 @@
#include "libretro.h"
#include "libretro-o2em.h"
#include "graph.h"
#include "vkbd.h"
#include <sys/types.h>
#include <sys/time.h>
#include <time.h>
unsigned short int mbmp[TEX_WIDTH * TEX_HEIGHT];
int RLOOP=1,NPAGE=-1, KCOL=1, BKGCOLOR=0;
int SHIFTON=-1,SHOWKEY=-1,STATUTON=-1;
int PAUSE=-1,SND=1;
short signed int SNDBUF[1024*2];
int snd_sampler = 44100 / 60;
char RPATH[512];
static int mbt[16]={0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
long mframe=0;
unsigned long Ktime=0 , LastFPSTime=0;
int BOXDEC= 32+2;
int STAT_BASEY=CROP_HEIGHT;
int jbt[5]={0,0,0,0,0};
extern unsigned char key[256*2];
void RetroLoop(){
if(PAUSE==-1)cpu_exec();
RLOOP=1;
}
extern int omain(int argc, char *argv[]);
static retro_input_state_t input_state_cb;
static retro_input_poll_t input_poll_cb;
void retro_set_input_state(retro_input_state_t cb)
{
input_state_cb = cb;
}
void retro_set_input_poll(retro_input_poll_t cb)
{
input_poll_cb = cb;
}
long GetTicks(void)
{ // in MSec
struct timeval tv;
gettimeofday (&tv, NULL);
return (tv.tv_sec*1000000 + tv.tv_usec)/1000;
}
void texture_init(){
memset(mbmp, 0, sizeof(mbmp));
}
void Emu_init(){
int result = 0;
char **argv2 = (char *[]){"o2em\0", "vp_16.bin\0","\0"};
argv2[1]=RPATH;
omain(2,argv2);
}
void Emu_uninit(){
close_audio();
close_voice();
close_display();
retro_destroybmp();
}
void Print_Statut(){
Draw_text((char*)mbmp,STAT_DECX+40 ,STAT_BASEY,0xffff,0x8080,1,2,40,(SHIFTON>0?"SHFT":""));
Draw_text((char*)mbmp,STAT_DECX+80 ,STAT_BASEY,0xffff,0x8080,1,2,40,"MS:%d",0);
Draw_text((char*)mbmp,STAT_DECX+120,STAT_BASEY,0xffff,0x8080,1,2,40,"Joy:%d",0);
}
void retro_key_down(unsigned char retrok){
key[retrok]=1;
}
void retro_key_up(unsigned char retrok){
key[retrok]=0;
}
/*
L2 show/hide Statut
R2 swap kbd pages
L show/hide vkbd
R switch Shift ON/OFF
SEL EMU KSPACE
STR EMU KRETURN
A fire/mousea/valid key in vkbd
B EMU KL
X EMU K0
Y EMU K1
*/
void update_joy(void){
int i;
input_poll_cb();
if(SHOWKEY!=1){
for(i=4;i<9;i++)jbt[i-4]= input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, i ); // Joy press UP/DW/RT/LF/A
key[RETROK_l]=input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, 0 ); //B -> L
key[RETROK_RETURN]=input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, 3 ); // START -> RETURN
key[RETROK_SPACE]=input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, 2 ); // SELECT -> SPACE
key[RETROK_0]=input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, 9 ); // X -> 0
key[RETROK_1]=input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, 1 ); // Y -> 1
}
}
void update_input(void)
{
int i;
// RETRO B Y SLT STA UP DWN LEFT RGT A X L R L2 R2 L3 R3
// INDEX 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
static int vbt[16]={0x1C,0x39,0x01,0x3B,0x01,0x02,0x04,0x08,0x80,0x6D,0x15,0x31,0x24,0x1F,0x6E,0x6F};
static int oldi=-1;
static int vkx=0,vky=0;
if(oldi!=-1){
retro_key_up(oldi);
oldi=-1;
}
input_poll_cb();
i=10;//show vkey toggle
if ( input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, i) && mbt[i]==0 )
mbt[i]=1;
else if ( mbt[i]==1 && ! input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, i) ){
mbt[i]=0;
SHOWKEY=-SHOWKEY;
}
i=11;//switch shift On/Off
if ( input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, i) && mbt[i]==0 )
mbt[i]=1;
else if ( mbt[i]==1 && ! input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, i) ){
mbt[i]=0;
SHIFTON=-SHIFTON;
}
i=12;//show/hide statut
if ( input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, i) && mbt[i]==0 )
mbt[i]=1;
else if ( mbt[i]==1 && ! input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, i) ){
mbt[i]=0;
STATUTON=-STATUTON;
}
i=13;//swap kbd pages
if ( input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, i) && mbt[i]==0 )
mbt[i]=1;
else if ( mbt[i]==1 && ! input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, i) ){
mbt[i]=0;
if(SHOWKEY==1){
NPAGE=-NPAGE;
}
}
if(SHOWKEY==1){
static int vkflag[5]={0,0,0,0,0};
if ( input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP) && vkflag[0]==0 )
vkflag[0]=1;
else if (vkflag[0]==1 && ! input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP) ){
vkflag[0]=0;
vky -= 1;
}
if ( input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN) && vkflag[1]==0 )
vkflag[1]=1;
else if (vkflag[1]==1 && ! input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN) ){
vkflag[1]=0;
vky += 1;
}
if ( input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT) && vkflag[2]==0 )
vkflag[2]=1;
else if (vkflag[2]==1 && ! input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT) ){
vkflag[2]=0;
vkx -= 1;
}
if ( input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT) && vkflag[3]==0 )
vkflag[3]=1;
else if (vkflag[3]==1 && ! input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT) ){
vkflag[3]=0;
vkx += 1;
}
if(vkx<0)vkx=9;
if(vkx>9)vkx=0;
if(vky<0)vky=4;
if(vky>4)vky=0;
virtual_kdb((char*)mbmp,vkx,vky);
i=8;
if(input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, i) && vkflag[4]==0)
vkflag[4]=1;
else if( !input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, i) && vkflag[4]==1) {
vkflag[4]=0;
i=check_vkey2(vkx,vky);
if(i==-2){ //SWAP VKBD PAGE
NPAGE=-NPAGE;oldi=-1;
}
else if(i==-1){ //NOP
oldi=-1;
}
else if(i==-3){//KDB bgcolor
KCOL=-KCOL;
oldi=-1;
}
else if(i==-4){//VKbd show/hide
oldi=-1;
SHOWKEY=-SHOWKEY;
}
else if(i==-5){//inject
rscore();
oldi=-1;
}
else if(i==-6){//quit
retro_shutdown_o2em();
oldi=-1;
}
else if(i==-7){//pause
PAUSE=-PAUSE;
oldi=-1;
}
else if(i==-8){//reset
rreset();
oldi=-1;
}
else if(i==-9){//screenshot
//TODO
oldi=-1;
}
else if(i==-10){//save
rsavestate();
oldi=-1;
}
else if(i==-11){//load
rloadstate();
oldi=-1;
}
else if(i==-12){//SOUND ON/OFF
SND=-SND;
oldi=-1;
}
else {
if(i==304){
if(SHIFTON == 1)retro_key_up(i);
else retro_key_down(i);
SHIFTON=-SHIFTON;
oldi=-1;
}
else {
oldi=i;
retro_key_down(i);
}
}
}
if(STATUTON==1)Print_Statut();
return;
}
if(STATUTON==1)Print_Statut();
}

View File

@ -1,38 +0,0 @@
#include "libretro-o2em.h"
#include "vkbd_def.h"
#include "graph.h"
extern int NPAGE;
extern int KCOL;
extern int BKGCOLOR;
extern int SHIFTON;
void virtual_kdb(char *pix,int vx,int vy)
{
int y,x,page=NPAGE==-1?0:50;
short unsigned coul=RGB565(28, 28, 31);
BKGCOLOR=(KCOL>0?0x8080:0);
for(x=0;x<NPLGN;x++){
for(y=0;y<NLIGN;y++){
DrawBoxBmp(pix,XBASE3+x*XSIDE,YBASE3+y*YSIDE, XSIDE,YSIDE, RGB565(7, 2, 1));
Draw_text(pix,XBASE0-2+x*XSIDE ,YBASE0+YSIDE*y,coul, BKGCOLOR ,2, 2,20,\
SHIFTON==-1?MVk[(y*NPLGN)+x+page].norml:MVk[(y*NPLGN)+x+page].shift);
}
}
DrawBoxBmp(pix,XBASE3+vx*XSIDE,YBASE3+vy*YSIDE, XSIDE,YSIDE, RGB565(31, 2, 1));
Draw_text(pix,XBASE0-2+vx*XSIDE ,YBASE0+YSIDE*vy,RGB565(2,31,1), BKGCOLOR ,2, 2,20,\
SHIFTON==-1?MVk[(vy*NPLGN)+vx+page].norml:MVk[(vy*NPLGN)+vx+page].shift);
}
int check_vkey2(int x,int y)
{
//check which key is press
int page=NPAGE==-1?0:50;
return MVk[y*NPLGN+x+page].val;
}

View File

@ -1,5 +0,0 @@
#ifndef VKBD_H
#define VKBD_H 1
extern void virtual_kdb(char *pix,int vx,int vy);
extern int check_vkey2(int x,int y);
#endif

View File

@ -1,135 +0,0 @@
#ifndef VKBD_DEF_H
#define VKBD_DEF_H 1
#include "libretro.h"
typedef struct {
char norml[NLETT];
char shift[NLETT];
int val;
} Mvk;
// 0 1 2 3 4 5 6 7 8 9
// funtion input reset
// + - * / = yes no clr enter reset
// alpha
// q w e r t y u i o p
// a s d f g h j k l
// z x c v b n m . ?
// space
Mvk MVk[NPLGN*NLIGN*2]={
//PG1
{ " 0" ," 0" ,RETROK_0},
{ " 1" ," 1" ,RETROK_1 },
{ " 2" ," 2" ,RETROK_2 },
{ " 3" ," 3" ,RETROK_3 },
{ " 4" ," 4" ,RETROK_4 },
{ " 5" ," 5" ,RETROK_5 },
{ " 6" ," 6" ,RETROK_6 },
{ " 7" ," 7" ,RETROK_7 },
{ " 8" ," 8" ,RETROK_8 },
{ " 9" ," 9" ,RETROK_9},
{ " +" ," +" ,RETROK_PLUS},
{ " -" ," -" , RETROK_MINUS},
{ " *" ," *" , RETROK_ASTERISK },
{ " /" ," /" ,RETROK_SLASH },
{ " =" ," =" ,RETROK_EQUALS },
{ "Ye" ,"Ye" ,RETROK_PAGEUP },
{ "No" ,"No" ,RETROK_PAGEDOWN },
{ "Cl" ,"Cl" ,RETROK_END },
{ "EN" ,"EN" ,RETROK_RETURN },
{ "P2" ,"P2" ,-2},
{ " q" ," q" ,RETROK_q},
{ " w" ," w" , RETROK_w },
{ " e" ," e" , RETROK_e },
{ " r" ," r" ,RETROK_r },
{ " t" ," t" ,RETROK_t },
{ " y" ," y" ,RETROK_y },
{ " u" ," u" ,RETROK_u },
{ " i" ," i" ,RETROK_i },
{ " o" ," o" ,RETROK_o },
{ " p" ," p" ,RETROK_p},
{ " a" ," a" ,RETROK_a},
{ " s" ," s" , RETROK_s },
{ " d" ," d" , RETROK_d },
{ " f" ," f" ,RETROK_f },
{ " g" ," g" ,RETROK_g },
{ " h" ," h" ,RETROK_h },
{ " j" ," j" ,RETROK_j },
{ " k" ," k" ,RETROK_k },
{ " l" ," l" ,RETROK_l },
{ "SD" ,"SD" ,-12},
{ " z" ," z" ,RETROK_z},
{ " x" ," x" ,RETROK_x },
{ " c" ," c" ,RETROK_c },
{ " v" ," v" ,RETROK_v },
{ " b" ," b" ,RETROK_b },
{ " n" ," n" ,RETROK_n },
{ " m" ," m" ,RETROK_m },
{ " ." ," ." ,RETROK_PERIOD },
{ " ?" ," ?" ,RETROK_QUESTION },
{ "Sp" ,"Sp" ,RETROK_SPACE},
//PG2
{ " 0" ," 0" ,RETROK_0},
{ " 1" ," 1" ,RETROK_1 },
{ " 2" ," 2" ,RETROK_2 },
{ " 3" ," 3" ,RETROK_3 },
{ " 4" ," 4" ,RETROK_4 },
{ " 5" ," 5" ,RETROK_5 },
{ " 6" ," 6" ,RETROK_6 },
{ " 7" ," 7" ,RETROK_7 },
{ " 8" ," 8" ,RETROK_8 },
{ " 9" ," 9" ,RETROK_9},
{ "Qt" ,"Qt" ,-6},
{ "Ps" ,"Ps" , -7},
{ "Rs" ,"Rs" , -8},
{ "SS" ,"SS" ,-9},
{ "Sv" ,"Sv" ,-10 },
{ "Lo" ,"Lo" ,-11 },
{ "Ij" ,"Ij" ,-5 },
{ "Co" ,"Co" ,-3 },
{ "Kb" ,"Kb" ,-4 },
{ "P1" ,"P1" ,-2},
{ " q" ," q" ,RETROK_q},
{ " w" ," w" , RETROK_w },
{ " e" ," e" , RETROK_e },
{ " r" ," r" ,RETROK_r },
{ " t" ," t" ,RETROK_t },
{ " y" ," y" ,RETROK_y },
{ " u" ," u" ,RETROK_u },
{ " i" ," i" ,RETROK_i },
{ " o" ," o" ,RETROK_o },
{ " p" ," p" ,RETROK_p},
{ " a" ," a" ,RETROK_a},
{ " s" ," s" , RETROK_s },
{ " d" ," d" , RETROK_d },
{ " f" ," f" ,RETROK_f },
{ " g" ," g" ,RETROK_g },
{ " h" ," h" ,RETROK_h },
{ " j" ," j" ,RETROK_j },
{ " k" ," k" ,RETROK_k },
{ " l" ," l" ,RETROK_l },
{ "SD" ,"SD" ,-12},
{ " z" ," z" ,RETROK_z},
{ " x" ," x" ,RETROK_x },
{ " c" ," c" ,RETROK_c },
{ " v" ," v" ,RETROK_v },
{ " b" ," b" ,RETROK_b },
{ " n" ," n" ,RETROK_n },
{ " m" ," m" ,RETROK_m },
{ " ." ," ." ,RETROK_PERIOD },
{ " ?" ," ?" ,RETROK_QUESTION },
{ "Sp" ,"Sp" ,RETROK_SPACE},
} ;
#endif

6
README.md Normal file
View File

@ -0,0 +1,6 @@
libretro-o2em
==================
Port of O2EM to libretro.
Place "o2rom.bin" (required) in your RetroArch/libretro "System Directory" folder.

207
allegrowrapper/wrapalleg.c Executable file
View File

@ -0,0 +1,207 @@
#include "wrapalleg.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define abs(a) miabs(a)
int miabs(int a){
if((a)<0)a=-a;
return a;
}
void upcase(char *p)
{
while(*p != '\0')
{
if(*p >= 97 && *p <= 122)
*p -= 32;
++p;
}
}
void downcase(char *p)
{
while(*p != '\0')
{
if(*p >= 97-32 && *p <= 122-32)
*p += 32;
++p;
}
}
void clear(BITMAP *buff){
memset(&buff->line,0,buff->w*buff->h);
}
BITMAP *create_bitmap(int w,int h){
BITMAP *buff;
buff = malloc(sizeof (BITMAP));
buff->line=malloc(1*w*h);
buff->w=w;
buff->h=h;
buff->pitch=w;
buff->depth=1;
return buff;
}
int destroy_bitmap(BITMAP *buff){
if (buff->line) {
free(buff->line);
}
free(buff);
return 0;
}
void rect(BITMAP *buff,int x,int y,int x2,int y2,unsigned char color){
// int i,j,idx;
//
// int dx= abs(x2-x);
// int dy= abs(y2-y);
// int V_WIDTH = buff->w;
// unsigned char *buffer=buff->line[0];
//
// for(i=x;i<x+dx;i++){
// idx=i+y*V_WIDTH;
// buffer[idx]=color;
// idx=i+(y+dy)*V_WIDTH;
// buffer[idx]=color;
// }
//
// for(j=y;j<y+dy;j++){
//
// idx=x+j*V_WIDTH;
// buffer[idx]=color;
// idx=(x+dx)+j*V_WIDTH;
// buffer[idx]=color;
// }
}
void rectfill(BITMAP *buff,int x,int y,int x2,int y2,unsigned char color){
// int i,j,idx;
//
// int dx= abs(x2-x);
// int dy= abs(y2-y);
// int V_WIDTH = buff->w;
// unsigned char *buffer=buff->line[0];
//
// for(i=x;i<x+dx;i++){
// for(j=y;j<y+dy;j++){
//
// idx=i+j*V_WIDTH;
// buffer[idx]=color;
// }
// }
}
void DrawHline(BITMAP *buff,int x,int y,int dx,int dy,unsigned char color){
// int i,j,idx;
// int V_WIDTH = buff->w;
// unsigned char *buffer=buff->line[0];
//
// for(i=x;i<x+dx;i++){
// idx=i+y*V_WIDTH;
// buffer[idx]=color;
// }
}
void DrawVline(BITMAP *buff,int x,int y,int dx,int dy,unsigned char color){
// int i,j,idx;
// int V_WIDTH = buff->w;
// unsigned char *buffer=buff->line[0];
//
// for(j=y;j<y+dy;j++){
// idx=x+j*V_WIDTH;
// buffer[idx]=color;
// }
}
void line(BITMAP *buff,int x1,int y1,int x2,int y2,unsigned char color){
// int pixx, pixy;
// int x, y;
// int dx, dy;
// int sx, sy;
// int swaptmp;
// int idx;
//
// int V_WIDTH = buff->w;
// unsigned char *buffer=buff->line[0];
//
// dx = x2 - x1;
// dy = y2 - y1;
// sx = (dx >= 0) ? 1 : -1;
// sy = (dy >= 0) ? 1 : -1;
//
// if (dx==0) {
// if (dy>0) {
// DrawVline(buff, x1, y1,0, dy, color);
// return;
//
// } else if (dy<0) {
// DrawVline(buff, x1, y2,0, -dy, color);
// return;
//
// } else {
// idx=x1+y1*V_WIDTH;
// buffer[idx]=color;
// return ;
// }
// }
// if (dy == 0) {
// if (dx>0) {
// DrawHline(buff, x1, y1, dx, 0, color);
// return;
//
// } else if (dx<0) {
// DrawHline(buff, x2, y1, -dx,0, color);
// return;
// }
// }
//
// dx = sx * dx + 1;
// dy = sy * dy + 1;
//
// pixx = 1;
// pixy = V_WIDTH;
//
// pixx *= sx;
// pixy *= sy;
//
// if (dx < dy) {
// swaptmp = dx;
// dx = dy;
// dy = swaptmp;
// swaptmp = pixx;
// pixx = pixy;
// pixy = swaptmp;
// }
//
// x = 0;
// y = 0;
//
// idx=x1+y1*V_WIDTH;
//
// for (; x < dx; x++, idx +=pixx) {
// buffer[idx]=color;
// y += dy;
// if (y >= dx) {
// y -= dx;
// idx += pixy;
// }
// }
}

56
allegrowrapper/wrapalleg.h Executable file
View File

@ -0,0 +1,56 @@
#ifndef WRAP_H
#define WRAP_H 1
#include <unistd.h>
#define INLINE static inline
#define rest(a) usleep(a)
#define strupr upcase
#define strlwr downcase
#define keypressed() 0
#define poll_keyboard()
#define yield_timeslice()
typedef struct
{
unsigned char *line;
int w;
int h;
int pitch;
int depth;
}BITMAP;
typedef struct
{
unsigned char r;
unsigned char g;
unsigned char b;
}APALETTE;
BITMAP *create_bitmap(int w,int h);
int destroy_bitmap(BITMAP *buff);
void line(BITMAP *buff,int x1,int y1,int x2,int y2,unsigned char color);
void rect(BITMAP *buff,int x,int y,int x2,int y2,unsigned char color);
void rectfill(BITMAP *buff,int x,int y,int x2,int y2,unsigned char color);
void upcase(char *p);
void downcase(char *p);
extern unsigned char key[256*2];
extern void update_joy(void);
#define INLINE static inline
#define EMUWIDTH 340
#define EMUHEIGHT 250
#define TEX_WIDTH 400
#define TEX_HEIGHT 300
#define RGB565(r, g, b) (((r) << (5+6)) | ((g) << 6) | (b))
#endif

539
libretro.c Normal file
View File

@ -0,0 +1,539 @@
#ifndef _MSC_VER
#include <stdbool.h>
#include <sched.h>
#endif
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
#ifdef _MSC_VER
#define snprintf _snprintf
#pragma pack(1)
#endif
#include "libretro.h"
#include "audio.h"
#include "config.h"
#include "cpu.h"
#include "crc32.h"
#include "debug.h"
#include "keyboard.h"
#include "score.h"
#include "vdc.h"
#include "vmachine.h"
#include "voice.h"
#include "vpp.h"
#include "wrapalleg.h"
static retro_log_printf_t log_cb;
static retro_video_refresh_t video_cb;
static retro_input_poll_t input_poll_cb;
static retro_input_state_t input_state_cb;
static retro_environment_t environ_cb;
static retro_audio_sample_t audio_cb;
static retro_audio_sample_batch_t audio_batch_cb;
void retro_set_environment(retro_environment_t cb) { environ_cb = cb; }
void retro_set_video_refresh(retro_video_refresh_t cb) { video_cb = cb; }
void retro_set_audio_sample(retro_audio_sample_t cb) { audio_cb = cb; }
void retro_set_audio_sample_batch(retro_audio_sample_batch_t cb) { audio_batch_cb = cb; }
void retro_set_input_poll(retro_input_poll_t cb) { input_poll_cb = cb; }
void retro_set_input_state(retro_input_state_t cb) { input_state_cb = cb; }
unsigned short int mbmp[TEX_WIDTH * TEX_HEIGHT];
uint8_t soundBuffer[1056];
int SND;
int RLOOP=0;
int jbt[5]={0,0,0,0,0};
int contax, o2flag, g74flag, c52flag, jopflag, helpflag;
unsigned long crcx = ~0;
static char bios[MAXC], scshot[MAXC], xrom[MAXC], romdir[MAXC], xbios[MAXC],
biosdir[MAXC], arkivo[MAXC][MAXC], biossux[MAXC], romssux[MAXC],
odyssey2[MAXC], g7400[MAXC], c52[MAXC], jopac[MAXC], file_l[MAXC], bios_l[MAXC],
file_v[MAXC],scorefile[MAXC], statefile[MAXC], path2[MAXC];
static int does_file_exist(const char *filename)
{
struct stat st;
int result = stat(filename, &st);
return result == 0;
}
static long filesize(FILE *stream){
long curpos, length;
curpos = ftell(stream);
fseek(stream, 0L, SEEK_END);
length = ftell(stream);
fseek(stream, curpos, SEEK_SET);
return length;
}
static void load_bios(const char *biosname){
FILE *fn;
static char s[MAXC+10];
unsigned long crc;
int i;
if ((biosname[strlen(biosname)-1]=='/') || (biosname[strlen(biosname)-1]=='\\') || (biosname[strlen(biosname)-1]==':')) {
strcpy(s,biosname);
strcat(s,odyssey2);
fn = fopen(s,"rb");
if (!fn) {
strcpy(s,biosname);
strcat(s,odyssey2);
fn = fopen(s,"rb");
}
}
else {
strcpy(s,biosname);
fn = fopen(biosname,"rb");
}
if (!fn) {
fprintf(stderr,"Error loading bios ROM (%s)\n",s);
exit(EXIT_FAILURE);
}
if (fread(rom_table[0],1024,1,fn) != 1) {
fprintf(stderr,"Error loading bios ROM %s\n",odyssey2);
exit(EXIT_FAILURE);
}
strcpy(s,biosname);
fn = fopen(biosname,"rb");
if (!fn) {
fprintf(stderr,"Error loading bios ROM (%s)\n",s);
exit(EXIT_FAILURE);
}
if (fread(rom_table[0],1024,1,fn) != 1) {
fprintf(stderr,"Error loading bios ROM %s\n",odyssey2);
exit(EXIT_FAILURE);
}
fclose(fn);
for (i=1; i<8; i++)
memcpy(rom_table[i],rom_table[0],1024);
crc = crc32_buf(rom_table[0],1024);
if (crc==0x8016A315) {
printf("Odyssey2 bios ROM loaded\n");
app_data.vpp = 0;
app_data.bios = ROM_O2;
} else if (crc==0xE20A9F41) {
printf("Videopac+ G7400 bios ROM loaded\n");
app_data.vpp = 1;
app_data.bios = ROM_G7400;
} else if (crc==0xA318E8D6) {
if (!((!o2flag)&&(c52flag))) printf("C52 bios ROM loaded\n"); else printf("Ok\n");
app_data.vpp = 0;
app_data.bios = ROM_C52;
} else if (crc==0x11647CA5) {
if (g74flag) printf("Jopac bios ROM loaded\n"); else printf(" Ok\n");
app_data.vpp = 1;
app_data.bios = ROM_JOPAC;
} else {
printf("Bios ROM loaded (unknown version)\n");
app_data.vpp = 0;
app_data.bios = ROM_UNKNOWN;
}
}
static void load_cart(const char *file){
FILE *fn;
long l;
int i, nb;
app_data.crc = crc32_file(file);
if (app_data.crc == 0xAFB23F89) app_data.exrom = 1; /* Musician */
if (app_data.crc == 0x3BFEF56B) app_data.exrom = 1; /* Four in 1 Row! */
if (app_data.crc == 0x9B5E9356) app_data.exrom = 1; /* Four in 1 Row! (french) */
if (((app_data.crc == 0x975AB8DA) || (app_data.crc == 0xE246A812)) && (!app_data.debug)) {
fprintf(stderr,"Error: file %s is an incomplete ROM dump\n",file_v);
exit(EXIT_FAILURE);
}
fn=fopen(file,"rb");
if (!fn) {
fprintf(stderr,"Error loading %s\n",file_v);
exit(EXIT_FAILURE);
}
printf("Loading: \"%s\" Size: ",file_v);
l = filesize(fn);
if ((l % 1024) != 0) {
fprintf(stderr,"Error: file %s is an invalid ROM dump\n",file_v);
exit(EXIT_FAILURE);
}
/* special MegaCART design by Soeren Gust */
if ((l == 32768) || (l == 65536) || (l == 131072) || (l == 262144) || (l == 524288) || (l == 1048576)) {
app_data.megaxrom = 1;
app_data.bank = 1;
megarom = malloc(1048576);
if (megarom == NULL) {
fprintf(stderr, "Out of memory loading %s\n", file);
exit(EXIT_FAILURE);
}
if (fread(megarom, l, 1, fn) != 1) {
fprintf(stderr,"Error loading %s\n",file);
exit(EXIT_FAILURE);
}
/* mirror shorter files into full megabyte */
if (l < 65536) memcpy(megarom+32768,megarom,32768);
if (l < 131072) memcpy(megarom+65536,megarom,65536);
if (l < 262144) memcpy(megarom+131072,megarom,131072);
if (l < 524288) memcpy(megarom+262144,megarom,262144);
if (l < 1048576) memcpy(megarom+524288,megarom,524288);
/* start in bank 0xff */
memcpy(&rom_table[0][1024], megarom + 4096*255 + 1024, 3072);
printf("MegaCart %ldK", l / 1024);
nb = 1;
} else if (((l % 3072) == 0))
{
app_data.three_k = 1;
nb = l/3072;
for (i=nb-1; i>=0; i--) {
if (fread(&rom_table[i][1024],3072,1,fn) != 1) {
fprintf(stderr,"Error loading %s\n",file);
exit(EXIT_FAILURE);
}
}
printf("%dK",nb*3);
} else {
nb = l/2048;
if ((nb == 2) && (app_data.exrom)) {
if (fread(&extROM[0], 1024,1,fn) != 1) {
fprintf(stderr,"Error loading %s\n",file);
exit(EXIT_FAILURE);
}
if (fread(&rom_table[0][1024],3072,1,fn) != 1) {
fprintf(stderr,"Error loading %s\n",file);
exit(EXIT_FAILURE);
}
printf("3K EXROM");
} else {
for (i=nb-1; i>=0; i--) {
if (fread(&rom_table[i][1024],2048,1,fn) != 1) {
fprintf(stderr,"Error loading %s\n",file);
exit(EXIT_FAILURE);
}
memcpy(&rom_table[i][3072],&rom_table[i][2048],1024); /* simulate missing A10 */
}
printf("%dK",nb*2);
}
}
fclose(fn);
rom = rom_table[0];
if (nb==1)
app_data.bank = 1;
else if (nb==2)
app_data.bank = app_data.exrom ? 1 : 2;
else if (nb==4)
app_data.bank = 3;
else
app_data.bank = 4;
if ((rom_table[nb-1][1024+12]=='O') && (rom_table[nb-1][1024+13]=='P') && (rom_table[nb-1][1024+14]=='N') && (rom_table[nb-1][1024+15]=='B'))
app_data.openb=1;
printf(" CRC: %08lX\n",app_data.crc);
}
void update_joy(void)
{
}
static void update_input()
{
if (!input_poll_cb)
return;
input_poll_cb();
// Joystick
jbt[0]= input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_UP);
jbt[1]= input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_DOWN);
jbt[2]= input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_LEFT);
jbt[3]= input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_RIGHT);
jbt[4]= input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_A); // "Action" button on the joystick
// Numeric and Alpha
key[RETROK_l]=input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_B); // L
key[RETROK_RETURN]=input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_START); // RETURN
key[RETROK_SPACE]=input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_SELECT); // SPACE
key[RETROK_0]=input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_X); // 0
key[RETROK_1]=input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, RETRO_DEVICE_ID_JOYPAD_Y); // 1
//TODO: Define more and 2 player support
}
/************************************
* libretro implementation
************************************/
static struct retro_system_av_info g_av_info;
void retro_get_system_info(struct retro_system_info *info)
{
memset(info, 0, sizeof(*info));
info->library_name = "O2EM";
info->library_version = "1.18";
info->need_fullpath = false;
info->valid_extensions = "bin";
}
void retro_get_system_av_info(struct retro_system_av_info *info)
{
memset(info, 0, sizeof(*info));
info->timing.fps = evblclk == EVBLCLK_NTSC ? 60 : 50;
info->timing.sample_rate = 44100;
info->geometry.base_width = EMUWIDTH;
info->geometry.base_height = EMUHEIGHT;
info->geometry.max_width = EMUWIDTH;
info->geometry.max_height = EMUHEIGHT;
info->geometry.aspect_ratio = 4.0 / 3.0;
}
void retro_set_controller_port_device(unsigned port, unsigned device)
{
(void)port;
(void)device;
}
size_t retro_serialize_size(void)
{
//return STATE_SIZE;
return 0;
}
bool retro_serialize(void *data, size_t size)
{
//savestate(fileName);
return false;
}
bool retro_unserialize(const void *data, size_t size)
{
//loadstate(fileName);
return false;
}
void retro_cheat_reset(void)
{}
void retro_cheat_set(unsigned index, bool enabled, const char *code)
{
(void)index;
(void)enabled;
(void)code;
}
bool retro_load_game(const struct retro_game_info *info)
{
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
if (!environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt))
{
if (log_cb)
log_cb(RETRO_LOG_INFO, "[O2EM]: RGB565 is not supported.\n");
return false;
}
const char *full_path;
full_path = info->path;
const char *system_directory_c = NULL;
char bios_file_path[256];
// BIOS is required
environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &system_directory_c);
if (!system_directory_c)
{
if (log_cb)
log_cb(RETRO_LOG_WARN, "[O2EM]: no system directory defined, unable to look for o2rom.bin\n");
return false;
}
else
{
#ifdef _WIN32
char slash = '\\';
#else
char slash = '/';
#endif
snprintf(bios_file_path, sizeof(bios_file_path), "%s%c%s", system_directory_c, slash, "o2rom.bin");
if (!does_file_exist(bios_file_path))
{
if (log_cb)
log_cb(RETRO_LOG_WARN, "[O2EM]: o2rom.bin not found, cannot load BIOS\n");
return false;
}
}
app_data.debug = 0;
app_data.stick[0] = app_data.stick[1] = 1;
app_data.sticknumber[0] = app_data.sticknumber[1] = 0;
set_defjoykeys(0,0);
set_defjoykeys(1,1);
set_defsystemkeys();
app_data.bank = 0;
app_data.limit = 1;
app_data.sound_en = 1;
app_data.speed = 100;
app_data.wsize = 2;
app_data.fullscreen = 0;
app_data.scanlines = 0;
app_data.voice = 1;
app_data.window_title = "O2EM v" O2EM_VERSION;
app_data.svolume = 100;
app_data.vvolume = 100;
app_data.filter = 0;
app_data.exrom = 0;
app_data.three_k = 0;
app_data.crc = 0;
app_data.scshot = scshot;
app_data.statefile = statefile;
app_data.euro = 0;
app_data.openb = 0;
app_data.vpp = 0;
app_data.bios = 0;
app_data.scoretype = 0;
app_data.scoreaddress = 0;
app_data.default_highscore = 0;
app_data.breakpoint = 65535;
app_data.megaxrom = 0;
//strcpy(file,"");
//strcpy(file_l,"");
//strcpy(bios_l,"");
//strcpy(bios,"");
//strcpy(scshot,"");
//strcpy(statefile,"");
//strcpy(xrom,"");
strcpy(scorefile,"highscore.txt");
//read_default_config();
init_audio();
app_data.crc = crc32_file(full_path);
//suck_bios();
o2flag = 1;
crcx = app_data.crc;
//suck_roms();
load_bios(bios_file_path);
load_cart(full_path);
//if (app_data.voice) load_voice_samples(path2);
init_display();
init_cpu();
init_system();
set_score(app_data.scoretype, app_data.scoreaddress, app_data.default_highscore);
return true;
}
bool retro_load_game_special(unsigned game_type, const struct retro_game_info *info, size_t num_info)
{
(void)game_type;
(void)info;
(void)num_info;
return false;
}
void retro_unload_game(void)
{
}
unsigned retro_get_region(void)
{
return evblclk == EVBLCLK_NTSC ? RETRO_REGION_NTSC : RETRO_REGION_PAL;
}
unsigned retro_api_version(void)
{
return RETRO_API_VERSION;
}
void *retro_get_memory_data(unsigned id)
{
return NULL;
}
size_t retro_get_memory_size(unsigned id)
{
return 0;
}
void retro_init(void)
{
struct retro_log_callback log;
unsigned level = 5;
if (environ_cb(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, &log))
log_cb = log.log;
else
log_cb = NULL;
environ_cb(RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVEL, &level);
memset(mbmp, 0, sizeof(mbmp));
RLOOP=1;
}
void retro_deinit(void)
{
close_audio();
close_voice();
close_display();
retro_destroybmp();
}
void retro_reset(void)
{
init_cpu();
init_roms();
init_vpp();
clearscr();
}
void retro_run(void)
{
update_input();
cpu_exec();
RLOOP=1;
video_cb(mbmp, EMUWIDTH, EMUHEIGHT, TEX_WIDTH << 1);
int length = evblclk == EVBLCLK_NTSC ? 44100/60 : 44100/50;
// Convert 8u to 16s
for(int i = 0; i != length; i ++)
{
int16_t sample16 = (soundBuffer[i] << 8) - 32768;
int16_t frame[2] = {sample16, sample16};
audio_cb(frame[0], frame[1]);
}
}

1476
libretro.h Executable file

File diff suppressed because it is too large Load Diff

0
O2EM/sources/libretro/link.T → link.T Executable file → Normal file
View File

View File

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@ -24,11 +24,11 @@
#include "vmachine.h"
#include "audio.h"
#ifndef RETRO
#ifndef __LIBRETRO__
#include "allegro.h"
#else
extern int SND;
extern short signed int SNDBUF[1024*2];
extern uint8_t soundBuffer[1056];
#endif
#define SAMPLE_RATE 44100
@ -44,7 +44,7 @@ extern short signed int SNDBUF[1024*2];
int sound_IRQ;
#ifndef RETRO
#ifndef __LIBRETRO__
static AUDIOSTREAM *stream=NULL;
#endif
FILE *sndlog=NULL;
@ -98,7 +98,7 @@ void audio_process(unsigned char *buffer){
void update_audio(void) {
#ifndef RETRO
#ifndef __LIBRETRO__
unsigned char *p;
if (app_data.sound_en) {
p = (unsigned char *)get_audio_stream_buffer(stream);
@ -109,13 +109,12 @@ void update_audio(void) {
}
}
#else
unsigned char *p;
p = (unsigned char *)SNDBUF;
if (p) {
audio_process(p);
dumpaudio(evblclk==EVBLCLK_NTSC?44100/60:44100/50);
}
//unsigned char *p;
//p = (unsigned char *)SNDBUF;
//if (p) {
// audio_process(p);
audio_process(soundBuffer);
//}
#endif
}
@ -126,7 +125,7 @@ void init_audio(void) {
sound_IRQ=0;
if ((app_data.sound_en) || (app_data.voice)) {
printf("Initializing sound system...\n");
#ifndef RETRO
#ifndef __LIBRETRO__
i = install_sound(DIGI_AUTODETECT, MIDI_NONE, NULL);
if (i != 0) {
printf(" ERROR: could not initialize sound card\n %s\n",allegro_error);
@ -148,7 +147,6 @@ void init_audio(void) {
}
}
#else
//TODO SOUND
init_sound_stream();
#endif
}
@ -164,7 +162,7 @@ void init_sound_stream(void){
vol = (255*app_data.svolume)/100;
else
vol = (255*app_data.svolume)/200;
#ifndef RETRO
#ifndef __LIBRETRO__
stream = play_audio_stream(SOUND_BUFFER_LEN,8,0,SAMPLE_RATE,vol,128);
if (!stream) {
printf("Error creating audio stream!\n");
@ -178,7 +176,7 @@ void init_sound_stream(void){
void mute_audio(void){
#ifndef RETRO
#ifndef __LIBRETRO__
if (app_data.sound_en && stream){
stop_audio_stream(stream);
stream=NULL;
@ -190,7 +188,7 @@ void mute_audio(void){
void close_audio(void) {
#ifndef RETRO
#ifndef __LIBRETRO__
if (app_data.sound_en && stream) {
stop_audio_stream(stream);
}

View File

@ -83,7 +83,7 @@ void make_psw_debug(void){
make_psw();
}
#ifdef RETRO
#ifdef __LIBRETRO__
extern int RLOOP;
#endif
@ -93,7 +93,7 @@ void cpu_exec(void) {
Byte dat;
int temp;
#ifndef RETRO
#ifndef __LIBRETRO__
for (;;)
#else
while(RLOOP==1)
@ -1568,14 +1568,14 @@ void cpu_exec(void) {
}
if ((mstate==1) && (master_clk > evblclk)) {
handle_evbl();
#ifdef RETRO
#ifdef __LIBRETRO__
RLOOP=0;
#endif
if (app_data.crc == 0xA7344D1F) handle_evbll(); /* Atlantis */
break;
}
#ifndef RETRO
#ifndef __LIBRETRO__
if (app_data.debug) break;
if (pc==app_data.breakpoint) break;

View File

@ -24,7 +24,7 @@
#include "table.h"
#include "debug.h"
#ifndef RETRO
#ifndef __LIBRETRO__
#include "allegro.h"
#else
#include "wrapalleg.h"
@ -71,7 +71,7 @@ void debug(void) {
done=go=0;
#ifndef RETRO
#ifndef __LIBRETRO__
set_display_switch_mode(SWITCH_BACKGROUND);
#endif
if (sndlog) fclose(sndlog);
@ -173,7 +173,7 @@ void debug(void) {
rest(1);
} while((key_done==0) && (!keypressed()));
set_textmode();
#ifndef RETRO
#ifndef __LIBRETRO__
set_display_switch_mode(SWITCH_BACKGROUND);
#endif
} else if (!strcmp(tok,"viewsprite")) {

View File

@ -28,7 +28,7 @@
#include "vpp.h"
#include "keyboard.h"
#ifndef RETRO
#ifndef __LIBRETRO__
#include "allegro.h"
#else
#include "libretro.h"
@ -45,7 +45,7 @@ Byte new_int=0; /* Is new interrupt installed */
Byte key_done=0;
Byte key_debug=0;
#ifndef RETRO
#ifndef __LIBRETRO__
struct keyb keybtab[] = {
{KEY_A,"A"},
@ -331,7 +331,7 @@ void set_systemkeys(int k_quit,int k_pause,int k_debug,int k_reset,int k_screenc
syskeys[7] = k_inject;
}
#ifdef RETRO
#ifdef __LIBRETRO__
unsigned char key[256*2];
void rloadstate(){
@ -361,22 +361,11 @@ void rsavestate(){
}
}
void rreset(){
init_cpu();
init_roms();
init_vpp();
clearscr();
}
void rscore(){
set_score(app_data.scoretype, app_data.scoreaddress, app_data.default_highscore);
}
void rscrshot(){
//TODO
}
#endif
void handle_key(void){
@ -497,7 +486,7 @@ void handle_key(void){
if (key[syskeys[4]]) {
#ifndef RETRO
#ifndef __LIBRETRO__
BITMAP *bmp;
PALETTE pal;
char *p;
@ -546,7 +535,7 @@ Byte keyjoy(int jn){
Byte d;
d=0xFF;
if ((jn>=0) && (jn<=1)){
#ifdef RETRO
#ifdef __LIBRETRO__
if (jbt[0]) d &= 0xFE;
if (jbt[1]) d &= 0xFB;
if (jbt[2]) d &= 0xF7;
@ -571,13 +560,13 @@ void init_keyboard(void){
key_done=0;
key_debug=0;
#ifndef RETRO
#ifndef __LIBRETRO__
install_keyboard();
#else
memset(key,0,512);
#endif
new_int=1;
#ifndef RETRO
#ifndef __LIBRETRO__
NeedsPoll = keyboard_needs_poll();
#else
NeedsPoll = 1;
@ -586,7 +575,7 @@ void init_keyboard(void){
void Set_Old_Int9(void){
#ifndef RETRO
#ifndef __LIBRETRO__
remove_keyboard();
#endif
new_int=0;

20
O2EM/sources/src/main.c → src/main.c Normal file → Executable file
View File

@ -26,7 +26,7 @@
#include "keyboard.h"
#include "voice.h"
#ifndef RETRO
#ifndef __LIBRETRO__
#include "allegro.h"
#else
#include "wrapalleg.h"
@ -177,17 +177,17 @@ int omain(int argc, char *argv[]){
exit(EXIT_FAILURE);
}
#ifdef RETRO
#ifdef __LIBRETRO__
sprintf(statefile,"%s.state\0",file);
#endif
printf("Starting emulation ...\n");
#ifndef RETRO
#ifndef __LIBRETRO__
allegro_init();
install_timer();
#endif
init_audio();
#ifndef RETRO
#ifndef __LIBRETRO__
printf("Using Allegro %s\n",allegro_id);
#endif
@ -205,7 +205,7 @@ sprintf(statefile,"%s.state\0",file);
strcpy(xrom,"roms/");
strcpy(romdir,file);
#ifndef RETRO
#ifndef __LIBRETRO__
strcpy(file,xrom);
strcat(file,romdir);
#endif
@ -235,7 +235,7 @@ sprintf(statefile,"%s.state\0",file);
strcpy (xrom,romdir);
}
#ifdef RETRO
#ifdef __LIBRETRO__
#ifdef AND
sprintf(xrom,"%s\0","/mnt/sdcard/O2EM/roms/");
strcpy(romdir,xrom);
@ -273,7 +273,7 @@ if (!launcher_flag_b){
strcpy (xbios,"bios/");
strcpy (biosdir,xbios);
}
#ifdef RETRO
#ifdef __LIBRETRO__
#ifdef AND
sprintf(xbios,"%s\0","/mnt/sdcard/O2EM/bios/");
strcpy (biosdir,xbios);
@ -405,7 +405,7 @@ if (!launcher_flag_b){
#endif
#endif
#ifdef RETRO
#ifdef __LIBRETRO__
return 1;
#endif
run();
@ -869,7 +869,7 @@ static void load_cart(char *file){
}
/*************************** Helpus*/
void helpus(void){
#ifndef RETRO
#ifndef __LIBRETRO__
allegro_init();
install_timer();
#endif
@ -894,7 +894,7 @@ int file_name(char *pathx)
if (dir_p == NULL) { fprintf(stderr,"dir '%s' not found !\n", pathx); exit(-1); }
while(0 != (dir_entry_p = readdir(dir_p)))
{
#ifndef RETRO
#ifndef __LIBRETRO__
strcpy(arkivo[contax], dir_entry_p->d_name);
#else
sprintf(arkivo[contax],"%s\0",dir_entry_p->d_name);

View File

Before

Width:  |  Height:  |  Size: 364 B

After

Width:  |  Height:  |  Size: 364 B

View File

@ -23,7 +23,7 @@
#include "types.h"
#include "score.h"
#ifdef RETRO
#ifdef __LIBRETRO__
#include <errno.h>
#endif

View File

@ -17,7 +17,7 @@
#include <time.h>
#ifndef RETRO
#ifndef __LIBRETRO__
#include "allegro.h"
#endif
@ -29,7 +29,7 @@
#endif
#include "timefunc.h"
#ifndef RETRO
#ifndef __LIBRETRO__
#ifdef ALLEGRO_WINDOWS

View File

@ -28,7 +28,7 @@
#include "vpp.h"
#include "vdc.h"
#ifndef RETRO
#ifndef __LIBRETRO__
#include "allegro.h"
#else
#include "libretro.h"
@ -154,7 +154,7 @@ static void create_cmap(void){
void grmode(void){
#ifndef RETRO
#ifndef __LIBRETRO__
set_color_depth(8);
wsize = app_data.wsize;
@ -223,7 +223,7 @@ clearscr();
void set_textmode(void){
#ifndef RETRO
#ifndef __LIBRETRO__
set_palette(oldcol);
set_gfx_mode(GFX_TEXT, 0, 0, 0, 0);
#endif
@ -232,7 +232,7 @@ void set_textmode(void){
void clearscr(void){
#ifndef RETRO
#ifndef __LIBRETRO__
acquire_screen();
clear(screen);
release_screen();
@ -337,9 +337,8 @@ static void draw_grid(void){
}
#ifdef RETRO
#ifdef __LIBRETRO__
#include "libretro-o2em.h"
extern unsigned short int mbmp[TEX_WIDTH * TEX_HEIGHT];
void retro_blit(){
@ -381,7 +380,7 @@ void finish_display(void){
last=t;
}
if (curr) {
#ifndef RETRO
#ifndef __LIBRETRO__
text_mode(0);
textprintf(bmp, font, 20 , 4, 7, "FPS: %3d",(int)((200.0*TICKSPERSEC)/curr+0.5));
#endif
@ -398,7 +397,7 @@ void finish_display(void){
for (y=0; y<10; y++) cached_lines[(y+cache_counter) % bmp->h] = 0;
cache_counter = (cache_counter+10) % bmp->h;
#ifndef RETRO
#ifndef __LIBRETRO__
acquire_screen();
#endif
@ -406,7 +405,7 @@ void finish_display(void){
for (y=0; y<WNDH; y++){
if (!cached_lines[y+2])
#ifndef RETRO
#ifndef __LIBRETRO__
stretch_blit(bmp,screen,7,2+y,WNDW,1,0,y*wsize,WNDW*wsize,wsize-sn);
#else
;
@ -418,7 +417,7 @@ void finish_display(void){
if (!cached_lines[y+2]) {
for (x=0; x<bmp->w; x++) bmp->line[(y+2)*bmp->w +x] += 16;
#ifndef RETRO
#ifndef __LIBRETRO__
stretch_blit(bmp,screen,7,2+y,WNDW,1,0,(y+1)*wsize-1,WNDW*wsize,1);
#else
//TODO
@ -430,7 +429,7 @@ void finish_display(void){
}
#ifndef RETRO
#ifndef __LIBRETRO__
release_screen();
#else
retro_blit();
@ -629,7 +628,7 @@ void draw_quad(Byte ypos, Byte xpos, Byte cp0l, Byte cp0h, Byte cp1l, Byte cp1h,
}
void close_display(void) {
#ifndef RETRO
#ifndef __LIBRETRO__
free(vscreen);
#endif
free(col);
@ -641,7 +640,7 @@ void window_close_hook(void){
key_done=1;
}
static void txtmsg(int x, int y, int c, const char *s){
#ifndef RETRO
#ifndef __LIBRETRO__
text_mode(-1);
textout_centre(bmp, font, s, x+1 , y+1, 32);
textout_centre(bmp, font, s, x , y, c);
@ -712,7 +711,7 @@ void display_msg(char *msg, int waits)
init_sound_stream();
}
void init_display(void) {
#ifndef RETRO
#ifndef __LIBRETRO__
get_palette(oldcol);
#endif
create_cmap();
@ -723,13 +722,13 @@ void init_display(void) {
fprintf(stderr,"Could not allocate memory for screen buffer.\n");
exit(EXIT_FAILURE);
}
#ifndef RETRO
#ifndef __LIBRETRO__
vscreen = (Byte *) bmp->dat;
#else
vscreen = (Byte *) &bmp->line[0];
#endif
#ifndef RETRO
#ifndef __LIBRETRO__
clear(bmp);
clear(bmpcache);
#endif
@ -745,7 +744,7 @@ void init_display(void) {
init_keyboard();
}
#ifndef RETRO
#ifndef __LIBRETRO__
set_window_close_button(TRUE);
set_window_close_hook(window_close_hook);
#endif
@ -815,7 +814,7 @@ static char hl[96][70]=
"-savefile=file",
" Load/Save State "," from/to file"
};
#ifndef RETRO
#ifndef __LIBRETRO__
text_mode(-1);
textout(bmp, font, "O2EM v" O2EM_VERSION " Help", 26 , 16, 2);
@ -825,7 +824,7 @@ rect(bmp,20,12,315,228,6);
line(bmp,20,35,315,35,6);
for (cntt=0; cntt<16; cntt++)
{
#ifndef RETRO
#ifndef __LIBRETRO__
textout(bmp, font, hl[cnt+cntt], 26, cnttt, 4);
#endif
cnttt += 12;
@ -843,7 +842,7 @@ for (cntt=0; cntt<16; cntt++)
rectfill(bmp,25,36,306,227,0);
for (cntt=0; cntt<16; cntt++)
{
#ifndef RETRO
#ifndef __LIBRETRO__
textout(bmp, font, hl[cnt+cntt], 26, cnttt, 4);
#endif
@ -859,7 +858,7 @@ for (cntt=0; cntt<16; cntt++)
rectfill(bmp,25,36,306,227,0);
for (cntt=0; cntt<16; cntt++)
{
#ifndef RETRO
#ifndef __LIBRETRO__
textout(bmp, font, hl[cnt+cntt], 26, cnttt, 4);
#endif
cnttt += 12;

View File

@ -30,7 +30,7 @@
#include "voice.h"
#include "vmachine.h"
#ifndef RETRO
#ifndef __LIBRETRO__
#include "allegro.h"
#else
#include "wrapalleg.h"
@ -123,7 +123,7 @@ void handle_vbl(void){
if (!app_data.debug) {
#ifndef RETRO
#ifndef __LIBRETRO__
handle_key();
#else
update_joy();
@ -131,7 +131,7 @@ void handle_vbl(void){
update_audio();
#ifndef RETRO
#ifndef __LIBRETRO__
update_voice();
#else
//TODO
@ -280,7 +280,7 @@ void init_system(void){
snapedlines[i][j][k]=0;
if (app_data.stick[0] == 2 || app_data.stick[1] == 2) {
#ifndef RETRO
#ifndef __LIBRETRO__
i = install_joystick(JOY_TYPE_AUTODETECT);
if (i || (num_joysticks<1)) {
fprintf(stderr,"Error: no joystick detected\n");
@ -347,7 +347,7 @@ Byte read_P2(void){
if (si<6) {
for (i=0; i<8; i++) {
km = key_map[si][i];
#ifndef RETRO
#ifndef __LIBRETRO__
if ((key[km] && ((!joykeystab[km]) || (key_shifts & KB_CAPSLOCK_FLAG))) || (key2[km])) {
so = i ^ 0x07;
}
@ -476,7 +476,7 @@ Byte in_bus(void){
break;
case 2:
#ifndef RETRO
#ifndef __LIBRETRO__
poll_joystick();
if (joy[sticknum].stick[0].axis[1].d1) d &= 0xFE; // joy_up
if (joy[sticknum].stick[0].axis[0].d2) d &= 0xFD; // joy_right
@ -726,7 +726,7 @@ static void setvideomode(int t){
}
#ifdef RETRO
#ifdef __LIBRETRO__
#include <errno.h>
#endif

View File

@ -20,7 +20,7 @@
#include "cpu.h"
#include "voice.h"
#ifndef RETRO
#ifndef __LIBRETRO__
#include "allegro.h"
#else
#define SAMPLE signed short
@ -36,7 +36,7 @@ static unsigned long clk_voice_start=0;
void load_voice_samples(char *path){
#ifndef RETRO
#ifndef __LIBRETRO__
int bank, sam, i, ld=0;
char name[MAXC];
SAMPLE *sp=NULL;
@ -86,7 +86,7 @@ void load_voice_samples(char *path){
void update_voice(void){
#ifndef RETRO
#ifndef __LIBRETRO__
if (!voice_ok) return;
if (voice_st==2) {
if (voice_get_position(voice_num) < 0){
@ -112,7 +112,7 @@ void update_voice(void){
void trigger_voice(int addr){
#ifndef RETRO
#ifndef __LIBRETRO__
if (voice_ok){
if (voice_st) update_voice();
if ((voice_st==0) && (voice_bank>=0) && (voice_bank<9) && (addr>=0x80) && (addr<=0xff)){
@ -126,7 +126,7 @@ void trigger_voice(int addr){
void set_voice_bank(int bank){
#ifndef RETRO
#ifndef __LIBRETRO__
if (!voice_ok) return;
if ((bank>=0) && (bank<=8)) voice_bank = bank;
#endif
@ -134,7 +134,7 @@ void set_voice_bank(int bank){
int get_voice_status(void){
#ifndef RETRO
#ifndef __LIBRETRO__
if (voice_ok){
update_voice();
if (voice_st) return 1;
@ -145,7 +145,7 @@ int get_voice_status(void){
void reset_voice(void){
#ifndef RETRO
#ifndef __LIBRETRO__
if (voice_ok) {
voice_stop(voice_num);
voice_bank=0;
@ -157,7 +157,7 @@ void reset_voice(void){
void mute_voice(void){
#ifndef RETRO
#ifndef __LIBRETRO__
if (voice_ok) {
voice_stop(voice_num);
}
@ -166,7 +166,7 @@ void mute_voice(void){
void close_voice(void){
#ifndef RETRO
#ifndef __LIBRETRO__
reset_voice();
#endif
voice_ok=0;

View File

@ -24,7 +24,7 @@
#include "vpp_cset.h"
#include "vpp.h"
#ifndef RETRO
#ifndef __LIBRETRO__
#include "allegro.h"
#else
#include "wrapalleg.h"
@ -282,7 +282,7 @@ void vpp_finish_bmp(Byte *vmem, int offx, int offy, int w, int h, int totw, int
for (y=0; y<h; y++){
pnt = vmem+(offy+y)*totw + offx;
#ifndef RETRO
#ifndef __LIBRETRO__
pnt2 = (Byte *)vppbmp->line[y];
#else
pnt2 = (Byte *)&vppbmp->line[y*vppbmp->w];
@ -358,7 +358,7 @@ static void vpp_draw_char(int x, int y, Byte ch, Byte c0, Byte c1, Byte ext, Byt
m = (dw==2) ? 0x08 : 0x80;
for (xx=0; xx<8; xx++) {
#ifndef RETRO
#ifndef __LIBRETRO__
vppbmp->line[y*10+yy][x*8+xx] = (k & m) ? c1 : c0;
#else
vppbmp->line[(y*10+yy)*vppbmp->w+(x*8+xx)] = (k & m) ? c1 : c0;
@ -374,7 +374,7 @@ static void vpp_draw_char(int x, int y, Byte ch, Byte c0, Byte c1, Byte ext, Byt
static void vpp_update_screen(void){
int i,x,y,l,chr,attr,ext,c0,c1,dw,dh,hpar,vpar,lvd,lhd,ser_chr,ser_atr,ul,conc,box,swapcol;
int tlum[8], m[8] = {0x01, 0x10, 0x04, 0x40, 0x02, 0x20, 0x08, 0x80};
#ifndef RETRO
#ifndef __LIBRETRO__
clear(vppbmp);
#endif
for (i=0; i<8; i++) tlum[i] = (LumReg & m[i]) ? 0 : 8;
@ -463,7 +463,7 @@ static void vpp_update_screen(void){
if (vpp_r & 0x20) {
for (y = vppbmp->h-1; y >= 10; y--)
for (x = 0; x < vppbmp->w; x++)
#ifndef RETRO
#ifndef __LIBRETRO__
vppbmp->line[y][x] = vppbmp->line[(y-10)/2+10][x];
#else
vppbmp->line[y*vppbmp->w +x] = vppbmp->line[((y-10)/2+10)*vppbmp->w +x]; ;
@ -492,7 +492,7 @@ void init_vpp(void){
fprintf(stderr,"Could not allocate memory for Videopac+ screen buffer.\n");
exit(EXIT_FAILURE);
}
#ifndef RETRO
#ifndef __LIBRETRO__
clear(vppbmp);
#endif
memset(colplus,0,BMPW*BMPH);